From f8221eca4de9d0cbb5c529acab6633f334cb09d3 Mon Sep 17 00:00:00 2001 From: Aaron Heckmann Date: Wed, 6 Aug 2025 17:06:11 -0700 Subject: [PATCH 1/3] feat(typescript-fetch): add docs support fixes #18276 --- .../TypeScriptFetchClientCodegen.java | 27 +++- .../typescript-fetch/README.mustache | 137 ++++++++++++++---- .../typescript-fetch/api_doc.mustache | 63 ++++++++ .../typescript-fetch/api_example.mustache | 44 ++++++ .../typescript-fetch/model_doc.mustache | 39 +++++ 5 files changed, 281 insertions(+), 29 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/typescript-fetch/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/typescript-fetch/api_example.mustache create mode 100644 modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 0c1b1ee13251..5ac5099b210b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -73,6 +73,8 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege protected boolean withoutRuntimeChecks = false; protected boolean stringEnums = false; protected String fileNaming = PASCAL_CASE; + protected String apiDocPath = "docs"; + protected String modelDocPath = "docs"; // "Saga and Record" mode. public static final String SAGAS_AND_RECORDS = "sagasAndRecords"; @@ -107,10 +109,14 @@ public TypeScriptFetchClientCodegen() { // at the moment importMapping.clear(); - outputFolder = "generated-code/typescript-fetch"; + outputFolder = "generated-code" + File.separator + "typescript-fetch"; embeddedTemplateDir = templateDir = "typescript-fetch"; this.apiTemplateFiles.put("apis.mustache", ".ts"); + this.modelTemplateFiles.put("models.mustache", ".ts"); + + this.apiDocTemplateFiles.put("api_doc.mustache", ".md"); + this.modelDocTemplateFiles.put("model_doc.mustache", ".md"); this.addExtraReservedWords(); @@ -138,6 +144,11 @@ public String toModelFilename(String name) { return convertUsingFileNamingConvention(super.toModelFilename(name)); } + @Override + public String toModelDocFilename(String name) { + return toModelName(name); + } + /** * Converts the original name according to the current fileNaming strategy. * @@ -242,6 +253,10 @@ public void processOpts() { this.apiPackage = sourceDir + "apis"; this.modelPackage = sourceDir + "models"; + // make api and model doc path available in mustache template + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + supportingFiles.add(new SupportingFile("index.mustache", sourceDir, "index.ts")); supportingFiles.add(new SupportingFile("runtime.mustache", sourceDir, "runtime.ts")); @@ -316,6 +331,16 @@ public void processOpts() { setGenerateValidationAttributes(convertPropertyToBooleanAndWriteBack(VALIDATION_ATTRIBUTES)); } + @Override + public String apiDocFileFolder() { + return (outputFolder + File.separator + apiDocPath); + } + + @Override + public String modelDocFileFolder() { + return (outputFolder + File.separator + modelDocPath); + } + @Override public String toEnumDefaultValue(String value, String datatype) { if (this.getSagasAndRecords()) { diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/README.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/README.mustache index 33dc3af27db9..b73c64591fc0 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/README.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/README.mustache @@ -1,46 +1,127 @@ -## {{npmName}}@{{npmVersion}} +# {{npmName}}@{{npmVersion}} -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: +A TypeScript SDK client for the {{host}} API. -Environment -* Node.js -* Webpack -* Browserify +## Usage -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 +First, install the SDK from npm. -Module system -* CommonJS -* ES6 module system +```bash +npm install {{npmName}} --save +``` + +Next, try it out. + +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +```ts +{{>api_example}} +``` +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + +## Documentation + +### API Endpoints + +All URIs are relative to *{{basePath}}* + +| Class | Method | HTTP request | Description +| ----- | ------ | ------------ | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +### Models + +{{#models}}{{#model}}- [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md){{/model}} +{{/models}} + +### Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +#### {{name}}{{#isOAuth}} {{flow}}{{/isOAuth}} + +{{#isApiKey}} + +- **Type**: API key +- **API key parameter name**: `{{keyParamName}}` +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}} + +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} -It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}} + +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - `{{scope}}`: {{description}} +{{/scopes}} +{{/isOAuth}} +{{/authMethods}} + +## About + +This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/) +and is automatically generated by the +[OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `{{appVersion}}` +- Package version: `{{npmVersion}}` +{{^hideGenerationTimestamp}} +- Build date: `{{generatedDate}}` +{{/hideGenerationTimestamp}} +- Generator version: `{{generatorVersion}}` +- Build package: `{{generatorClass}}` + +The generated npm module supports the following: + +- Environments + * Node.js + * Webpack + * Browserify +- Language levels + * ES5 - you must have a Promises/A+ library installed + * ES6 +- Module systems + * CommonJS + * ES6 module system + +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Development ### Building -To build and compile the typescript sources to javascript use: -``` +To build the TypeScript source code, you need to have Node.js and npm installed. +After cloning the repository, navigate to the project directory and run: + +```bash npm install npm run build ``` ### Publishing -First build the package then run `npm publish` - -### Consuming - -navigate to the folder of your consuming project and run one of the following commands. +Once you've built the package, you can publish it to npm: -_published:_ - -``` -npm install {{npmName}}@{{npmVersion}} --save +```bash +npm publish ``` -_unPublished (not recommended):_ +## License -``` -npm install PATH_TO_GENERATED_PACKAGE --save -``` +[{{licenseInfo}}]({{{licenseUrl}}}) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/api_doc.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/api_doc.mustache new file mode 100644 index 000000000000..f5c49271a9fc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/api_doc.mustache @@ -0,0 +1,63 @@ +# {{classname}}{{#description}} + +{{.}}{{/description}} + +All URIs are relative to *{{basePath}}* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} | +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{operationId}} + +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{summary}}{{#notes}} + +{{.}}{{/notes}} + +### Example + +```ts +{{>api_example}} +``` + +### Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isEnum}}{{#allowableValues}}{{#values}}`{{{.}}}`{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}{{/isEnum}}{{^isEnum}}{{#isModel}}[{{baseType}}]({{baseType}}.md){{/isModel}}{{^isModel}}`{{{dataType}}}`{{/isModel}}{{/isEnum}} | {{description}} |{{^required}} [Optional]{{/required}}{{^isContainer}}{{#defaultValue}} [Defaults to `{{.}}`]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [Enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}`void` (Empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}{{#isOAuth}} {{flow}}{{/isOAuth}}](../README.md#{{{name}}}{{#isOAuth}}-{{flow}}{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/api_example.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/api_example.mustache new file mode 100644 index 000000000000..b43ddee7da5b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/api_example.mustache @@ -0,0 +1,44 @@ +import { + Configuration, + {{classname}}, +} from '{{npmName}}'; +import type { {{operationIdCamelCase}}Request } from '{{npmName}}'; + +async function example() { + console.log("🚀 Testing {{npmName}} SDK..."); + {{#hasAuthMethods}} + const config = new Configuration({ {{#authMethods}}{{#isBasicBasic}} + // To configure HTTP basic authorization: {{{name}}} + username: "YOUR USERNAME", + password: "YOUR PASSWORD",{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + accessToken: "YOUR BEARER TOKEN",{{/isBasicBearer}}{{#isOAuth}} + // To configure OAuth2 access token for authorization: {{{name}}} {{{flow}}} + accessToken: "YOUR ACCESS TOKEN",{{/isOAuth}}{{#isApiKey}} + // To configure API key authorization: {{{name}}} + apiKey: "YOUR API KEY",{{/isApiKey}}{{#isHttpSignature}} + // To configure HTTP signature authorization: {{{name}}} + headers: { "YOUR HEADER NAME": "YOUR SIGNATURE" },{{/isHttpSignature}}{{/authMethods}} + }); + {{/hasAuthMethods}} + const api = new {{classname}}({{#hasAuthMethods}}config{{/hasAuthMethods}}); + + {{#hasParams}} + const body = { + {{#allParams}} + // {{{dataType}}}{{#description}} | {{{description}}}{{/description}}{{^required}} (optional){{/required}} + {{paramName}}: {{{example}}}{{^example}}...{{/example}}, + {{/allParams}} + } satisfies {{operationIdCamelCase}}Request; + + {{/hasParams}} + try { + const data = await api.{{{operationId}}}({{#hasParams}}body{{/hasParams}}); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache new file mode 100644 index 000000000000..3fc704a0ae52 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache @@ -0,0 +1,39 @@ +{{#models}}{{#model}} +# {{classname}} + +{{#description}}{{&description}} +{{/description}} + +## Properties + +Name | Type +------------ | ------------- +{{#vars}}`{{name}}` | {{#isPrimitiveType}}{{dataType}}{{/isPrimitiveType}}{{^isPrimitiveType}}[{{dataType}}]({{complexType}}.md){{/isPrimitiveType}} +{{/vars}} + +## Example + +```typescript +import type { {{classname}} } from '{{npmName}}' + +// TODO: Update the object below with actual values +const example = { +{{#vars}} + "{{name}}": {{{example}}}, +{{/vars}} +} satisfies {{classname}} + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as {{classname}} +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +{{/model}}{{/models}} From 0d17ea25fe2f9ebb205fd234c62419b0c99b245b Mon Sep 17 00:00:00 2001 From: Aaron Heckmann Date: Fri, 8 Aug 2025 17:16:30 -0700 Subject: [PATCH 2/3] chore: regenerate - generate-samples.sh - export_docs_generators.sh --- .../.openapi-generator/FILES | 4 + .../self-import-issue/docs/AbstractUserDto.md | 38 + .../self-import-issue/docs/BranchDto.md | 34 + .../docs/InternalAuthenticatedUserDto.md | 32 + .../docs/RemoteAuthenticatedUserDto.md | 32 + .../allOf-nullable/.openapi-generator/FILES | 3 + .../builds/allOf-nullable/docs/Club.md | 34 + .../builds/allOf-nullable/docs/DefaultApi.md | 74 + .../builds/allOf-nullable/docs/Owner.md | 34 + .../allOf-readonly/.openapi-generator/FILES | 3 + .../builds/allOf-readonly/docs/Club.md | 34 + .../builds/allOf-readonly/docs/DefaultApi.md | 74 + .../builds/allOf-readonly/docs/Owner.md | 34 + .../default-v3.0/.openapi-generator/FILES | 57 + .../docs/AdditionalPropertiesClass.md | 36 + .../default-v3.0/docs/AllOfWithSingleRef.md | 36 + .../builds/default-v3.0/docs/Animal.md | 36 + .../default-v3.0/docs/AnotherFakeApi.md | 76 + .../docs/ArrayOfArrayOfNumberOnly.md | 34 + .../default-v3.0/docs/ArrayOfNumberOnly.md | 34 + .../builds/default-v3.0/docs/ArrayTest.md | 38 + .../default-v3.0/docs/Capitalization.md | 44 + .../builds/default-v3.0/docs/Cat.md | 34 + .../builds/default-v3.0/docs/Category.md | 36 + .../default-v3.0/docs/ChildWithNullable.md | 34 + .../builds/default-v3.0/docs/ClassModel.md | 35 + .../builds/default-v3.0/docs/Client.md | 34 + .../builds/default-v3.0/docs/DefaultApi.md | 66 + .../default-v3.0/docs/DeprecatedObject.md | 34 + .../builds/default-v3.0/docs/Dog.md | 34 + .../builds/default-v3.0/docs/EnumArrays.md | 36 + .../builds/default-v3.0/docs/EnumClass.md | 32 + .../builds/default-v3.0/docs/EnumTest.md | 48 + .../builds/default-v3.0/docs/FakeApi.md | 1605 +++++++++++++++++ .../docs/FakeBigDecimalMap200Response.md | 36 + .../docs/FakeClassnameTags123Api.md | 80 + .../default-v3.0/docs/FileSchemaTestClass.md | 36 + .../builds/default-v3.0/docs/Foo.md | 34 + .../docs/FooGetDefaultResponse.md | 34 + .../builds/default-v3.0/docs/FormatTest.md | 64 + .../default-v3.0/docs/HasOnlyReadOnly.md | 36 + .../default-v3.0/docs/HealthCheckResult.md | 35 + .../builds/default-v3.0/docs/List.md | 34 + .../builds/default-v3.0/docs/MapTest.md | 40 + ...dPropertiesAndAdditionalPropertiesClass.md | 38 + .../default-v3.0/docs/Model200Response.md | 37 + .../default-v3.0/docs/ModelApiResponse.md | 38 + .../builds/default-v3.0/docs/ModelFile.md | 35 + .../builds/default-v3.0/docs/Name.md | 41 + .../builds/default-v3.0/docs/NullableClass.md | 56 + .../builds/default-v3.0/docs/NumberOnly.md | 34 + .../docs/ObjectWithDeprecatedFields.md | 40 + .../builds/default-v3.0/docs/Order.md | 44 + .../default-v3.0/docs/OuterComposite.md | 38 + .../builds/default-v3.0/docs/OuterEnum.md | 32 + .../docs/OuterEnumDefaultValue.md | 32 + .../default-v3.0/docs/OuterEnumInteger.md | 32 + .../docs/OuterEnumIntegerDefaultValue.md | 32 + .../docs/OuterObjectWithEnumProperty.md | 34 + .../default-v3.0/docs/ParentWithNullable.md | 36 + .../builds/default-v3.0/docs/Pet.md | 44 + .../builds/default-v3.0/docs/PetApi.md | 687 +++++++ .../builds/default-v3.0/docs/ReadOnlyFirst.md | 36 + .../builds/default-v3.0/docs/Return.md | 35 + .../builds/default-v3.0/docs/SingleRefType.md | 32 + .../default-v3.0/docs/SpecialModelName.md | 34 + .../builds/default-v3.0/docs/StoreApi.md | 280 +++ .../builds/default-v3.0/docs/Tag.md | 36 + ...lineFreeformAdditionalPropertiesRequest.md | 34 + .../builds/default-v3.0/docs/User.md | 48 + .../builds/default-v3.0/docs/UserApi.md | 555 ++++++ .../builds/default/.openapi-generator/FILES | 9 + .../builds/default/docs/Category.md | 37 + .../builds/default/docs/ModelApiResponse.md | 39 + .../builds/default/docs/Order.md | 45 + .../builds/default/docs/Pet.md | 45 + .../builds/default/docs/PetApi.md | 595 ++++++ .../builds/default/docs/StoreApi.md | 278 +++ .../builds/default/docs/Tag.md | 37 + .../builds/default/docs/User.md | 49 + .../builds/default/docs/UserApi.md | 545 ++++++ .../builds/enum/.openapi-generator/FILES | 5 + .../builds/enum/docs/DefaultApi.md | 290 +++ .../builds/enum/docs/EnumPatternObject.md | 40 + .../FakeEnumRequestGetInline200Response.md | 40 + .../builds/enum/docs/NumberEnum.md | 32 + .../builds/enum/docs/StringEnum.md | 32 + .../es6-target/.openapi-generator/FILES | 9 + .../builds/es6-target/README.md | 167 +- .../builds/es6-target/docs/Category.md | 37 + .../es6-target/docs/ModelApiResponse.md | 39 + .../builds/es6-target/docs/Order.md | 45 + .../builds/es6-target/docs/Pet.md | 45 + .../builds/es6-target/docs/PetApi.md | 595 ++++++ .../builds/es6-target/docs/StoreApi.md | 278 +++ .../builds/es6-target/docs/Tag.md | 37 + .../builds/es6-target/docs/User.md | 49 + .../builds/es6-target/docs/UserApi.md | 545 ++++++ .../.openapi-generator/FILES | 9 + .../multiple-parameters/docs/Category.md | 37 + .../docs/ModelApiResponse.md | 39 + .../builds/multiple-parameters/docs/Order.md | 45 + .../builds/multiple-parameters/docs/Pet.md | 45 + .../builds/multiple-parameters/docs/PetApi.md | 595 ++++++ .../multiple-parameters/docs/StoreApi.md | 278 +++ .../builds/multiple-parameters/docs/Tag.md | 37 + .../builds/multiple-parameters/docs/User.md | 49 + .../multiple-parameters/docs/UserApi.md | 545 ++++++ .../builds/oneOf/.openapi-generator/FILES | 8 + .../builds/oneOf/docs/DefaultApi.md | 182 ++ .../builds/oneOf/docs/OptionOne.md | 34 + .../builds/oneOf/docs/OptionTwo.md | 34 + .../builds/oneOf/docs/TestA.md | 34 + .../builds/oneOf/docs/TestArrayResponse.md | 32 + .../builds/oneOf/docs/TestB.md | 34 + .../oneOf/docs/TestDiscriminatorResponse.md | 34 + .../builds/oneOf/docs/TestResponse.md | 36 + .../.openapi-generator/FILES | 9 + .../prefix-parameter-interfaces/README.md | 167 +- .../docs/Category.md | 37 + .../docs/ModelApiResponse.md | 39 + .../prefix-parameter-interfaces/docs/Order.md | 45 + .../prefix-parameter-interfaces/docs/Pet.md | 45 + .../docs/PetApi.md | 595 ++++++ .../docs/StoreApi.md | 278 +++ .../prefix-parameter-interfaces/docs/Tag.md | 37 + .../prefix-parameter-interfaces/docs/User.md | 49 + .../docs/UserApi.md | 545 ++++++ .../.openapi-generator/FILES | 29 + .../builds/sagas-and-records/README.md | 189 +- .../sagas-and-records/docs/BehaviorApi.md | 140 ++ .../sagas-and-records/docs/BehaviorType.md | 33 + .../builds/sagas-and-records/docs/Category.md | 37 + .../docs/DefaultMetaOnlyResponse.md | 34 + .../docs/DeploymentRequestStatus.md | 33 + .../sagas-and-records/docs/ErrorCode.md | 33 + .../docs/FindPetsByStatusResponse.md | 36 + .../docs/FindPetsByUserResponse.md | 36 + .../docs/GetBehaviorPermissionsResponse.md | 36 + .../docs/GetBehaviorTypeResponse.md | 36 + .../docs/GetMatchingPartsResponse.md | 36 + .../docs/GetPetPartTypeResponse.md | 36 + .../builds/sagas-and-records/docs/ItemId.md | 37 + .../sagas-and-records/docs/MatchingParts.md | 37 + .../docs/ModelApiResponse.md | 39 + .../sagas-and-records/docs/ModelError.md | 41 + .../builds/sagas-and-records/docs/Order.md | 45 + .../builds/sagas-and-records/docs/Part.md | 37 + .../builds/sagas-and-records/docs/Pet.md | 75 + .../builds/sagas-and-records/docs/PetApi.md | 876 +++++++++ .../sagas-and-records/docs/PetPartApi.md | 155 ++ .../sagas-and-records/docs/PetPartType.md | 33 + .../docs/PetRegionsResponse.md | 36 + .../sagas-and-records/docs/ResponseMeta.md | 45 + .../builds/sagas-and-records/docs/StoreApi.md | 278 +++ .../builds/sagas-and-records/docs/Tag.md | 37 + .../builds/sagas-and-records/docs/User.md | 53 + .../builds/sagas-and-records/docs/UserApi.md | 546 ++++++ .../sagas-and-records/docs/WarningCode.md | 33 + .../.openapi-generator/FILES | 54 + .../docs/AdditionalPropertiesClass.md | 36 + .../docs/AllOfWithSingleRef.md | 36 + .../snakecase-discriminator/docs/Animal.md | 36 + .../docs/AnotherFakeApi.md | 76 + .../docs/ArrayOfArrayOfNumberOnly.md | 34 + .../docs/ArrayOfNumberOnly.md | 34 + .../snakecase-discriminator/docs/ArrayTest.md | 38 + .../docs/Capitalization.md | 44 + .../snakecase-discriminator/docs/Cat.md | 34 + .../snakecase-discriminator/docs/Category.md | 36 + .../docs/ClassModel.md | 35 + .../snakecase-discriminator/docs/Client.md | 34 + .../docs/DefaultApi.md | 66 + .../docs/DeprecatedObject.md | 34 + .../snakecase-discriminator/docs/Dog.md | 34 + .../docs/EnumArrays.md | 36 + .../snakecase-discriminator/docs/EnumClass.md | 32 + .../snakecase-discriminator/docs/EnumTest.md | 48 + .../snakecase-discriminator/docs/FakeApi.md | 1333 ++++++++++++++ .../docs/FakeBigDecimalMap200Response.md | 36 + .../docs/FakeClassnameTags123Api.md | 80 + .../docs/FileSchemaTestClass.md | 36 + .../snakecase-discriminator/docs/Foo.md | 34 + .../docs/FooGetDefaultResponse.md | 34 + .../docs/FormatTest.md | 64 + .../docs/HasOnlyReadOnly.md | 36 + .../docs/HealthCheckResult.md | 35 + .../snakecase-discriminator/docs/List.md | 34 + .../snakecase-discriminator/docs/MapTest.md | 40 + ...dPropertiesAndAdditionalPropertiesClass.md | 38 + .../docs/Model200Response.md | 37 + .../docs/ModelApiResponse.md | 38 + .../snakecase-discriminator/docs/ModelFile.md | 35 + .../snakecase-discriminator/docs/Name.md | 41 + .../docs/NullableClass.md | 56 + .../docs/NumberOnly.md | 34 + .../docs/ObjectWithDeprecatedFields.md | 40 + .../snakecase-discriminator/docs/Order.md | 44 + .../docs/OuterComposite.md | 38 + .../snakecase-discriminator/docs/OuterEnum.md | 32 + .../docs/OuterEnumDefaultValue.md | 32 + .../docs/OuterEnumInteger.md | 32 + .../docs/OuterEnumIntegerDefaultValue.md | 32 + .../docs/OuterObjectWithEnumProperty.md | 34 + .../snakecase-discriminator/docs/Pet.md | 44 + .../snakecase-discriminator/docs/PetApi.md | 687 +++++++ .../docs/ReadOnlyFirst.md | 36 + .../snakecase-discriminator/docs/Return.md | 35 + .../docs/SingleRefType.md | 32 + .../docs/SpecialModelName.md | 34 + .../snakecase-discriminator/docs/StoreApi.md | 280 +++ .../snakecase-discriminator/docs/Tag.md | 36 + .../snakecase-discriminator/docs/User.md | 48 + .../snakecase-discriminator/docs/UserApi.md | 555 ++++++ .../.openapi-generator/FILES | 9 + .../validation-attributes/docs/Category.md | 37 + .../docs/ModelApiResponse.md | 39 + .../validation-attributes/docs/Order.md | 45 + .../builds/validation-attributes/docs/Pet.md | 45 + .../validation-attributes/docs/PetApi.md | 607 +++++++ .../validation-attributes/docs/StoreApi.md | 280 +++ .../builds/validation-attributes/docs/Tag.md | 37 + .../builds/validation-attributes/docs/User.md | 49 + .../validation-attributes/docs/UserApi.md | 579 ++++++ .../with-interfaces/.openapi-generator/FILES | 9 + .../builds/with-interfaces/docs/Category.md | 37 + .../with-interfaces/docs/ModelApiResponse.md | 39 + .../builds/with-interfaces/docs/Order.md | 45 + .../builds/with-interfaces/docs/Pet.md | 45 + .../builds/with-interfaces/docs/PetApi.md | 595 ++++++ .../builds/with-interfaces/docs/StoreApi.md | 278 +++ .../builds/with-interfaces/docs/Tag.md | 37 + .../builds/with-interfaces/docs/User.md | 49 + .../builds/with-interfaces/docs/UserApi.md | 545 ++++++ .../with-npm-version/.openapi-generator/FILES | 9 + .../builds/with-npm-version/README.md | 167 +- .../builds/with-npm-version/docs/Category.md | 37 + .../with-npm-version/docs/ModelApiResponse.md | 39 + .../builds/with-npm-version/docs/Order.md | 45 + .../builds/with-npm-version/docs/Pet.md | 45 + .../builds/with-npm-version/docs/PetApi.md | 595 ++++++ .../builds/with-npm-version/docs/StoreApi.md | 278 +++ .../builds/with-npm-version/docs/Tag.md | 37 + .../builds/with-npm-version/docs/User.md | 49 + .../builds/with-npm-version/docs/UserApi.md | 545 ++++++ .../.openapi-generator/FILES | 5 + .../with-string-enums/docs/DefaultApi.md | 290 +++ .../docs/EnumPatternObject.md | 40 + .../FakeEnumRequestGetInline200Response.md | 40 + .../with-string-enums/docs/NumberEnum.md | 32 + .../with-string-enums/docs/StringEnum.md | 32 + .../.openapi-generator/FILES | 15 + .../builds/without-runtime-checks/README.md | 167 +- .../without-runtime-checks/docs/Category.md | 37 + .../docs/ModelApiResponse.md | 39 + .../without-runtime-checks/docs/Order.md | 45 + .../builds/without-runtime-checks/docs/Pet.md | 45 + .../without-runtime-checks/docs/PetApi.md | 595 ++++++ .../without-runtime-checks/docs/StoreApi.md | 278 +++ .../builds/without-runtime-checks/docs/Tag.md | 37 + .../without-runtime-checks/docs/User.md | 49 + .../without-runtime-checks/docs/UserApi.md | 545 ++++++ .../src/models/Category.ts | 73 + .../src/models/ModelApiResponse.ts | 81 + .../src/models/Order.ts | 117 ++ .../without-runtime-checks/src/models/Pet.ts | 134 ++ .../without-runtime-checks/src/models/Tag.ts | 73 + .../without-runtime-checks/src/models/User.ts | 121 ++ 268 files changed, 29653 insertions(+), 140 deletions(-) create mode 100644 samples/client/others/typescript-fetch/self-import-issue/docs/AbstractUserDto.md create mode 100644 samples/client/others/typescript-fetch/self-import-issue/docs/BranchDto.md create mode 100644 samples/client/others/typescript-fetch/self-import-issue/docs/InternalAuthenticatedUserDto.md create mode 100644 samples/client/others/typescript-fetch/self-import-issue/docs/RemoteAuthenticatedUserDto.md create mode 100644 samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/Club.md create mode 100644 samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/DefaultApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/Owner.md create mode 100644 samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/Club.md create mode 100644 samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/DefaultApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/Owner.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AllOfWithSingleRef.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Animal.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayTest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Capitalization.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Cat.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ChildWithNullable.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ClassModel.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Client.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/DefaultApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Dog.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumArrays.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumTest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeBigDecimalMap200Response.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Foo.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FooGetDefaultResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FormatTest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/List.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MapTest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Model200Response.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ModelFile.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Name.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NullableClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NumberOnly.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterComposite.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnum.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterObjectWithEnumProperty.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ParentWithNullable.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Return.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/SingleRefType.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/SpecialModelName.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/default/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/enum/docs/DefaultApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/enum/docs/EnumPatternObject.md create mode 100644 samples/client/petstore/typescript-fetch/builds/enum/docs/FakeEnumRequestGetInline200Response.md create mode 100644 samples/client/petstore/typescript-fetch/builds/enum/docs/NumberEnum.md create mode 100644 samples/client/petstore/typescript-fetch/builds/enum/docs/StringEnum.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/oneOf/docs/DefaultApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/oneOf/docs/OptionOne.md create mode 100644 samples/client/petstore/typescript-fetch/builds/oneOf/docs/OptionTwo.md create mode 100644 samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestA.md create mode 100644 samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestArrayResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestB.md create mode 100644 samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestDiscriminatorResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/BehaviorApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/BehaviorType.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/DefaultMetaOnlyResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/DeploymentRequestStatus.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ErrorCode.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/FindPetsByStatusResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/FindPetsByUserResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorPermissionsResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorTypeResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetMatchingPartsResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetPetPartTypeResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ItemId.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/MatchingParts.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ModelError.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Part.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetPartApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetPartType.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetRegionsResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ResponseMeta.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/WarningCode.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AllOfWithSingleRef.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Animal.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayTest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Capitalization.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Cat.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ClassModel.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Client.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/DefaultApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Dog.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumArrays.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumTest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeBigDecimalMap200Response.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Foo.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FooGetDefaultResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FormatTest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/List.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MapTest.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Model200Response.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ModelFile.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Name.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NullableClass.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NumberOnly.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterComposite.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnum.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterObjectWithEnumProperty.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Return.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/SingleRefType.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/SpecialModelName.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/DefaultApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/EnumPatternObject.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/FakeEnumRequestGetInline200Response.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/NumberEnum.md create mode 100644 samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/StringEnum.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/PetApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/StoreApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/UserApi.md create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Category.ts create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/ModelApiResponse.ts create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Order.ts create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Pet.ts create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Tag.ts create mode 100644 samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/User.ts diff --git a/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES index e75080e4b5f4..a4c6a2bbba2c 100644 --- a/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES +++ b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES @@ -1,3 +1,7 @@ +docs/AbstractUserDto.md +docs/BranchDto.md +docs/InternalAuthenticatedUserDto.md +docs/RemoteAuthenticatedUserDto.md index.ts models/AbstractUserDto.ts models/BranchDto.ts diff --git a/samples/client/others/typescript-fetch/self-import-issue/docs/AbstractUserDto.md b/samples/client/others/typescript-fetch/self-import-issue/docs/AbstractUserDto.md new file mode 100644 index 000000000000..ad31927b8960 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/docs/AbstractUserDto.md @@ -0,0 +1,38 @@ + +# AbstractUserDto + + +## Properties + +Name | Type +------------ | ------------- +`username` | string +`branch` | [BranchDto](BranchDto.md) +`type` | string + +## Example + +```typescript +import type { AbstractUserDto } from '' + +// TODO: Update the object below with actual values +const example = { + "username": null, + "branch": null, + "type": null, +} satisfies AbstractUserDto + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AbstractUserDto +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/others/typescript-fetch/self-import-issue/docs/BranchDto.md b/samples/client/others/typescript-fetch/self-import-issue/docs/BranchDto.md new file mode 100644 index 000000000000..425fca5d261f --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/docs/BranchDto.md @@ -0,0 +1,34 @@ + +# BranchDto + + +## Properties + +Name | Type +------------ | ------------- +`name` | string + +## Example + +```typescript +import type { BranchDto } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, +} satisfies BranchDto + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as BranchDto +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/others/typescript-fetch/self-import-issue/docs/InternalAuthenticatedUserDto.md b/samples/client/others/typescript-fetch/self-import-issue/docs/InternalAuthenticatedUserDto.md new file mode 100644 index 000000000000..ae490733da4a --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/docs/InternalAuthenticatedUserDto.md @@ -0,0 +1,32 @@ + +# InternalAuthenticatedUserDto + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { InternalAuthenticatedUserDto } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies InternalAuthenticatedUserDto + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as InternalAuthenticatedUserDto +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/others/typescript-fetch/self-import-issue/docs/RemoteAuthenticatedUserDto.md b/samples/client/others/typescript-fetch/self-import-issue/docs/RemoteAuthenticatedUserDto.md new file mode 100644 index 000000000000..206ea3654f47 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/docs/RemoteAuthenticatedUserDto.md @@ -0,0 +1,32 @@ + +# RemoteAuthenticatedUserDto + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { RemoteAuthenticatedUserDto } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies RemoteAuthenticatedUserDto + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as RemoteAuthenticatedUserDto +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/.openapi-generator/FILES index 4036fef51863..63371da50f90 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/.openapi-generator/FILES @@ -1,5 +1,8 @@ apis/DefaultApi.ts apis/index.ts +docs/Club.md +docs/DefaultApi.md +docs/Owner.md index.ts models/Club.ts models/Owner.ts diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/Club.md b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/Club.md new file mode 100644 index 000000000000..c5f4b018ac30 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/Club.md @@ -0,0 +1,34 @@ + +# Club + + +## Properties + +Name | Type +------------ | ------------- +`owner` | [Owner](Owner.md) + +## Example + +```typescript +import type { Club } from '' + +// TODO: Update the object below with actual values +const example = { + "owner": null, +} satisfies Club + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Club +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/DefaultApi.md b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/DefaultApi.md new file mode 100644 index 000000000000..2ac133c8cfdd --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/DefaultApi.md @@ -0,0 +1,74 @@ +# DefaultApi + +All URIs are relative to *http://api.example.xyz/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**list**](DefaultApi.md#list) | **GET** /person/display/{personId} | | + + + +## list + +> Club list(personId) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { ListRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // string | The id of the person to retrieve + personId: personId_example, + } satisfies ListRequest; + + try { + const data = await api.list(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **personId** | `string` | The id of the person to retrieve | [Defaults to `undefined`] | + +### Return type + +[**Club**](Club.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/Owner.md b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/Owner.md new file mode 100644 index 000000000000..5b339eab195d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/docs/Owner.md @@ -0,0 +1,34 @@ + +# Owner + + +## Properties + +Name | Type +------------ | ------------- +`name` | string + +## Example + +```typescript +import type { Owner } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, +} satisfies Owner + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Owner +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/.openapi-generator/FILES index 4036fef51863..63371da50f90 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/.openapi-generator/FILES @@ -1,5 +1,8 @@ apis/DefaultApi.ts apis/index.ts +docs/Club.md +docs/DefaultApi.md +docs/Owner.md index.ts models/Club.ts models/Owner.ts diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/Club.md b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/Club.md new file mode 100644 index 000000000000..c5f4b018ac30 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/Club.md @@ -0,0 +1,34 @@ + +# Club + + +## Properties + +Name | Type +------------ | ------------- +`owner` | [Owner](Owner.md) + +## Example + +```typescript +import type { Club } from '' + +// TODO: Update the object below with actual values +const example = { + "owner": null, +} satisfies Club + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Club +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/DefaultApi.md b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/DefaultApi.md new file mode 100644 index 000000000000..2ac133c8cfdd --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/DefaultApi.md @@ -0,0 +1,74 @@ +# DefaultApi + +All URIs are relative to *http://api.example.xyz/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**list**](DefaultApi.md#list) | **GET** /person/display/{personId} | | + + + +## list + +> Club list(personId) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { ListRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // string | The id of the person to retrieve + personId: personId_example, + } satisfies ListRequest; + + try { + const data = await api.list(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **personId** | `string` | The id of the person to retrieve | [Defaults to `undefined`] | + +### Return type + +[**Club**](Club.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/Owner.md b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/Owner.md new file mode 100644 index 000000000000..5b339eab195d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/docs/Owner.md @@ -0,0 +1,34 @@ + +# Owner + + +## Properties + +Name | Type +------------ | ------------- +`name` | string + +## Example + +```typescript +import type { Owner } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, +} satisfies Owner + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Owner +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES index 6baaabbfd169..7d711c859272 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES @@ -6,6 +6,63 @@ apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts apis/index.ts +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/ParentWithNullable.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/User.md +docs/UserApi.md index.ts models/AdditionalPropertiesClass.ts models/AllOfWithSingleRef.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..57a49c2172f4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AdditionalPropertiesClass.md @@ -0,0 +1,36 @@ + +# AdditionalPropertiesClass + + +## Properties + +Name | Type +------------ | ------------- +`mapProperty` | { [key: string]: string; } +`mapOfMapProperty` | { [key: string]: { [key: string]: string; }; } + +## Example + +```typescript +import type { AdditionalPropertiesClass } from '' + +// TODO: Update the object below with actual values +const example = { + "mapProperty": null, + "mapOfMapProperty": null, +} satisfies AdditionalPropertiesClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AdditionalPropertiesClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AllOfWithSingleRef.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AllOfWithSingleRef.md new file mode 100644 index 000000000000..ac58cb9ac4a9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AllOfWithSingleRef.md @@ -0,0 +1,36 @@ + +# AllOfWithSingleRef + + +## Properties + +Name | Type +------------ | ------------- +`username` | string +`singleRefType` | [SingleRefType](SingleRefType.md) + +## Example + +```typescript +import type { AllOfWithSingleRef } from '' + +// TODO: Update the object below with actual values +const example = { + "username": null, + "singleRefType": null, +} satisfies AllOfWithSingleRef + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AllOfWithSingleRef +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Animal.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Animal.md new file mode 100644 index 000000000000..c9340f7f3829 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Animal.md @@ -0,0 +1,36 @@ + +# Animal + + +## Properties + +Name | Type +------------ | ------------- +`className` | string +`color` | string + +## Example + +```typescript +import type { Animal } from '' + +// TODO: Update the object below with actual values +const example = { + "className": null, + "color": null, +} satisfies Animal + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Animal +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AnotherFakeApi.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..0bbea8646ae4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AnotherFakeApi.md @@ -0,0 +1,76 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**_123testSpecialTags**](AnotherFakeApi.md#_123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## _123testSpecialTags + +> Client _123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```ts +import { + Configuration, + AnotherFakeApi, +} from ''; +import type { 123testSpecialTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new AnotherFakeApi(); + + const body = { + // Client | client model + client: ..., + } satisfies 123testSpecialTagsRequest; + + try { + const data = await api._123testSpecialTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..be7f8c68a8d3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,34 @@ + +# ArrayOfArrayOfNumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`arrayArrayNumber` | Array<Array<number>> + +## Example + +```typescript +import type { ArrayOfArrayOfNumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayArrayNumber": null, +} satisfies ArrayOfArrayOfNumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayOfArrayOfNumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayOfNumberOnly.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..5a45078ec80a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayOfNumberOnly.md @@ -0,0 +1,34 @@ + +# ArrayOfNumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`arrayNumber` | Array<number> + +## Example + +```typescript +import type { ArrayOfNumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayNumber": null, +} satisfies ArrayOfNumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayOfNumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayTest.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayTest.md new file mode 100644 index 000000000000..c96a28873389 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ArrayTest.md @@ -0,0 +1,38 @@ + +# ArrayTest + + +## Properties + +Name | Type +------------ | ------------- +`arrayOfString` | Array<string> +`arrayArrayOfInteger` | Array<Array<number>> +`arrayArrayOfModel` | Array<Array<ReadOnlyFirst>> + +## Example + +```typescript +import type { ArrayTest } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayOfString": null, + "arrayArrayOfInteger": null, + "arrayArrayOfModel": null, +} satisfies ArrayTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Capitalization.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Capitalization.md new file mode 100644 index 000000000000..7295256c294d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Capitalization.md @@ -0,0 +1,44 @@ + +# Capitalization + + +## Properties + +Name | Type +------------ | ------------- +`smallCamel` | string +`capitalCamel` | string +`smallSnake` | string +`capitalSnake` | string +`sCAETHFlowPoints` | string +`aTTNAME` | string + +## Example + +```typescript +import type { Capitalization } from '' + +// TODO: Update the object below with actual values +const example = { + "smallCamel": null, + "capitalCamel": null, + "smallSnake": null, + "capitalSnake": null, + "sCAETHFlowPoints": null, + "aTTNAME": null, +} satisfies Capitalization + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Capitalization +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Cat.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Cat.md new file mode 100644 index 000000000000..c9af5916c1d7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Cat.md @@ -0,0 +1,34 @@ + +# Cat + + +## Properties + +Name | Type +------------ | ------------- +`declawed` | boolean + +## Example + +```typescript +import type { Cat } from '' + +// TODO: Update the object below with actual values +const example = { + "declawed": null, +} satisfies Cat + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Cat +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Category.md new file mode 100644 index 000000000000..a436c463edae --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Category.md @@ -0,0 +1,36 @@ + +# Category + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ChildWithNullable.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ChildWithNullable.md new file mode 100644 index 000000000000..21df9798d44d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ChildWithNullable.md @@ -0,0 +1,34 @@ + +# ChildWithNullable + + +## Properties + +Name | Type +------------ | ------------- +`otherProperty` | string + +## Example + +```typescript +import type { ChildWithNullable } from '' + +// TODO: Update the object below with actual values +const example = { + "otherProperty": null, +} satisfies ChildWithNullable + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ChildWithNullable +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ClassModel.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ClassModel.md new file mode 100644 index 000000000000..11e87e883716 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ClassModel.md @@ -0,0 +1,35 @@ + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +Name | Type +------------ | ------------- +`_class` | string + +## Example + +```typescript +import type { ClassModel } from '' + +// TODO: Update the object below with actual values +const example = { + "_class": null, +} satisfies ClassModel + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ClassModel +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Client.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Client.md new file mode 100644 index 000000000000..a695e731d26d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Client.md @@ -0,0 +1,34 @@ + +# Client + + +## Properties + +Name | Type +------------ | ------------- +`client` | string + +## Example + +```typescript +import type { Client } from '' + +// TODO: Update the object below with actual values +const example = { + "client": null, +} satisfies Client + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Client +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/DefaultApi.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/DefaultApi.md new file mode 100644 index 000000000000..634c8687af1b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/DefaultApi.md @@ -0,0 +1,66 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooget) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FooGetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + try { + const data = await api.fooGet(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/DeprecatedObject.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/DeprecatedObject.md new file mode 100644 index 000000000000..0205d848ea10 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/DeprecatedObject.md @@ -0,0 +1,34 @@ + +# DeprecatedObject + + +## Properties + +Name | Type +------------ | ------------- +`name` | string + +## Example + +```typescript +import type { DeprecatedObject } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, +} satisfies DeprecatedObject + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeprecatedObject +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Dog.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Dog.md new file mode 100644 index 000000000000..7cec0ceeffaf --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Dog.md @@ -0,0 +1,34 @@ + +# Dog + + +## Properties + +Name | Type +------------ | ------------- +`breed` | string + +## Example + +```typescript +import type { Dog } from '' + +// TODO: Update the object below with actual values +const example = { + "breed": null, +} satisfies Dog + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Dog +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumArrays.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumArrays.md new file mode 100644 index 000000000000..ec959f362b4b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumArrays.md @@ -0,0 +1,36 @@ + +# EnumArrays + + +## Properties + +Name | Type +------------ | ------------- +`justSymbol` | string +`arrayEnum` | Array<string> + +## Example + +```typescript +import type { EnumArrays } from '' + +// TODO: Update the object below with actual values +const example = { + "justSymbol": null, + "arrayEnum": null, +} satisfies EnumArrays + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumArrays +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumClass.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumClass.md new file mode 100644 index 000000000000..eb421a41a1b4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumClass.md @@ -0,0 +1,32 @@ + +# EnumClass + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { EnumClass } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies EnumClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumTest.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumTest.md new file mode 100644 index 000000000000..4015a156ba48 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/EnumTest.md @@ -0,0 +1,48 @@ + +# EnumTest + + +## Properties + +Name | Type +------------ | ------------- +`enumString` | string +`enumStringRequired` | string +`enumInteger` | number +`enumNumber` | number +`outerEnum` | [OuterEnum](OuterEnum.md) +`outerEnumInteger` | [OuterEnumInteger](OuterEnumInteger.md) +`outerEnumDefaultValue` | [OuterEnumDefaultValue](OuterEnumDefaultValue.md) +`outerEnumIntegerDefaultValue` | [OuterEnumIntegerDefaultValue](OuterEnumIntegerDefaultValue.md) + +## Example + +```typescript +import type { EnumTest } from '' + +// TODO: Update the object below with actual values +const example = { + "enumString": null, + "enumStringRequired": null, + "enumInteger": null, + "enumNumber": null, + "outerEnum": null, + "outerEnumInteger": null, + "outerEnumDefaultValue": null, + "outerEnumIntegerDefaultValue": null, +} satisfies EnumTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeApi.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeApi.md new file mode 100644 index 000000000000..9a679499c16f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeApi.md @@ -0,0 +1,1605 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalpropertiesoperation) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testNullable**](FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeBigDecimalMapRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + try { + const data = await api.fakeBigDecimalMap(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeHealthGetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + try { + const data = await api.fakeHealthGet(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeHttpSignatureTest + +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeHttpSignatureTestRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP signature authorization: http_signature_test + headers: { "YOUR HEADER NAME": "YOUR SIGNATURE" }, + }); + const api = new FakeApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + // string | query parameter (optional) + query1: query1_example, + // string | header parameter (optional) + header1: header1_example, + } satisfies FakeHttpSignatureTestRequest; + + try { + const data = await api.fakeHttpSignatureTest(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | +| **query1** | `string` | query parameter | [Optional] [Defaults to `undefined`] | +| **header1** | `string` | header parameter | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterBooleanSerialize + +> boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterBooleanSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // boolean | Input boolean as post body (optional) + body: true, + } satisfies FakeOuterBooleanSerializeRequest; + + try { + const data = await api.fakeOuterBooleanSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `boolean` | Input boolean as post body | [Optional] | + +### Return type + +**boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterCompositeSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // OuterComposite | Input composite as post body (optional) + outerComposite: ..., + } satisfies FakeOuterCompositeSerializeRequest; + + try { + const data = await api.fakeOuterCompositeSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [OuterComposite](OuterComposite.md) | Input composite as post body | [Optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterNumberSerialize + +> number fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterNumberSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // number | Input number as post body (optional) + body: 8.14, + } satisfies FakeOuterNumberSerializeRequest; + + try { + const data = await api.fakeOuterNumberSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `number` | Input number as post body | [Optional] | + +### Return type + +**number** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterStringSerialize + +> string fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterStringSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string | Input string as post body (optional) + body: body_example, + } satisfies FakeOuterStringSerializeRequest; + + try { + const data = await api.fakeOuterStringSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `string` | Input string as post body | [Optional] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakePropertyEnumIntegerSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // OuterObjectWithEnumProperty | Input enum (int) as post body + outerObjectWithEnumProperty: ..., + } satisfies FakePropertyEnumIntegerSerializeRequest; + + try { + const data = await api.fakePropertyEnumIntegerSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [OuterObjectWithEnumProperty](OuterObjectWithEnumProperty.md) | Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testAdditionalPropertiesReference + +> testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestAdditionalPropertiesReferenceRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // { [key: string]: any; } | request body + requestBody: Object, + } satisfies TestAdditionalPropertiesReferenceRequest; + + try { + const data = await api.testAdditionalPropertiesReference(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | `{ [key: string]: any; }` | request body | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithBinary + +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithBinaryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Blob | image to upload + body: BINARY_DATA_HERE, + } satisfies TestBodyWithBinaryRequest; + + try { + const data = await api.testBodyWithBinary(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Blob` | image to upload | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `image/png` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithFileSchema + +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithFileSchemaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // FileSchemaTestClass + fileSchemaTestClass: ..., + } satisfies TestBodyWithFileSchemaRequest; + + try { + const data = await api.testBodyWithFileSchema(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [FileSchemaTestClass](FileSchemaTestClass.md) | | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithQueryParams + +> testBodyWithQueryParams(query, user) + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithQueryParamsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string + query: query_example, + // User + user: ..., + } satisfies TestBodyWithQueryParamsRequest; + + try { + const data = await api.testBodyWithQueryParams(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | `string` | | [Defaults to `undefined`] | +| **user** | [User](User.md) | | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestClientModelRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Client | client model + client: ..., + } satisfies TestClientModelRequest; + + try { + const data = await api.testClientModel(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testEndpointParameters + +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestEndpointParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: http_basic_test + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new FakeApi(config); + + const body = { + // number | None + number: 8.14, + // number | None + _double: 1.2, + // string | None + patternWithoutDelimiter: patternWithoutDelimiter_example, + // string | None + _byte: BYTE_ARRAY_DATA_HERE, + // number | None (optional) + integer: 56, + // number | None (optional) + int32: 56, + // number | None (optional) + int64: 789, + // number | None (optional) + _float: 3.4, + // string | None (optional) + string: string_example, + // Blob | None (optional) + binary: BINARY_DATA_HERE, + // Date | None (optional) + date: 2013-10-20, + // Date | None (optional) + dateTime: 2013-10-20T19:20:30+01:00, + // string | None (optional) + password: password_example, + // string | None (optional) + callback: callback_example, + } satisfies TestEndpointParametersRequest; + + try { + const data = await api.testEndpointParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | `number` | None | [Defaults to `undefined`] | +| **_double** | `number` | None | [Defaults to `undefined`] | +| **patternWithoutDelimiter** | `string` | None | [Defaults to `undefined`] | +| **_byte** | `string` | None | [Defaults to `undefined`] | +| **integer** | `number` | None | [Optional] [Defaults to `undefined`] | +| **int32** | `number` | None | [Optional] [Defaults to `undefined`] | +| **int64** | `number` | None | [Optional] [Defaults to `undefined`] | +| **_float** | `number` | None | [Optional] [Defaults to `undefined`] | +| **string** | `string` | None | [Optional] [Defaults to `undefined`] | +| **binary** | `Blob` | None | [Optional] [Defaults to `undefined`] | +| **date** | `Date` | None | [Optional] [Defaults to `undefined`] | +| **dateTime** | `Date` | None | [Optional] [Defaults to `undefined`] | +| **password** | `string` | None | [Optional] [Defaults to `undefined`] | +| **callback** | `string` | None | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testEnumParameters + +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestEnumParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Array<'>' | '$'> | Header parameter enum test (string array) (optional) + enumHeaderStringArray: ..., + // '_abc' | '-efg' | '(xyz)' | Header parameter enum test (string) (optional) + enumHeaderString: enumHeaderString_example, + // Array<'>' | '$'> | Query parameter enum test (string array) (optional) + enumQueryStringArray: ..., + // '_abc' | '-efg' | '(xyz)' | Query parameter enum test (string) (optional) + enumQueryString: enumQueryString_example, + // 1 | -2 | Query parameter enum test (double) (optional) + enumQueryInteger: 56, + // 1.1 | -1.2 | Query parameter enum test (double) (optional) + enumQueryDouble: 1.2, + // Array (optional) + enumQueryModelArray: ..., + // Array | Form parameter enum test (string array) (optional) + enumFormStringArray: ..., + // string | Form parameter enum test (string) (optional) + enumFormString: enumFormString_example, + } satisfies TestEnumParametersRequest; + + try { + const data = await api.testEnumParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | `>`, `$` | Header parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumHeaderString** | `_abc`, `-efg`, `(xyz)` | Header parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | `>`, `$` | Query parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumQueryString** | `_abc`, `-efg`, `(xyz)` | Query parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | `1`, `-2` | Query parameter enum test (double) | [Optional] [Defaults to `undefined`] [Enum: 1, -2] | +| **enumQueryDouble** | `1.1`, `-1.2` | Query parameter enum test (double) | [Optional] [Defaults to `undefined`] [Enum: 1.1, -1.2] | +| **enumQueryModelArray** | `Array` | | [Optional] | +| **enumFormStringArray** | `>`, `$` | Form parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumFormString** | `_abc`, `-efg`, `(xyz)` | Form parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testGroupParameters + +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestGroupParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearer_test + accessToken: "YOUR BEARER TOKEN", + }); + const api = new FakeApi(config); + + const body = { + // number | Required String in group parameters + requiredStringGroup: 56, + // boolean | Required Boolean in group parameters + requiredBooleanGroup: true, + // number | Required Integer in group parameters + requiredInt64Group: 789, + // number | String in group parameters (optional) + stringGroup: 56, + // boolean | Boolean in group parameters (optional) + booleanGroup: true, + // number | Integer in group parameters (optional) + int64Group: 789, + } satisfies TestGroupParametersRequest; + + try { + const data = await api.testGroupParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | `number` | Required String in group parameters | [Defaults to `undefined`] | +| **requiredBooleanGroup** | `boolean` | Required Boolean in group parameters | [Defaults to `undefined`] | +| **requiredInt64Group** | `number` | Required Integer in group parameters | [Defaults to `undefined`] | +| **stringGroup** | `number` | String in group parameters | [Optional] [Defaults to `undefined`] | +| **booleanGroup** | `boolean` | Boolean in group parameters | [Optional] [Defaults to `undefined`] | +| **int64Group** | `number` | Integer in group parameters | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testInlineAdditionalProperties + +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestInlineAdditionalPropertiesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // { [key: string]: string; } | request body + requestBody: ..., + } satisfies TestInlineAdditionalPropertiesRequest; + + try { + const data = await api.testInlineAdditionalProperties(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | `{ [key: string]: string; }` | request body | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestInlineFreeformAdditionalPropertiesOperationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // TestInlineFreeformAdditionalPropertiesRequest | request body + testInlineFreeformAdditionalPropertiesRequest: ..., + } satisfies TestInlineFreeformAdditionalPropertiesOperationRequest; + + try { + const data = await api.testInlineFreeformAdditionalProperties(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [TestInlineFreeformAdditionalPropertiesRequest](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testJsonFormData + +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestJsonFormDataRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string | field1 + param: param_example, + // string | field2 + param2: param2_example, + } satisfies TestJsonFormDataRequest; + + try { + const data = await api.testJsonFormData(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | `string` | field1 | [Defaults to `undefined`] | +| **param2** | `string` | field2 | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testNullable + +> testNullable(childWithNullable) + +test nullable parent property + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestNullableRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // ChildWithNullable | request body + childWithNullable: ..., + } satisfies TestNullableRequest; + + try { + const data = await api.testNullable(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **childWithNullable** | [ChildWithNullable](ChildWithNullable.md) | request body | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestQueryParameterCollectionFormatRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Array + pipe: ..., + // Array + ioutil: ..., + // Array + http: ..., + // Array + url: ..., + // Array + context: ..., + // string + allowEmpty: allowEmpty_example, + // { [key: string]: string; } (optional) + language: ..., + } satisfies TestQueryParameterCollectionFormatRequest; + + try { + const data = await api.testQueryParameterCollectionFormat(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | `Array` | | | +| **ioutil** | `Array` | | | +| **http** | `Array` | | | +| **url** | `Array` | | | +| **context** | `Array` | | | +| **allowEmpty** | `string` | | [Defaults to `undefined`] | +| **language** | `{ [key: string]: string; }` | | [Optional] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestStringMapReferenceRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // { [key: string]: string; } | request body + requestBody: ..., + } satisfies TestStringMapReferenceRequest; + + try { + const data = await api.testStringMapReference(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | `{ [key: string]: string; }` | request body | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..55decbceae7a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,36 @@ + +# FakeBigDecimalMap200Response + + +## Properties + +Name | Type +------------ | ------------- +`someId` | number +`someMap` | { [key: string]: number; } + +## Example + +```typescript +import type { FakeBigDecimalMap200Response } from '' + +// TODO: Update the object below with actual values +const example = { + "someId": null, + "someMap": null, +} satisfies FakeBigDecimalMap200Response + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FakeBigDecimalMap200Response +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeClassnameTags123Api.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..f92fbbfdc5e6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeClassnameTags123Api.md @@ -0,0 +1,80 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```ts +import { + Configuration, + FakeClassnameTags123Api, +} from ''; +import type { TestClassnameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key_query + apiKey: "YOUR API KEY", + }); + const api = new FakeClassnameTags123Api(config); + + const body = { + // Client | client model + client: ..., + } satisfies TestClassnameRequest; + + try { + const data = await api.testClassname(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FileSchemaTestClass.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..0d8a01ce7744 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FileSchemaTestClass.md @@ -0,0 +1,36 @@ + +# FileSchemaTestClass + + +## Properties + +Name | Type +------------ | ------------- +`file` | any +`files` | Array<any> + +## Example + +```typescript +import type { FileSchemaTestClass } from '' + +// TODO: Update the object below with actual values +const example = { + "file": null, + "files": null, +} satisfies FileSchemaTestClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FileSchemaTestClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Foo.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Foo.md new file mode 100644 index 000000000000..9dc80038989e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Foo.md @@ -0,0 +1,34 @@ + +# Foo + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string + +## Example + +```typescript +import type { Foo } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, +} satisfies Foo + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Foo +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FooGetDefaultResponse.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FooGetDefaultResponse.md new file mode 100644 index 000000000000..142288f71a1b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FooGetDefaultResponse.md @@ -0,0 +1,34 @@ + +# FooGetDefaultResponse + + +## Properties + +Name | Type +------------ | ------------- +`string` | [Foo](Foo.md) + +## Example + +```typescript +import type { FooGetDefaultResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "string": null, +} satisfies FooGetDefaultResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FooGetDefaultResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FormatTest.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FormatTest.md new file mode 100644 index 000000000000..8c5381729918 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FormatTest.md @@ -0,0 +1,64 @@ + +# FormatTest + + +## Properties + +Name | Type +------------ | ------------- +`integer` | number +`int32` | number +`int64` | number +`number` | number +`_float` | number +`_double` | number +`decimal` | string +`string` | string +`_byte` | string +`binary` | Blob +`date` | Date +`dateTime` | Date +`uuid` | string +`password` | string +`patternWithDigits` | string +`patternWithDigitsAndDelimiter` | string + +## Example + +```typescript +import type { FormatTest } from '' + +// TODO: Update the object below with actual values +const example = { + "integer": null, + "int32": null, + "int64": null, + "number": null, + "_float": null, + "_double": null, + "decimal": null, + "string": null, + "_byte": null, + "binary": null, + "date": null, + "dateTime": null, + "uuid": 72f98069-206d-4f12-9f12-3d1e525a8e84, + "password": null, + "patternWithDigits": null, + "patternWithDigitsAndDelimiter": null, +} satisfies FormatTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FormatTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/HasOnlyReadOnly.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..5e4acb6fab84 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/HasOnlyReadOnly.md @@ -0,0 +1,36 @@ + +# HasOnlyReadOnly + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string +`foo` | string + +## Example + +```typescript +import type { HasOnlyReadOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, + "foo": null, +} satisfies HasOnlyReadOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as HasOnlyReadOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/HealthCheckResult.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/HealthCheckResult.md new file mode 100644 index 000000000000..e50fd4dc523a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/HealthCheckResult.md @@ -0,0 +1,35 @@ + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +Name | Type +------------ | ------------- +`nullableMessage` | string + +## Example + +```typescript +import type { HealthCheckResult } from '' + +// TODO: Update the object below with actual values +const example = { + "nullableMessage": null, +} satisfies HealthCheckResult + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as HealthCheckResult +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/List.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/List.md new file mode 100644 index 000000000000..528de6c951e8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/List.md @@ -0,0 +1,34 @@ + +# List + + +## Properties + +Name | Type +------------ | ------------- +`_123list` | string + +## Example + +```typescript +import type { List } from '' + +// TODO: Update the object below with actual values +const example = { + "_123list": null, +} satisfies List + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as List +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MapTest.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MapTest.md new file mode 100644 index 000000000000..dfb73cded89a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MapTest.md @@ -0,0 +1,40 @@ + +# MapTest + + +## Properties + +Name | Type +------------ | ------------- +`mapMapOfString` | { [key: string]: { [key: string]: string; }; } +`mapOfEnumString` | { [key: string]: string; } +`directMap` | { [key: string]: boolean; } +`indirectMap` | { [key: string]: boolean; } + +## Example + +```typescript +import type { MapTest } from '' + +// TODO: Update the object below with actual values +const example = { + "mapMapOfString": null, + "mapOfEnumString": null, + "directMap": null, + "indirectMap": null, +} satisfies MapTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as MapTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..7113d7669471 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,38 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +Name | Type +------------ | ------------- +`uuid` | string +`dateTime` | Date +`map` | [{ [key: string]: Animal; }](Animal.md) + +## Example + +```typescript +import type { MixedPropertiesAndAdditionalPropertiesClass } from '' + +// TODO: Update the object below with actual values +const example = { + "uuid": null, + "dateTime": null, + "map": null, +} satisfies MixedPropertiesAndAdditionalPropertiesClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as MixedPropertiesAndAdditionalPropertiesClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Model200Response.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Model200Response.md new file mode 100644 index 000000000000..b8c44438d1f8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Model200Response.md @@ -0,0 +1,37 @@ + +# Model200Response + +Model for testing model name starting with number + +## Properties + +Name | Type +------------ | ------------- +`name` | number +`_class` | string + +## Example + +```typescript +import type { Model200Response } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, + "_class": null, +} satisfies Model200Response + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Model200Response +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ModelApiResponse.md new file mode 100644 index 000000000000..c029285d2f1a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ModelApiResponse.md @@ -0,0 +1,38 @@ + +# ModelApiResponse + + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ModelFile.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ModelFile.md new file mode 100644 index 000000000000..c8d923e37bc4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ModelFile.md @@ -0,0 +1,35 @@ + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type +------------ | ------------- +`sourceURI` | string + +## Example + +```typescript +import type { ModelFile } from '' + +// TODO: Update the object below with actual values +const example = { + "sourceURI": null, +} satisfies ModelFile + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelFile +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Name.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Name.md new file mode 100644 index 000000000000..8c8c48b60ed8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Name.md @@ -0,0 +1,41 @@ + +# Name + +Model for testing model name same as property name + +## Properties + +Name | Type +------------ | ------------- +`name` | number +`snakeCase` | number +`property` | string +`_123number` | number + +## Example + +```typescript +import type { Name } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, + "snakeCase": null, + "property": null, + "_123number": null, +} satisfies Name + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Name +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NullableClass.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NullableClass.md new file mode 100644 index 000000000000..70d7011287c9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NullableClass.md @@ -0,0 +1,56 @@ + +# NullableClass + + +## Properties + +Name | Type +------------ | ------------- +`integerProp` | number +`numberProp` | number +`booleanProp` | boolean +`stringProp` | string +`dateProp` | Date +`datetimeProp` | Date +`arrayNullableProp` | Array<object> +`arrayAndItemsNullableProp` | Array<object | null> +`arrayItemsNullable` | Array<object | null> +`objectNullableProp` | { [key: string]: object; } +`objectAndItemsNullableProp` | { [key: string]: object | null; } +`objectItemsNullable` | { [key: string]: object | null; } + +## Example + +```typescript +import type { NullableClass } from '' + +// TODO: Update the object below with actual values +const example = { + "integerProp": null, + "numberProp": null, + "booleanProp": null, + "stringProp": null, + "dateProp": null, + "datetimeProp": null, + "arrayNullableProp": null, + "arrayAndItemsNullableProp": null, + "arrayItemsNullable": null, + "objectNullableProp": null, + "objectAndItemsNullableProp": null, + "objectItemsNullable": null, +} satisfies NullableClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as NullableClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NumberOnly.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NumberOnly.md new file mode 100644 index 000000000000..7a8a70f5c311 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NumberOnly.md @@ -0,0 +1,34 @@ + +# NumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`justNumber` | number + +## Example + +```typescript +import type { NumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "justNumber": null, +} satisfies NumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as NumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..be78d0004a79 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,40 @@ + +# ObjectWithDeprecatedFields + + +## Properties + +Name | Type +------------ | ------------- +`uuid` | string +`id` | number +`deprecatedRef` | [DeprecatedObject](DeprecatedObject.md) +`bars` | Array<string> + +## Example + +```typescript +import type { ObjectWithDeprecatedFields } from '' + +// TODO: Update the object below with actual values +const example = { + "uuid": null, + "id": null, + "deprecatedRef": null, + "bars": null, +} satisfies ObjectWithDeprecatedFields + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ObjectWithDeprecatedFields +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Order.md new file mode 100644 index 000000000000..602f01d8d40f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Order.md @@ -0,0 +1,44 @@ + +# Order + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterComposite.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterComposite.md new file mode 100644 index 000000000000..3aa13c3f0d4e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterComposite.md @@ -0,0 +1,38 @@ + +# OuterComposite + + +## Properties + +Name | Type +------------ | ------------- +`myNumber` | number +`myString` | string +`myBoolean` | boolean + +## Example + +```typescript +import type { OuterComposite } from '' + +// TODO: Update the object below with actual values +const example = { + "myNumber": null, + "myString": null, + "myBoolean": null, +} satisfies OuterComposite + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterComposite +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnum.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnum.md new file mode 100644 index 000000000000..f0a854cd58d7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnum.md @@ -0,0 +1,32 @@ + +# OuterEnum + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnum } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnum + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnum +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumDefaultValue.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..635202415f87 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumDefaultValue.md @@ -0,0 +1,32 @@ + +# OuterEnumDefaultValue + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumDefaultValue } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumDefaultValue + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumDefaultValue +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumInteger.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..c5c4b7ee3fef --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumInteger.md @@ -0,0 +1,32 @@ + +# OuterEnumInteger + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumInteger } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumInteger + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumInteger +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..1e932e921220 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,32 @@ + +# OuterEnumIntegerDefaultValue + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumIntegerDefaultValue } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumIntegerDefaultValue + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumIntegerDefaultValue +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..468927f018f9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,34 @@ + +# OuterObjectWithEnumProperty + + +## Properties + +Name | Type +------------ | ------------- +`value` | [OuterEnumInteger](OuterEnumInteger.md) + +## Example + +```typescript +import type { OuterObjectWithEnumProperty } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies OuterObjectWithEnumProperty + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterObjectWithEnumProperty +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ParentWithNullable.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ParentWithNullable.md new file mode 100644 index 000000000000..04eb64fd5306 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ParentWithNullable.md @@ -0,0 +1,36 @@ + +# ParentWithNullable + + +## Properties + +Name | Type +------------ | ------------- +`type` | string +`nullableProperty` | string + +## Example + +```typescript +import type { ParentWithNullable } from '' + +// TODO: Update the object below with actual values +const example = { + "type": null, + "nullableProperty": null, +} satisfies ParentWithNullable + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ParentWithNullable +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Pet.md new file mode 100644 index 000000000000..c2719b9b2ac9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Pet.md @@ -0,0 +1,44 @@ + +# Pet + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Set<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/PetApi.md new file mode 100644 index 000000000000..e5da18e8bdb6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/PetApi.md @@ -0,0 +1,687 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + + +## addPet + +> addPet(pet) + +Add a new pet to the store + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { AddPetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { DeletePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByStatusRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Set<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Set | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Set` | Tags to filter by | | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { GetPetByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(pet) + +Update an existing pet + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetWithFormRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileWithRequiredFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // Blob | file to upload + requiredFile: BINARY_DATA_HERE, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + } satisfies UploadFileWithRequiredFileRequest; + + try { + const data = await api.uploadFileWithRequiredFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **requiredFile** | `Blob` | file to upload | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ReadOnlyFirst.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..f663955bc85f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/ReadOnlyFirst.md @@ -0,0 +1,36 @@ + +# ReadOnlyFirst + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string +`baz` | string + +## Example + +```typescript +import type { ReadOnlyFirst } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, + "baz": null, +} satisfies ReadOnlyFirst + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ReadOnlyFirst +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Return.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Return.md new file mode 100644 index 000000000000..c2163d20294d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Return.md @@ -0,0 +1,35 @@ + +# Return + +Model for testing reserved words + +## Properties + +Name | Type +------------ | ------------- +`_return` | number + +## Example + +```typescript +import type { Return } from '' + +// TODO: Update the object below with actual values +const example = { + "_return": null, +} satisfies Return + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Return +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/SingleRefType.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/SingleRefType.md new file mode 100644 index 000000000000..6f61f0b5a6ce --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/SingleRefType.md @@ -0,0 +1,32 @@ + +# SingleRefType + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { SingleRefType } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies SingleRefType + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SingleRefType +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/SpecialModelName.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/SpecialModelName.md new file mode 100644 index 000000000000..5b462196a720 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/SpecialModelName.md @@ -0,0 +1,34 @@ + +# SpecialModelName + + +## Properties + +Name | Type +------------ | ------------- +`$specialPropertyName` | number + +## Example + +```typescript +import type { SpecialModelName } from '' + +// TODO: Update the object below with actual values +const example = { + "$specialPropertyName": null, +} satisfies SpecialModelName + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SpecialModelName +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/StoreApi.md new file mode 100644 index 000000000000..9f6136a7714e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/StoreApi.md @@ -0,0 +1,280 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { DeleteOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetInventoryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetOrderByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { PlaceOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + order: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Tag.md new file mode 100644 index 000000000000..94b8b8810ed7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/Tag.md @@ -0,0 +1,36 @@ + +# Tag + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..0f434686fe93 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,34 @@ + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +Name | Type +------------ | ------------- +`someProperty` | string + +## Example + +```typescript +import type { TestInlineFreeformAdditionalPropertiesRequest } from '' + +// TODO: Update the object below with actual values +const example = { + "someProperty": null, +} satisfies TestInlineFreeformAdditionalPropertiesRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TestInlineFreeformAdditionalPropertiesRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/User.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/User.md new file mode 100644 index 000000000000..198cd8da459d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/User.md @@ -0,0 +1,48 @@ + +# User + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/UserApi.md new file mode 100644 index 000000000000..f537a517e225 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/UserApi.md @@ -0,0 +1,555 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + user: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithArrayInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + user: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithListInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + user: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { DeleteUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { GetUserByNameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LoginUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LogoutUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { UpdateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + user: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **user** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/FILES index 2a7406ef851b..946584cc4cc9 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/FILES @@ -2,6 +2,15 @@ apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts apis/index.ts +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md index.ts models/Category.ts models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/default/docs/Category.md new file mode 100644 index 000000000000..3666c22c002a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/default/docs/ModelApiResponse.md new file mode 100644 index 000000000000..77430704bd2a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/default/docs/Order.md new file mode 100644 index 000000000000..e2527b3aa31c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/default/docs/Pet.md new file mode 100644 index 000000000000..5cff690c1f62 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/Pet.md @@ -0,0 +1,45 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Array<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/default/docs/PetApi.md new file mode 100644 index 000000000000..2827a301c5e3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/PetApi.md @@ -0,0 +1,595 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> addPet(body) + +Add a new pet to the store + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { AddPetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { DeletePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByStatusRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { GetPetByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetWithFormRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/default/docs/StoreApi.md new file mode 100644 index 000000000000..ceb7e08b016e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/StoreApi.md @@ -0,0 +1,278 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { DeleteOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetInventoryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetOrderByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { PlaceOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + body: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/default/docs/Tag.md new file mode 100644 index 000000000000..e6c34b2dab01 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/User.md b/samples/client/petstore/typescript-fetch/builds/default/docs/User.md new file mode 100644 index 000000000000..af455b7cf7b2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/User.md @@ -0,0 +1,49 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/default/docs/UserApi.md new file mode 100644 index 000000000000..7d2b3fa00c39 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/UserApi.md @@ -0,0 +1,545 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + body: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithArrayInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithListInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { DeleteUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { GetUserByNameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LoginUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LogoutUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { UpdateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + body: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **body** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/FILES index f237d91aea43..1e2d4cb46bfc 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/FILES @@ -1,5 +1,10 @@ apis/DefaultApi.ts apis/index.ts +docs/DefaultApi.md +docs/EnumPatternObject.md +docs/FakeEnumRequestGetInline200Response.md +docs/NumberEnum.md +docs/StringEnum.md index.ts models/EnumPatternObject.ts models/FakeEnumRequestGetInline200Response.ts diff --git a/samples/client/petstore/typescript-fetch/builds/enum/docs/DefaultApi.md b/samples/client/petstore/typescript-fetch/builds/enum/docs/DefaultApi.md new file mode 100644 index 000000000000..9650fa77bd97 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/enum/docs/DefaultApi.md @@ -0,0 +1,290 @@ +# DefaultApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeEnumRequestGetInline**](DefaultApi.md#fakeenumrequestgetinline) | **GET** /fake/enum-request-inline | | +| [**fakeEnumRequestGetRef**](DefaultApi.md#fakeenumrequestgetref) | **GET** /fake/enum-request-ref | | +| [**fakeEnumRequestPostInline**](DefaultApi.md#fakeenumrequestpostinline) | **POST** /fake/enum-request-inline | | +| [**fakeEnumRequestPostRef**](DefaultApi.md#fakeenumrequestpostref) | **POST** /fake/enum-request-ref | | + + + +## fakeEnumRequestGetInline + +> FakeEnumRequestGetInline200Response fakeEnumRequestGetInline(stringEnum, nullableStringEnum, numberEnum, nullableNumberEnum) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FakeEnumRequestGetInlineRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // 'one' | 'two' | 'three' (optional) + stringEnum: stringEnum_example, + // string (optional) + nullableStringEnum: ..., + // 1 | 2 | 3 (optional) + numberEnum: 8.14, + // number (optional) + nullableNumberEnum: ..., + } satisfies FakeEnumRequestGetInlineRequest; + + try { + const data = await api.fakeEnumRequestGetInline(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **stringEnum** | `one`, `two`, `three` | | [Optional] [Defaults to `undefined`] [Enum: one, two, three] | +| **nullableStringEnum** | `one`, `two`, `three` | | [Optional] [Defaults to `undefined`] [Enum: one, two, three] | +| **numberEnum** | `1`, `2`, `3` | | [Optional] [Defaults to `undefined`] [Enum: 1, 2, 3] | +| **nullableNumberEnum** | `1`, `2`, `3` | | [Optional] [Defaults to `undefined`] [Enum: 1, 2, 3] | + +### Return type + +[**FakeEnumRequestGetInline200Response**](FakeEnumRequestGetInline200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeEnumRequestGetRef + +> EnumPatternObject fakeEnumRequestGetRef(stringEnum, nullableStringEnum, numberEnum, nullableNumberEnum) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FakeEnumRequestGetRefRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // StringEnum (optional) + stringEnum: ..., + // StringEnum (optional) + nullableStringEnum: ..., + // NumberEnum (optional) + numberEnum: ..., + // NumberEnum (optional) + nullableNumberEnum: ..., + } satisfies FakeEnumRequestGetRefRequest; + + try { + const data = await api.fakeEnumRequestGetRef(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **stringEnum** | `StringEnum` | | [Optional] [Defaults to `undefined`] [Enum: one, two, three] | +| **nullableStringEnum** | `StringEnum` | | [Optional] [Defaults to `undefined`] [Enum: one, two, three] | +| **numberEnum** | `NumberEnum` | | [Optional] [Defaults to `undefined`] [Enum: 1, 2, 3] | +| **nullableNumberEnum** | `NumberEnum` | | [Optional] [Defaults to `undefined`] [Enum: 1, 2, 3] | + +### Return type + +[**EnumPatternObject**](EnumPatternObject.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeEnumRequestPostInline + +> FakeEnumRequestGetInline200Response fakeEnumRequestPostInline(fakeEnumRequestGetInline200Response) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FakeEnumRequestPostInlineRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // FakeEnumRequestGetInline200Response (optional) + fakeEnumRequestGetInline200Response: ..., + } satisfies FakeEnumRequestPostInlineRequest; + + try { + const data = await api.fakeEnumRequestPostInline(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fakeEnumRequestGetInline200Response** | [FakeEnumRequestGetInline200Response](FakeEnumRequestGetInline200Response.md) | | [Optional] | + +### Return type + +[**FakeEnumRequestGetInline200Response**](FakeEnumRequestGetInline200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeEnumRequestPostRef + +> EnumPatternObject fakeEnumRequestPostRef(enumPatternObject) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FakeEnumRequestPostRefRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // EnumPatternObject (optional) + enumPatternObject: ..., + } satisfies FakeEnumRequestPostRefRequest; + + try { + const data = await api.fakeEnumRequestPostRef(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumPatternObject** | [EnumPatternObject](EnumPatternObject.md) | | [Optional] | + +### Return type + +[**EnumPatternObject**](EnumPatternObject.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/enum/docs/EnumPatternObject.md b/samples/client/petstore/typescript-fetch/builds/enum/docs/EnumPatternObject.md new file mode 100644 index 000000000000..ce126b6c0231 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/enum/docs/EnumPatternObject.md @@ -0,0 +1,40 @@ + +# EnumPatternObject + + +## Properties + +Name | Type +------------ | ------------- +`stringEnum` | [StringEnum](StringEnum.md) +`nullableStringEnum` | [StringEnum](StringEnum.md) +`numberEnum` | [NumberEnum](NumberEnum.md) +`nullableNumberEnum` | [NumberEnum](NumberEnum.md) + +## Example + +```typescript +import type { EnumPatternObject } from '' + +// TODO: Update the object below with actual values +const example = { + "stringEnum": null, + "nullableStringEnum": null, + "numberEnum": null, + "nullableNumberEnum": null, +} satisfies EnumPatternObject + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumPatternObject +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/enum/docs/FakeEnumRequestGetInline200Response.md b/samples/client/petstore/typescript-fetch/builds/enum/docs/FakeEnumRequestGetInline200Response.md new file mode 100644 index 000000000000..1856455884e2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/enum/docs/FakeEnumRequestGetInline200Response.md @@ -0,0 +1,40 @@ + +# FakeEnumRequestGetInline200Response + + +## Properties + +Name | Type +------------ | ------------- +`stringEnum` | string +`nullableStringEnum` | string +`numberEnum` | number +`nullableNumberEnum` | number + +## Example + +```typescript +import type { FakeEnumRequestGetInline200Response } from '' + +// TODO: Update the object below with actual values +const example = { + "stringEnum": null, + "nullableStringEnum": null, + "numberEnum": null, + "nullableNumberEnum": null, +} satisfies FakeEnumRequestGetInline200Response + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FakeEnumRequestGetInline200Response +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/enum/docs/NumberEnum.md b/samples/client/petstore/typescript-fetch/builds/enum/docs/NumberEnum.md new file mode 100644 index 000000000000..18e8953984aa --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/enum/docs/NumberEnum.md @@ -0,0 +1,32 @@ + +# NumberEnum + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { NumberEnum } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies NumberEnum + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as NumberEnum +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/enum/docs/StringEnum.md b/samples/client/petstore/typescript-fetch/builds/enum/docs/StringEnum.md new file mode 100644 index 000000000000..4e035c514858 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/enum/docs/StringEnum.md @@ -0,0 +1,32 @@ + +# StringEnum + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { StringEnum } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies StringEnum + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as StringEnum +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/FILES index cfa1534a047b..b7078082a023 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/FILES @@ -1,6 +1,15 @@ .gitignore .npmignore README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md package.json src/apis/PetApi.ts src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/README.md b/samples/client/petstore/typescript-fetch/builds/es6-target/README.md index 9b50c27ec63f..fb2e5499836c 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/README.md +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/README.md @@ -1,46 +1,157 @@ -## @openapitools/typescript-fetch-petstore@1.0.0 +# @openapitools/typescript-fetch-petstore@1.0.0 -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: +A TypeScript SDK client for the petstore.swagger.io API. -Environment -* Node.js -* Webpack -* Browserify +## Usage -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 +First, install the SDK from npm. -Module system -* CommonJS -* ES6 module system +```bash +npm install @openapitools/typescript-fetch-petstore --save +``` -It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) +Next, try it out. -### Building -To build and compile the typescript sources to javascript use: -``` -npm install -npm run build +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` -### Publishing -First build the package then run `npm publish` +## Documentation -### Consuming +### API Endpoints -navigate to the folder of your consuming project and run one of the following commands. +All URIs are relative to *http://petstore.swagger.io/v2* -_published:_ +| Class | Method | HTTP request | Description +| ----- | ------ | ------------ | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user -``` -npm install @openapitools/typescript-fetch-petstore@1.0.0 --save -``` -_unPublished (not recommended):_ +### Models + +- [Category](docs/Category.md) +- [ModelApiResponse](docs/ModelApiResponse.md) +- [Order](docs/Order.md) +- [Pet](docs/Pet.md) +- [Tag](docs/Tag.md) +- [User](docs/User.md) + +### Authorization + + +Authentication schemes defined for the API: + +#### petstore_auth implicit + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - `write:pets`: modify pets in your account + - `read:pets`: read your pets + +#### api_key + +- **Type**: API key +- **API key parameter name**: `api_key` +- **Location**: HTTP header + +## About + +This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/) +and is automatically generated by the +[OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.0.0` +- Package version: `1.0.0` +- Generator version: `7.15.0-SNAPSHOT` +- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen` + +The generated npm module supports the following: + +- Environments + * Node.js + * Webpack + * Browserify +- Language levels + * ES5 - you must have a Promises/A+ library installed + * ES6 +- Module systems + * CommonJS + * ES6 module system + + +## Development + +### Building + +To build the TypeScript source code, you need to have Node.js and npm installed. +After cloning the repository, navigate to the project directory and run: + +```bash +npm install +npm run build ``` -npm install PATH_TO_GENERATED_PACKAGE --save + +### Publishing + +Once you've built the package, you can publish it to npm: + +```bash +npm publish ``` + +## License + +[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Category.md new file mode 100644 index 000000000000..6b1d545b2f35 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/ModelApiResponse.md new file mode 100644 index 000000000000..2583fa00e7a3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Order.md new file mode 100644 index 000000000000..3c1be2566f70 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Pet.md new file mode 100644 index 000000000000..221555445c78 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Pet.md @@ -0,0 +1,45 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Array<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/PetApi.md new file mode 100644 index 000000000000..b642fb6bcef5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/PetApi.md @@ -0,0 +1,595 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> addPet(body) + +Add a new pet to the store + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeletePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByStatusRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByTagsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetPetByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetWithFormRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UploadFileRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/StoreApi.md new file mode 100644 index 000000000000..fea668fdac48 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/StoreApi.md @@ -0,0 +1,278 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetInventoryRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetOrderByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { PlaceOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + body: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Tag.md new file mode 100644 index 000000000000..d112fe3b95e5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/User.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/User.md new file mode 100644 index 000000000000..98bd755583d5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/User.md @@ -0,0 +1,49 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/UserApi.md new file mode 100644 index 000000000000..9d42e138d5b1 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/UserApi.md @@ -0,0 +1,545 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + body: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithArrayInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithListInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetUserByNameRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LoginUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LogoutUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + body: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **body** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/FILES index 2a7406ef851b..946584cc4cc9 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/FILES @@ -2,6 +2,15 @@ apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts apis/index.ts +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md index.ts models/Category.ts models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Category.md new file mode 100644 index 000000000000..3666c22c002a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/ModelApiResponse.md new file mode 100644 index 000000000000..77430704bd2a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Order.md new file mode 100644 index 000000000000..e2527b3aa31c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Pet.md new file mode 100644 index 000000000000..5cff690c1f62 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Pet.md @@ -0,0 +1,45 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Array<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/PetApi.md new file mode 100644 index 000000000000..2827a301c5e3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/PetApi.md @@ -0,0 +1,595 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> addPet(body) + +Add a new pet to the store + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { AddPetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { DeletePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByStatusRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { GetPetByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetWithFormRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/StoreApi.md new file mode 100644 index 000000000000..ceb7e08b016e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/StoreApi.md @@ -0,0 +1,278 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { DeleteOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetInventoryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetOrderByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { PlaceOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + body: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Tag.md new file mode 100644 index 000000000000..e6c34b2dab01 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/User.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/User.md new file mode 100644 index 000000000000..af455b7cf7b2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/User.md @@ -0,0 +1,49 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/UserApi.md new file mode 100644 index 000000000000..7d2b3fa00c39 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/UserApi.md @@ -0,0 +1,545 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + body: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithArrayInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithListInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { DeleteUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { GetUserByNameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LoginUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LogoutUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { UpdateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + body: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **body** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES index 037062f16b80..20834d7a9398 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES @@ -1,5 +1,13 @@ apis/DefaultApi.ts apis/index.ts +docs/DefaultApi.md +docs/OptionOne.md +docs/OptionTwo.md +docs/TestA.md +docs/TestArrayResponse.md +docs/TestB.md +docs/TestDiscriminatorResponse.md +docs/TestResponse.md index.ts models/OptionOne.ts models/OptionTwo.ts diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/docs/DefaultApi.md b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/DefaultApi.md new file mode 100644 index 000000000000..270369707540 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/DefaultApi.md @@ -0,0 +1,182 @@ +# DefaultApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**test**](DefaultApi.md#test) | **GET** /test | | +| [**testArray**](DefaultApi.md#testarray) | **GET** /test-array | | +| [**testDiscriminator**](DefaultApi.md#testdiscriminator) | **GET** /test-discriminator | | + + + +## test + +> TestResponse test() + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { TestRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + try { + const data = await api.test(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**TestResponse**](TestResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testArray + +> TestArrayResponse testArray() + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { TestArrayRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + try { + const data = await api.testArray(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**TestArrayResponse**](TestArrayResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testDiscriminator + +> TestDiscriminatorResponse testDiscriminator() + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { TestDiscriminatorRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + try { + const data = await api.testDiscriminator(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**TestDiscriminatorResponse**](TestDiscriminatorResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/docs/OptionOne.md b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/OptionOne.md new file mode 100644 index 000000000000..cfb9d67b6cee --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/OptionOne.md @@ -0,0 +1,34 @@ + +# OptionOne + + +## Properties + +Name | Type +------------ | ------------- +`discriminatorField` | string + +## Example + +```typescript +import type { OptionOne } from '' + +// TODO: Update the object below with actual values +const example = { + "discriminatorField": null, +} satisfies OptionOne + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OptionOne +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/docs/OptionTwo.md b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/OptionTwo.md new file mode 100644 index 000000000000..bfb80f587b8b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/OptionTwo.md @@ -0,0 +1,34 @@ + +# OptionTwo + + +## Properties + +Name | Type +------------ | ------------- +`discriminatorField` | string + +## Example + +```typescript +import type { OptionTwo } from '' + +// TODO: Update the object below with actual values +const example = { + "discriminatorField": null, +} satisfies OptionTwo + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OptionTwo +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestA.md b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestA.md new file mode 100644 index 000000000000..c1b89ab63a90 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestA.md @@ -0,0 +1,34 @@ + +# TestA + + +## Properties + +Name | Type +------------ | ------------- +`foo` | string + +## Example + +```typescript +import type { TestA } from '' + +// TODO: Update the object below with actual values +const example = { + "foo": null, +} satisfies TestA + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TestA +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestArrayResponse.md b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestArrayResponse.md new file mode 100644 index 000000000000..7594da4c4baf --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestArrayResponse.md @@ -0,0 +1,32 @@ + +# TestArrayResponse + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { TestArrayResponse } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies TestArrayResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TestArrayResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestB.md b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestB.md new file mode 100644 index 000000000000..a930f36731b8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestB.md @@ -0,0 +1,34 @@ + +# TestB + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string + +## Example + +```typescript +import type { TestB } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, +} satisfies TestB + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TestB +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestDiscriminatorResponse.md b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestDiscriminatorResponse.md new file mode 100644 index 000000000000..12acff490180 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestDiscriminatorResponse.md @@ -0,0 +1,34 @@ + +# TestDiscriminatorResponse + + +## Properties + +Name | Type +------------ | ------------- +`discriminatorField` | string + +## Example + +```typescript +import type { TestDiscriminatorResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "discriminatorField": null, +} satisfies TestDiscriminatorResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TestDiscriminatorResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestResponse.md b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestResponse.md new file mode 100644 index 000000000000..ab5595e1543a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/docs/TestResponse.md @@ -0,0 +1,36 @@ + +# TestResponse + + +## Properties + +Name | Type +------------ | ------------- +`foo` | string +`bar` | string + +## Example + +```typescript +import type { TestResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "foo": null, + "bar": null, +} satisfies TestResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TestResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/FILES index 38feffe8896a..3cf2461a65c2 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/FILES @@ -1,6 +1,15 @@ .gitignore .npmignore README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md package.json src/apis/PetApi.ts src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/README.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/README.md index 9b50c27ec63f..fb2e5499836c 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/README.md +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/README.md @@ -1,46 +1,157 @@ -## @openapitools/typescript-fetch-petstore@1.0.0 +# @openapitools/typescript-fetch-petstore@1.0.0 -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: +A TypeScript SDK client for the petstore.swagger.io API. -Environment -* Node.js -* Webpack -* Browserify +## Usage -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 +First, install the SDK from npm. -Module system -* CommonJS -* ES6 module system +```bash +npm install @openapitools/typescript-fetch-petstore --save +``` -It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) +Next, try it out. -### Building -To build and compile the typescript sources to javascript use: -``` -npm install -npm run build +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` -### Publishing -First build the package then run `npm publish` +## Documentation -### Consuming +### API Endpoints -navigate to the folder of your consuming project and run one of the following commands. +All URIs are relative to *http://petstore.swagger.io/v2* -_published:_ +| Class | Method | HTTP request | Description +| ----- | ------ | ------------ | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user -``` -npm install @openapitools/typescript-fetch-petstore@1.0.0 --save -``` -_unPublished (not recommended):_ +### Models + +- [Category](docs/Category.md) +- [ModelApiResponse](docs/ModelApiResponse.md) +- [Order](docs/Order.md) +- [Pet](docs/Pet.md) +- [Tag](docs/Tag.md) +- [User](docs/User.md) + +### Authorization + + +Authentication schemes defined for the API: + +#### petstore_auth implicit + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - `write:pets`: modify pets in your account + - `read:pets`: read your pets + +#### api_key + +- **Type**: API key +- **API key parameter name**: `api_key` +- **Location**: HTTP header + +## About + +This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/) +and is automatically generated by the +[OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.0.0` +- Package version: `1.0.0` +- Generator version: `7.15.0-SNAPSHOT` +- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen` + +The generated npm module supports the following: + +- Environments + * Node.js + * Webpack + * Browserify +- Language levels + * ES5 - you must have a Promises/A+ library installed + * ES6 +- Module systems + * CommonJS + * ES6 module system + + +## Development + +### Building + +To build the TypeScript source code, you need to have Node.js and npm installed. +After cloning the repository, navigate to the project directory and run: + +```bash +npm install +npm run build ``` -npm install PATH_TO_GENERATED_PACKAGE --save + +### Publishing + +Once you've built the package, you can publish it to npm: + +```bash +npm publish ``` + +## License + +[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Category.md new file mode 100644 index 000000000000..6b1d545b2f35 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/ModelApiResponse.md new file mode 100644 index 000000000000..2583fa00e7a3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Order.md new file mode 100644 index 000000000000..3c1be2566f70 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Pet.md new file mode 100644 index 000000000000..221555445c78 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Pet.md @@ -0,0 +1,45 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Array<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/PetApi.md new file mode 100644 index 000000000000..b642fb6bcef5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/PetApi.md @@ -0,0 +1,595 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> addPet(body) + +Add a new pet to the store + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeletePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByStatusRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByTagsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetPetByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetWithFormRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UploadFileRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/StoreApi.md new file mode 100644 index 000000000000..fea668fdac48 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/StoreApi.md @@ -0,0 +1,278 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetInventoryRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetOrderByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { PlaceOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + body: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Tag.md new file mode 100644 index 000000000000..d112fe3b95e5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/User.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/User.md new file mode 100644 index 000000000000..98bd755583d5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/User.md @@ -0,0 +1,49 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/UserApi.md new file mode 100644 index 000000000000..9d42e138d5b1 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/UserApi.md @@ -0,0 +1,545 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + body: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithArrayInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithListInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetUserByNameRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LoginUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LogoutUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + body: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **body** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/FILES index c7d07ac052f6..e9468978b80f 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/FILES @@ -1,6 +1,35 @@ .gitignore .npmignore README.md +docs/BehaviorApi.md +docs/BehaviorType.md +docs/Category.md +docs/DefaultMetaOnlyResponse.md +docs/DeploymentRequestStatus.md +docs/ErrorCode.md +docs/FindPetsByStatusResponse.md +docs/FindPetsByUserResponse.md +docs/GetBehaviorPermissionsResponse.md +docs/GetBehaviorTypeResponse.md +docs/GetMatchingPartsResponse.md +docs/GetPetPartTypeResponse.md +docs/ItemId.md +docs/MatchingParts.md +docs/ModelApiResponse.md +docs/ModelError.md +docs/Order.md +docs/Part.md +docs/Pet.md +docs/PetApi.md +docs/PetPartApi.md +docs/PetPartType.md +docs/PetRegionsResponse.md +docs/ResponseMeta.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +docs/WarningCode.md package.json src/ApiEntitiesRecord.ts src/ApiEntitiesReducer.ts diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/README.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/README.md index 9b50c27ec63f..7bfe96e95980 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/README.md +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/README.md @@ -1,46 +1,179 @@ -## @openapitools/typescript-fetch-petstore@1.0.0 +# @openapitools/typescript-fetch-petstore@1.0.0 -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: +A TypeScript SDK client for the petstore.swagger.io API. -Environment -* Node.js -* Webpack -* Browserify +## Usage -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 +First, install the SDK from npm. -Module system -* CommonJS -* ES6 module system +```bash +npm install @openapitools/typescript-fetch-petstore --save +``` -It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) +Next, try it out. -### Building -To build and compile the typescript sources to javascript use: -``` -npm install -npm run build +```ts +import { + Configuration, + BehaviorApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetBehaviorPermissionsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new BehaviorApi(); + + const body = { + // number + behaviorId: 789, + } satisfies GetBehaviorPermissionsRequest; + + try { + const data = await api.getBehaviorPermissions(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` -### Publishing -First build the package then run `npm publish` +## Documentation -### Consuming +### API Endpoints -navigate to the folder of your consuming project and run one of the following commands. +All URIs are relative to *http://petstore.swagger.io/v2* -_published:_ +| Class | Method | HTTP request | Description +| ----- | ------ | ------------ | ------------- +*BehaviorApi* | [**getBehaviorPermissions**](docs/BehaviorApi.md#getbehaviorpermissions) | **GET** /fake_behavior/{behavior-id}/permissions | Get permissions for the behavior +*BehaviorApi* | [**getBehaviorType**](docs/BehaviorApi.md#getbehaviortype) | **GET** /fake_behavior/{behavior-id}/type | Get the type of behavior +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByIds**](docs/PetApi.md#findpetsbyids) | **GET** /pet/findByIds | Finds Pets by ids +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**findPetsByUserIds**](docs/PetApi.md#findpetsbyuserids) | **GET** /pet/findByUserIds | Finds Pets by user ids +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**getPetRegions**](docs/PetApi.md#getpetregions) | **GET** /pet/{petId}/regions | Gets regions for a single pet. +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetRegions**](docs/PetApi.md#updatepetregions) | **PUT** /pet/{petId}/regions | Updates the pet regions. +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetPartApi* | [**getFakePetPartType**](docs/PetPartApi.md#getfakepetparttype) | **GET** /fake_petParts/{fake_petPart-id}/part-type | Returns single pet part type for the petPart id. +*PetPartApi* | [**getMatchingParts**](docs/PetPartApi.md#getmatchingparts) | **GET** /fake_petParts/{fake_petPart-id}/matching-parts | Get the matching parts for the given pet part. +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user -``` -npm install @openapitools/typescript-fetch-petstore@1.0.0 --save -``` -_unPublished (not recommended):_ +### Models + +- [BehaviorType](docs/BehaviorType.md) +- [Category](docs/Category.md) +- [DefaultMetaOnlyResponse](docs/DefaultMetaOnlyResponse.md) +- [DeploymentRequestStatus](docs/DeploymentRequestStatus.md) +- [ErrorCode](docs/ErrorCode.md) +- [FindPetsByStatusResponse](docs/FindPetsByStatusResponse.md) +- [FindPetsByUserResponse](docs/FindPetsByUserResponse.md) +- [GetBehaviorPermissionsResponse](docs/GetBehaviorPermissionsResponse.md) +- [GetBehaviorTypeResponse](docs/GetBehaviorTypeResponse.md) +- [GetMatchingPartsResponse](docs/GetMatchingPartsResponse.md) +- [GetPetPartTypeResponse](docs/GetPetPartTypeResponse.md) +- [ItemId](docs/ItemId.md) +- [MatchingParts](docs/MatchingParts.md) +- [ModelApiResponse](docs/ModelApiResponse.md) +- [ModelError](docs/ModelError.md) +- [Order](docs/Order.md) +- [Part](docs/Part.md) +- [Pet](docs/Pet.md) +- [PetPartType](docs/PetPartType.md) +- [PetRegionsResponse](docs/PetRegionsResponse.md) +- [ResponseMeta](docs/ResponseMeta.md) +- [Tag](docs/Tag.md) +- [User](docs/User.md) +- [WarningCode](docs/WarningCode.md) + +### Authorization + + +Authentication schemes defined for the API: + +#### petstore_auth implicit + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - `write:pets`: modify pets in your account + - `read:pets`: read your pets + +#### api_key + +- **Type**: API key +- **API key parameter name**: `api_key` +- **Location**: HTTP header + +## About + +This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/) +and is automatically generated by the +[OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.0.0` +- Package version: `1.0.0` +- Generator version: `7.15.0-SNAPSHOT` +- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen` + +The generated npm module supports the following: + +- Environments + * Node.js + * Webpack + * Browserify +- Language levels + * ES5 - you must have a Promises/A+ library installed + * ES6 +- Module systems + * CommonJS + * ES6 module system + + +## Development + +### Building + +To build the TypeScript source code, you need to have Node.js and npm installed. +After cloning the repository, navigate to the project directory and run: + +```bash +npm install +npm run build ``` -npm install PATH_TO_GENERATED_PACKAGE --save + +### Publishing + +Once you've built the package, you can publish it to npm: + +```bash +npm publish ``` + +## License + +[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/BehaviorApi.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/BehaviorApi.md new file mode 100644 index 000000000000..fd552a48833e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/BehaviorApi.md @@ -0,0 +1,140 @@ +# BehaviorApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getBehaviorPermissions**](BehaviorApi.md#getbehaviorpermissions) | **GET** /fake_behavior/{behavior-id}/permissions | Get permissions for the behavior | +| [**getBehaviorType**](BehaviorApi.md#getbehaviortype) | **GET** /fake_behavior/{behavior-id}/type | Get the type of behavior | + + + +## getBehaviorPermissions + +> GetBehaviorPermissionsResponse getBehaviorPermissions(behaviorId) + +Get permissions for the behavior + +### Example + +```ts +import { + Configuration, + BehaviorApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetBehaviorPermissionsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new BehaviorApi(); + + const body = { + // number + behaviorId: 789, + } satisfies GetBehaviorPermissionsRequest; + + try { + const data = await api.getBehaviorPermissions(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **behaviorId** | `number` | | [Defaults to `undefined`] | + +### Return type + +[**GetBehaviorPermissionsResponse**](GetBehaviorPermissionsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getBehaviorType + +> GetBehaviorTypeResponse getBehaviorType(behaviorId) + +Get the type of behavior + +### Example + +```ts +import { + Configuration, + BehaviorApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetBehaviorTypeRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new BehaviorApi(); + + const body = { + // number + behaviorId: 789, + } satisfies GetBehaviorTypeRequest; + + try { + const data = await api.getBehaviorType(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **behaviorId** | `number` | | [Defaults to `undefined`] | + +### Return type + +[**GetBehaviorTypeResponse**](GetBehaviorTypeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/BehaviorType.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/BehaviorType.md new file mode 100644 index 000000000000..6203794d64d8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/BehaviorType.md @@ -0,0 +1,33 @@ + +# BehaviorType + +Behavior type of a pet + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { BehaviorType } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { +} satisfies BehaviorType + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as BehaviorType +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Category.md new file mode 100644 index 000000000000..6b1d545b2f35 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/DefaultMetaOnlyResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/DefaultMetaOnlyResponse.md new file mode 100644 index 000000000000..4b9fb71eaec9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/DefaultMetaOnlyResponse.md @@ -0,0 +1,34 @@ + +# DefaultMetaOnlyResponse + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [ResponseMeta](ResponseMeta.md) + +## Example + +```typescript +import type { DefaultMetaOnlyResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "meta": null, +} satisfies DefaultMetaOnlyResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DefaultMetaOnlyResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/DeploymentRequestStatus.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/DeploymentRequestStatus.md new file mode 100644 index 000000000000..c8ad842f4e60 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/DeploymentRequestStatus.md @@ -0,0 +1,33 @@ + +# DeploymentRequestStatus + +Status of the deployment request + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { DeploymentRequestStatus } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { +} satisfies DeploymentRequestStatus + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeploymentRequestStatus +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ErrorCode.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ErrorCode.md new file mode 100644 index 000000000000..4dd712fbfed6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ErrorCode.md @@ -0,0 +1,33 @@ + +# ErrorCode + +Error code returned when an error occurs + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { ErrorCode } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { +} satisfies ErrorCode + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ErrorCode +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/FindPetsByStatusResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/FindPetsByStatusResponse.md new file mode 100644 index 000000000000..c2c5c819d1b8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/FindPetsByStatusResponse.md @@ -0,0 +1,36 @@ + +# FindPetsByStatusResponse + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [ResponseMeta](ResponseMeta.md) +`data` | [Array<Pet>](Pet.md) + +## Example + +```typescript +import type { FindPetsByStatusResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "meta": null, + "data": null, +} satisfies FindPetsByStatusResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FindPetsByStatusResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/FindPetsByUserResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/FindPetsByUserResponse.md new file mode 100644 index 000000000000..bab26ee7f016 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/FindPetsByUserResponse.md @@ -0,0 +1,36 @@ + +# FindPetsByUserResponse + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [ResponseMeta](ResponseMeta.md) +`data` | [Array<User>](User.md) + +## Example + +```typescript +import type { FindPetsByUserResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "meta": null, + "data": null, +} satisfies FindPetsByUserResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FindPetsByUserResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorPermissionsResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorPermissionsResponse.md new file mode 100644 index 000000000000..5deb6c64e11d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorPermissionsResponse.md @@ -0,0 +1,36 @@ + +# GetBehaviorPermissionsResponse + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [ResponseMeta](ResponseMeta.md) +`data` | { [key: string]: boolean; } + +## Example + +```typescript +import type { GetBehaviorPermissionsResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "meta": null, + "data": null, +} satisfies GetBehaviorPermissionsResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as GetBehaviorPermissionsResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorTypeResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorTypeResponse.md new file mode 100644 index 000000000000..5e2f5c1f6550 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorTypeResponse.md @@ -0,0 +1,36 @@ + +# GetBehaviorTypeResponse + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [ResponseMeta](ResponseMeta.md) +`data` | [BehaviorType](BehaviorType.md) + +## Example + +```typescript +import type { GetBehaviorTypeResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "meta": null, + "data": null, +} satisfies GetBehaviorTypeResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as GetBehaviorTypeResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetMatchingPartsResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetMatchingPartsResponse.md new file mode 100644 index 000000000000..263a0f4aa33c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetMatchingPartsResponse.md @@ -0,0 +1,36 @@ + +# GetMatchingPartsResponse + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [ResponseMeta](ResponseMeta.md) +`data` | [MatchingParts](MatchingParts.md) + +## Example + +```typescript +import type { GetMatchingPartsResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "meta": null, + "data": null, +} satisfies GetMatchingPartsResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as GetMatchingPartsResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetPetPartTypeResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetPetPartTypeResponse.md new file mode 100644 index 000000000000..33d6fa49a5b6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetPetPartTypeResponse.md @@ -0,0 +1,36 @@ + +# GetPetPartTypeResponse + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [ResponseMeta](ResponseMeta.md) +`data` | [PetPartType](PetPartType.md) + +## Example + +```typescript +import type { GetPetPartTypeResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "meta": null, + "data": null, +} satisfies GetPetPartTypeResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as GetPetPartTypeResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ItemId.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ItemId.md new file mode 100644 index 000000000000..343209c7b51f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ItemId.md @@ -0,0 +1,37 @@ + +# ItemId + +Simplified identifier of an item + +## Properties + +Name | Type +------------ | ------------- +`id` | string +`type` | string + +## Example + +```typescript +import type { ItemId } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": 45, + "type": 5667, +} satisfies ItemId + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ItemId +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/MatchingParts.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/MatchingParts.md new file mode 100644 index 000000000000..595f972db502 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/MatchingParts.md @@ -0,0 +1,37 @@ + +# MatchingParts + +Contains all the matching parts + +## Properties + +Name | Type +------------ | ------------- +`connected` | [Array<Part>](Part.md) +`related` | [Array<Part>](Part.md) + +## Example + +```typescript +import type { MatchingParts } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "connected": null, + "related": null, +} satisfies MatchingParts + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as MatchingParts +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ModelApiResponse.md new file mode 100644 index 000000000000..2583fa00e7a3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ModelError.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ModelError.md new file mode 100644 index 000000000000..0c054811d045 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ModelError.md @@ -0,0 +1,41 @@ + +# ModelError + +This represent an error normally linked to a specific item from a previous request + +## Properties + +Name | Type +------------ | ------------- +`type` | string +`itemInfo` | [ItemId](ItemId.md) +`details` | string +`exception` | string + +## Example + +```typescript +import type { ModelError } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "type": GenericException, + "itemInfo": null, + "details": Could not update that field, + "exception": DBException + stack trace, +} satisfies ModelError + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelError +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Order.md new file mode 100644 index 000000000000..3c1be2566f70 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Part.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Part.md new file mode 100644 index 000000000000..9a6517f7d550 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Part.md @@ -0,0 +1,37 @@ + +# Part + +Contains all the info about a pet part + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Part } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": 1, + "name": head, +} satisfies Part + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Part +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Pet.md new file mode 100644 index 000000000000..4a70ff130df8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Pet.md @@ -0,0 +1,75 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`friendId` | number +`otherFriendIds` | Array<number> +`friendAge` | number +`age` | number +`isHappy` | boolean +`isTall` | boolean +`category` | [Category](Category.md) +`optionalCategory` | [Category](Category.md) +`name` | string +`_entries` | [Array<Category>](Category.md) +`surname` | string +`photoUrls` | Array<string> +`warningStatus` | [WarningCode](WarningCode.md) +`depStatus` | [DeploymentRequestStatus](DeploymentRequestStatus.md) +`alternateStatus` | [DeploymentRequestStatus](DeploymentRequestStatus.md) +`otherDepStatuses` | [Array<DeploymentRequestStatus>](DeploymentRequestStatus.md) +`tags` | [Array<Tag>](Tag.md) +`optionalTags` | [Array<Tag>](Tag.md) +`status` | string +`regions` | Array<Array<number | null>> + +## Example + +```typescript +import type { Pet } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "friendId": null, + "otherFriendIds": null, + "friendAge": null, + "age": null, + "isHappy": null, + "isTall": null, + "category": null, + "optionalCategory": null, + "name": doggie, + "_entries": null, + "surname": woofy, + "photoUrls": null, + "warningStatus": null, + "depStatus": null, + "alternateStatus": null, + "otherDepStatuses": null, + "tags": null, + "optionalTags": null, + "status": null, + "regions": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetApi.md new file mode 100644 index 000000000000..865ddc12ed8e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetApi.md @@ -0,0 +1,876 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByIds**](PetApi.md#findpetsbyids) | **GET** /pet/findByIds | Finds Pets by ids | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**findPetsByUserIds**](PetApi.md#findpetsbyuserids) | **GET** /pet/findByUserIds | Finds Pets by user ids | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**getPetRegions**](PetApi.md#getpetregions) | **GET** /pet/{petId}/regions | Gets regions for a single pet. | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetRegions**](PetApi.md#updatepetregions) | **PUT** /pet/{petId}/regions | Updates the pet regions. | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> addPet(dummyCat) + +Add a new pet to the store + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Category | dummy category for testing + dummyCat: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **dummyCat** | [Category](Category.md) | dummy category for testing | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeletePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByIds + +> Array<Pet> findPetsByIds(ids) + +Finds Pets by ids + +Multiple ids can be provided with comma separated strings. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByIdsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Ids to filter by + ids: ..., + } satisfies FindPetsByIdsRequest; + + try { + const data = await api.findPetsByIds(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **ids** | `Array` | Ids to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> FindPetsByStatusResponse findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByStatusRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**FindPetsByStatusResponse**](FindPetsByStatusResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByTagsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByUserIds + +> FindPetsByUserResponse findPetsByUserIds(ids) + +Finds Pets by user ids + +Multiple ids can be provided with comma separated strings. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByUserIdsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Ids to filter by + ids: ..., + } satisfies FindPetsByUserIdsRequest; + + try { + const data = await api.findPetsByUserIds(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **ids** | `Array` | Ids to filter by | | + +### Return type + +[**FindPetsByUserResponse**](FindPetsByUserResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetPetByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetRegions + +> PetRegionsResponse getPetRegions(petId) + +Gets regions for a single pet. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetPetRegionsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new PetApi(); + + const body = { + // number | ID of pet + petId: 789, + } satisfies GetPetRegionsRequest; + + try { + const data = await api.getPetRegions(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet | [Defaults to `undefined`] | + +### Return type + +[**PetRegionsResponse**](PetRegionsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be updated in the store + body: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be updated in the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetRegions + +> PetRegionsResponse updatePetRegions(petId, newRegions) + +Updates the pet regions. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetRegionsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new PetApi(); + + const body = { + // number | ID of pet + petId: 789, + // Array> + newRegions: ..., + } satisfies UpdatePetRegionsRequest; + + try { + const data = await api.updatePetRegions(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet | [Defaults to `undefined`] | +| **newRegions** | `Array>` | | | + +### Return type + +[**PetRegionsResponse**](PetRegionsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetWithFormRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UploadFileRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetPartApi.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetPartApi.md new file mode 100644 index 000000000000..459efa043255 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetPartApi.md @@ -0,0 +1,155 @@ +# PetPartApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getFakePetPartType**](PetPartApi.md#getfakepetparttype) | **GET** /fake_petParts/{fake_petPart-id}/part-type | Returns single pet part type for the petPart id. | +| [**getMatchingParts**](PetPartApi.md#getmatchingparts) | **GET** /fake_petParts/{fake_petPart-id}/matching-parts | Get the matching parts for the given pet part. | + + + +## getFakePetPartType + +> GetPetPartTypeResponse getFakePetPartType(fakePetPartId) + +Returns single pet part type for the petPart id. + +### Example + +```ts +import { + Configuration, + PetPartApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetFakePetPartTypeRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new PetPartApi(); + + const body = { + // number + fakePetPartId: 789, + } satisfies GetFakePetPartTypeRequest; + + try { + const data = await api.getFakePetPartType(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fakePetPartId** | `number` | | [Defaults to `undefined`] | + +### Return type + +[**GetPetPartTypeResponse**](GetPetPartTypeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getMatchingParts + +> GetMatchingPartsResponse getMatchingParts(fakePetPartId, _long, smooth, _short, name, connectedPart) + +Get the matching parts for the given pet part. + +### Example + +```ts +import { + Configuration, + PetPartApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetMatchingPartsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new PetPartApi(); + + const body = { + // number + fakePetPartId: 789, + // boolean + _long: true, + // boolean + smooth: true, + // boolean + _short: true, + // string (optional) + name: name_example, + // string (optional) + connectedPart: connectedPart_example, + } satisfies GetMatchingPartsRequest; + + try { + const data = await api.getMatchingParts(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fakePetPartId** | `number` | | [Defaults to `undefined`] | +| **_long** | `boolean` | | [Defaults to `undefined`] | +| **smooth** | `boolean` | | [Defaults to `undefined`] | +| **_short** | `boolean` | | [Defaults to `undefined`] | +| **name** | `string` | | [Optional] [Defaults to `undefined`] | +| **connectedPart** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +[**GetMatchingPartsResponse**](GetMatchingPartsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetPartType.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetPartType.md new file mode 100644 index 000000000000..7c3fa962ec1a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetPartType.md @@ -0,0 +1,33 @@ + +# PetPartType + +Type of pet part + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { PetPartType } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { +} satisfies PetPartType + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as PetPartType +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetRegionsResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetRegionsResponse.md new file mode 100644 index 000000000000..1bb0acfcc945 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/PetRegionsResponse.md @@ -0,0 +1,36 @@ + +# PetRegionsResponse + + +## Properties + +Name | Type +------------ | ------------- +`meta` | [ResponseMeta](ResponseMeta.md) +`data` | Array<Array<number | null>> + +## Example + +```typescript +import type { PetRegionsResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "meta": null, + "data": null, +} satisfies PetRegionsResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as PetRegionsResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ResponseMeta.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ResponseMeta.md new file mode 100644 index 000000000000..462d350e7d99 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/ResponseMeta.md @@ -0,0 +1,45 @@ + +# ResponseMeta + +Mandatory part of each response given by our API + +## Properties + +Name | Type +------------ | ------------- +`code` | string +`detail` | string +`exception` | string +`type` | string +`errorCode` | [ErrorCode](ErrorCode.md) +`errors` | Array<Error> + +## Example + +```typescript +import type { ResponseMeta } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "code": Ok, + "detail": this is some detail about the error or the success, + "exception": IOException + stack trace, + "type": Invalid Token, + "errorCode": null, + "errors": null, +} satisfies ResponseMeta + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ResponseMeta +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/StoreApi.md new file mode 100644 index 000000000000..fea668fdac48 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/StoreApi.md @@ -0,0 +1,278 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetInventoryRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetOrderByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { PlaceOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + body: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Tag.md new file mode 100644 index 000000000000..d112fe3b95e5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/User.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/User.md new file mode 100644 index 000000000000..9ca15489f323 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/User.md @@ -0,0 +1,53 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number +`subUser` | [User](User.md) +`subUser2` | [User](User.md) + +## Example + +```typescript +import type { User } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, + "subUser": null, + "subUser2": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/UserApi.md new file mode 100644 index 000000000000..de6702892b2f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/UserApi.md @@ -0,0 +1,546 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + body: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithArrayInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithListInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetUserByNameRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LoginUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LogoutUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> DefaultMetaOnlyResponse updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + body: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **body** | [User](User.md) | Updated user object | | + +### Return type + +[**DefaultMetaOnlyResponse**](DefaultMetaOnlyResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/WarningCode.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/WarningCode.md new file mode 100644 index 000000000000..ba6d14e81219 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/WarningCode.md @@ -0,0 +1,33 @@ + +# WarningCode + +Warning code returned when a potential problem is detected + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { WarningCode } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { +} satisfies WarningCode + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as WarningCode +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/.openapi-generator/FILES index 0015dca0c838..df006f8c6712 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/.openapi-generator/FILES @@ -6,6 +6,60 @@ apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts apis/index.ts +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md index.ts models/AdditionalPropertiesClass.ts models/AllOfWithSingleRef.ts diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..57a49c2172f4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AdditionalPropertiesClass.md @@ -0,0 +1,36 @@ + +# AdditionalPropertiesClass + + +## Properties + +Name | Type +------------ | ------------- +`mapProperty` | { [key: string]: string; } +`mapOfMapProperty` | { [key: string]: { [key: string]: string; }; } + +## Example + +```typescript +import type { AdditionalPropertiesClass } from '' + +// TODO: Update the object below with actual values +const example = { + "mapProperty": null, + "mapOfMapProperty": null, +} satisfies AdditionalPropertiesClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AdditionalPropertiesClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AllOfWithSingleRef.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AllOfWithSingleRef.md new file mode 100644 index 000000000000..ac58cb9ac4a9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AllOfWithSingleRef.md @@ -0,0 +1,36 @@ + +# AllOfWithSingleRef + + +## Properties + +Name | Type +------------ | ------------- +`username` | string +`singleRefType` | [SingleRefType](SingleRefType.md) + +## Example + +```typescript +import type { AllOfWithSingleRef } from '' + +// TODO: Update the object below with actual values +const example = { + "username": null, + "singleRefType": null, +} satisfies AllOfWithSingleRef + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AllOfWithSingleRef +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Animal.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Animal.md new file mode 100644 index 000000000000..c9340f7f3829 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Animal.md @@ -0,0 +1,36 @@ + +# Animal + + +## Properties + +Name | Type +------------ | ------------- +`className` | string +`color` | string + +## Example + +```typescript +import type { Animal } from '' + +// TODO: Update the object below with actual values +const example = { + "className": null, + "color": null, +} satisfies Animal + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Animal +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AnotherFakeApi.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..0bbea8646ae4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AnotherFakeApi.md @@ -0,0 +1,76 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**_123testSpecialTags**](AnotherFakeApi.md#_123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## _123testSpecialTags + +> Client _123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```ts +import { + Configuration, + AnotherFakeApi, +} from ''; +import type { 123testSpecialTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new AnotherFakeApi(); + + const body = { + // Client | client model + client: ..., + } satisfies 123testSpecialTagsRequest; + + try { + const data = await api._123testSpecialTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..be7f8c68a8d3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,34 @@ + +# ArrayOfArrayOfNumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`arrayArrayNumber` | Array<Array<number>> + +## Example + +```typescript +import type { ArrayOfArrayOfNumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayArrayNumber": null, +} satisfies ArrayOfArrayOfNumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayOfArrayOfNumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayOfNumberOnly.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..5a45078ec80a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayOfNumberOnly.md @@ -0,0 +1,34 @@ + +# ArrayOfNumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`arrayNumber` | Array<number> + +## Example + +```typescript +import type { ArrayOfNumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayNumber": null, +} satisfies ArrayOfNumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayOfNumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayTest.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayTest.md new file mode 100644 index 000000000000..c96a28873389 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ArrayTest.md @@ -0,0 +1,38 @@ + +# ArrayTest + + +## Properties + +Name | Type +------------ | ------------- +`arrayOfString` | Array<string> +`arrayArrayOfInteger` | Array<Array<number>> +`arrayArrayOfModel` | Array<Array<ReadOnlyFirst>> + +## Example + +```typescript +import type { ArrayTest } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayOfString": null, + "arrayArrayOfInteger": null, + "arrayArrayOfModel": null, +} satisfies ArrayTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Capitalization.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Capitalization.md new file mode 100644 index 000000000000..7295256c294d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Capitalization.md @@ -0,0 +1,44 @@ + +# Capitalization + + +## Properties + +Name | Type +------------ | ------------- +`smallCamel` | string +`capitalCamel` | string +`smallSnake` | string +`capitalSnake` | string +`sCAETHFlowPoints` | string +`aTTNAME` | string + +## Example + +```typescript +import type { Capitalization } from '' + +// TODO: Update the object below with actual values +const example = { + "smallCamel": null, + "capitalCamel": null, + "smallSnake": null, + "capitalSnake": null, + "sCAETHFlowPoints": null, + "aTTNAME": null, +} satisfies Capitalization + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Capitalization +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Cat.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Cat.md new file mode 100644 index 000000000000..c9af5916c1d7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Cat.md @@ -0,0 +1,34 @@ + +# Cat + + +## Properties + +Name | Type +------------ | ------------- +`declawed` | boolean + +## Example + +```typescript +import type { Cat } from '' + +// TODO: Update the object below with actual values +const example = { + "declawed": null, +} satisfies Cat + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Cat +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Category.md new file mode 100644 index 000000000000..a436c463edae --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Category.md @@ -0,0 +1,36 @@ + +# Category + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ClassModel.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ClassModel.md new file mode 100644 index 000000000000..11e87e883716 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ClassModel.md @@ -0,0 +1,35 @@ + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +Name | Type +------------ | ------------- +`_class` | string + +## Example + +```typescript +import type { ClassModel } from '' + +// TODO: Update the object below with actual values +const example = { + "_class": null, +} satisfies ClassModel + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ClassModel +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Client.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Client.md new file mode 100644 index 000000000000..a695e731d26d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Client.md @@ -0,0 +1,34 @@ + +# Client + + +## Properties + +Name | Type +------------ | ------------- +`client` | string + +## Example + +```typescript +import type { Client } from '' + +// TODO: Update the object below with actual values +const example = { + "client": null, +} satisfies Client + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Client +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/DefaultApi.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/DefaultApi.md new file mode 100644 index 000000000000..634c8687af1b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/DefaultApi.md @@ -0,0 +1,66 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooget) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FooGetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + try { + const data = await api.fooGet(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/DeprecatedObject.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/DeprecatedObject.md new file mode 100644 index 000000000000..0205d848ea10 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/DeprecatedObject.md @@ -0,0 +1,34 @@ + +# DeprecatedObject + + +## Properties + +Name | Type +------------ | ------------- +`name` | string + +## Example + +```typescript +import type { DeprecatedObject } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, +} satisfies DeprecatedObject + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeprecatedObject +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Dog.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Dog.md new file mode 100644 index 000000000000..7cec0ceeffaf --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Dog.md @@ -0,0 +1,34 @@ + +# Dog + + +## Properties + +Name | Type +------------ | ------------- +`breed` | string + +## Example + +```typescript +import type { Dog } from '' + +// TODO: Update the object below with actual values +const example = { + "breed": null, +} satisfies Dog + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Dog +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumArrays.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumArrays.md new file mode 100644 index 000000000000..ec959f362b4b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumArrays.md @@ -0,0 +1,36 @@ + +# EnumArrays + + +## Properties + +Name | Type +------------ | ------------- +`justSymbol` | string +`arrayEnum` | Array<string> + +## Example + +```typescript +import type { EnumArrays } from '' + +// TODO: Update the object below with actual values +const example = { + "justSymbol": null, + "arrayEnum": null, +} satisfies EnumArrays + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumArrays +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumClass.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumClass.md new file mode 100644 index 000000000000..eb421a41a1b4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumClass.md @@ -0,0 +1,32 @@ + +# EnumClass + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { EnumClass } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies EnumClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumTest.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumTest.md new file mode 100644 index 000000000000..4015a156ba48 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/EnumTest.md @@ -0,0 +1,48 @@ + +# EnumTest + + +## Properties + +Name | Type +------------ | ------------- +`enumString` | string +`enumStringRequired` | string +`enumInteger` | number +`enumNumber` | number +`outerEnum` | [OuterEnum](OuterEnum.md) +`outerEnumInteger` | [OuterEnumInteger](OuterEnumInteger.md) +`outerEnumDefaultValue` | [OuterEnumDefaultValue](OuterEnumDefaultValue.md) +`outerEnumIntegerDefaultValue` | [OuterEnumIntegerDefaultValue](OuterEnumIntegerDefaultValue.md) + +## Example + +```typescript +import type { EnumTest } from '' + +// TODO: Update the object below with actual values +const example = { + "enumString": null, + "enumStringRequired": null, + "enumInteger": null, + "enumNumber": null, + "outerEnum": null, + "outerEnumInteger": null, + "outerEnumDefaultValue": null, + "outerEnumIntegerDefaultValue": null, +} satisfies EnumTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeApi.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeApi.md new file mode 100644 index 000000000000..4c05440de4b0 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeApi.md @@ -0,0 +1,1333 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | | +| [**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeBigDecimalMapRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + try { + const data = await api.fakeBigDecimalMap(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeHealthGetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + try { + const data = await api.fakeHealthGet(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeHttpSignatureTest + +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeHttpSignatureTestRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP signature authorization: http_signature_test + headers: { "YOUR HEADER NAME": "YOUR SIGNATURE" }, + }); + const api = new FakeApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + // string | query parameter (optional) + query1: query1_example, + // string | header parameter (optional) + header1: header1_example, + } satisfies FakeHttpSignatureTestRequest; + + try { + const data = await api.fakeHttpSignatureTest(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | +| **query1** | `string` | query parameter | [Optional] [Defaults to `undefined`] | +| **header1** | `string` | header parameter | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterBooleanSerialize + +> boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterBooleanSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // boolean | Input boolean as post body (optional) + body: true, + } satisfies FakeOuterBooleanSerializeRequest; + + try { + const data = await api.fakeOuterBooleanSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `boolean` | Input boolean as post body | [Optional] | + +### Return type + +**boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterCompositeSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // OuterComposite | Input composite as post body (optional) + outerComposite: ..., + } satisfies FakeOuterCompositeSerializeRequest; + + try { + const data = await api.fakeOuterCompositeSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [OuterComposite](OuterComposite.md) | Input composite as post body | [Optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterNumberSerialize + +> number fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterNumberSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // number | Input number as post body (optional) + body: 8.14, + } satisfies FakeOuterNumberSerializeRequest; + + try { + const data = await api.fakeOuterNumberSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `number` | Input number as post body | [Optional] | + +### Return type + +**number** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterStringSerialize + +> string fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterStringSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string | Input string as post body (optional) + body: body_example, + } satisfies FakeOuterStringSerializeRequest; + + try { + const data = await api.fakeOuterStringSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `string` | Input string as post body | [Optional] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakePropertyEnumIntegerSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // OuterObjectWithEnumProperty | Input enum (int) as post body + outerObjectWithEnumProperty: ..., + } satisfies FakePropertyEnumIntegerSerializeRequest; + + try { + const data = await api.fakePropertyEnumIntegerSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [OuterObjectWithEnumProperty](OuterObjectWithEnumProperty.md) | Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `*/*` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithBinary + +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithBinaryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Blob | image to upload + body: BINARY_DATA_HERE, + } satisfies TestBodyWithBinaryRequest; + + try { + const data = await api.testBodyWithBinary(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Blob` | image to upload | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `image/png` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithFileSchema + +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithFileSchemaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // FileSchemaTestClass + fileSchemaTestClass: ..., + } satisfies TestBodyWithFileSchemaRequest; + + try { + const data = await api.testBodyWithFileSchema(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [FileSchemaTestClass](FileSchemaTestClass.md) | | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithQueryParams + +> testBodyWithQueryParams(query, user) + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithQueryParamsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string + query: query_example, + // User + user: ..., + } satisfies TestBodyWithQueryParamsRequest; + + try { + const data = await api.testBodyWithQueryParams(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | `string` | | [Defaults to `undefined`] | +| **user** | [User](User.md) | | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestClientModelRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Client | client model + client: ..., + } satisfies TestClientModelRequest; + + try { + const data = await api.testClientModel(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testEndpointParameters + +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestEndpointParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: http_basic_test + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new FakeApi(config); + + const body = { + // number | None + number: 8.14, + // number | None + _double: 1.2, + // string | None + patternWithoutDelimiter: patternWithoutDelimiter_example, + // string | None + _byte: BYTE_ARRAY_DATA_HERE, + // number | None (optional) + integer: 56, + // number | None (optional) + int32: 56, + // number | None (optional) + int64: 789, + // number | None (optional) + _float: 3.4, + // string | None (optional) + string: string_example, + // Blob | None (optional) + binary: BINARY_DATA_HERE, + // Date | None (optional) + date: 2013-10-20, + // Date | None (optional) + dateTime: 2013-10-20T19:20:30+01:00, + // string | None (optional) + password: password_example, + // string | None (optional) + callback: callback_example, + } satisfies TestEndpointParametersRequest; + + try { + const data = await api.testEndpointParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | `number` | None | [Defaults to `undefined`] | +| **_double** | `number` | None | [Defaults to `undefined`] | +| **patternWithoutDelimiter** | `string` | None | [Defaults to `undefined`] | +| **_byte** | `string` | None | [Defaults to `undefined`] | +| **integer** | `number` | None | [Optional] [Defaults to `undefined`] | +| **int32** | `number` | None | [Optional] [Defaults to `undefined`] | +| **int64** | `number` | None | [Optional] [Defaults to `undefined`] | +| **_float** | `number` | None | [Optional] [Defaults to `undefined`] | +| **string** | `string` | None | [Optional] [Defaults to `undefined`] | +| **binary** | `Blob` | None | [Optional] [Defaults to `undefined`] | +| **date** | `Date` | None | [Optional] [Defaults to `undefined`] | +| **dateTime** | `Date` | None | [Optional] [Defaults to `undefined`] | +| **password** | `string` | None | [Optional] [Defaults to `undefined`] | +| **callback** | `string` | None | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testEnumParameters + +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestEnumParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Array<'>' | '$'> | Header parameter enum test (string array) (optional) + enumHeaderStringArray: ..., + // '_abc' | '-efg' | '(xyz)' | Header parameter enum test (string) (optional) + enumHeaderString: enumHeaderString_example, + // Array<'>' | '$'> | Query parameter enum test (string array) (optional) + enumQueryStringArray: ..., + // '_abc' | '-efg' | '(xyz)' | Query parameter enum test (string) (optional) + enumQueryString: enumQueryString_example, + // 1 | -2 | Query parameter enum test (double) (optional) + enumQueryInteger: 56, + // 1.1 | -1.2 | Query parameter enum test (double) (optional) + enumQueryDouble: 1.2, + // Array (optional) + enumQueryModelArray: ..., + // Array | Form parameter enum test (string array) (optional) + enumFormStringArray: ..., + // string | Form parameter enum test (string) (optional) + enumFormString: enumFormString_example, + } satisfies TestEnumParametersRequest; + + try { + const data = await api.testEnumParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | `>`, `$` | Header parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumHeaderString** | `_abc`, `-efg`, `(xyz)` | Header parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | `>`, `$` | Query parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumQueryString** | `_abc`, `-efg`, `(xyz)` | Query parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | `1`, `-2` | Query parameter enum test (double) | [Optional] [Defaults to `undefined`] [Enum: 1, -2] | +| **enumQueryDouble** | `1.1`, `-1.2` | Query parameter enum test (double) | [Optional] [Defaults to `undefined`] [Enum: 1.1, -1.2] | +| **enumQueryModelArray** | `Array` | | [Optional] | +| **enumFormStringArray** | `>`, `$` | Form parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumFormString** | `_abc`, `-efg`, `(xyz)` | Form parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testGroupParameters + +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestGroupParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearer_test + accessToken: "YOUR BEARER TOKEN", + }); + const api = new FakeApi(config); + + const body = { + // number | Required String in group parameters + requiredStringGroup: 56, + // boolean | Required Boolean in group parameters + requiredBooleanGroup: true, + // number | Required Integer in group parameters + requiredInt64Group: 789, + // number | String in group parameters (optional) + stringGroup: 56, + // boolean | Boolean in group parameters (optional) + booleanGroup: true, + // number | Integer in group parameters (optional) + int64Group: 789, + } satisfies TestGroupParametersRequest; + + try { + const data = await api.testGroupParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | `number` | Required String in group parameters | [Defaults to `undefined`] | +| **requiredBooleanGroup** | `boolean` | Required Boolean in group parameters | [Defaults to `undefined`] | +| **requiredInt64Group** | `number` | Required Integer in group parameters | [Defaults to `undefined`] | +| **stringGroup** | `number` | String in group parameters | [Optional] [Defaults to `undefined`] | +| **booleanGroup** | `boolean` | Boolean in group parameters | [Optional] [Defaults to `undefined`] | +| **int64Group** | `number` | Integer in group parameters | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testInlineAdditionalProperties + +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestInlineAdditionalPropertiesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // { [key: string]: string; } | request body + requestBody: ..., + } satisfies TestInlineAdditionalPropertiesRequest; + + try { + const data = await api.testInlineAdditionalProperties(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | `{ [key: string]: string; }` | request body | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testJsonFormData + +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestJsonFormDataRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string | field1 + param: param_example, + // string | field2 + param2: param2_example, + } satisfies TestJsonFormDataRequest; + + try { + const data = await api.testJsonFormData(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | `string` | field1 | [Defaults to `undefined`] | +| **param2** | `string` | field2 | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestQueryParameterCollectionFormatRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Array + pipe: ..., + // Array + ioutil: ..., + // Array + http: ..., + // Array + url: ..., + // Array + context: ..., + // string + allowEmpty: allowEmpty_example, + // { [key: string]: string; } (optional) + language: ..., + } satisfies TestQueryParameterCollectionFormatRequest; + + try { + const data = await api.testQueryParameterCollectionFormat(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | `Array` | | | +| **ioutil** | `Array` | | | +| **http** | `Array` | | | +| **url** | `Array` | | | +| **context** | `Array` | | | +| **allowEmpty** | `string` | | [Defaults to `undefined`] | +| **language** | `{ [key: string]: string; }` | | [Optional] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..55decbceae7a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,36 @@ + +# FakeBigDecimalMap200Response + + +## Properties + +Name | Type +------------ | ------------- +`someId` | number +`someMap` | { [key: string]: number; } + +## Example + +```typescript +import type { FakeBigDecimalMap200Response } from '' + +// TODO: Update the object below with actual values +const example = { + "someId": null, + "someMap": null, +} satisfies FakeBigDecimalMap200Response + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FakeBigDecimalMap200Response +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeClassnameTags123Api.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..f92fbbfdc5e6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeClassnameTags123Api.md @@ -0,0 +1,80 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```ts +import { + Configuration, + FakeClassnameTags123Api, +} from ''; +import type { TestClassnameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key_query + apiKey: "YOUR API KEY", + }); + const api = new FakeClassnameTags123Api(config); + + const body = { + // Client | client model + client: ..., + } satisfies TestClassnameRequest; + + try { + const data = await api.testClassname(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FileSchemaTestClass.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..0d8a01ce7744 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FileSchemaTestClass.md @@ -0,0 +1,36 @@ + +# FileSchemaTestClass + + +## Properties + +Name | Type +------------ | ------------- +`file` | any +`files` | Array<any> + +## Example + +```typescript +import type { FileSchemaTestClass } from '' + +// TODO: Update the object below with actual values +const example = { + "file": null, + "files": null, +} satisfies FileSchemaTestClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FileSchemaTestClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Foo.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Foo.md new file mode 100644 index 000000000000..9dc80038989e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Foo.md @@ -0,0 +1,34 @@ + +# Foo + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string + +## Example + +```typescript +import type { Foo } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, +} satisfies Foo + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Foo +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FooGetDefaultResponse.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FooGetDefaultResponse.md new file mode 100644 index 000000000000..142288f71a1b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FooGetDefaultResponse.md @@ -0,0 +1,34 @@ + +# FooGetDefaultResponse + + +## Properties + +Name | Type +------------ | ------------- +`string` | [Foo](Foo.md) + +## Example + +```typescript +import type { FooGetDefaultResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "string": null, +} satisfies FooGetDefaultResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FooGetDefaultResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FormatTest.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FormatTest.md new file mode 100644 index 000000000000..8c5381729918 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FormatTest.md @@ -0,0 +1,64 @@ + +# FormatTest + + +## Properties + +Name | Type +------------ | ------------- +`integer` | number +`int32` | number +`int64` | number +`number` | number +`_float` | number +`_double` | number +`decimal` | string +`string` | string +`_byte` | string +`binary` | Blob +`date` | Date +`dateTime` | Date +`uuid` | string +`password` | string +`patternWithDigits` | string +`patternWithDigitsAndDelimiter` | string + +## Example + +```typescript +import type { FormatTest } from '' + +// TODO: Update the object below with actual values +const example = { + "integer": null, + "int32": null, + "int64": null, + "number": null, + "_float": null, + "_double": null, + "decimal": null, + "string": null, + "_byte": null, + "binary": null, + "date": null, + "dateTime": null, + "uuid": 72f98069-206d-4f12-9f12-3d1e525a8e84, + "password": null, + "patternWithDigits": null, + "patternWithDigitsAndDelimiter": null, +} satisfies FormatTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FormatTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/HasOnlyReadOnly.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..5e4acb6fab84 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/HasOnlyReadOnly.md @@ -0,0 +1,36 @@ + +# HasOnlyReadOnly + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string +`foo` | string + +## Example + +```typescript +import type { HasOnlyReadOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, + "foo": null, +} satisfies HasOnlyReadOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as HasOnlyReadOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/HealthCheckResult.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/HealthCheckResult.md new file mode 100644 index 000000000000..e50fd4dc523a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/HealthCheckResult.md @@ -0,0 +1,35 @@ + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +Name | Type +------------ | ------------- +`nullableMessage` | string + +## Example + +```typescript +import type { HealthCheckResult } from '' + +// TODO: Update the object below with actual values +const example = { + "nullableMessage": null, +} satisfies HealthCheckResult + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as HealthCheckResult +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/List.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/List.md new file mode 100644 index 000000000000..528de6c951e8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/List.md @@ -0,0 +1,34 @@ + +# List + + +## Properties + +Name | Type +------------ | ------------- +`_123list` | string + +## Example + +```typescript +import type { List } from '' + +// TODO: Update the object below with actual values +const example = { + "_123list": null, +} satisfies List + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as List +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MapTest.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MapTest.md new file mode 100644 index 000000000000..dfb73cded89a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MapTest.md @@ -0,0 +1,40 @@ + +# MapTest + + +## Properties + +Name | Type +------------ | ------------- +`mapMapOfString` | { [key: string]: { [key: string]: string; }; } +`mapOfEnumString` | { [key: string]: string; } +`directMap` | { [key: string]: boolean; } +`indirectMap` | { [key: string]: boolean; } + +## Example + +```typescript +import type { MapTest } from '' + +// TODO: Update the object below with actual values +const example = { + "mapMapOfString": null, + "mapOfEnumString": null, + "directMap": null, + "indirectMap": null, +} satisfies MapTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as MapTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..7113d7669471 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,38 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +Name | Type +------------ | ------------- +`uuid` | string +`dateTime` | Date +`map` | [{ [key: string]: Animal; }](Animal.md) + +## Example + +```typescript +import type { MixedPropertiesAndAdditionalPropertiesClass } from '' + +// TODO: Update the object below with actual values +const example = { + "uuid": null, + "dateTime": null, + "map": null, +} satisfies MixedPropertiesAndAdditionalPropertiesClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as MixedPropertiesAndAdditionalPropertiesClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Model200Response.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Model200Response.md new file mode 100644 index 000000000000..b8c44438d1f8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Model200Response.md @@ -0,0 +1,37 @@ + +# Model200Response + +Model for testing model name starting with number + +## Properties + +Name | Type +------------ | ------------- +`name` | number +`_class` | string + +## Example + +```typescript +import type { Model200Response } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, + "_class": null, +} satisfies Model200Response + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Model200Response +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ModelApiResponse.md new file mode 100644 index 000000000000..c029285d2f1a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ModelApiResponse.md @@ -0,0 +1,38 @@ + +# ModelApiResponse + + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ModelFile.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ModelFile.md new file mode 100644 index 000000000000..c8d923e37bc4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ModelFile.md @@ -0,0 +1,35 @@ + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type +------------ | ------------- +`sourceURI` | string + +## Example + +```typescript +import type { ModelFile } from '' + +// TODO: Update the object below with actual values +const example = { + "sourceURI": null, +} satisfies ModelFile + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelFile +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Name.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Name.md new file mode 100644 index 000000000000..8c8c48b60ed8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Name.md @@ -0,0 +1,41 @@ + +# Name + +Model for testing model name same as property name + +## Properties + +Name | Type +------------ | ------------- +`name` | number +`snakeCase` | number +`property` | string +`_123number` | number + +## Example + +```typescript +import type { Name } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, + "snakeCase": null, + "property": null, + "_123number": null, +} satisfies Name + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Name +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NullableClass.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NullableClass.md new file mode 100644 index 000000000000..70d7011287c9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NullableClass.md @@ -0,0 +1,56 @@ + +# NullableClass + + +## Properties + +Name | Type +------------ | ------------- +`integerProp` | number +`numberProp` | number +`booleanProp` | boolean +`stringProp` | string +`dateProp` | Date +`datetimeProp` | Date +`arrayNullableProp` | Array<object> +`arrayAndItemsNullableProp` | Array<object | null> +`arrayItemsNullable` | Array<object | null> +`objectNullableProp` | { [key: string]: object; } +`objectAndItemsNullableProp` | { [key: string]: object | null; } +`objectItemsNullable` | { [key: string]: object | null; } + +## Example + +```typescript +import type { NullableClass } from '' + +// TODO: Update the object below with actual values +const example = { + "integerProp": null, + "numberProp": null, + "booleanProp": null, + "stringProp": null, + "dateProp": null, + "datetimeProp": null, + "arrayNullableProp": null, + "arrayAndItemsNullableProp": null, + "arrayItemsNullable": null, + "objectNullableProp": null, + "objectAndItemsNullableProp": null, + "objectItemsNullable": null, +} satisfies NullableClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as NullableClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NumberOnly.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NumberOnly.md new file mode 100644 index 000000000000..7a8a70f5c311 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NumberOnly.md @@ -0,0 +1,34 @@ + +# NumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`justNumber` | number + +## Example + +```typescript +import type { NumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "justNumber": null, +} satisfies NumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as NumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..be78d0004a79 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,40 @@ + +# ObjectWithDeprecatedFields + + +## Properties + +Name | Type +------------ | ------------- +`uuid` | string +`id` | number +`deprecatedRef` | [DeprecatedObject](DeprecatedObject.md) +`bars` | Array<string> + +## Example + +```typescript +import type { ObjectWithDeprecatedFields } from '' + +// TODO: Update the object below with actual values +const example = { + "uuid": null, + "id": null, + "deprecatedRef": null, + "bars": null, +} satisfies ObjectWithDeprecatedFields + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ObjectWithDeprecatedFields +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Order.md new file mode 100644 index 000000000000..602f01d8d40f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Order.md @@ -0,0 +1,44 @@ + +# Order + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterComposite.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterComposite.md new file mode 100644 index 000000000000..3aa13c3f0d4e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterComposite.md @@ -0,0 +1,38 @@ + +# OuterComposite + + +## Properties + +Name | Type +------------ | ------------- +`myNumber` | number +`myString` | string +`myBoolean` | boolean + +## Example + +```typescript +import type { OuterComposite } from '' + +// TODO: Update the object below with actual values +const example = { + "myNumber": null, + "myString": null, + "myBoolean": null, +} satisfies OuterComposite + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterComposite +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnum.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnum.md new file mode 100644 index 000000000000..f0a854cd58d7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnum.md @@ -0,0 +1,32 @@ + +# OuterEnum + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnum } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnum + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnum +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumDefaultValue.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..635202415f87 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumDefaultValue.md @@ -0,0 +1,32 @@ + +# OuterEnumDefaultValue + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumDefaultValue } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumDefaultValue + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumDefaultValue +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumInteger.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..c5c4b7ee3fef --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumInteger.md @@ -0,0 +1,32 @@ + +# OuterEnumInteger + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumInteger } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumInteger + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumInteger +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..1e932e921220 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,32 @@ + +# OuterEnumIntegerDefaultValue + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumIntegerDefaultValue } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumIntegerDefaultValue + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumIntegerDefaultValue +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..468927f018f9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,34 @@ + +# OuterObjectWithEnumProperty + + +## Properties + +Name | Type +------------ | ------------- +`value` | [OuterEnumInteger](OuterEnumInteger.md) + +## Example + +```typescript +import type { OuterObjectWithEnumProperty } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies OuterObjectWithEnumProperty + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterObjectWithEnumProperty +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Pet.md new file mode 100644 index 000000000000..c2719b9b2ac9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Pet.md @@ -0,0 +1,44 @@ + +# Pet + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Set<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/PetApi.md new file mode 100644 index 000000000000..e5da18e8bdb6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/PetApi.md @@ -0,0 +1,687 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + + +## addPet + +> addPet(pet) + +Add a new pet to the store + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { AddPetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { DeletePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByStatusRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Set<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Set | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Set` | Tags to filter by | | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { GetPetByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(pet) + +Update an existing pet + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetWithFormRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileWithRequiredFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // Blob | file to upload + requiredFile: BINARY_DATA_HERE, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + } satisfies UploadFileWithRequiredFileRequest; + + try { + const data = await api.uploadFileWithRequiredFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **requiredFile** | `Blob` | file to upload | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ReadOnlyFirst.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..f663955bc85f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/ReadOnlyFirst.md @@ -0,0 +1,36 @@ + +# ReadOnlyFirst + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string +`baz` | string + +## Example + +```typescript +import type { ReadOnlyFirst } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, + "baz": null, +} satisfies ReadOnlyFirst + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ReadOnlyFirst +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Return.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Return.md new file mode 100644 index 000000000000..c2163d20294d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Return.md @@ -0,0 +1,35 @@ + +# Return + +Model for testing reserved words + +## Properties + +Name | Type +------------ | ------------- +`_return` | number + +## Example + +```typescript +import type { Return } from '' + +// TODO: Update the object below with actual values +const example = { + "_return": null, +} satisfies Return + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Return +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/SingleRefType.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/SingleRefType.md new file mode 100644 index 000000000000..6f61f0b5a6ce --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/SingleRefType.md @@ -0,0 +1,32 @@ + +# SingleRefType + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { SingleRefType } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies SingleRefType + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SingleRefType +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/SpecialModelName.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/SpecialModelName.md new file mode 100644 index 000000000000..5b462196a720 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/SpecialModelName.md @@ -0,0 +1,34 @@ + +# SpecialModelName + + +## Properties + +Name | Type +------------ | ------------- +`$specialPropertyName` | number + +## Example + +```typescript +import type { SpecialModelName } from '' + +// TODO: Update the object below with actual values +const example = { + "$specialPropertyName": null, +} satisfies SpecialModelName + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SpecialModelName +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/StoreApi.md new file mode 100644 index 000000000000..9f6136a7714e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/StoreApi.md @@ -0,0 +1,280 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { DeleteOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetInventoryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetOrderByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { PlaceOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + order: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Tag.md new file mode 100644 index 000000000000..94b8b8810ed7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/Tag.md @@ -0,0 +1,36 @@ + +# Tag + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/User.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/User.md new file mode 100644 index 000000000000..198cd8da459d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/User.md @@ -0,0 +1,48 @@ + +# User + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/UserApi.md new file mode 100644 index 000000000000..f537a517e225 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/UserApi.md @@ -0,0 +1,555 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + user: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithArrayInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + user: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithListInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + user: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { DeleteUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { GetUserByNameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LoginUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LogoutUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { UpdateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + user: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **user** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/validation-attributes/.openapi-generator/FILES index 2a7406ef851b..946584cc4cc9 100644 --- a/samples/client/petstore/typescript-fetch/builds/validation-attributes/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/.openapi-generator/FILES @@ -2,6 +2,15 @@ apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts apis/index.ts +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md index.ts models/Category.ts models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Category.md new file mode 100644 index 000000000000..3666c22c002a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/ModelApiResponse.md new file mode 100644 index 000000000000..77430704bd2a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Order.md new file mode 100644 index 000000000000..e2527b3aa31c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Pet.md new file mode 100644 index 000000000000..390697270e57 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Pet.md @@ -0,0 +1,45 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Set<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/PetApi.md new file mode 100644 index 000000000000..d467c614e48a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/PetApi.md @@ -0,0 +1,607 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { AddPetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { DeletePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByStatusRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { GetPetByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> Pet updatePet(pet) + +Update an existing pet + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetWithFormRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/StoreApi.md new file mode 100644 index 000000000000..379b8bb621ab --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/StoreApi.md @@ -0,0 +1,280 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { DeleteOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetInventoryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetOrderByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { PlaceOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + order: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Tag.md new file mode 100644 index 000000000000..e6c34b2dab01 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/User.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/User.md new file mode 100644 index 000000000000..af455b7cf7b2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/User.md @@ -0,0 +1,49 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/UserApi.md new file mode 100644 index 000000000000..3c7e269bd8a5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/UserApi.md @@ -0,0 +1,579 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new UserApi(config); + + const body = { + // User | Created user object + user: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithArrayInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new UserApi(config); + + const body = { + // Array | List of user object + user: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithListInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new UserApi(config); + + const body = { + // Array | List of user object + user: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { DeleteUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new UserApi(config); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { GetUserByNameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LoginUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LogoutUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new UserApi(config); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { UpdateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new UserApi(config); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + user: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **user** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/FILES index 2a7406ef851b..946584cc4cc9 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/FILES @@ -2,6 +2,15 @@ apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts apis/index.ts +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md index.ts models/Category.ts models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Category.md new file mode 100644 index 000000000000..3666c22c002a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/ModelApiResponse.md new file mode 100644 index 000000000000..77430704bd2a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Order.md new file mode 100644 index 000000000000..e2527b3aa31c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Pet.md new file mode 100644 index 000000000000..5cff690c1f62 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Pet.md @@ -0,0 +1,45 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Array<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/PetApi.md new file mode 100644 index 000000000000..2827a301c5e3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/PetApi.md @@ -0,0 +1,595 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> addPet(body) + +Add a new pet to the store + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { AddPetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { DeletePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByStatusRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { GetPetByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetWithFormRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/StoreApi.md new file mode 100644 index 000000000000..ceb7e08b016e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/StoreApi.md @@ -0,0 +1,278 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { DeleteOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetInventoryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetOrderByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { PlaceOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + body: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Tag.md new file mode 100644 index 000000000000..e6c34b2dab01 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/User.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/User.md new file mode 100644 index 000000000000..af455b7cf7b2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/User.md @@ -0,0 +1,49 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/UserApi.md new file mode 100644 index 000000000000..7d2b3fa00c39 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/UserApi.md @@ -0,0 +1,545 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + body: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithArrayInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithListInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { DeleteUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { GetUserByNameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LoginUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LogoutUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { UpdateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + body: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **body** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/FILES index 38feffe8896a..3cf2461a65c2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/FILES @@ -1,6 +1,15 @@ .gitignore .npmignore README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md package.json src/apis/PetApi.ts src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md index 9b50c27ec63f..fb2e5499836c 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md @@ -1,46 +1,157 @@ -## @openapitools/typescript-fetch-petstore@1.0.0 +# @openapitools/typescript-fetch-petstore@1.0.0 -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: +A TypeScript SDK client for the petstore.swagger.io API. -Environment -* Node.js -* Webpack -* Browserify +## Usage -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 +First, install the SDK from npm. -Module system -* CommonJS -* ES6 module system +```bash +npm install @openapitools/typescript-fetch-petstore --save +``` -It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) +Next, try it out. -### Building -To build and compile the typescript sources to javascript use: -``` -npm install -npm run build +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` -### Publishing -First build the package then run `npm publish` +## Documentation -### Consuming +### API Endpoints -navigate to the folder of your consuming project and run one of the following commands. +All URIs are relative to *http://petstore.swagger.io/v2* -_published:_ +| Class | Method | HTTP request | Description +| ----- | ------ | ------------ | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user -``` -npm install @openapitools/typescript-fetch-petstore@1.0.0 --save -``` -_unPublished (not recommended):_ +### Models + +- [Category](docs/Category.md) +- [ModelApiResponse](docs/ModelApiResponse.md) +- [Order](docs/Order.md) +- [Pet](docs/Pet.md) +- [Tag](docs/Tag.md) +- [User](docs/User.md) + +### Authorization + + +Authentication schemes defined for the API: + +#### petstore_auth implicit + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - `write:pets`: modify pets in your account + - `read:pets`: read your pets + +#### api_key + +- **Type**: API key +- **API key parameter name**: `api_key` +- **Location**: HTTP header + +## About + +This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/) +and is automatically generated by the +[OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.0.0` +- Package version: `1.0.0` +- Generator version: `7.15.0-SNAPSHOT` +- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen` + +The generated npm module supports the following: + +- Environments + * Node.js + * Webpack + * Browserify +- Language levels + * ES5 - you must have a Promises/A+ library installed + * ES6 +- Module systems + * CommonJS + * ES6 module system + + +## Development + +### Building + +To build the TypeScript source code, you need to have Node.js and npm installed. +After cloning the repository, navigate to the project directory and run: + +```bash +npm install +npm run build ``` -npm install PATH_TO_GENERATED_PACKAGE --save + +### Publishing + +Once you've built the package, you can publish it to npm: + +```bash +npm publish ``` + +## License + +[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Category.md new file mode 100644 index 000000000000..6b1d545b2f35 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/ModelApiResponse.md new file mode 100644 index 000000000000..2583fa00e7a3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Order.md new file mode 100644 index 000000000000..3c1be2566f70 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Pet.md new file mode 100644 index 000000000000..221555445c78 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Pet.md @@ -0,0 +1,45 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Array<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/PetApi.md new file mode 100644 index 000000000000..b642fb6bcef5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/PetApi.md @@ -0,0 +1,595 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> addPet(body) + +Add a new pet to the store + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeletePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByStatusRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByTagsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetPetByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetWithFormRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UploadFileRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/StoreApi.md new file mode 100644 index 000000000000..fea668fdac48 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/StoreApi.md @@ -0,0 +1,278 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetInventoryRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetOrderByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { PlaceOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + body: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Tag.md new file mode 100644 index 000000000000..d112fe3b95e5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/User.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/User.md new file mode 100644 index 000000000000..98bd755583d5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/User.md @@ -0,0 +1,49 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/UserApi.md new file mode 100644 index 000000000000..9d42e138d5b1 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/UserApi.md @@ -0,0 +1,545 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + body: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithArrayInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithListInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetUserByNameRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LoginUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LogoutUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + body: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **body** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/with-string-enums/.openapi-generator/FILES index f237d91aea43..1e2d4cb46bfc 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/.openapi-generator/FILES @@ -1,5 +1,10 @@ apis/DefaultApi.ts apis/index.ts +docs/DefaultApi.md +docs/EnumPatternObject.md +docs/FakeEnumRequestGetInline200Response.md +docs/NumberEnum.md +docs/StringEnum.md index.ts models/EnumPatternObject.ts models/FakeEnumRequestGetInline200Response.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/DefaultApi.md b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/DefaultApi.md new file mode 100644 index 000000000000..9650fa77bd97 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/DefaultApi.md @@ -0,0 +1,290 @@ +# DefaultApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeEnumRequestGetInline**](DefaultApi.md#fakeenumrequestgetinline) | **GET** /fake/enum-request-inline | | +| [**fakeEnumRequestGetRef**](DefaultApi.md#fakeenumrequestgetref) | **GET** /fake/enum-request-ref | | +| [**fakeEnumRequestPostInline**](DefaultApi.md#fakeenumrequestpostinline) | **POST** /fake/enum-request-inline | | +| [**fakeEnumRequestPostRef**](DefaultApi.md#fakeenumrequestpostref) | **POST** /fake/enum-request-ref | | + + + +## fakeEnumRequestGetInline + +> FakeEnumRequestGetInline200Response fakeEnumRequestGetInline(stringEnum, nullableStringEnum, numberEnum, nullableNumberEnum) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FakeEnumRequestGetInlineRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // 'one' | 'two' | 'three' (optional) + stringEnum: stringEnum_example, + // string (optional) + nullableStringEnum: ..., + // 1 | 2 | 3 (optional) + numberEnum: 8.14, + // number (optional) + nullableNumberEnum: ..., + } satisfies FakeEnumRequestGetInlineRequest; + + try { + const data = await api.fakeEnumRequestGetInline(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **stringEnum** | `one`, `two`, `three` | | [Optional] [Defaults to `undefined`] [Enum: one, two, three] | +| **nullableStringEnum** | `one`, `two`, `three` | | [Optional] [Defaults to `undefined`] [Enum: one, two, three] | +| **numberEnum** | `1`, `2`, `3` | | [Optional] [Defaults to `undefined`] [Enum: 1, 2, 3] | +| **nullableNumberEnum** | `1`, `2`, `3` | | [Optional] [Defaults to `undefined`] [Enum: 1, 2, 3] | + +### Return type + +[**FakeEnumRequestGetInline200Response**](FakeEnumRequestGetInline200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeEnumRequestGetRef + +> EnumPatternObject fakeEnumRequestGetRef(stringEnum, nullableStringEnum, numberEnum, nullableNumberEnum) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FakeEnumRequestGetRefRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // StringEnum (optional) + stringEnum: ..., + // StringEnum (optional) + nullableStringEnum: ..., + // NumberEnum (optional) + numberEnum: ..., + // NumberEnum (optional) + nullableNumberEnum: ..., + } satisfies FakeEnumRequestGetRefRequest; + + try { + const data = await api.fakeEnumRequestGetRef(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **stringEnum** | `StringEnum` | | [Optional] [Defaults to `undefined`] [Enum: one, two, three] | +| **nullableStringEnum** | `StringEnum` | | [Optional] [Defaults to `undefined`] [Enum: one, two, three] | +| **numberEnum** | `NumberEnum` | | [Optional] [Defaults to `undefined`] [Enum: 1, 2, 3] | +| **nullableNumberEnum** | `NumberEnum` | | [Optional] [Defaults to `undefined`] [Enum: 1, 2, 3] | + +### Return type + +[**EnumPatternObject**](EnumPatternObject.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeEnumRequestPostInline + +> FakeEnumRequestGetInline200Response fakeEnumRequestPostInline(fakeEnumRequestGetInline200Response) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FakeEnumRequestPostInlineRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // FakeEnumRequestGetInline200Response (optional) + fakeEnumRequestGetInline200Response: ..., + } satisfies FakeEnumRequestPostInlineRequest; + + try { + const data = await api.fakeEnumRequestPostInline(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fakeEnumRequestGetInline200Response** | [FakeEnumRequestGetInline200Response](FakeEnumRequestGetInline200Response.md) | | [Optional] | + +### Return type + +[**FakeEnumRequestGetInline200Response**](FakeEnumRequestGetInline200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeEnumRequestPostRef + +> EnumPatternObject fakeEnumRequestPostRef(enumPatternObject) + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FakeEnumRequestPostRefRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + const body = { + // EnumPatternObject (optional) + enumPatternObject: ..., + } satisfies FakeEnumRequestPostRefRequest; + + try { + const data = await api.fakeEnumRequestPostRef(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumPatternObject** | [EnumPatternObject](EnumPatternObject.md) | | [Optional] | + +### Return type + +[**EnumPatternObject**](EnumPatternObject.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/EnumPatternObject.md b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/EnumPatternObject.md new file mode 100644 index 000000000000..ce126b6c0231 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/EnumPatternObject.md @@ -0,0 +1,40 @@ + +# EnumPatternObject + + +## Properties + +Name | Type +------------ | ------------- +`stringEnum` | [StringEnum](StringEnum.md) +`nullableStringEnum` | [StringEnum](StringEnum.md) +`numberEnum` | [NumberEnum](NumberEnum.md) +`nullableNumberEnum` | [NumberEnum](NumberEnum.md) + +## Example + +```typescript +import type { EnumPatternObject } from '' + +// TODO: Update the object below with actual values +const example = { + "stringEnum": null, + "nullableStringEnum": null, + "numberEnum": null, + "nullableNumberEnum": null, +} satisfies EnumPatternObject + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumPatternObject +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/FakeEnumRequestGetInline200Response.md b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/FakeEnumRequestGetInline200Response.md new file mode 100644 index 000000000000..1856455884e2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/FakeEnumRequestGetInline200Response.md @@ -0,0 +1,40 @@ + +# FakeEnumRequestGetInline200Response + + +## Properties + +Name | Type +------------ | ------------- +`stringEnum` | string +`nullableStringEnum` | string +`numberEnum` | number +`nullableNumberEnum` | number + +## Example + +```typescript +import type { FakeEnumRequestGetInline200Response } from '' + +// TODO: Update the object below with actual values +const example = { + "stringEnum": null, + "nullableStringEnum": null, + "numberEnum": null, + "nullableNumberEnum": null, +} satisfies FakeEnumRequestGetInline200Response + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FakeEnumRequestGetInline200Response +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/NumberEnum.md b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/NumberEnum.md new file mode 100644 index 000000000000..18e8953984aa --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/NumberEnum.md @@ -0,0 +1,32 @@ + +# NumberEnum + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { NumberEnum } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies NumberEnum + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as NumberEnum +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/StringEnum.md b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/StringEnum.md new file mode 100644 index 000000000000..4e035c514858 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/docs/StringEnum.md @@ -0,0 +1,32 @@ + +# StringEnum + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { StringEnum } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies StringEnum + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as StringEnum +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES index 83b6414b911e..3cf2461a65c2 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES @@ -1,12 +1,27 @@ .gitignore .npmignore README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md package.json src/apis/PetApi.ts src/apis/StoreApi.ts src/apis/UserApi.ts src/apis/index.ts src/index.ts +src/models/Category.ts +src/models/ModelApiResponse.ts +src/models/Order.ts +src/models/Pet.ts +src/models/Tag.ts +src/models/User.ts src/models/index.ts src/runtime.ts tsconfig.json diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/README.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/README.md index 9b50c27ec63f..fb2e5499836c 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/README.md +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/README.md @@ -1,46 +1,157 @@ -## @openapitools/typescript-fetch-petstore@1.0.0 +# @openapitools/typescript-fetch-petstore@1.0.0 -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: +A TypeScript SDK client for the petstore.swagger.io API. -Environment -* Node.js -* Webpack -* Browserify +## Usage -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 +First, install the SDK from npm. -Module system -* CommonJS -* ES6 module system +```bash +npm install @openapitools/typescript-fetch-petstore --save +``` -It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) +Next, try it out. -### Building -To build and compile the typescript sources to javascript use: -``` -npm install -npm run build +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); ``` -### Publishing -First build the package then run `npm publish` +## Documentation -### Consuming +### API Endpoints -navigate to the folder of your consuming project and run one of the following commands. +All URIs are relative to *http://petstore.swagger.io/v2* -_published:_ +| Class | Method | HTTP request | Description +| ----- | ------ | ------------ | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user -``` -npm install @openapitools/typescript-fetch-petstore@1.0.0 --save -``` -_unPublished (not recommended):_ +### Models + +- [Category](docs/Category.md) +- [ModelApiResponse](docs/ModelApiResponse.md) +- [Order](docs/Order.md) +- [Pet](docs/Pet.md) +- [Tag](docs/Tag.md) +- [User](docs/User.md) + +### Authorization + + +Authentication schemes defined for the API: + +#### petstore_auth implicit + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - `write:pets`: modify pets in your account + - `read:pets`: read your pets + +#### api_key + +- **Type**: API key +- **API key parameter name**: `api_key` +- **Location**: HTTP header + +## About + +This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/) +and is automatically generated by the +[OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.0.0` +- Package version: `1.0.0` +- Generator version: `7.15.0-SNAPSHOT` +- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen` + +The generated npm module supports the following: + +- Environments + * Node.js + * Webpack + * Browserify +- Language levels + * ES5 - you must have a Promises/A+ library installed + * ES6 +- Module systems + * CommonJS + * ES6 module system + + +## Development + +### Building + +To build the TypeScript source code, you need to have Node.js and npm installed. +After cloning the repository, navigate to the project directory and run: + +```bash +npm install +npm run build ``` -npm install PATH_TO_GENERATED_PACKAGE --save + +### Publishing + +Once you've built the package, you can publish it to npm: + +```bash +npm publish ``` + +## License + +[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md new file mode 100644 index 000000000000..6b1d545b2f35 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md @@ -0,0 +1,37 @@ + +# Category + +A category for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md new file mode 100644 index 000000000000..2583fa00e7a3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md @@ -0,0 +1,39 @@ + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md new file mode 100644 index 000000000000..7d6b7191968d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md @@ -0,0 +1,45 @@ + +# Order + +An order for a pets from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | string +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md new file mode 100644 index 000000000000..221555445c78 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md @@ -0,0 +1,45 @@ + +# Pet + +A pet for sale in the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Array<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/PetApi.md new file mode 100644 index 000000000000..b642fb6bcef5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/PetApi.md @@ -0,0 +1,595 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> addPet(body) + +Add a new pet to the store + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { AddPetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeletePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByStatusRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { FindPetsByTagsRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Array` | Tags to filter by | | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetPetByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + body: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/json`, `application/xml` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdatePetWithFormRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] | +| **name** | `string` | Updated name of the pet | [Optional] [Defaults to `undefined`] | +| **status** | `string` | Updated status of the pet | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```ts +import { + Configuration, + PetApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UploadFileRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | +| **file** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/StoreApi.md new file mode 100644 index 000000000000..fea668fdac48 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/StoreApi.md @@ -0,0 +1,278 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `string` | ID of the order that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetInventoryRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetOrderByIdRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```ts +import { + Configuration, + StoreApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { PlaceOrderRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + body: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md new file mode 100644 index 000000000000..d112fe3b95e5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md @@ -0,0 +1,37 @@ + +# Tag + +A tag for a pet + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md new file mode 100644 index 000000000000..98bd755583d5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md @@ -0,0 +1,49 @@ + +# User + +A User who is purchasing from the pet store + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '@openapitools/typescript-fetch-petstore' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/UserApi.md new file mode 100644 index 000000000000..9d42e138d5b1 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/UserApi.md @@ -0,0 +1,545 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createuser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + body: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [User](User.md) | Created user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithArrayInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { CreateUsersWithListInputRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + body: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Array` | List of user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { DeleteUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be deleted | [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { GetUserByNameRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LoginUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The user name for login | [Defaults to `undefined`] | +| **password** | `string` | The password for login in clear text | [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/xml`, `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { LogoutUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from '@openapitools/typescript-fetch-petstore'; +import type { UpdateUserRequest } from '@openapitools/typescript-fetch-petstore'; + +async function example() { + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + body: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **body** | [User](User.md) | Updated user object | | + +### Return type + +`void` (Empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Category.ts new file mode 100644 index 000000000000..5e56849000d5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Category.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} + +/** + * Check if a given object implements the Category interface. + */ +export function instanceOfCategory(value: object): value is Category { + return true; +} + +export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + }; +} + +export function CategoryToJSON(json: any): Category { + return CategoryToJSONTyped(json, false); +} + +export function CategoryToJSONTyped(value?: Category | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/ModelApiResponse.ts new file mode 100644 index 000000000000..756cdf624098 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/ModelApiResponse.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Describes the result of uploading an image resource + * @export + * @interface ModelApiResponse + */ +export interface ModelApiResponse { + /** + * + * @type {number} + * @memberof ModelApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ModelApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ModelApiResponse + */ + message?: string; +} + +/** + * Check if a given object implements the ModelApiResponse interface. + */ +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { + return true; +} + +export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if (json == null) { + return json; + } + return { + + 'code': json['code'] == null ? undefined : json['code'], + 'type': json['type'] == null ? undefined : json['type'], + 'message': json['message'] == null ? undefined : json['message'], + }; +} + +export function ModelApiResponseToJSON(json: any): ModelApiResponse { + return ModelApiResponseToJSONTyped(json, false); +} + +export function ModelApiResponseToJSONTyped(value?: ModelApiResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'code': value['code'], + 'type': value['type'], + 'message': value['message'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Order.ts new file mode 100644 index 000000000000..223d5b59115e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Order.ts @@ -0,0 +1,117 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {string} + * @memberof Order + */ + shipDate?: string; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + + +/** + * @export + */ +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; + + +/** + * Check if a given object implements the Order interface. + */ +export function instanceOfOrder(value: object): value is Order { + return true; +} + +export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'petId': json['petId'] == null ? undefined : json['petId'], + 'quantity': json['quantity'] == null ? undefined : json['quantity'], + 'shipDate': json['shipDate'] == null ? undefined : json['shipDate'], + 'status': json['status'] == null ? undefined : json['status'], + 'complete': json['complete'] == null ? undefined : json['complete'], + }; +} + +export function OrderToJSON(json: any): Order { + return OrderToJSONTyped(json, false); +} + +export function OrderToJSONTyped(value?: Order | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'petId': value['petId'], + 'quantity': value['quantity'], + 'shipDate': value['shipDate'], + 'status': value['status'], + 'complete': value['complete'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Pet.ts new file mode 100644 index 000000000000..981d00a85076 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Pet.ts @@ -0,0 +1,134 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Category } from './Category'; +import { + CategoryFromJSON, + CategoryFromJSONTyped, + CategoryToJSON, + CategoryToJSONTyped, +} from './Category'; +import type { Tag } from './Tag'; +import { + TagFromJSON, + TagFromJSONTyped, + TagToJSON, + TagToJSONTyped, +} from './Tag'; + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: PetStatusEnum; +} + + +/** + * @export + */ +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; + + +/** + * Check if a given object implements the Pet interface. + */ +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; + return true; +} + +export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'category': json['category'] == null ? undefined : CategoryFromJSON(json['category']), + 'name': json['name'], + 'photoUrls': json['photoUrls'], + 'tags': json['tags'] == null ? undefined : ((json['tags'] as Array).map(TagFromJSON)), + 'status': json['status'] == null ? undefined : json['status'], + }; +} + +export function PetToJSON(json: any): Pet { + return PetToJSONTyped(json, false); +} + +export function PetToJSONTyped(value?: Pet | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'category': CategoryToJSON(value['category']), + 'name': value['name'], + 'photoUrls': value['photoUrls'], + 'tags': value['tags'] == null ? undefined : ((value['tags'] as Array).map(TagToJSON)), + 'status': value['status'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Tag.ts new file mode 100644 index 000000000000..f2c835eb0462 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/Tag.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} + +/** + * Check if a given object implements the Tag interface. + */ +export function instanceOfTag(value: object): value is Tag { + return true; +} + +export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + }; +} + +export function TagToJSON(json: any): Tag { + return TagToJSONTyped(json, false); +} + +export function TagToJSONTyped(value?: Tag | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/User.ts new file mode 100644 index 000000000000..4d57bd098a66 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/models/User.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + +/** + * Check if a given object implements the User interface. + */ +export function instanceOfUser(value: object): value is User { + return true; +} + +export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'username': json['username'] == null ? undefined : json['username'], + 'firstName': json['firstName'] == null ? undefined : json['firstName'], + 'lastName': json['lastName'] == null ? undefined : json['lastName'], + 'email': json['email'] == null ? undefined : json['email'], + 'password': json['password'] == null ? undefined : json['password'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'userStatus': json['userStatus'] == null ? undefined : json['userStatus'], + }; +} + +export function UserToJSON(json: any): User { + return UserToJSONTyped(json, false); +} + +export function UserToJSONTyped(value?: User | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'username': value['username'], + 'firstName': value['firstName'], + 'lastName': value['lastName'], + 'email': value['email'], + 'password': value['password'], + 'phone': value['phone'], + 'userStatus': value['userStatus'], + }; +} + From e016fe185c0daf1fb0aabf7475bba57877c22dda Mon Sep 17 00:00:00 2001 From: Aaron Heckmann Date: Tue, 12 Aug 2025 15:17:43 -0700 Subject: [PATCH 3/3] chore: address PR feedback --- .../TypeScriptFetchClientCodegen.java | 2 -- .../typescript-fetch/model_doc.mustache | 2 ++ .../.openapi-generator/FILES | 6 ----- .../without-runtime-checks/docs/Category.md | 21 --------------- .../docs/ModelApiResponse.md | 22 --------------- .../without-runtime-checks/docs/Order.md | 25 ----------------- .../builds/without-runtime-checks/docs/Pet.md | 25 ----------------- .../builds/without-runtime-checks/docs/Tag.md | 21 --------------- .../without-runtime-checks/docs/User.md | 27 ------------------- 9 files changed, 2 insertions(+), 149 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 5ac5099b210b..e1065d5d1c48 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -113,8 +113,6 @@ public TypeScriptFetchClientCodegen() { embeddedTemplateDir = templateDir = "typescript-fetch"; this.apiTemplateFiles.put("apis.mustache", ".ts"); - this.modelTemplateFiles.put("models.mustache", ".ts"); - this.apiDocTemplateFiles.put("api_doc.mustache", ".md"); this.modelDocTemplateFiles.put("model_doc.mustache", ".md"); diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache index 3fc704a0ae52..b2f77d5244bd 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/model_doc.mustache @@ -11,6 +11,7 @@ Name | Type {{#vars}}`{{name}}` | {{#isPrimitiveType}}{{dataType}}{{/isPrimitiveType}}{{^isPrimitiveType}}[{{dataType}}]({{complexType}}.md){{/isPrimitiveType}} {{/vars}} +{{^withoutRuntimeChecks}} ## Example ```typescript @@ -33,6 +34,7 @@ console.log(exampleJSON) const exampleParsed = JSON.parse(exampleJSON) as {{classname}} console.log(exampleParsed) ``` +{{/withoutRuntimeChecks}} [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES index 3cf2461a65c2..f195160ec9e5 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/FILES @@ -16,12 +16,6 @@ src/apis/StoreApi.ts src/apis/UserApi.ts src/apis/index.ts src/index.ts -src/models/Category.ts -src/models/ModelApiResponse.ts -src/models/Order.ts -src/models/Pet.ts -src/models/Tag.ts -src/models/User.ts src/models/index.ts src/runtime.ts tsconfig.json diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md index 6b1d545b2f35..14ab73d1387f 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Category.md @@ -10,27 +10,6 @@ Name | Type `id` | number `name` | string -## Example - -```typescript -import type { Category } from '@openapitools/typescript-fetch-petstore' - -// TODO: Update the object below with actual values -const example = { - "id": null, - "name": null, -} satisfies Category - -console.log(example) - -// Convert the instance to a JSON string -const exampleJSON: string = JSON.stringify(example) -console.log(exampleJSON) - -// Parse the JSON string back to an object -const exampleParsed = JSON.parse(exampleJSON) as Category -console.log(exampleParsed) -``` [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md index 2583fa00e7a3..294fd7dcfed5 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/ModelApiResponse.md @@ -11,28 +11,6 @@ Name | Type `type` | string `message` | string -## Example - -```typescript -import type { ModelApiResponse } from '@openapitools/typescript-fetch-petstore' - -// TODO: Update the object below with actual values -const example = { - "code": null, - "type": null, - "message": null, -} satisfies ModelApiResponse - -console.log(example) - -// Convert the instance to a JSON string -const exampleJSON: string = JSON.stringify(example) -console.log(exampleJSON) - -// Parse the JSON string back to an object -const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse -console.log(exampleParsed) -``` [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md index 7d6b7191968d..1a0daa42d1f4 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Order.md @@ -14,31 +14,6 @@ Name | Type `status` | string `complete` | boolean -## Example - -```typescript -import type { Order } from '@openapitools/typescript-fetch-petstore' - -// TODO: Update the object below with actual values -const example = { - "id": null, - "petId": null, - "quantity": null, - "shipDate": null, - "status": null, - "complete": null, -} satisfies Order - -console.log(example) - -// Convert the instance to a JSON string -const exampleJSON: string = JSON.stringify(example) -console.log(exampleJSON) - -// Parse the JSON string back to an object -const exampleParsed = JSON.parse(exampleJSON) as Order -console.log(exampleParsed) -``` [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md index 221555445c78..c86f62b6abf1 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Pet.md @@ -14,31 +14,6 @@ Name | Type `tags` | [Array<Tag>](Tag.md) `status` | string -## Example - -```typescript -import type { Pet } from '@openapitools/typescript-fetch-petstore' - -// TODO: Update the object below with actual values -const example = { - "id": null, - "category": null, - "name": doggie, - "photoUrls": null, - "tags": null, - "status": null, -} satisfies Pet - -console.log(example) - -// Convert the instance to a JSON string -const exampleJSON: string = JSON.stringify(example) -console.log(exampleJSON) - -// Parse the JSON string back to an object -const exampleParsed = JSON.parse(exampleJSON) as Pet -console.log(exampleParsed) -``` [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md index d112fe3b95e5..05c825792d57 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/Tag.md @@ -10,27 +10,6 @@ Name | Type `id` | number `name` | string -## Example - -```typescript -import type { Tag } from '@openapitools/typescript-fetch-petstore' - -// TODO: Update the object below with actual values -const example = { - "id": null, - "name": null, -} satisfies Tag - -console.log(example) - -// Convert the instance to a JSON string -const exampleJSON: string = JSON.stringify(example) -console.log(exampleJSON) - -// Parse the JSON string back to an object -const exampleParsed = JSON.parse(exampleJSON) as Tag -console.log(exampleParsed) -``` [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md index 98bd755583d5..09741733d345 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/User.md @@ -16,33 +16,6 @@ Name | Type `phone` | string `userStatus` | number -## Example - -```typescript -import type { User } from '@openapitools/typescript-fetch-petstore' - -// TODO: Update the object below with actual values -const example = { - "id": null, - "username": null, - "firstName": null, - "lastName": null, - "email": null, - "password": null, - "phone": null, - "userStatus": null, -} satisfies User - -console.log(example) - -// Convert the instance to a JSON string -const exampleJSON: string = JSON.stringify(example) -console.log(exampleJSON) - -// Parse the JSON string back to an object -const exampleParsed = JSON.parse(exampleJSON) as User -console.log(exampleParsed) -``` [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)