From 67e515447e66ce7e3ef6f11be237178ffdc4e5e8 Mon Sep 17 00:00:00 2001 From: LionH Date: Thu, 2 Sep 2021 04:32:15 +0200 Subject: [PATCH 01/75] Adding the useOptional in the ApiController (#6735) * Adding the useOptional in the ApiController * If jdk8 is disabled but useOptional is enabled, avoid duplicate import. --- .../src/main/resources/JavaSpring/apiController.mustache | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache index 3b1020c8e98..cfdf2b9772b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache @@ -37,6 +37,11 @@ import javax.validation.Valid; {{#jdk8}} import java.util.Optional; {{/jdk8}} +{{^jdk8}} + {{#useOptional}} +import java.util.Optional; + {{/useOptional}} +{{/jdk8}} {{^jdk8}} import java.util.List; import java.util.Map; From 74f84b6f9ba8ffceae4a0f4e0881103be74f2399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E8=A3=95=E5=87=AF?= <598130593@qq.com> Date: Thu, 2 Sep 2021 10:45:04 +0800 Subject: [PATCH 02/75] [Java][Spring] fix enum variables in path parameters which generated allowableValues with double quote(#6762) (#10285) Co-authored-by: Yukai Lin --- .../codegen/languages/SpringCodegen.java | 2 + .../resources/JavaSpring/pathParams.mustache | 2 +- .../java/spring/SpringCodegenTest.java | 37 +++++++++++ .../src/test/resources/3_0/issue_6762.yaml | 61 +++++++++++++++++++ 4 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue_6762.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index b0db9a4c124..cdd4d96b2e3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -488,6 +488,8 @@ public class SpringCodegen extends AbstractJavaCodegen } // add lambda for mustache templates + additionalProperties.put("lambdaRemoveDoubleQuote", + (Mustache.Lambda) (fragment, writer) -> writer.write(fragment.execute().replaceAll("\"", Matcher.quoteReplacement("")))); additionalProperties.put("lambdaEscapeDoubleQuote", (Mustache.Lambda) (fragment, writer) -> writer.write(fragment.execute().replaceAll("\"", Matcher.quoteReplacement("\\\"")))); additionalProperties.put("lambdaRemoveLineBreak", diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache index 4e79ee0f4ba..2596e9df399 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaRemoveDoubleQuote}}{{{value}}}{{/lambdaRemoveDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 6bdd0cc4836..99606af840b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -653,4 +653,41 @@ public class SpringCodegenTest { assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApi.java"), "Mono"); assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApiDelegate.java"), "Mono"); } + + @Test + public void doGeneratePathVariableForSimpleParam() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/issue_6762.yaml", null, new ParseOptions()).getOpenAPI(); + + SpringCodegen codegen = new SpringCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java"), "allowableValues = \"0, 1\""); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java"), "@PathVariable"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/BearsApi.java"), "allowableValues = \"sleeping, awake\""); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/BearsApi.java"), "@PathVariable"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/CamelsApi.java"), "allowableValues = \"sleeping, awake\""); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/CamelsApi.java"), "@PathVariable"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GirafesApi.java"), "allowableValues = \"0, 1\""); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GirafesApi.java"), "@PathVariable"); + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_6762.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_6762.yaml new file mode 100644 index 00000000000..9df77efc7f9 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_6762.yaml @@ -0,0 +1,61 @@ +openapi: 3.0.0 +servers: + - url: 'localhost:8080' +info: + version: 1.0.0 + title: OpenAPI Zoo + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +paths: + /girafes/{refStatus}: + get: + operationId: getGirafes + parameters: + - $ref: '#/components/parameters/refStatus' + /zebras/{status}: + get: + operationId: getZebras + parameters: + - in: path + name: status + required: true + schema: + type: integer + enum: [0,1] + default: 0 + /bears/{refCondition}: + get: + operationId: getBears + parameters: + - $ref: '#/components/parameters/refCondition' + /camels/{condition}: + get: + operationId: getCamels + parameters: + - in: path + name: condition + required: true + schema: + type: string + enum: + - sleeping + - awake +components: + parameters: + refStatus: + in: path + name: refStatus + required: true + schema: + type: integer + enum: [0,1] + default: 0 + refCondition: + in: path + name: refCondition + schema: + type: string + enum: + - sleeping + - awake From c148539ce324cf6cfe1081fd24ea16973927beae Mon Sep 17 00:00:00 2001 From: Oleh Kurpiak Date: Thu, 2 Sep 2021 06:01:12 +0300 Subject: [PATCH 03/75] [Java][Spring] fix imports for nullable helpers (#10234) --- .../org/openapitools/codegen/languages/SpringCodegen.java | 4 ++++ .../src/main/resources/Java/libraries/jersey2/pojo.mustache | 6 ++---- .../src/main/resources/Java/libraries/native/pojo.mustache | 6 ++---- .../openapi-generator/src/main/resources/Java/pojo.mustache | 6 ++---- .../src/main/resources/JavaSpring/pojo.mustache | 6 ++---- .../main/java/org/openapitools/client/model/EnumTest.java | 6 ++---- .../org/openapitools/client/model/HealthCheckResult.java | 6 ++---- .../java/org/openapitools/client/model/NullableClass.java | 6 ++---- .../java/org/openapitools/client/model/ByteArrayObject.java | 6 ++---- .../main/java/org/openapitools/client/model/EnumTest.java | 6 ++---- .../org/openapitools/client/model/HealthCheckResult.java | 6 ++---- .../java/org/openapitools/client/model/NullableClass.java | 6 ++---- .../client/model/AdditionalPropertiesClass.java | 6 ++---- .../main/java/org/openapitools/client/model/Drawing.java | 6 ++---- .../main/java/org/openapitools/client/model/EnumTest.java | 6 ++---- .../org/openapitools/client/model/HealthCheckResult.java | 6 ++---- .../java/org/openapitools/client/model/NullableClass.java | 6 ++---- .../src/main/java/org/openapitools/client/model/User.java | 6 ++---- 18 files changed, 38 insertions(+), 68 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index cdd4d96b2e3..ba5a7f99ef5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -840,6 +840,10 @@ public class SpringCodegen extends AbstractJavaCodegen if (property.isByteArray) { model.imports.add("Arrays"); } + + if (model.getVendorExtensions().containsKey("x-jackson-optional-nullable-helpers")) { + model.imports.add("Arrays"); + } } @Override diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index b01a88a6646..e43449ddc0d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -287,7 +287,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} @Override @@ -304,9 +304,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} @Override diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache index 20957c36c1f..66eb1760eb7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -290,7 +290,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} @Override @@ -307,9 +307,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} @Override diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index b9be16ad565..ce4207b3040 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -263,7 +263,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} @Override @@ -280,9 +280,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} @Override diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index df0b98bfaf7..4226edb1170 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -139,7 +139,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{^parent}}{{#ha }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} @Override @@ -151,9 +151,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{^parent}}{{#ha if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} @Override diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index a2bc31cdab7..3ae56d3979a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -461,7 +461,7 @@ public class EnumTest { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -473,9 +473,7 @@ public class EnumTest { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 9ca1ed06b50..e9acad1a3f0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -90,7 +90,7 @@ public class HealthCheckResult { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -102,9 +102,7 @@ public class HealthCheckResult { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java index a0cdc543f9c..37d9cc95440 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java @@ -585,7 +585,7 @@ public class NullableClass extends HashMap { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -597,9 +597,7 @@ public class NullableClass extends HashMap { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java index 0f1960813ae..a15edcb77f4 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java @@ -226,7 +226,7 @@ public class ByteArrayObject { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -238,9 +238,7 @@ public class ByteArrayObject { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index a2bc31cdab7..3ae56d3979a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -461,7 +461,7 @@ public class EnumTest { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -473,9 +473,7 @@ public class EnumTest { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 9ca1ed06b50..e9acad1a3f0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -90,7 +90,7 @@ public class HealthCheckResult { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -102,9 +102,7 @@ public class HealthCheckResult { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java index fee8d1fa00e..d11a03e3e31 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java @@ -585,7 +585,7 @@ public class NullableClass extends HashMap { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -597,9 +597,7 @@ public class NullableClass extends HashMap { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index bc5318f3f9e..f7badd84904 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -346,7 +346,7 @@ public class AdditionalPropertiesClass { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -358,9 +358,7 @@ public class AdditionalPropertiesClass { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java index eb2ce538d97..eedf71283c3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java @@ -243,7 +243,7 @@ public class Drawing { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -255,9 +255,7 @@ public class Drawing { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 7304f015f29..aee1b8c5343 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -525,7 +525,7 @@ public class EnumTest { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -537,9 +537,7 @@ public class EnumTest { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 71a5e8e2c9f..479a14c09e7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -95,7 +95,7 @@ public class HealthCheckResult { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -107,9 +107,7 @@ public class HealthCheckResult { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index 2163e1535b8..de8f62c6667 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -620,7 +620,7 @@ public class NullableClass { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -632,9 +632,7 @@ public class NullableClass { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 3644c760842..fceb70ecf5f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -451,7 +451,7 @@ public class User { } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && a.get().getClass().isArray() ? Arrays.equals((T[])a.get(), (T[])b.get()) : Objects.equals(a.get(), b.get())); + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override @@ -463,9 +463,7 @@ public class User { if (a == null) { return 1; } - return a.isPresent() - ? (a.get().getClass().isArray() ? Arrays.hashCode((T[])a.get()) : Objects.hashCode(a.get())) - : 31; + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override From f9fa62a79eac402cf0d14ec5e23f26e760d4a78d Mon Sep 17 00:00:00 2001 From: Eric Durand-Tremblay Date: Wed, 1 Sep 2021 23:03:31 -0400 Subject: [PATCH 04/75] Issue #10244 fix php enum default value initialization (#10273) Co-authored-by: Eric Durand-Tremblay --- .../codegen/languages/AbstractPhpCodegen.java | 4 +-- .../codegen/php/AbstractPhpCodegenTest.java | 21 +++++++++++++++ .../test/resources/3_0/php/issue_10244.yaml | 26 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/php/issue_10244.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index 9a7a0e91772..2805cd301ee 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -195,7 +195,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg if (additionalProperties.containsKey(CodegenConstants.GIT_USER_ID)) { this.setGitUserId((String) additionalProperties.get(CodegenConstants.GIT_USER_ID)); } - + if (additionalProperties.containsKey(CodegenConstants.GIT_REPO_ID)) { this.setGitRepoId((String) additionalProperties.get(CodegenConstants.GIT_REPO_ID)); } @@ -631,7 +631,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg @Override public String toEnumDefaultValue(String value, String datatype) { - return datatype + "_" + value; + return "self::" + datatype + "_" + value; } @Override diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java index 667e91df22e..44661e7498c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java @@ -32,6 +32,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; public class AbstractPhpCodegenTest { @@ -146,6 +147,26 @@ public class AbstractPhpCodegenTest { Assert.assertTrue(cp1.isPrimitiveType); } + @Test(description = "Issue #10244") + public void testEnumPropertyWithDefaultValue() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/php/issue_10244.yaml"); + final AbstractPhpCodegen codegen = new P_AbstractPhpCodegen(); + + Schema test1 = openAPI.getComponents().getSchemas().get("ModelWithEnumPropertyHavingDefault"); + CodegenModel cm1 = codegen.fromModel("ModelWithEnumPropertyHavingDefault", test1); + + // Make sure we got the container object. + Assert.assertEquals(cm1.getDataType(), "object"); + Assert.assertEquals(codegen.getTypeDeclaration("MyResponse"), "\\php\\Model\\MyResponse"); + + // We need to postProcess the model for enums to be processed + codegen.postProcessModels(Collections.singletonMap("models", Collections.singletonList(Collections.singletonMap("model", cm1)))); + + // Assert the enum default value is properly generated + CodegenProperty cp1 = cm1.vars.get(0); + Assert.assertEquals(cp1.getDefaultValue(), "self::PROPERTY_NAME_VALUE"); + } + private static class P_AbstractPhpCodegen extends AbstractPhpCodegen { @Override public CodegenType getTag() { diff --git a/modules/openapi-generator/src/test/resources/3_0/php/issue_10244.yaml b/modules/openapi-generator/src/test/resources/3_0/php/issue_10244.yaml new file mode 100644 index 00000000000..6a2c48310d9 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/php/issue_10244.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: 'Issue 10224 Enum default value' + version: latest +paths: + '/': + get: + operationId: operation + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/ModelWithEnumPropertyHavingDefault' +components: + schemas: + ModelWithEnumPropertyHavingDefault: + required: + - propertyName + properties: + propertyName: + type: string + default: VALUE + enum: + - VALUE From d68d65ce00c49b43ca238ada5d843cd9e681bff6 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 2 Sep 2021 06:08:35 +0300 Subject: [PATCH 05/75] Fix java examples (#10257) * TAP-655 fix examples java * update samples --- .../languages/AbstractJavaCodegen.java | 38 ++++- .../AbstractJavaCodegenExampleValuesTest.java | 157 ++++++++++++++++++ .../java/apache-httpclient/docs/FakeApi.md | 14 +- .../java/google-api-client/docs/FakeApi.md | 14 +- .../petstore/java/jersey1/docs/FakeApi.md | 14 +- .../docs/FakeApi.md | 14 +- .../java/jersey2-java8/docs/FakeApi.md | 14 +- .../java/native-async/docs/FakeApi.md | 28 ++-- .../petstore/java/native/docs/FakeApi.md | 28 ++-- .../docs/FakeApi.md | 14 +- .../docs/FakeApi.md | 14 +- .../petstore/java/okhttp-gson/docs/FakeApi.md | 14 +- .../petstore/java/resteasy/docs/FakeApi.md | 14 +- .../java/resttemplate-withXml/docs/FakeApi.md | 14 +- .../java/resttemplate/docs/FakeApi.md | 14 +- .../java/retrofit2-play26/docs/FakeApi.md | 14 +- .../petstore/java/retrofit2/docs/FakeApi.md | 14 +- .../java/retrofit2rx2/docs/FakeApi.md | 14 +- .../java/retrofit2rx3/docs/FakeApi.md | 14 +- .../java/vertx-no-nullable/docs/FakeApi.md | 14 +- .../petstore/java/vertx/docs/FakeApi.md | 14 +- .../petstore/java/webclient/docs/FakeApi.md | 14 +- .../java/jersey2-java8/docs/FakeApi.md | 16 +- 23 files changed, 350 insertions(+), 169 deletions(-) create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 68fd77a768b..dbe0af28fb2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -1087,7 +1087,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public void setParameterExampleValue(CodegenParameter p) { String example; - if (p.defaultValue == null) { + boolean hasAllowableValues = p.allowableValues != null && !p.allowableValues.isEmpty(); + if (hasAllowableValues) { + //support examples for inline enums + final List values = (List) p.allowableValues.get("values"); + example = String.valueOf(values.get(0)); + } else if (p.defaultValue == null) { example = p.example; } else { example = p.defaultValue; @@ -1133,14 +1138,33 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code example = "new File(\"" + escapeText(example) + "\")"; } else if ("Date".equals(type)) { example = "new Date()"; + } else if ("LocalDate".equals(type)) { + if (example == null) { + example = "LocalDate.now()"; + } else { + example = "LocalDate.parse(\"" + example + "\")"; + } } else if ("OffsetDateTime".equals(type)) { - example = "OffsetDateTime.now()"; + if (example == null) { + example = "OffsetDateTime.now()"; + } else { + example = "OffsetDateTime.parse(\"" + example + "\")"; + } } else if ("BigDecimal".equals(type)) { - example = "new BigDecimal(78)"; - } else if (p.allowableValues != null && !p.allowableValues.isEmpty()) { - Map allowableValues = p.allowableValues; - List values = (List) allowableValues.get("values"); - example = type + ".fromValue(\"" + String.valueOf(values.get(0)) + "\")"; + if (example == null) { + example = "new BigDecimal(78)"; + } else { + example = "new BigDecimal(\"" + example + "\")"; + } + } else if ("UUID".equals(type)) { + if (example == null) { + example = "UUID.randomUUID()"; + } else { + example = "UUID.fromString(\"" + example + "\")"; + } + } else if (hasAllowableValues) { + //parameter is enum defined as a schema component + example = type + ".fromValue(\"" + example + "\")"; } else if (!languageSpecificPrimitives.contains(type)) { // type is a model class, e.g. User example = "new " + type + "()"; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java new file mode 100644 index 00000000000..d9f451a462e --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java @@ -0,0 +1,157 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java; + +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.languages.AbstractJavaCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Arrays; +import java.util.Collections; + +public class AbstractJavaCodegenExampleValuesTest { + + private final AbstractJavaCodegen fakeJavaCodegen = new P_AbstractJavaCodegen(); + + @Test + void referencedEnumTakeFirstName() { + final CodegenParameter p = new CodegenParameter(); + p.allowableValues = Collections.singletonMap("values", Arrays.asList("first", "second")); + p.dataType = "WrappedEnum"; + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "WrappedEnum.fromValue(\"first\")"); + } + + @Test + void inlineEnum() { + final CodegenParameter p = new CodegenParameter(); + p.allowableValues = Collections.singletonMap("values", Arrays.asList("first", "second")); + p.isEnum = true; + p.dataType = "String"; + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "\"first\""); + } + + @Test + void inlineEnumArray() { + final CodegenParameter p = new CodegenParameter(); + p.allowableValues = Collections.singletonMap("values", Arrays.asList("first", "second")); + p.isEnum = true; + p.isArray = true; + p.dataType = "List"; + p.items = new CodegenProperty(); + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "Arrays.asList()"); + } + + @Test + void dateDefault() { + final CodegenParameter p = new CodegenParameter(); + p.isDate = true; + p.dataType = "LocalDate"; + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "LocalDate.now()"); + } + + @Test + void dateGivenExample() { + final CodegenParameter p = new CodegenParameter(); + p.isDate = true; + p.dataType = "LocalDate"; + p.example = "2017-03-30"; + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "LocalDate.parse(\"2017-03-30\")"); + } + + @Test + void dateTimeDefault() { + final CodegenParameter p = new CodegenParameter(); + p.isDateTime = true; + p.dataType = "OffsetDateTime"; + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "OffsetDateTime.now()"); + } + + @Test + void dateTimeGivenExample() { + final CodegenParameter p = new CodegenParameter(); + p.isDateTime = true; + p.dataType = "OffsetDateTime"; + p.example = "2007-12-03T10:15:30+01:00"; + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "OffsetDateTime.parse(\"2007-12-03T10:15:30+01:00\")"); + } + + @Test + void uuidDefault() { + final CodegenParameter p = new CodegenParameter(); + p.isUuid = true; + p.dataType = "UUID"; + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "UUID.randomUUID()"); + } + + @Test + void uuidGivenExample() { + final CodegenParameter p = new CodegenParameter(); + p.isUuid = true; + p.dataType = "UUID"; + p.example = "13b48713-b931-45ea-bd60-b07491245960"; + + fakeJavaCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "UUID.fromString(\"13b48713-b931-45ea-bd60-b07491245960\")"); + } + + private static class P_AbstractJavaCodegen extends AbstractJavaCodegen { + @Override + public CodegenType getTag() { + return null; + } + + @Override + public String getName() { + return null; + } + + @Override + public String getHelp() { + return null; + } + + /** + * Gets artifact version. + * Only for testing purposes. + * + * @return version + */ + public String getArtifactVersion() { + return this.artifactVersion; + } + } +} diff --git a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md index 4f81e527a10..c76fd80c324 100644 --- a/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/java/apache-httpclient/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/google-api-client/docs/FakeApi.md b/samples/client/petstore/java/google-api-client/docs/FakeApi.md index 4f81e527a10..c76fd80c324 100644 --- a/samples/client/petstore/java/google-api-client/docs/FakeApi.md +++ b/samples/client/petstore/java/google-api-client/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index 4f81e527a10..c76fd80c324 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeApi.md index 9b87b7538f6..c538fd7fcd4 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None LocalDateTime dateTime = new LocalDateTime(); // LocalDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -668,13 +668,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index a5c59d91e0b..29f79920394 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -668,13 +668,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/native-async/docs/FakeApi.md b/samples/client/petstore/java/native-async/docs/FakeApi.md index 40a35f715d8..fd327749d6c 100644 --- a/samples/client/petstore/java/native-async/docs/FakeApi.md +++ b/samples/client/petstore/java/native-async/docs/FakeApi.md @@ -1214,7 +1214,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -1313,7 +1313,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -1406,13 +1406,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { CompletableFuture result = apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { @@ -1487,13 +1487,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { CompletableFuture> response = apiInstance.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); System.out.println("Status code: " + response.get().getStatusCode()); diff --git a/samples/client/petstore/java/native/docs/FakeApi.md b/samples/client/petstore/java/native/docs/FakeApi.md index 64ac73b2bbc..1d0e8ca9ebb 100644 --- a/samples/client/petstore/java/native/docs/FakeApi.md +++ b/samples/client/petstore/java/native/docs/FakeApi.md @@ -1141,7 +1141,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -1239,7 +1239,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -1324,13 +1324,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { @@ -1404,13 +1404,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { ApiResponse response = apiInstance.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); System.out.println("Status code: " + response.getStatusCode()); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeApi.md index 6a47638bab7..5a20b8b1911 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeApi.md @@ -552,7 +552,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -631,13 +631,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index 6a47638bab7..5a20b8b1911 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md @@ -552,7 +552,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -631,13 +631,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 6a47638bab7..5a20b8b1911 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -552,7 +552,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -631,13 +631,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/resteasy/docs/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index 4f81e527a10..c76fd80c324 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md index 4f81e527a10..c76fd80c324 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index 4f81e527a10..c76fd80c324 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md index 740c810f28b..d0080643e4b 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index 740c810f28b..d0080643e4b 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md index 740c810f28b..d0080643e4b 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/retrofit2rx3/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx3/docs/FakeApi.md index 740c810f28b..d0080643e4b 100644 --- a/samples/client/petstore/java/retrofit2rx3/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx3/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/vertx-no-nullable/docs/FakeApi.md b/samples/client/petstore/java/vertx-no-nullable/docs/FakeApi.md index c50095a6a58..99c87b67656 100644 --- a/samples/client/petstore/java/vertx-no-nullable/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx-no-nullable/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None AsyncFile binary = new AsyncFile(); // AsyncFile | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index c50095a6a58..99c87b67656 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -586,7 +586,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None AsyncFile binary = new AsyncFile(); // AsyncFile | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -669,13 +669,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index 8630d8419c8..b4c92eb6a9c 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -784,7 +784,7 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None + LocalDate date = LocalDate.now(); // LocalDate | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None @@ -867,13 +867,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md index 505db20273f..32a66fa54dc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -642,8 +642,8 @@ public class Example { Float _float = 3.4F; // Float | None String string = "string_example"; // String | None File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None - OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None + LocalDate date = LocalDate.now(); // LocalDate | None + OffsetDateTime dateTime = OffsetDateTime.parse("OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))"); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None try { @@ -724,13 +724,13 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = ">"; // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { From 6331eb62935c0acc3c872e90ce62282c70670bc6 Mon Sep 17 00:00:00 2001 From: Josh Bridge Date: Thu, 2 Sep 2021 04:19:13 +0100 Subject: [PATCH 06/75] [Java] Return content type on default spring reactive responses (#10099) * Return content type on default spring reactive responses * Return content type on default spring reactive responses * Refactor apiUtil and use request mediaType Co-authored-by: Joshua Bridge --- .../src/main/resources/JavaSpring/apiUtil.mustache | 12 ++++++++++-- .../main/resources/JavaSpring/methodBody.mustache | 2 +- .../openapitools/api/AnotherFakeApiDelegate.java | 2 +- .../main/java/org/openapitools/api/ApiUtil.java | 12 ++++++++++-- .../java/org/openapitools/api/FakeApiDelegate.java | 6 +++--- .../api/FakeClassnameTestApiDelegate.java | 2 +- .../java/org/openapitools/api/PetApiDelegate.java | 14 +++++++------- .../org/openapitools/api/StoreApiDelegate.java | 8 ++++---- .../java/org/openapitools/api/UserApiDelegate.java | 4 ++-- 9 files changed, 39 insertions(+), 23 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiUtil.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiUtil.mustache index 6608bdb2b97..cf72ff100b4 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiUtil.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiUtil.mustache @@ -2,7 +2,10 @@ package {{apiPackage}}; {{#reactive}} import java.nio.charset.StandardCharsets; +import org.springframework.core.io.buffer.DefaultDataBuffer; import org.springframework.core.io.buffer.DefaultDataBufferFactory; +import org.springframework.http.MediaType; +import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Mono; {{/reactive}} @@ -27,8 +30,13 @@ public class ApiUtil { } {{/reactive}} {{#reactive}} - public static Mono getExampleResponse(ServerWebExchange exchange, String example) { - return exchange.getResponse().writeWith(Mono.just(new DefaultDataBufferFactory().wrap(example.getBytes(StandardCharsets.UTF_8)))); + public static Mono getExampleResponse(ServerWebExchange exchange, MediaType mediaType, String example) { + ServerHttpResponse response = exchange.getResponse(); + response.getHeaders().setContentType(mediaType); + + byte[] exampleBytes = example.getBytes(StandardCharsets.UTF_8); + DefaultDataBuffer data = new DefaultDataBufferFactory().wrap(exampleBytes); + return response.writeWith(Mono.just(data)); } {{/reactive}} } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache index e71414e99e1..b2f8edeb808 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache @@ -38,7 +38,7 @@ Mono result = Mono.empty(); {{/-first}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) { String exampleString = {{>exampleString}}; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } {{#-last}} diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 1cff47f7cfe..f925f8ac478 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -42,7 +42,7 @@ public interface AnotherFakeApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java index f8d5d1d70b4..7ed3b0ab28d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java @@ -1,12 +1,20 @@ package org.openapitools.api; import java.nio.charset.StandardCharsets; +import org.springframework.core.io.buffer.DefaultDataBuffer; import org.springframework.core.io.buffer.DefaultDataBufferFactory; +import org.springframework.http.MediaType; +import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Mono; public class ApiUtil { - public static Mono getExampleResponse(ServerWebExchange exchange, String example) { - return exchange.getResponse().writeWith(Mono.just(new DefaultDataBufferFactory().wrap(example.getBytes(StandardCharsets.UTF_8)))); + public static Mono getExampleResponse(ServerWebExchange exchange, MediaType mediaType, String example) { + ServerHttpResponse response = exchange.getResponse(); + response.getHeaders().setContentType(mediaType); + + byte[] exampleBytes = example.getBytes(StandardCharsets.UTF_8); + DefaultDataBuffer data = new DefaultDataBufferFactory().wrap(exampleBytes); + return response.writeWith(Mono.just(data)); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index f79e5dc614f..348bc54bb04 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -83,7 +83,7 @@ public interface FakeApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } @@ -171,7 +171,7 @@ public interface FakeApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } @@ -353,7 +353,7 @@ public interface FakeApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index de22e925256..621c2335818 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -42,7 +42,7 @@ public interface FakeClassnameTestApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index b6abecd34cb..12eca420903 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -79,12 +79,12 @@ public interface PetApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { String exampleString = " 123456789 doggie aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } @@ -109,12 +109,12 @@ public interface PetApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { String exampleString = " 123456789 doggie aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } @@ -139,12 +139,12 @@ public interface PetApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { String exampleString = " 123456789 doggie aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } @@ -207,7 +207,7 @@ public interface PetApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index cf7b723ae56..680de023d02 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -76,12 +76,12 @@ public interface StoreApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } @@ -104,12 +104,12 @@ public interface StoreApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index b40ebabc5cd..7241a736ea1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -107,12 +107,12 @@ public interface UserApiDelegate { for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - result = ApiUtil.getExampleResponse(exchange, exampleString); + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); break; } } From f79f1916edc2ba1a47ae8ee946b24ad4d2ab7dbf Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 2 Sep 2021 11:27:56 +0800 Subject: [PATCH 07/75] test springboot-reactive in circleci --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index db2f0e08eee..41eef786716 100644 --- a/pom.xml +++ b/pom.xml @@ -1287,6 +1287,7 @@ samples/server/petstore/springboot samples/server/petstore/springboot-beanvalidation samples/server/petstore/springboot-useoptional + samples/server/petstore/springboot-reactive samples/server/petstore/jaxrs-cxf samples/server/petstore/jaxrs-cxf-annotated-base-path samples/server/petstore/jaxrs-cxf-cdi From 8cc2bc4fa7f1833fa7a154e0af4ec1ef9c5836ec Mon Sep 17 00:00:00 2001 From: Kaijia Feng Date: Thu, 2 Sep 2021 21:03:29 +0800 Subject: [PATCH 08/75] [Java][RestTemplate][WebClient] Fix typo in comments (#10311) --- .../resources/Java/libraries/resttemplate/ApiClient.mustache | 2 +- .../main/resources/Java/libraries/webclient/ApiClient.mustache | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 7909a65a41d..73cfe2d43a5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -619,7 +619,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** * Include queryParams in uriParams taking into account the paramName * - * @param queryParam The query parameters + * @param queryParams The query parameters * @param uriParams The path parameters * return templatized query string */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index 2cc373ae78f..bf3eb952083 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -615,7 +615,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** * Include queryParams in uriParams taking into account the paramName - * @param queryParam The query parameters + * @param queryParams The query parameters * @param uriParams The path parameters * return templatized query string */ diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index 244cbd852dd..1b63359e1e1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -575,7 +575,7 @@ public class ApiClient extends JavaTimeFormatter { /** * Include queryParams in uriParams taking into account the paramName * - * @param queryParam The query parameters + * @param queryParams The query parameters * @param uriParams The path parameters * return templatized query string */ diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 37788fa2818..9a6e71a8841 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -570,7 +570,7 @@ public class ApiClient extends JavaTimeFormatter { /** * Include queryParams in uriParams taking into account the paramName * - * @param queryParam The query parameters + * @param queryParams The query parameters * @param uriParams The path parameters * return templatized query string */ diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java index 7694b7d9b95..711e3ce865b 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java @@ -581,7 +581,7 @@ public class ApiClient extends JavaTimeFormatter { /** * Include queryParams in uriParams taking into account the paramName - * @param queryParam The query parameters + * @param queryParams The query parameters * @param uriParams The path parameters * return templatized query string */ diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java index 3510c9f459b..ba5abc0153a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java @@ -602,7 +602,7 @@ public class ApiClient extends JavaTimeFormatter { /** * Include queryParams in uriParams taking into account the paramName - * @param queryParam The query parameters + * @param queryParams The query parameters * @param uriParams The path parameters * return templatized query string */ From 490c747c2b7730e8b2e4149b0829ca2af42cd57c Mon Sep 17 00:00:00 2001 From: Guus Bloemsma Date: Fri, 3 Sep 2021 05:56:31 +0200 Subject: [PATCH 09/75] [kotlin-client] OkHttp call is now non-blocking (#10303) * suspend method is now non-blocking * added required imports * generated the samples * suspend method is now non-blocking * added required imports * generated the samples * Cancelling the call when the coroutine is cancelled Only use coroutines when requested Not adding potentially unavailable imports Co-authored-by: Guus Bloemsma --- .../infrastructure/ApiClient.kt.mustache | 28 ++++++++++++++++++- .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 23 +++++++++++++-- .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ .../client/infrastructure/ApiClient.kt | 5 ++++ 13 files changed, 103 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 742a69012ed..84fbd169c09 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -26,9 +26,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection {{^threetenbp}} import java.time.LocalDate @@ -39,6 +43,11 @@ import java.time.OffsetTime {{/threetenbp}} import java.util.Date import java.util.Locale +{{#useCoroutines}} +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlinx.coroutines.suspendCancellableCoroutine +{{/useCoroutines}} {{#kotlinx_serialization}} import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString @@ -271,7 +280,7 @@ import com.squareup.moshi.adapter } {{/hasAuthMethods}} - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected {{#useCoroutines}}suspend {{/useCoroutines}}inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { {{#jvm-okhttp3}} val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") {{/jvm-okhttp3}} @@ -326,7 +335,24 @@ import com.squareup.moshi.adapter headers.forEach { header -> addHeader(header.key, header.value) } }.build() + {{#useCoroutines}} + val response: Response = suspendCancellableCoroutine { continuation -> + val call = client.newCall(request) + continuation.invokeOnCancellation { call.cancel() } + call.enqueue(object : Callback { + override fun onFailure(c: Call, e: IOException) { + continuation.resumeWithException(e) + } + override fun onResponse(c: Call, response: Response) { + continuation.resume(response) + } + }) + } + {{/useCoroutines}} + {{^useCoroutines}} val response = client.newCall(request).execute() + {{/useCoroutines}} + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9d8cfd8c184..2deeb3eaeb6 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -196,6 +200,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 5db80e34f81..6910a1d58de 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -196,6 +200,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 2dfe0159d45..3223314734f 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -12,9 +12,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -203,6 +207,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9d8cfd8c184..d67840dcc7e 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -22,6 +26,9 @@ import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Date import java.util.Locale +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlinx.coroutines.suspendCancellableCoroutine import com.google.gson.reflect.TypeToken open class ApiClient(val baseUrl: String) { @@ -147,7 +154,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected suspend inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation @@ -195,7 +202,19 @@ open class ApiClient(val baseUrl: String) { headers.forEach { header -> addHeader(header.key, header.value) } }.build() - val response = client.newCall(request).execute() + val response: Response = suspendCancellableCoroutine { continuation -> + val call = client.newCall(request) + continuation.invokeOnCancellation { call.cancel() } + call.enqueue(object : Callback { + override fun onFailure(c: Call, e: IOException) { + continuation.resumeWithException(e) + } + override fun onResponse(c: Call, response: Response) { + continuation.resume(response) + } + }) + } + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index bc8a5963fb6..58c8ac294a5 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -197,6 +201,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 924fb6cd4c8..24d224a6909 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -197,6 +201,7 @@ internal open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index bc8a5963fb6..58c8ac294a5 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -197,6 +201,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b591a6d5e50..1d0ed1043bd 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -9,9 +9,13 @@ import okhttp3.ResponseBody import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -195,6 +199,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index bc8a5963fb6..58c8ac294a5 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -197,6 +201,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index a7441f81d1b..14ce7181d91 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.util.Date import java.util.Locale @@ -197,6 +201,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index b359be1e41d..3791101dfe1 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -178,6 +182,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index bc8a5963fb6..58c8ac294a5 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -11,9 +11,13 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request import okhttp3.Headers import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response import java.io.BufferedWriter import java.io.File import java.io.FileWriter +import java.io.IOException import java.net.URLConnection import java.time.LocalDate import java.time.LocalDateTime @@ -197,6 +201,7 @@ open class ApiClient(val baseUrl: String) { }.build() val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) // TODO: handle specific mapping types. e.g. Map> From a5585549614fa030133227ab21e805c89915aafe Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Fri, 3 Sep 2021 10:32:51 +0200 Subject: [PATCH 10/75] Add OAS3 allowEmptyValue for query params (#10312) * add the special case of empty query parameters to the fake API --- .../codegen/CodegenParameter.java | 7 +++- .../openapitools/codegen/DefaultCodegen.java | 1 + ...ith-fake-endpoints-models-for-testing.yaml | 6 +++ .../csharp/OpenAPIClient/docs/FakeApi.md | 6 ++- .../src/Org.OpenAPITools/Api/FakeApi.cs | 36 ++++++++++++----- .../elixir/lib/openapi_petstore/api/fake.ex | 6 ++- .../petstore/java/feign/api/openapi.yaml | 8 ++++ .../org/openapitools/client/api/FakeApi.java | 12 ++++-- .../petstore/java/webclient/api/openapi.yaml | 8 ++++ .../petstore/java/webclient/docs/FakeApi.md | 6 ++- .../org/openapitools/client/api/FakeApi.java | 17 +++++--- .../petstore/javascript-es6/docs/FakeApi.md | 6 ++- .../javascript-es6/src/api/FakeApi.js | 10 ++++- .../javascript-promise-es6/docs/FakeApi.md | 6 ++- .../javascript-promise-es6/src/api/FakeApi.js | 15 +++++-- samples/client/petstore/perl/docs/FakeApi.md | 6 ++- .../perl/lib/WWW/OpenAPIClient/FakeApi.pm | 16 ++++++++ .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 6 ++- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 40 ++++++++++++++----- .../petstore/ruby-faraday/docs/FakeApi.md | 10 +++-- .../ruby-faraday/lib/petstore/api/fake_api.rb | 13 ++++-- samples/client/petstore/ruby/docs/FakeApi.md | 10 +++-- .../ruby/lib/petstore/api/fake_api.rb | 13 ++++-- .../builds/default-v3.0/apis/FakeApi.ts | 9 +++++ .../petstore_client_lib_fake/doc/FakeApi.md | 6 ++- .../lib/src/api/fake_api.dart | 3 ++ .../petstore_client_lib_fake/doc/FakeApi.md | 6 ++- .../lib/api/fake_api.dart | 4 +- .../petstore_client_lib_fake/doc/FakeApi.md | 6 ++- .../lib/api/fake_api.dart | 14 +++++-- .../doc/FakeApi.md | 6 ++- .../lib/api/fake_api.dart | 14 +++++-- .../petstore/python-legacy/docs/FakeApi.md | 6 ++- .../petstore_api/api/fake_api.py | 21 +++++++--- .../java/org/openapitools/api/FakeApi.java | 4 +- .../org/openapitools/api/FakeApiService.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 2 +- .../app/Http/Controllers/FakeController.php | 5 +++ .../lib/app/Http/Controllers/FakeApi.php | 5 +++ 39 files changed, 288 insertions(+), 89 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 8f512e4cec7..6c0aaf869da 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -27,7 +27,7 @@ import java.util.*; public class CodegenParameter implements IJsonSchemaValidationProperties { public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, - isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject; + isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isAllowEmptyValue; public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style; @@ -208,6 +208,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { output.isExplode = this.isExplode; output.style = this.style; output.isDeepObject = this.isDeepObject; + output.isAllowEmptyValue = this.isAllowEmptyValue; output.contentType = this.contentType; return output; @@ -215,7 +216,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { @Override public int hashCode() { - return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping); + return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping); } @Override @@ -283,6 +284,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { Objects.equals(enumName, that.enumName) && Objects.equals(style, that.style) && Objects.equals(isDeepObject, that.isDeepObject) && + Objects.equals(isAllowEmptyValue, that.isAllowEmptyValue) && Objects.equals(example, that.example) && Objects.equals(jsonSchema, that.jsonSchema) && Objects.equals(_enum, that._enum) && @@ -333,6 +335,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { sb.append(", enumName='").append(enumName).append('\''); sb.append(", style='").append(style).append('\''); sb.append(", deepObject='").append(isDeepObject).append('\''); + sb.append(", allowEmptyValue='").append(isAllowEmptyValue).append('\''); sb.append(", example='").append(example).append('\''); sb.append(", jsonSchema='").append(jsonSchema).append('\''); sb.append(", isString=").append(isString); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 3bfcebaac1c..53154f1af80 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4547,6 +4547,7 @@ public class DefaultCodegen implements CodegenConfig { if (parameter instanceof QueryParameter || "query".equalsIgnoreCase(parameter.getIn())) { codegenParameter.isQueryParam = true; + codegenParameter.isAllowEmptyValue = parameter.getAllowEmptyValue() != null && parameter.getAllowEmptyValue(); } else if (parameter instanceof PathParameter || "path".equalsIgnoreCase(parameter.getIn())) { codegenParameter.required = true; codegenParameter.isPathParam = true; diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 941db12d9ab..80e6ff8e9de 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1097,6 +1097,12 @@ paths: additionalProperties: type: string format: string + - name: allowEmpty + in: query + required: true + allowEmptyValue: true + schema: + type: string responses: "200": description: Success diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 941db457ba7..f138a6abd27 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -1279,7 +1279,7 @@ No authorization required ## TestQueryParameterCollectionFormat -> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, Dictionary language = null) +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = null) @@ -1307,11 +1307,12 @@ namespace Example var http = new List(); // List | var url = new List(); // List | var context = new List(); // List | + var allowEmpty = allowEmpty_example; // string | var language = new Dictionary(); // Dictionary | (optional) try { - apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (ApiException e) { @@ -1334,6 +1335,7 @@ Name | Type | Description | Notes **http** | [**List<string>**](string.md)| | **url** | [**List<string>**](string.md)| | **context** | [**List<string>**](string.md)| | + **allowEmpty** | **string**| | **language** | [**Dictionary<string, string>**](string.md)| | [optional] ### Return type diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 8053bdf6b56..a5ee5003015 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -429,9 +429,10 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// - void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary)); + void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary)); /// /// @@ -445,9 +446,10 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// ApiResponse of Object(void) - ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary)); + ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary)); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -886,10 +888,11 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// Cancellation Token to cancel request (optional) /// Task of void - System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)); /// /// @@ -903,10 +906,11 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// Cancellation Token to cancel request (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)); #endregion Asynchronous Operations } @@ -3535,11 +3539,12 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// - public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary)) + public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary)) { - TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, language); + TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language); } /// @@ -3551,9 +3556,10 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// ApiResponse of Object(void) - public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary)) + public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary)) { // verify the required parameter 'pipe' is set if (pipe == null) @@ -3570,6 +3576,9 @@ namespace Org.OpenAPITools.Api // verify the required parameter 'context' is set if (context == null) throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'allowEmpty' is set + if (allowEmpty == null) + throw new ApiException(400, "Missing required parameter 'allowEmpty' when calling FakeApi->TestQueryParameterCollectionFormat"); var localVarPath = "/fake/test-query-parameters"; var localVarPathParams = new Dictionary(); @@ -3597,6 +3606,7 @@ namespace Org.OpenAPITools.Api if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter if (language != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "language", language)); // query parameter + if (allowEmpty != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "allowEmpty", allowEmpty)); // query parameter // make the HTTP request @@ -3626,12 +3636,13 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// Cancellation Token to cancel request (optional) /// Task of void - public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)) { - await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, language, cancellationToken); + await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, allowEmpty, language, cancellationToken); } @@ -3644,10 +3655,11 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// Cancellation Token to cancel request (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)) { // verify the required parameter 'pipe' is set if (pipe == null) @@ -3664,6 +3676,9 @@ namespace Org.OpenAPITools.Api // verify the required parameter 'context' is set if (context == null) throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'allowEmpty' is set + if (allowEmpty == null) + throw new ApiException(400, "Missing required parameter 'allowEmpty' when calling FakeApi->TestQueryParameterCollectionFormat"); var localVarPath = "/fake/test-query-parameters"; var localVarPathParams = new Dictionary(); @@ -3691,6 +3706,7 @@ namespace Org.OpenAPITools.Api if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter if (language != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "language", language)); // query parameter + if (allowEmpty != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "allowEmpty", allowEmpty)); // query parameter // make the HTTP request diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 428b2261e8a..8962b3b9439 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -527,6 +527,7 @@ defmodule OpenapiPetstore.Api.Fake do - http ([String.t]): - url ([String.t]): - context ([String.t]): + - allow_empty (String.t): - opts (KeywordList): [optional] Optional parameters - :language (%{optional(String.t) => String.t}): ## Returns @@ -534,8 +535,8 @@ defmodule OpenapiPetstore.Api.Fake do {:ok, nil} on success {:error, Tesla.Env.t} on failure """ - @spec test_query_parameter_collection_format(Tesla.Env.client, list(String.t), list(String.t), list(String.t), list(String.t), list(String.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def test_query_parameter_collection_format(connection, pipe, ioutil, http, url, context, opts \\ []) do + @spec test_query_parameter_collection_format(Tesla.Env.client, list(String.t), list(String.t), list(String.t), list(String.t), list(String.t), String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_query_parameter_collection_format(connection, pipe, ioutil, http, url, context, allow_empty, opts \\ []) do optional_params = %{ :"language" => :query } @@ -547,6 +548,7 @@ defmodule OpenapiPetstore.Api.Fake do |> add_param(:query, :"http", http) |> add_param(:query, :"url", url) |> add_param(:query, :"context", context) + |> add_param(:query, :"allowEmpty", allow_empty) |> add_optional_params(optional_params, opts) |> ensure_body() |> Enum.into([]) diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index d40c88329eb..69355993fb1 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1232,6 +1232,14 @@ paths: type: string type: object style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form responses: "200": description: Success diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index 2980e7a0050..85ef53e3695 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -438,13 +438,14 @@ public interface FakeApi extends ApiClient.Api { * @param http (required) * @param url (required) * @param context (required) + * @param allowEmpty (required) * @param language (optional) */ - @RequestLine("PUT /fake/test-query-parameters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}&language={language}") + @RequestLine("PUT /fake/test-query-parameters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}&language={language}&allowEmpty={allowEmpty}") @Headers({ "Accept: application/json", }) - void testQueryParameterCollectionFormat(@Param("pipe") List pipe, @Param("ioutil") List ioutil, @Param("http") List http, @Param("url") List url, @Param("context") List context, @Param("language") Map language); + void testQueryParameterCollectionFormat(@Param("pipe") List pipe, @Param("ioutil") List ioutil, @Param("http") List http, @Param("url") List url, @Param("context") List context, @Param("allowEmpty") String allowEmpty, @Param("language") Map language); /** * @@ -463,9 +464,10 @@ public interface FakeApi extends ApiClient.Api { *
  • url - (required)
  • *
  • context - (required)
  • *
  • language - (optional)
  • + *
  • allowEmpty - (required)
  • * */ - @RequestLine("PUT /fake/test-query-parameters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}&language={language}") + @RequestLine("PUT /fake/test-query-parameters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}&language={language}&allowEmpty={allowEmpty}") @Headers({ "Accept: application/json", }) @@ -500,5 +502,9 @@ public interface FakeApi extends ApiClient.Api { put("language", EncodingUtils.encode(value)); return this; } + public TestQueryParameterCollectionFormatQueryParams allowEmpty(final String value) { + put("allowEmpty", EncodingUtils.encode(value)); + return this; + } } } diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index d40c88329eb..69355993fb1 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1232,6 +1232,14 @@ paths: type: string type: object style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form responses: "200": description: Success diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index b4c92eb6a9c..c3ed83515d1 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -1132,7 +1132,7 @@ No authorization required ## testQueryParameterCollectionFormat -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -1159,9 +1159,10 @@ public class Example { List http = Arrays.asList(); // List | List url = Arrays.asList(); // List | List context = Arrays.asList(); // List | + String allowEmpty = "allowEmpty_example"; // String | Map language = new HashMap(); // Map | try { - apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); System.err.println("Status code: " + e.getCode()); @@ -1183,6 +1184,7 @@ Name | Type | Description | Notes **http** | [**List<String>**](String.md)| | **url** | [**List<String>**](String.md)| | **context** | [**List<String>**](String.md)| | + **allowEmpty** | **String**| | **language** | [**Map<String, String>**](String.md)| | [optional] ### Return type diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 87e7eba7d68..fdaa53623ef 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1016,10 +1016,11 @@ public class FakeApi { * @param http The http parameter * @param url The url parameter * @param context The context parameter + * @param allowEmpty The allowEmpty parameter * @param language The language parameter * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - private ResponseSpec testQueryParameterCollectionFormatRequestCreation(List pipe, List ioutil, List http, List url, List context, Map language) throws WebClientResponseException { + private ResponseSpec testQueryParameterCollectionFormatRequestCreation(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { @@ -1041,6 +1042,10 @@ public class FakeApi { if (context == null) { throw new WebClientResponseException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } + // verify the required parameter 'allowEmpty' is set + if (allowEmpty == null) { + throw new WebClientResponseException("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } // create path and map variables final Map pathParams = new HashMap(); @@ -1055,6 +1060,7 @@ public class FakeApi { queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "language", language)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "allowEmpty", allowEmpty)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -1076,16 +1082,17 @@ public class FakeApi { * @param http The http parameter * @param url The url parameter * @param context The context parameter + * @param allowEmpty The allowEmpty parameter * @param language The language parameter * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Map language) throws WebClientResponseException { + public Mono testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, language).bodyToMono(localVarReturnType); + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).bodyToMono(localVarReturnType); } - public Mono> testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, Map language) throws WebClientResponseException { + public Mono> testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, language).toEntity(localVarReturnType); + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).toEntity(localVarReturnType); } } diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index 487be0a0156..aa1af642c66 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/docs/FakeApi.md @@ -816,7 +816,7 @@ No authorization required ## testQueryParameterCollectionFormat -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts) @@ -833,10 +833,11 @@ let ioutil = ["null"]; // [String] | let http = ["null"]; // [String] | let url = ["null"]; // [String] | let context = ["null"]; // [String] | +let allowEmpty = "allowEmpty_example"; // String | let opts = { 'language': {key: "null"} // {String: String} | }; -apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts, (error, data, response) => { +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts, (error, data, response) => { if (error) { console.error(error); } else { @@ -855,6 +856,7 @@ Name | Type | Description | Notes **http** | [**[String]**](String.md)| | **url** | [**[String]**](String.md)| | **context** | [**[String]**](String.md)| | + **allowEmpty** | **String**| | **language** | [**{String: String}**](String.md)| | [optional] ### Return type diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index aad7170733f..521fa3347d0 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -786,11 +786,12 @@ export default class FakeApi { * @param {Array.} http * @param {Array.} url * @param {Array.} context + * @param {String} allowEmpty * @param {Object} opts Optional parameters * @param {Object.} opts.language * @param {module:api/FakeApi~testQueryParameterCollectionFormatCallback} callback The callback function, accepting three arguments: error, data, response */ - testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts, callback) { + testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts, callback) { opts = opts || {}; let postBody = null; // verify the required parameter 'pipe' is set @@ -813,6 +814,10 @@ export default class FakeApi { if (context === undefined || context === null) { throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); } + // verify the required parameter 'allowEmpty' is set + if (allowEmpty === undefined || allowEmpty === null) { + throw new Error("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat"); + } let pathParams = { }; @@ -822,7 +827,8 @@ export default class FakeApi { 'http': this.apiClient.buildCollectionParam(http, 'ssv'), 'url': this.apiClient.buildCollectionParam(url, 'csv'), 'context': this.apiClient.buildCollectionParam(context, 'multi'), - 'language': opts['language'] + 'language': opts['language'], + 'allowEmpty': allowEmpty }; let headerParams = { }; diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index 32b076e660f..ed68b81f16e 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md @@ -800,7 +800,7 @@ No authorization required ## testQueryParameterCollectionFormat -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts) @@ -817,10 +817,11 @@ let ioutil = ["null"]; // [String] | let http = ["null"]; // [String] | let url = ["null"]; // [String] | let context = ["null"]; // [String] | +let allowEmpty = "allowEmpty_example"; // String | let opts = { 'language': {key: "null"} // {String: String} | }; -apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts).then(() => { +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); @@ -838,6 +839,7 @@ Name | Type | Description | Notes **http** | [**[String]**](String.md)| | **url** | [**[String]**](String.md)| | **context** | [**[String]**](String.md)| | + **allowEmpty** | **String**| | **language** | [**{String: String}**](String.md)| | [optional] ### Return type diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index 465ce674147..fe69d0176d6 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -891,11 +891,12 @@ export default class FakeApi { * @param {Array.} http * @param {Array.} url * @param {Array.} context + * @param {String} allowEmpty * @param {Object} opts Optional parameters * @param {Object.} opts.language * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ - testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, opts) { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, opts) { opts = opts || {}; let postBody = null; // verify the required parameter 'pipe' is set @@ -918,6 +919,10 @@ export default class FakeApi { if (context === undefined || context === null) { throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); } + // verify the required parameter 'allowEmpty' is set + if (allowEmpty === undefined || allowEmpty === null) { + throw new Error("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat"); + } let pathParams = { }; @@ -927,7 +932,8 @@ export default class FakeApi { 'http': this.apiClient.buildCollectionParam(http, 'ssv'), 'url': this.apiClient.buildCollectionParam(url, 'csv'), 'context': this.apiClient.buildCollectionParam(context, 'multi'), - 'language': opts['language'] + 'language': opts['language'], + 'allowEmpty': allowEmpty }; let headerParams = { }; @@ -952,12 +958,13 @@ export default class FakeApi { * @param {Array.} http * @param {Array.} url * @param {Array.} context + * @param {String} allowEmpty * @param {Object} opts Optional parameters * @param {Object.} opts.language * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ - testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts) { - return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, opts) + testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts) { + return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, opts) .then(function(response_and_data) { return response_and_data.data; }); diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index b02655e1310..599921ab22d 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -813,7 +813,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context, language => $language) +> test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context, allow_empty => $allow_empty, language => $language) @@ -831,10 +831,11 @@ my $ioutil = [("null")]; # ARRAY[string] | my $http = [("null")]; # ARRAY[string] | my $url = [("null")]; # ARRAY[string] | my $context = [("null")]; # ARRAY[string] | +my $allow_empty = "allow_empty_example"; # string | my $language = ('key' => "null"}; # HASH[string,string] | eval { - $api_instance->test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context, language => $language); + $api_instance->test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context, allow_empty => $allow_empty, language => $language); }; if ($@) { warn "Exception when calling FakeApi->test_query_parameter_collection_format: $@\n"; @@ -850,6 +851,7 @@ Name | Type | Description | Notes **http** | [**ARRAY[string]**](string.md)| | **url** | [**ARRAY[string]**](string.md)| | **context** | [**ARRAY[string]**](string.md)| | + **allow_empty** | **string**| | **language** | [**HASH[string,string]**](string.md)| | [optional] ### Return type diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index 2aee9f3d800..f13af8a695a 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -1371,6 +1371,7 @@ sub test_json_form_data { # @param ARRAY[string] $http (required) # @param ARRAY[string] $url (required) # @param ARRAY[string] $context (required) +# @param string $allow_empty (required) # @param HASH[string,string] $language (optional) { my $params = { @@ -1399,6 +1400,11 @@ sub test_json_form_data { description => '', required => '1', }, + 'allow_empty' => { + data_type => 'string', + description => '', + required => '1', + }, 'language' => { data_type => 'HASH[string,string]', description => '', @@ -1441,6 +1447,11 @@ sub test_query_parameter_collection_format { croak("Missing the required parameter 'context' when calling test_query_parameter_collection_format"); } + # verify the required parameter 'allow_empty' is set + unless (exists $args{'allow_empty'}) { + croak("Missing the required parameter 'allow_empty' when calling test_query_parameter_collection_format"); + } + # parse inputs my $_resource_path = '/fake/test-query-parameters'; @@ -1486,6 +1497,11 @@ sub test_query_parameter_collection_format { $query_params->{'language'} = $self->{api_client}->to_query_value($args{'language'}); } + # query params + if ( exists $args{'allow_empty'}) { + $query_params->{'allowEmpty'} = $self->{api_client}->to_query_value($args{'allow_empty'}); + } + my $_body_data; # authentication setting, if any my $auth_settings = [qw()]; diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index f0eeb5f60a8..840d51e0678 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -972,7 +972,7 @@ No authorization required ## `testQueryParameterCollectionFormat()` ```php -testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $language) +testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $allow_empty, $language) ``` @@ -997,10 +997,11 @@ $ioutil = array('ioutil_example'); // string[] $http = array('http_example'); // string[] $url = array('url_example'); // string[] $context = array('context_example'); // string[] +$allow_empty = 'allow_empty_example'; // string $language = array('key' => 'language_example'); // array try { - $apiInstance->testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $language); + $apiInstance->testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); } catch (Exception $e) { echo 'Exception when calling FakeApi->testQueryParameterCollectionFormat: ', $e->getMessage(), PHP_EOL; } @@ -1015,6 +1016,7 @@ Name | Type | Description | Notes **http** | [**string[]**](../Model/string.md)| | **url** | [**string[]**](../Model/string.md)| | **context** | [**string[]**](../Model/string.md)| | + **allow_empty** | **string**| | **language** | [**array**](../Model/string.md)| | [optional] ### Return type diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index a221e69d85d..a4996ace418 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -4247,15 +4247,16 @@ class FakeApi * @param string[] $http http (required) * @param string[] $url url (required) * @param string[] $context context (required) + * @param string $allow_empty allow_empty (required) * @param array $language language (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { - $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $language); + $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); } /** @@ -4266,15 +4267,16 @@ class FakeApi * @param string[] $http (required) * @param string[] $url (required) * @param string[] $context (required) + * @param string $allow_empty (required) * @param array $language (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { - $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $language); + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); try { $options = $this->createHttpClientOption(); @@ -4321,14 +4323,15 @@ class FakeApi * @param string[] $http (required) * @param string[] $url (required) * @param string[] $context (required) + * @param string $allow_empty (required) * @param array $language (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { - return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $language) + return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language) ->then( function ($response) { return $response[0]; @@ -4344,15 +4347,16 @@ class FakeApi * @param string[] $http (required) * @param string[] $url (required) * @param string[] $context (required) + * @param string $allow_empty (required) * @param array $language (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { $returnType = ''; - $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $language); + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4385,12 +4389,13 @@ class FakeApi * @param string[] $http (required) * @param string[] $url (required) * @param string[] $context (required) + * @param string $allow_empty (required) * @param array $language (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { // verify the required parameter 'pipe' is set if ($pipe === null || (is_array($pipe) && count($pipe) === 0)) { @@ -4422,6 +4427,12 @@ class FakeApi 'Missing the required parameter $context when calling testQueryParameterCollectionFormat' ); } + // verify the required parameter 'allow_empty' is set + if ($allow_empty === null || (is_array($allow_empty) && count($allow_empty) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $allow_empty when calling testQueryParameterCollectionFormat' + ); + } $resourcePath = '/fake/test-query-parameters'; $formParams = []; @@ -4480,6 +4491,17 @@ class FakeApi $queryParams['language'] = $language; } } + // query params + if ($allow_empty !== null) { + if('form' === 'form' && is_array($allow_empty)) { + foreach($allow_empty as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['allowEmpty'] = $allow_empty; + } + } diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index b704e78f9d3..ae7fab93e5c 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -1115,7 +1115,7 @@ No authorization required ## test_query_parameter_collection_format -> test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts) +> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) @@ -1133,13 +1133,14 @@ ioutil = ['inner_example'] # Array | http = ['inner_example'] # Array | url = ['inner_example'] # Array | context = ['inner_example'] # Array | +allow_empty = 'allow_empty_example' # String | opts = { language: { key: 'inner_example'} # Hash | } begin - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts) + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) rescue Petstore::ApiError => e puts "Error when calling FakeApi->test_query_parameter_collection_format: #{e}" end @@ -1149,12 +1150,12 @@ end This returns an Array which contains the response data (`nil` in this case), status code and headers. -> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) +> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) ```ruby begin - data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) p status_code # => 2xx p headers # => { ... } p data # => nil @@ -1172,6 +1173,7 @@ end | **http** | [**Array<String>**](String.md) | | | | **url** | [**Array<String>**](String.md) | | | | **context** | [**Array<String>**](String.md) | | | +| **allow_empty** | **String** | | | | **language** | [**Hash<String, String>**](String.md) | | [optional] | ### Return type diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index a401da83042..62809e843cc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -1192,11 +1192,12 @@ module Petstore # @param http [Array] # @param url [Array] # @param context [Array] + # @param allow_empty [String] # @param [Hash] opts the optional parameters # @option opts [Hash] :language # @return [nil] - def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) - test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) nil end @@ -1206,10 +1207,11 @@ module Petstore # @param http [Array] # @param url [Array] # @param context [Array] + # @param allow_empty [String] # @param [Hash] opts the optional parameters # @option opts [Hash] :language # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' end @@ -1233,6 +1235,10 @@ module Petstore if @api_client.config.client_side_validation && context.nil? fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" end + # verify the required parameter 'allow_empty' is set + if @api_client.config.client_side_validation && allow_empty.nil? + fail ArgumentError, "Missing the required parameter 'allow_empty' when calling FakeApi.test_query_parameter_collection_format" + end # resource path local_var_path = '/fake/test-query-parameters' @@ -1243,6 +1249,7 @@ module Petstore query_params[:'http'] = @api_client.build_collection_param(http, :ssv) query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'context'] = @api_client.build_collection_param(context, :multi) + query_params[:'allowEmpty'] = allow_empty query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? # header parameters diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index b704e78f9d3..ae7fab93e5c 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -1115,7 +1115,7 @@ No authorization required ## test_query_parameter_collection_format -> test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts) +> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) @@ -1133,13 +1133,14 @@ ioutil = ['inner_example'] # Array | http = ['inner_example'] # Array | url = ['inner_example'] # Array | context = ['inner_example'] # Array | +allow_empty = 'allow_empty_example' # String | opts = { language: { key: 'inner_example'} # Hash | } begin - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts) + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) rescue Petstore::ApiError => e puts "Error when calling FakeApi->test_query_parameter_collection_format: #{e}" end @@ -1149,12 +1150,12 @@ end This returns an Array which contains the response data (`nil` in this case), status code and headers. -> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) +> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) ```ruby begin - data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) p status_code # => 2xx p headers # => { ... } p data # => nil @@ -1172,6 +1173,7 @@ end | **http** | [**Array<String>**](String.md) | | | | **url** | [**Array<String>**](String.md) | | | | **context** | [**Array<String>**](String.md) | | | +| **allow_empty** | **String** | | | | **language** | [**Hash<String, String>**](String.md) | | [optional] | ### Return type diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index a401da83042..62809e843cc 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -1192,11 +1192,12 @@ module Petstore # @param http [Array] # @param url [Array] # @param context [Array] + # @param allow_empty [String] # @param [Hash] opts the optional parameters # @option opts [Hash] :language # @return [nil] - def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) - test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) nil end @@ -1206,10 +1207,11 @@ module Petstore # @param http [Array] # @param url [Array] # @param context [Array] + # @param allow_empty [String] # @param [Hash] opts the optional parameters # @option opts [Hash] :language # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' end @@ -1233,6 +1235,10 @@ module Petstore if @api_client.config.client_side_validation && context.nil? fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" end + # verify the required parameter 'allow_empty' is set + if @api_client.config.client_side_validation && allow_empty.nil? + fail ArgumentError, "Missing the required parameter 'allow_empty' when calling FakeApi.test_query_parameter_collection_format" + end # resource path local_var_path = '/fake/test-query-parameters' @@ -1243,6 +1249,7 @@ module Petstore query_params[:'http'] = @api_client.build_collection_param(http, :ssv) query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'context'] = @api_client.build_collection_param(context, :multi) + query_params[:'allowEmpty'] = allow_empty query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? # header parameters diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index bc28b93eec1..19d5f89fce9 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -133,6 +133,7 @@ export interface TestQueryParameterCollectionFormatRequest { http: Array; url: Array; context: Array; + allowEmpty: string; language?: { [key: string]: string; }; } @@ -869,6 +870,10 @@ export class FakeApi extends runtime.BaseAPI { throw new runtime.RequiredError('context','Required parameter requestParameters.context was null or undefined when calling testQueryParameterCollectionFormat.'); } + if (requestParameters.allowEmpty === null || requestParameters.allowEmpty === undefined) { + throw new runtime.RequiredError('allowEmpty','Required parameter requestParameters.allowEmpty was null or undefined when calling testQueryParameterCollectionFormat.'); + } + const queryParameters: any = {}; if (requestParameters.pipe) { @@ -895,6 +900,10 @@ export class FakeApi extends runtime.BaseAPI { queryParameters['language'] = requestParameters.language; } + if (requestParameters.allowEmpty !== undefined) { + queryParameters['allowEmpty'] = requestParameters.allowEmpty; + } + const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md index ed94b4b79b1..544b6e316c3 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md @@ -761,7 +761,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -777,10 +777,11 @@ final BuiltList ioutil = ; // BuiltList | final BuiltList http = ; // BuiltList | final BuiltList url = ; // BuiltList | final BuiltList context = ; // BuiltList | +final String allowEmpty = allowEmpty_example; // String | final BuiltMap language = ; // BuiltMap | try { - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch on DioError (e) { print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } @@ -795,6 +796,7 @@ Name | Type | Description | Notes **http** | [**BuiltList<String>**](String.md)| | **url** | [**BuiltList<String>**](String.md)| | **context** | [**BuiltList<String>**](String.md)| | + **allowEmpty** | **String**| | **language** | [**BuiltMap<String, String>**](String.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/api/fake_api.dart index 22a2d4706fe..d600aba3181 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -1353,6 +1353,7 @@ class FakeApi { /// * [http] /// * [url] /// * [context] + /// * [allowEmpty] /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request @@ -1369,6 +1370,7 @@ class FakeApi { required BuiltList http, required BuiltList url, required BuiltList context, + required String allowEmpty, BuiltMap? language, CancelToken? cancelToken, Map? headers, @@ -1397,6 +1399,7 @@ class FakeApi { r'url': encodeCollectionQueryParameter(_serializers, url, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), r'context': encodeCollectionQueryParameter(_serializers, context, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), if (language != null) r'language': encodeQueryParameter(_serializers, language, const FullType(BuiltMap, [FullType(String), FullType(String)]), ), + r'allowEmpty': encodeQueryParameter(_serializers, allowEmpty, const FullType(String)), }; final _response = await _dio.request( diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md index 9e9fee11ef4..ddd5068fa40 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md @@ -761,7 +761,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -777,10 +777,11 @@ var ioutil = []; // BuiltList | var http = []; // BuiltList | var url = []; // BuiltList | var context = []; // BuiltList | +var allowEmpty = allowEmpty_example; // String | var language = ; // BuiltMap | try { - api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (e) { print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } @@ -795,6 +796,7 @@ Name | Type | Description | Notes **http** | [**BuiltList**](String.md)| | **url** | [**BuiltList**](String.md)| | **context** | [**BuiltList**](String.md)| | + **allowEmpty** | **String**| | **language** | [**BuiltMap**](String.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart index 98444a81c25..6df5299a477 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart @@ -891,7 +891,8 @@ class FakeApi { BuiltList ioutil, BuiltList http, BuiltList url, - BuiltList context, { + BuiltList context, + String allowEmpty, { BuiltMap language, CancelToken cancelToken, Map headers, @@ -913,6 +914,7 @@ class FakeApi { r'url': url, r'context': context, if (language != null) r'language': language, + r'allowEmpty': allowEmpty, }, extra: { 'secure': >[], diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md index 2b8a068b46d..3f4460fa623 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md @@ -761,7 +761,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -777,10 +777,11 @@ final ioutil = []; // List | final http = []; // List | final url = []; // List | final context = []; // List | +final allowEmpty = allowEmpty_example; // String | final language = ; // Map | try { - api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (e) { print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } @@ -795,6 +796,7 @@ Name | Type | Description | Notes **http** | [**List**](String.md)| | [default to const []] **url** | [**List**](String.md)| | [default to const []] **context** | [**List**](String.md)| | [default to const []] + **allowEmpty** | **String**| | **language** | [**Map**](String.md)| | [optional] [default to const {}] ### Return type diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart index 7d6048e41f7..d33a5697d31 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart @@ -1177,8 +1177,10 @@ class FakeApi { /// /// * [List] context (required): /// + /// * [String] allowEmpty (required): + /// /// * [Map] language: - Future testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, { Map language }) async { + Future testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async { // Verify required params are set. if (pipe == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: pipe'); @@ -1195,6 +1197,9 @@ class FakeApi { if (context == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: context'); } + if (allowEmpty == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: allowEmpty'); + } final path = r'/fake/test-query-parameters'; @@ -1212,6 +1217,7 @@ class FakeApi { if (language != null) { queryParams.addAll(_convertParametersForCollectionFormat('', 'language', language)); } + queryParams.addAll(_convertParametersForCollectionFormat('', 'allowEmpty', allowEmpty)); final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; @@ -1244,9 +1250,11 @@ class FakeApi { /// /// * [List] context (required): /// + /// * [String] allowEmpty (required): + /// /// * [Map] language: - Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, { Map language }) async { - final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, language: language ); + Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async { + final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language: language ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md index 2b8a068b46d..3f4460fa623 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md @@ -761,7 +761,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -777,10 +777,11 @@ final ioutil = []; // List | final http = []; // List | final url = []; // List | final context = []; // List | +final allowEmpty = allowEmpty_example; // String | final language = ; // Map | try { - api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (e) { print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } @@ -795,6 +796,7 @@ Name | Type | Description | Notes **http** | [**List**](String.md)| | [default to const []] **url** | [**List**](String.md)| | [default to const []] **context** | [**List**](String.md)| | [default to const []] + **allowEmpty** | **String**| | **language** | [**Map**](String.md)| | [optional] [default to const {}] ### Return type diff --git a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api/fake_api.dart index 0fdbd57ab88..3a1d5162364 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api/fake_api.dart @@ -1184,8 +1184,10 @@ class FakeApi { /// /// * [List] context (required): /// + /// * [String] allowEmpty (required): + /// /// * [Map] language: - Future testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, { Map language }) async { + Future testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async { // Verify required params are set. if (pipe == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: pipe'); @@ -1202,6 +1204,9 @@ class FakeApi { if (context == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: context'); } + if (allowEmpty == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: allowEmpty'); + } final path = r'/fake/test-query-parameters'; @@ -1219,6 +1224,7 @@ class FakeApi { if (language != null) { queryParams.addAll(_convertParametersForCollectionFormat('', 'language', language)); } + queryParams.addAll(_convertParametersForCollectionFormat('', 'allowEmpty', allowEmpty)); final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; @@ -1251,9 +1257,11 @@ class FakeApi { /// /// * [List] context (required): /// + /// * [String] allowEmpty (required): + /// /// * [Map] language: - Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, { Map language }) async { - final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, language: language ); + Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async { + final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language: language ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md index 991a48e56c6..0bf51adc9e5 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md @@ -1130,7 +1130,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe, ioutil, http, url, context, language=language) +> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language) @@ -1160,10 +1160,11 @@ ioutil = ['ioutil_example'] # list[str] | http = ['http_example'] # list[str] | url = ['url_example'] # list[str] | context = ['context_example'] # list[str] | +allow_empty = 'allow_empty_example' # str | language = {'key': 'language_example'} # dict(str, str) | (optional) try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, language=language) + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language) except ApiException as e: print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) ``` @@ -1177,6 +1178,7 @@ Name | Type | Description | Notes **http** | [**list[str]**](str.md)| | **url** | [**list[str]**](str.md)| | **context** | [**list[str]**](str.md)| | + **allow_empty** | **str**| | **language** | [**dict(str, str)**](str.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py index 90606ec5aea..7de994ea565 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -2415,14 +2415,14 @@ class FakeApi(object): collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth')) - def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, allow_empty, **kwargs): # noqa: E501 """test_query_parameter_collection_format # noqa: E501 To test the collection format in query parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, async_req=True) >>> result = thread.get() :param pipe: (required) @@ -2435,6 +2435,8 @@ class FakeApi(object): :type url: list[str] :param context: (required) :type context: list[str] + :param allow_empty: (required) + :type allow_empty: str :param language: :type language: dict(str, str) :param async_req: Whether to execute the request asynchronously. @@ -2453,16 +2455,16 @@ class FakeApi(object): :rtype: None """ kwargs['_return_http_data_only'] = True - return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, **kwargs) # noqa: E501 - def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, allow_empty, **kwargs): # noqa: E501 """test_query_parameter_collection_format # noqa: E501 To test the collection format in query parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) + >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, async_req=True) >>> result = thread.get() :param pipe: (required) @@ -2475,6 +2477,8 @@ class FakeApi(object): :type url: list[str] :param context: (required) :type context: list[str] + :param allow_empty: (required) + :type allow_empty: str :param language: :type language: dict(str, str) :param async_req: Whether to execute the request asynchronously. @@ -2508,6 +2512,7 @@ class FakeApi(object): 'http', 'url', 'context', + 'allow_empty', 'language' ] all_params.extend( @@ -2548,6 +2553,10 @@ class FakeApi(object): if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501 local_var_params['context'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'allow_empty' is set + if self.api_client.client_side_validation and ('allow_empty' not in local_var_params or # noqa: E501 + local_var_params['allow_empty'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `allow_empty` when calling `test_query_parameter_collection_format`") # noqa: E501 collection_formats = {} @@ -2571,6 +2580,8 @@ class FakeApi(object): collection_formats['context'] = 'multi' # noqa: E501 if 'language' in local_var_params and local_var_params['language'] is not None: # noqa: E501 query_params.append(('language', local_var_params['language'])) # noqa: E501 + if 'allow_empty' in local_var_params and local_var_params['allow_empty'] is not None: # noqa: E501 + query_params.append(('allowEmpty', local_var_params['allow_empty'])) # noqa: E501 header_params = {} diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 1e871d737c6..977a1d06f70 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -275,9 +275,9 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@ApiParam(value = "") @QueryParam("language") @Valid Map language,@Context SecurityContext securityContext) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@ApiParam(value = "", required = true) @QueryParam("allowEmpty") @NotNull String allowEmpty,@ApiParam(value = "") @QueryParam("language") @Valid Map language,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language, securityContext); + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, securityContext); } @POST @Path("/{petId}/uploadImageWithRequiredFile") diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java index 8eb7c460c97..1b48df160ff 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java @@ -44,6 +44,6 @@ public abstract class FakeApiService { public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup, @NotNull Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group,Integer stringGroup,Boolean booleanGroup,Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; - public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context,Map language,SecurityContext securityContext) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, @NotNull String allowEmpty,Map language,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,FormDataBodyPart requiredFileBodypart,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 72a21a6db06..68be0aeef19 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -109,7 +109,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, Map language, SecurityContext securityContext) throws NotFoundException { + public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, @NotNull String allowEmpty, Map language, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index d742f4cf6db..c6c58dfdb98 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -554,6 +554,11 @@ class FakeController extends Controller } $context = $input['context']; + if (!isset($input['allowEmpty'])) { + throw new \InvalidArgumentException('Missing the required parameter $allowEmpty when calling testQueryParameterCollectionFormat'); + } + $allowEmpty = $input['allowEmpty']; + $language = $input['language']; diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index b431d00ab5e..8d417ce34db 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -550,6 +550,11 @@ class FakeApi extends Controller } $context = $input['context']; + if (!isset($input['allow_empty'])) { + throw new \InvalidArgumentException('Missing the required parameter $allow_empty when calling testQueryParameterCollectionFormat'); + } + $allow_empty = $input['allow_empty']; + $language = $input['language']; From 1da6c223e69d8aea6a5fc51b610f0db30258b7ee Mon Sep 17 00:00:00 2001 From: Jimi Steidl Date: Fri, 3 Sep 2021 14:27:58 +0200 Subject: [PATCH 11/75] Fix condition bug in dart-dio-next OauthInterceptor (#10317) --- .../dart/libraries/dio/auth/oauth.mustache | 2 +- .../petstore_client_lib_fake/README.md | 174 +++++++++--------- .../lib/src/auth/oauth.dart | 2 +- 3 files changed, 89 insertions(+), 89 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache index 05a8c3a5745..4f7b79655af 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache @@ -10,7 +10,7 @@ class OAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' && secure['type'] == 'oauth2'); + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/README.md index 52553e236b0..d92d866edcb 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/README.md @@ -64,97 +64,97 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | -[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user -[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +[*AnotherFakeApi*](doc\AnotherFakeApi.md) | [**call123testSpecialTags**](doc\AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +[*DefaultApi*](doc\DefaultApi.md) | [**fooGet**](doc\DefaultApi.md#fooget) | **GET** /foo | +[*FakeApi*](doc\FakeApi.md) | [**fakeHealthGet**](doc\FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[*FakeApi*](doc\FakeApi.md) | [**fakeHttpSignatureTest**](doc\FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[*FakeApi*](doc\FakeApi.md) | [**fakeOuterBooleanSerialize**](doc\FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[*FakeApi*](doc\FakeApi.md) | [**fakeOuterCompositeSerialize**](doc\FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[*FakeApi*](doc\FakeApi.md) | [**fakeOuterNumberSerialize**](doc\FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[*FakeApi*](doc\FakeApi.md) | [**fakeOuterStringSerialize**](doc\FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[*FakeApi*](doc\FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc\FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[*FakeApi*](doc\FakeApi.md) | [**testBodyWithBinary**](doc\FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[*FakeApi*](doc\FakeApi.md) | [**testBodyWithFileSchema**](doc\FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[*FakeApi*](doc\FakeApi.md) | [**testBodyWithQueryParams**](doc\FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[*FakeApi*](doc\FakeApi.md) | [**testClientModel**](doc\FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[*FakeApi*](doc\FakeApi.md) | [**testEndpointParameters**](doc\FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[*FakeApi*](doc\FakeApi.md) | [**testEnumParameters**](doc\FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[*FakeApi*](doc\FakeApi.md) | [**testGroupParameters**](doc\FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[*FakeApi*](doc\FakeApi.md) | [**testInlineAdditionalProperties**](doc\FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[*FakeApi*](doc\FakeApi.md) | [**testJsonFormData**](doc\FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[*FakeApi*](doc\FakeApi.md) | [**testQueryParameterCollectionFormat**](doc\FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[*FakeClassnameTags123Api*](doc\FakeClassnameTags123Api.md) | [**testClassname**](doc\FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +[*PetApi*](doc\PetApi.md) | [**addPet**](doc\PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[*PetApi*](doc\PetApi.md) | [**deletePet**](doc\PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[*PetApi*](doc\PetApi.md) | [**findPetsByStatus**](doc\PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[*PetApi*](doc\PetApi.md) | [**findPetsByTags**](doc\PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[*PetApi*](doc\PetApi.md) | [**getPetById**](doc\PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[*PetApi*](doc\PetApi.md) | [**updatePet**](doc\PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[*PetApi*](doc\PetApi.md) | [**updatePetWithForm**](doc\PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[*PetApi*](doc\PetApi.md) | [**uploadFile**](doc\PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[*PetApi*](doc\PetApi.md) | [**uploadFileWithRequiredFile**](doc\PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[*StoreApi*](doc\StoreApi.md) | [**deleteOrder**](doc\StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[*StoreApi*](doc\StoreApi.md) | [**getInventory**](doc\StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[*StoreApi*](doc\StoreApi.md) | [**getOrderById**](doc\StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[*StoreApi*](doc\StoreApi.md) | [**placeOrder**](doc\StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +[*UserApi*](doc\UserApi.md) | [**createUser**](doc\UserApi.md#createuser) | **POST** /user | Create user +[*UserApi*](doc\UserApi.md) | [**createUsersWithArrayInput**](doc\UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[*UserApi*](doc\UserApi.md) | [**createUsersWithListInput**](doc\UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[*UserApi*](doc\UserApi.md) | [**deleteUser**](doc\UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[*UserApi*](doc\UserApi.md) | [**getUserByName**](doc\UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[*UserApi*](doc\UserApi.md) | [**loginUser**](doc\UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[*UserApi*](doc\UserApi.md) | [**logoutUser**](doc\UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[*UserApi*](doc\UserApi.md) | [**updateUser**](doc\UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) - - [Animal](doc/Animal.md) - - [ApiResponse](doc/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) - - [ArrayTest](doc/ArrayTest.md) - - [Capitalization](doc/Capitalization.md) - - [Cat](doc/Cat.md) - - [CatAllOf](doc/CatAllOf.md) - - [Category](doc/Category.md) - - [ClassModel](doc/ClassModel.md) - - [DeprecatedObject](doc/DeprecatedObject.md) - - [Dog](doc/Dog.md) - - [DogAllOf](doc/DogAllOf.md) - - [EnumArrays](doc/EnumArrays.md) - - [EnumTest](doc/EnumTest.md) - - [FileSchemaTestClass](doc/FileSchemaTestClass.md) - - [Foo](doc/Foo.md) - - [FormatTest](doc/FormatTest.md) - - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) - - [HealthCheckResult](doc/HealthCheckResult.md) - - [InlineResponseDefault](doc/InlineResponseDefault.md) - - [MapTest](doc/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](doc/Model200Response.md) - - [ModelClient](doc/ModelClient.md) - - [ModelEnumClass](doc/ModelEnumClass.md) - - [ModelFile](doc/ModelFile.md) - - [ModelList](doc/ModelList.md) - - [ModelReturn](doc/ModelReturn.md) - - [Name](doc/Name.md) - - [NullableClass](doc/NullableClass.md) - - [NumberOnly](doc/NumberOnly.md) - - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) - - [Order](doc/Order.md) - - [OuterComposite](doc/OuterComposite.md) - - [OuterEnum](doc/OuterEnum.md) - - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) - - [OuterEnumInteger](doc/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) - - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) - - [Pet](doc/Pet.md) - - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - - [SpecialModelName](doc/SpecialModelName.md) - - [Tag](doc/Tag.md) - - [User](doc/User.md) + - [AdditionalPropertiesClass](doc\AdditionalPropertiesClass.md) + - [Animal](doc\Animal.md) + - [ApiResponse](doc\ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](doc\ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc\ArrayOfNumberOnly.md) + - [ArrayTest](doc\ArrayTest.md) + - [Capitalization](doc\Capitalization.md) + - [Cat](doc\Cat.md) + - [CatAllOf](doc\CatAllOf.md) + - [Category](doc\Category.md) + - [ClassModel](doc\ClassModel.md) + - [DeprecatedObject](doc\DeprecatedObject.md) + - [Dog](doc\Dog.md) + - [DogAllOf](doc\DogAllOf.md) + - [EnumArrays](doc\EnumArrays.md) + - [EnumTest](doc\EnumTest.md) + - [FileSchemaTestClass](doc\FileSchemaTestClass.md) + - [Foo](doc\Foo.md) + - [FormatTest](doc\FormatTest.md) + - [HasOnlyReadOnly](doc\HasOnlyReadOnly.md) + - [HealthCheckResult](doc\HealthCheckResult.md) + - [InlineResponseDefault](doc\InlineResponseDefault.md) + - [MapTest](doc\MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](doc\MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](doc\Model200Response.md) + - [ModelClient](doc\ModelClient.md) + - [ModelEnumClass](doc\ModelEnumClass.md) + - [ModelFile](doc\ModelFile.md) + - [ModelList](doc\ModelList.md) + - [ModelReturn](doc\ModelReturn.md) + - [Name](doc\Name.md) + - [NullableClass](doc\NullableClass.md) + - [NumberOnly](doc\NumberOnly.md) + - [ObjectWithDeprecatedFields](doc\ObjectWithDeprecatedFields.md) + - [Order](doc\Order.md) + - [OuterComposite](doc\OuterComposite.md) + - [OuterEnum](doc\OuterEnum.md) + - [OuterEnumDefaultValue](doc\OuterEnumDefaultValue.md) + - [OuterEnumInteger](doc\OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](doc\OuterEnumIntegerDefaultValue.md) + - [OuterObjectWithEnumProperty](doc\OuterObjectWithEnumProperty.md) + - [Pet](doc\Pet.md) + - [ReadOnlyFirst](doc\ReadOnlyFirst.md) + - [SpecialModelName](doc\SpecialModelName.md) + - [Tag](doc\Tag.md) + - [User](doc\User.md) ## Documentation For Authorization diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/auth/oauth.dart index 0d7901b764c..337cf762b0c 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/auth/oauth.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/auth/oauth.dart @@ -13,7 +13,7 @@ class OAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' && secure['type'] == 'oauth2'); + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { From d8d5709b8b048b8eeb68f17024ef02a635584d80 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 3 Sep 2021 20:36:36 +0800 Subject: [PATCH 12/75] update samples --- .../petstore_client_lib_fake/README.md | 174 +++++++++--------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/README.md index d92d866edcb..52553e236b0 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/README.md @@ -64,97 +64,97 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -[*AnotherFakeApi*](doc\AnotherFakeApi.md) | [**call123testSpecialTags**](doc\AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -[*DefaultApi*](doc\DefaultApi.md) | [**fooGet**](doc\DefaultApi.md#fooget) | **GET** /foo | -[*FakeApi*](doc\FakeApi.md) | [**fakeHealthGet**](doc\FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[*FakeApi*](doc\FakeApi.md) | [**fakeHttpSignatureTest**](doc\FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -[*FakeApi*](doc\FakeApi.md) | [**fakeOuterBooleanSerialize**](doc\FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[*FakeApi*](doc\FakeApi.md) | [**fakeOuterCompositeSerialize**](doc\FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[*FakeApi*](doc\FakeApi.md) | [**fakeOuterNumberSerialize**](doc\FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[*FakeApi*](doc\FakeApi.md) | [**fakeOuterStringSerialize**](doc\FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[*FakeApi*](doc\FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc\FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | -[*FakeApi*](doc\FakeApi.md) | [**testBodyWithBinary**](doc\FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | -[*FakeApi*](doc\FakeApi.md) | [**testBodyWithFileSchema**](doc\FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[*FakeApi*](doc\FakeApi.md) | [**testBodyWithQueryParams**](doc\FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[*FakeApi*](doc\FakeApi.md) | [**testClientModel**](doc\FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[*FakeApi*](doc\FakeApi.md) | [**testEndpointParameters**](doc\FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[*FakeApi*](doc\FakeApi.md) | [**testEnumParameters**](doc\FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -[*FakeApi*](doc\FakeApi.md) | [**testGroupParameters**](doc\FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[*FakeApi*](doc\FakeApi.md) | [**testInlineAdditionalProperties**](doc\FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[*FakeApi*](doc\FakeApi.md) | [**testJsonFormData**](doc\FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[*FakeApi*](doc\FakeApi.md) | [**testQueryParameterCollectionFormat**](doc\FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -[*FakeClassnameTags123Api*](doc\FakeClassnameTags123Api.md) | [**testClassname**](doc\FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -[*PetApi*](doc\PetApi.md) | [**addPet**](doc\PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[*PetApi*](doc\PetApi.md) | [**deletePet**](doc\PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[*PetApi*](doc\PetApi.md) | [**findPetsByStatus**](doc\PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[*PetApi*](doc\PetApi.md) | [**findPetsByTags**](doc\PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[*PetApi*](doc\PetApi.md) | [**getPetById**](doc\PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[*PetApi*](doc\PetApi.md) | [**updatePet**](doc\PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[*PetApi*](doc\PetApi.md) | [**updatePetWithForm**](doc\PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[*PetApi*](doc\PetApi.md) | [**uploadFile**](doc\PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[*PetApi*](doc\PetApi.md) | [**uploadFileWithRequiredFile**](doc\PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -[*StoreApi*](doc\StoreApi.md) | [**deleteOrder**](doc\StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[*StoreApi*](doc\StoreApi.md) | [**getInventory**](doc\StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[*StoreApi*](doc\StoreApi.md) | [**getOrderById**](doc\StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -[*StoreApi*](doc\StoreApi.md) | [**placeOrder**](doc\StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -[*UserApi*](doc\UserApi.md) | [**createUser**](doc\UserApi.md#createuser) | **POST** /user | Create user -[*UserApi*](doc\UserApi.md) | [**createUsersWithArrayInput**](doc\UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[*UserApi*](doc\UserApi.md) | [**createUsersWithListInput**](doc\UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[*UserApi*](doc\UserApi.md) | [**deleteUser**](doc\UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[*UserApi*](doc\UserApi.md) | [**getUserByName**](doc\UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[*UserApi*](doc\UserApi.md) | [**loginUser**](doc\UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[*UserApi*](doc\UserApi.md) | [**logoutUser**](doc\UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[*UserApi*](doc\UserApi.md) | [**updateUser**](doc\UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | +[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user +[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [AdditionalPropertiesClass](doc\AdditionalPropertiesClass.md) - - [Animal](doc\Animal.md) - - [ApiResponse](doc\ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](doc\ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](doc\ArrayOfNumberOnly.md) - - [ArrayTest](doc\ArrayTest.md) - - [Capitalization](doc\Capitalization.md) - - [Cat](doc\Cat.md) - - [CatAllOf](doc\CatAllOf.md) - - [Category](doc\Category.md) - - [ClassModel](doc\ClassModel.md) - - [DeprecatedObject](doc\DeprecatedObject.md) - - [Dog](doc\Dog.md) - - [DogAllOf](doc\DogAllOf.md) - - [EnumArrays](doc\EnumArrays.md) - - [EnumTest](doc\EnumTest.md) - - [FileSchemaTestClass](doc\FileSchemaTestClass.md) - - [Foo](doc\Foo.md) - - [FormatTest](doc\FormatTest.md) - - [HasOnlyReadOnly](doc\HasOnlyReadOnly.md) - - [HealthCheckResult](doc\HealthCheckResult.md) - - [InlineResponseDefault](doc\InlineResponseDefault.md) - - [MapTest](doc\MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](doc\MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](doc\Model200Response.md) - - [ModelClient](doc\ModelClient.md) - - [ModelEnumClass](doc\ModelEnumClass.md) - - [ModelFile](doc\ModelFile.md) - - [ModelList](doc\ModelList.md) - - [ModelReturn](doc\ModelReturn.md) - - [Name](doc\Name.md) - - [NullableClass](doc\NullableClass.md) - - [NumberOnly](doc\NumberOnly.md) - - [ObjectWithDeprecatedFields](doc\ObjectWithDeprecatedFields.md) - - [Order](doc\Order.md) - - [OuterComposite](doc\OuterComposite.md) - - [OuterEnum](doc\OuterEnum.md) - - [OuterEnumDefaultValue](doc\OuterEnumDefaultValue.md) - - [OuterEnumInteger](doc\OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](doc\OuterEnumIntegerDefaultValue.md) - - [OuterObjectWithEnumProperty](doc\OuterObjectWithEnumProperty.md) - - [Pet](doc\Pet.md) - - [ReadOnlyFirst](doc\ReadOnlyFirst.md) - - [SpecialModelName](doc\SpecialModelName.md) - - [Tag](doc\Tag.md) - - [User](doc\User.md) + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [CatAllOf](doc/CatAllOf.md) + - [Category](doc/Category.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [DogAllOf](doc/DogAllOf.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FormatTest](doc/FormatTest.md) + - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) + - [HealthCheckResult](doc/HealthCheckResult.md) + - [InlineResponseDefault](doc/InlineResponseDefault.md) + - [MapTest](doc/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](doc/Model200Response.md) + - [ModelClient](doc/ModelClient.md) + - [ModelEnumClass](doc/ModelEnumClass.md) + - [ModelFile](doc/ModelFile.md) + - [ModelList](doc/ModelList.md) + - [ModelReturn](doc/ModelReturn.md) + - [Name](doc/Name.md) + - [NullableClass](doc/NullableClass.md) + - [NumberOnly](doc/NumberOnly.md) + - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) + - [Order](doc/Order.md) + - [OuterComposite](doc/OuterComposite.md) + - [OuterEnum](doc/OuterEnum.md) + - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) + - [OuterEnumInteger](doc/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) + - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) + - [Pet](doc/Pet.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [User](doc/User.md) ## Documentation For Authorization From ae88cf14dae6404beeb7efb8ba881ea86c12f37c Mon Sep 17 00:00:00 2001 From: bflaton <6792453+bflaton@users.noreply.github.com> Date: Tue, 7 Sep 2021 00:01:33 +0200 Subject: [PATCH 13/75] Updated template so that generated code now renders docstrings and function parameters nicely in IDE. (#10331) Endpoints are still accessible in generated code, mainly to satisfy some test cases. --- .../src/main/resources/python/api.mustache | 199 +- .../petstore_api/api/another_fake_api.py | 139 +- .../python/petstore_api/api/fake_api.py | 2275 +++++----- .../api/fake_classname_tags_123_api.py | 139 +- .../python/petstore_api/api/pet_api.py | 1253 +++--- .../python/petstore_api/api/store_api.py | 541 ++- .../python/petstore_api/api/user_api.py | 1101 +++-- .../petstore/python/test/test_fake_api.py | 20 +- .../petstore_api/api/another_fake_api.py | 139 +- .../petstore_api/api/fake_api.py | 2275 +++++----- .../api/fake_classname_tags_123_api.py | 139 +- .../petstore_api/api/pet_api.py | 1253 +++--- .../petstore_api/api/store_api.py | 541 ++- .../petstore_api/api/user_api.py | 1101 +++-- .../test/test_fake_api.py | 20 +- .../python/x_auth_id_alias/api/usage_api.py | 513 ++- .../python/dynamic_servers/api/usage_api.py | 257 +- .../petstore_api/api/another_fake_api.py | 139 +- .../python/petstore_api/api/default_api.py | 127 +- .../python/petstore_api/api/fake_api.py | 3709 ++++++++--------- .../api/fake_classname_tags_123_api.py | 139 +- .../python/petstore_api/api/pet_api.py | 965 +++-- .../python/petstore_api/api/store_api.py | 541 ++- .../python/petstore_api/api/user_api.py | 1101 +++-- 24 files changed, 9192 insertions(+), 9434 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 573224455a9..841ac8bb855 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -18,7 +18,6 @@ from {{packageName}}.model_utils import ( # noqa: F401 {{/imports}} -{{#operations}} class {{classname}}(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -30,102 +29,9 @@ class {{classname}}(object): if api_client is None: api_client = ApiClient() self.api_client = api_client +{{#operations}} {{#operation}} - - def __{{operationId}}( - self, -{{#requiredParams}} -{{^defaultValue}} - {{paramName}}, -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}}={{{defaultValue}}}, -{{/defaultValue}} -{{/requiredParams}} - **kwargs - ): - """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{.}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) - >>> result = thread.get() - -{{#requiredParams}} -{{#-last}} - Args: -{{/-last}} -{{/requiredParams}} -{{#requiredParams}} -{{^defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}] -{{/defaultValue}} -{{/requiredParams}} - - Keyword Args:{{#optionalParams}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}{{/optionalParams}} - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {{returnType}}{{^returnType}}None{{/returnType}} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') -{{#requiredParams}} - kwargs['{{paramName}}'] = \ - {{paramName}} -{{/requiredParams}} - return self.call_with_http_info(**kwargs) - - self.{{operationId}} = _Endpoint( + self.{{operationId}}_endpoint = _Endpoint( settings={ 'response_type': {{#returnType}}({{{.}}},){{/returnType}}{{^returnType}}None{{/returnType}}, {{#authMethods}} @@ -299,8 +205,105 @@ class {{classname}}(object): 'content_type': [], {{/hasConsumes}} }, - api_client=api_client, - callable=__{{operationId}} + api_client=api_client ) {{/operation}} {{/operations}} + +{{#operations}} +{{#operation}} + def {{operationId}}( + self, +{{#requiredParams}} +{{^defaultValue}} + {{paramName}}, +{{/defaultValue}} +{{/requiredParams}} +{{#requiredParams}} +{{#defaultValue}} + {{paramName}}={{{defaultValue}}}, +{{/defaultValue}} +{{/requiredParams}} + **kwargs + ): + """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + +{{#notes}} + {{{.}}} # noqa: E501 +{{/notes}} + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) + >>> result = thread.get() + +{{#requiredParams}} +{{#-last}} + Args: +{{/-last}} +{{/requiredParams}} +{{#requiredParams}} +{{^defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{{.}}}{{/description}} +{{/defaultValue}} +{{/requiredParams}} +{{#requiredParams}} +{{#defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}] +{{/defaultValue}} +{{/requiredParams}} + + Keyword Args:{{#optionalParams}} + {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}{{/optionalParams}} + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {{returnType}}{{^returnType}}None{{/returnType}} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') +{{#requiredParams}} + kwargs['{{paramName}}'] = \ + {{paramName}} +{{/requiredParams}} + return self.{{operationId}}_endpoint.call_with_http_info(**kwargs) + +{{/operation}} +{{/operations}} diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index 3a4931f84d4..2ae65760a36 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -35,74 +35,7 @@ class AnotherFakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __call_123_test_special_tags( - self, - body, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.call_123_test_special_tags = _Endpoint( + self.call_123_test_special_tags_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -150,6 +83,72 @@ class AnotherFakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__call_123_test_special_tags + api_client=api_client ) + + def call_123_test_special_tags( + self, + body, + **kwargs + ): + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.call_123_test_special_tags(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index d821febabed..4afa17e3cb2 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -42,70 +42,7 @@ class FakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.array_model = _Endpoint( + self.array_model_endpoint = _Endpoint( settings={ 'response_type': (AnimalFarm,), 'auth': [], @@ -149,73 +86,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__array_model + api_client=api_client ) - - def __boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.boolean = _Endpoint( + self.boolean_endpoint = _Endpoint( settings={ 'response_type': (bool,), 'auth': [], @@ -259,77 +132,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__boolean + api_client=api_client ) - - def __create_xml_item( - self, - xml_item, - **kwargs - ): - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - Args: - xml_item (XmlItem): XmlItem Body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['xml_item'] = \ - xml_item - return self.call_with_http_info(**kwargs) - - self.create_xml_item = _Endpoint( + self.create_xml_item_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -380,73 +185,9 @@ class FakeApi(object): 'text/xml; charset=utf-16' ] }, - api_client=api_client, - callable=__create_xml_item + api_client=api_client ) - - def __number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.number_with_validations = _Endpoint( + self.number_with_validations_endpoint = _Endpoint( settings={ 'response_type': (NumberWithValidations,), 'auth': [], @@ -490,73 +231,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__number_with_validations + api_client=api_client ) - - def __object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.object_model_with_ref_props = _Endpoint( + self.object_model_with_ref_props_endpoint = _Endpoint( settings={ 'response_type': (ObjectModelWithRefProps,), 'auth': [], @@ -600,73 +277,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__object_model_with_ref_props + api_client=api_client ) - - def __string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.string = _Endpoint( + self.string_endpoint = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -710,73 +323,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__string + api_client=api_client ) - - def __string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.string_enum = _Endpoint( + self.string_enum_endpoint = _Endpoint( settings={ 'response_type': (StringEnum,), 'auth': [], @@ -820,77 +369,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__string_enum + api_client=api_client ) - - def __test_body_with_file_schema( - self, - body, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - Args: - body (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.test_body_with_file_schema = _Endpoint( + self.test_body_with_file_schema_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -936,80 +417,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_body_with_file_schema + api_client=api_client ) - - def __test_body_with_query_params( - self, - query, - body, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - Args: - query (str): - body (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query'] = \ - query - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.test_body_with_query_params = _Endpoint( + self.test_body_with_query_params_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1061,77 +471,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_body_with_query_params + api_client=api_client ) - - def __test_client_model( - self, - body, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.test_client_model = _Endpoint( + self.test_client_model_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -1179,93 +521,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_client_model + api_client=api_client ) - - def __test_endpoint_enums_length_one( - self, - query_integer=3, - query_string="brillig", - path_string="hello", - path_integer=34, - header_number=1.234, - **kwargs - ): - """test_endpoint_enums_length_one # noqa: E501 - - This route has required values with enums of 1 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) - >>> result = thread.get() - - Args: - query_integer (int): defaults to 3, must be one of [3] - query_string (str): defaults to "brillig", must be one of ["brillig"] - path_string (str): defaults to "hello", must be one of ["hello"] - path_integer (int): defaults to 34, must be one of [34] - header_number (float): defaults to 1.234, must be one of [1.234] - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query_integer'] = \ - query_integer - kwargs['query_string'] = \ - query_string - kwargs['path_string'] = \ - path_string - kwargs['path_integer'] = \ - path_integer - kwargs['header_number'] = \ - header_number - return self.call_with_http_info(**kwargs) - - self.test_endpoint_enums_length_one = _Endpoint( + self.test_endpoint_enums_length_one_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1359,99 +617,9 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__test_endpoint_enums_length_one + api_client=api_client ) - - def __test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.call_with_http_info(**kwargs) - - self.test_endpoint_parameters = _Endpoint( + self.test_endpoint_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -1617,80 +785,9 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_endpoint_parameters + api_client=api_client ) - - def __test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.test_enum_parameters = _Endpoint( + self.test_enum_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1824,88 +921,9 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_enum_parameters + api_client=api_client ) - - def __test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.call_with_http_info(**kwargs) - - self.test_group_parameters = _Endpoint( + self.test_group_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1977,76 +995,9 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__test_group_parameters + api_client=api_client ) - - def __test_inline_additional_properties( - self, - param, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - Args: - param ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - return self.call_with_http_info(**kwargs) - - self.test_inline_additional_properties = _Endpoint( + self.test_inline_additional_properties_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -2092,80 +1043,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_inline_additional_properties + api_client=api_client ) - - def __test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.call_with_http_info(**kwargs) - - self.test_json_form_data = _Endpoint( + self.test_json_form_data_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -2218,6 +1098,1095 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_json_form_data + api_client=api_client ) + + def array_model( + self, + **kwargs + ): + """array_model # noqa: E501 + + Test serialization of ArrayModel # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_model(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (AnimalFarm): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnimalFarm + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.array_model_endpoint.call_with_http_info(**kwargs) + + def boolean( + self, + **kwargs + ): + """boolean # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.boolean(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.boolean_endpoint.call_with_http_info(**kwargs) + + def create_xml_item( + self, + xml_item, + **kwargs + ): + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> result = thread.get() + + Args: + xml_item (XmlItem): XmlItem Body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['xml_item'] = \ + xml_item + return self.create_xml_item_endpoint.call_with_http_info(**kwargs) + + def number_with_validations( + self, + **kwargs + ): + """number_with_validations # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (NumberWithValidations): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + NumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.number_with_validations_endpoint.call_with_http_info(**kwargs) + + def object_model_with_ref_props( + self, + **kwargs + ): + """object_model_with_ref_props # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.object_model_with_ref_props(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (ObjectModelWithRefProps): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ObjectModelWithRefProps + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) + + def string( + self, + **kwargs + ): + """string # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.string_endpoint.call_with_http_info(**kwargs) + + def string_enum( + self, + **kwargs + ): + """string_enum # noqa: E501 + + Test serialization of outer enum # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string_enum(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (StringEnum): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + StringEnum + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.string_enum_endpoint.call_with_http_info(**kwargs) + + def test_body_with_file_schema( + self, + body, + **kwargs + ): + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_file_schema(body, async_req=True) + >>> result = thread.get() + + Args: + body (FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) + + def test_body_with_query_params( + self, + query, + body, + **kwargs + ): + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_query_params(query, body, async_req=True) + >>> result = thread.get() + + Args: + query (str): + body (User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query'] = \ + query + kwargs['body'] = \ + body + return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) + + def test_client_model( + self, + body, + **kwargs + ): + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_client_model(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.test_client_model_endpoint.call_with_http_info(**kwargs) + + def test_endpoint_enums_length_one( + self, + query_integer=3, + query_string="brillig", + path_string="hello", + path_integer=34, + header_number=1.234, + **kwargs + ): + """test_endpoint_enums_length_one # noqa: E501 + + This route has required values with enums of 1 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) + >>> result = thread.get() + + Args: + query_integer (int): defaults to 3, must be one of [3] + query_string (str): defaults to "brillig", must be one of ["brillig"] + path_string (str): defaults to "hello", must be one of ["hello"] + path_integer (int): defaults to 34, must be one of [34] + header_number (float): defaults to 1.234, must be one of [1.234] + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query_integer'] = \ + query_integer + kwargs['query_string'] = \ + query_string + kwargs['path_string'] = \ + path_string + kwargs['path_integer'] = \ + path_integer + kwargs['header_number'] = \ + header_number + return self.test_endpoint_enums_length_one_endpoint.call_with_http_info(**kwargs) + + def test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) + + def test_enum_parameters( + self, + **kwargs + ): + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) + + def test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) + + def test_inline_additional_properties( + self, + param, + **kwargs + ): + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_additional_properties(param, async_req=True) + >>> result = thread.get() + + Args: + param ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) + + def test_json_form_data( + self, + param, + param2, + **kwargs + ): + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 1f8275b9eec..54fdf7f892a 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -35,74 +35,7 @@ class FakeClassnameTags123Api(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __test_classname( - self, - body, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.test_classname = _Endpoint( + self.test_classname_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [ @@ -152,6 +85,72 @@ class FakeClassnameTags123Api(object): 'application/json' ] }, - api_client=api_client, - callable=__test_classname + api_client=api_client ) + + def test_classname( + self, + body, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.test_classname_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index 52478be44a1..1a8a4c51fde 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -36,73 +36,7 @@ class PetApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __add_pet( - self, - body, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.add_pet = _Endpoint( + self.add_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -151,77 +85,9 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client, - callable=__add_pet + api_client=api_client ) - - def __delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.delete_pet = _Endpoint( + self.delete_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -273,77 +139,9 @@ class PetApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_pet + api_client=api_client ) - - def __find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['status'] = \ - status - return self.call_with_http_info(**kwargs) - - self.find_pets_by_status = _Endpoint( + self.find_pets_by_status_endpoint = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -401,77 +199,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__find_pets_by_status + api_client=api_client ) - - def __find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['tags'] = \ - tags - return self.call_with_http_info(**kwargs) - - self.find_pets_by_tags = _Endpoint( + self.find_pets_by_tags_endpoint = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -522,77 +252,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__find_pets_by_tags + api_client=api_client ) - - def __get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.get_pet_by_id = _Endpoint( + self.get_pet_by_id_endpoint = _Endpoint( settings={ 'response_type': (Pet,), 'auth': [ @@ -642,76 +304,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_pet_by_id + api_client=api_client ) - - def __update_pet( - self, - body, - **kwargs - ): - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.update_pet = _Endpoint( + self.update_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -760,78 +355,9 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client, - callable=__update_pet + api_client=api_client ) - - def __update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.update_pet_with_form = _Endpoint( + self.update_pet_with_form_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -890,79 +416,9 @@ class PetApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__update_pet_with_form + api_client=api_client ) - - def __upload_file( - self, - pet_id, - **kwargs - ): - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - file (file_type): file to upload. [optional] - files ([file_type]): files to upload. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.upload_file = _Endpoint( + self.upload_file_endpoint = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [ @@ -1029,81 +485,9 @@ class PetApi(object): 'multipart/form-data' ] }, - api_client=api_client, - callable=__upload_file + api_client=api_client ) - - def __upload_file_with_required_file( - self, - pet_id, - required_file, - **kwargs - ): - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - required_file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - kwargs['required_file'] = \ - required_file - return self.call_with_http_info(**kwargs) - - self.upload_file_with_required_file = _Endpoint( + self.upload_file_with_required_file_endpoint = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [ @@ -1165,6 +549,605 @@ class PetApi(object): 'multipart/form-data' ] }, - api_client=api_client, - callable=__upload_file_with_required_file + api_client=api_client ) + + def add_pet( + self, + body, + **kwargs + ): + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.add_pet_endpoint.call_with_http_info(**kwargs) + + def delete_pet( + self, + pet_id, + **kwargs + ): + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.delete_pet_endpoint.call_with_http_info(**kwargs) + + def find_pets_by_status( + self, + status, + **kwargs + ): + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['status'] = \ + status + return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) + + def find_pets_by_tags( + self, + tags, + **kwargs + ): + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tags'] = \ + tags + return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) + + def get_pet_by_id( + self, + pet_id, + **kwargs + ): + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) + + def update_pet( + self, + body, + **kwargs + ): + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.update_pet_endpoint.call_with_http_info(**kwargs) + + def update_pet_with_form( + self, + pet_id, + **kwargs + ): + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) + + def upload_file( + self, + pet_id, + **kwargs + ): + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file_type): file to upload. [optional] + files ([file_type]): files to upload. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.upload_file_endpoint.call_with_http_info(**kwargs) + + def upload_file_with_required_file( + self, + pet_id, + required_file, + **kwargs + ): + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + required_file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file + return self.upload_file_with_required_file_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index 81f1779174b..cd573a91121 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -35,74 +35,7 @@ class StoreApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.call_with_http_info(**kwargs) - - self.delete_order = _Endpoint( + self.delete_order_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -147,72 +80,9 @@ class StoreApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_order + api_client=api_client ) - - def __get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.get_inventory = _Endpoint( + self.get_inventory_endpoint = _Endpoint( settings={ 'response_type': ({str: (int,)},), 'auth': [ @@ -254,77 +124,9 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_inventory + api_client=api_client ) - - def __get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.call_with_http_info(**kwargs) - - self.get_order_by_id = _Endpoint( + self.get_order_by_id_endpoint = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -378,76 +180,9 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_order_by_id + api_client=api_client ) - - def __place_order( - self, - body, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - Args: - body (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.place_order = _Endpoint( + self.place_order_endpoint = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -494,6 +229,264 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__place_order + api_client=api_client ) + + def delete_order( + self, + order_id, + **kwargs + ): + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.delete_order_endpoint.call_with_http_info(**kwargs) + + def get_inventory( + self, + **kwargs + ): + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_inventory_endpoint.call_with_http_info(**kwargs) + + def get_order_by_id( + self, + order_id, + **kwargs + ): + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) + + def place_order( + self, + body, + **kwargs + ): + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.place_order(body, async_req=True) + >>> result = thread.get() + + Args: + body (Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.place_order_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 931b31d5ef8..3088eb159f1 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -35,74 +35,7 @@ class UserApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_user( - self, - body, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - Args: - body (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.create_user = _Endpoint( + self.create_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -146,76 +79,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__create_user + api_client=api_client ) - - def __create_users_with_array_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.create_users_with_array_input = _Endpoint( + self.create_users_with_array_input_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -259,76 +125,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__create_users_with_array_input + api_client=api_client ) - - def __create_users_with_list_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.create_users_with_list_input = _Endpoint( + self.create_users_with_list_input_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -372,77 +171,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__create_users_with_list_input + api_client=api_client ) - - def __delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.call_with_http_info(**kwargs) - - self.delete_user = _Endpoint( + self.delete_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -487,76 +218,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_user + api_client=api_client ) - - def __get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.call_with_http_info(**kwargs) - - self.get_user_by_name = _Endpoint( + self.get_user_by_name_endpoint = _Endpoint( settings={ 'response_type': (User,), 'auth': [], @@ -604,80 +268,9 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_user_by_name + api_client=api_client ) - - def __login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.call_with_http_info(**kwargs) - - self.login_user = _Endpoint( + self.login_user_endpoint = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -731,71 +324,9 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__login_user + api_client=api_client ) - - def __logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.logout_user = _Endpoint( + self.logout_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -833,81 +364,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__logout_user + api_client=api_client ) - - def __update_user( - self, - username, - body, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - body (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.update_user = _Endpoint( + self.update_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -957,6 +416,532 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__update_user + api_client=api_client ) + + def create_user( + self, + body, + **kwargs + ): + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_user(body, async_req=True) + >>> result = thread.get() + + Args: + body (User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.create_user_endpoint.call_with_http_info(**kwargs) + + def create_users_with_array_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_array_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) + + def create_users_with_list_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_list_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) + + def delete_user( + self, + username, + **kwargs + ): + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.delete_user_endpoint.call_with_http_info(**kwargs) + + def get_user_by_name( + self, + username, + **kwargs + ): + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) + + def login_user( + self, + username, + password, + **kwargs + ): + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.login_user_endpoint.call_with_http_info(**kwargs) + + def logout_user( + self, + **kwargs + ): + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.logout_user_endpoint.call_with_http_info(**kwargs) + + def update_user( + self, + username, + body, + **kwargs + ): + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_user(username, body, async_req=True) + >>> result = thread.get() + + Args: + username (str): name that need to be deleted + body (User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['body'] = \ + body + return self.update_user_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index 34d207f3c71..9275f2047c4 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -38,7 +38,7 @@ class TestFakeApi(unittest.TestCase): """Test case for boolean """ - endpoint = self.api.boolean + endpoint = self.api.boolean_endpoint assert endpoint.openapi_types['body'] == (bool,) assert endpoint.settings['response_type'] == (bool,) @@ -46,7 +46,7 @@ class TestFakeApi(unittest.TestCase): """Test case for string """ - endpoint = self.api.string + endpoint = self.api.string_endpoint assert endpoint.openapi_types['body'] == (str,) assert endpoint.settings['response_type'] == (str,) @@ -55,7 +55,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import object_model_with_ref_props - endpoint = self.api.object_model_with_ref_props + endpoint = self.api.object_model_with_ref_props_endpoint assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) @@ -64,7 +64,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import string_enum - endpoint = self.api.string_enum + endpoint = self.api.string_enum_endpoint assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) assert endpoint.settings['response_type'] == (string_enum.StringEnum,) @@ -73,7 +73,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import animal_farm - endpoint = self.api.array_model + endpoint = self.api.array_model_endpoint assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) @@ -82,7 +82,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import number_with_validations - endpoint = self.api.number_with_validations + endpoint = self.api.number_with_validations_endpoint assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) @@ -110,14 +110,14 @@ class TestFakeApi(unittest.TestCase): """ # when we omit the required enums of length one, they are still set - endpoint = self.api.test_endpoint_enums_length_one + endpoint = self.api.test_endpoint_enums_length_one_endpoint import six if six.PY3: from unittest.mock import patch else: from mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: - endpoint() + self.api.test_endpoint_enums_length_one() call_with_http_info.assert_called_with( _check_input_type=True, _check_return_type=True, @@ -139,7 +139,7 @@ class TestFakeApi(unittest.TestCase): Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 """ # check that we can access the endpoint's validations - endpoint = self.api.test_endpoint_parameters + endpoint = self.api.test_endpoint_parameters_endpoint assert endpoint.validations[('number',)] == { 'inclusive_maximum': 543.2, 'inclusive_minimum': 32.1, @@ -160,7 +160,7 @@ class TestFakeApi(unittest.TestCase): To test enum parameters # noqa: E501 """ # check that we can access the endpoint's allowed_values - endpoint = self.api.test_enum_parameters + endpoint = self.api.test_enum_parameters_endpoint assert endpoint.allowed_values[('enum_query_string',)] == { "_ABC": "_abc", "-EFG": "-efg", diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py index 3a4931f84d4..2ae65760a36 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py @@ -35,74 +35,7 @@ class AnotherFakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __call_123_test_special_tags( - self, - body, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.call_123_test_special_tags = _Endpoint( + self.call_123_test_special_tags_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -150,6 +83,72 @@ class AnotherFakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__call_123_test_special_tags + api_client=api_client ) + + def call_123_test_special_tags( + self, + body, + **kwargs + ): + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.call_123_test_special_tags(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py index d821febabed..4afa17e3cb2 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py @@ -42,70 +42,7 @@ class FakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.array_model = _Endpoint( + self.array_model_endpoint = _Endpoint( settings={ 'response_type': (AnimalFarm,), 'auth': [], @@ -149,73 +86,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__array_model + api_client=api_client ) - - def __boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.boolean = _Endpoint( + self.boolean_endpoint = _Endpoint( settings={ 'response_type': (bool,), 'auth': [], @@ -259,77 +132,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__boolean + api_client=api_client ) - - def __create_xml_item( - self, - xml_item, - **kwargs - ): - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - Args: - xml_item (XmlItem): XmlItem Body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['xml_item'] = \ - xml_item - return self.call_with_http_info(**kwargs) - - self.create_xml_item = _Endpoint( + self.create_xml_item_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -380,73 +185,9 @@ class FakeApi(object): 'text/xml; charset=utf-16' ] }, - api_client=api_client, - callable=__create_xml_item + api_client=api_client ) - - def __number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.number_with_validations = _Endpoint( + self.number_with_validations_endpoint = _Endpoint( settings={ 'response_type': (NumberWithValidations,), 'auth': [], @@ -490,73 +231,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__number_with_validations + api_client=api_client ) - - def __object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.object_model_with_ref_props = _Endpoint( + self.object_model_with_ref_props_endpoint = _Endpoint( settings={ 'response_type': (ObjectModelWithRefProps,), 'auth': [], @@ -600,73 +277,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__object_model_with_ref_props + api_client=api_client ) - - def __string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.string = _Endpoint( + self.string_endpoint = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -710,73 +323,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__string + api_client=api_client ) - - def __string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.string_enum = _Endpoint( + self.string_enum_endpoint = _Endpoint( settings={ 'response_type': (StringEnum,), 'auth': [], @@ -820,77 +369,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__string_enum + api_client=api_client ) - - def __test_body_with_file_schema( - self, - body, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - Args: - body (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.test_body_with_file_schema = _Endpoint( + self.test_body_with_file_schema_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -936,80 +417,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_body_with_file_schema + api_client=api_client ) - - def __test_body_with_query_params( - self, - query, - body, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - Args: - query (str): - body (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query'] = \ - query - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.test_body_with_query_params = _Endpoint( + self.test_body_with_query_params_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1061,77 +471,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_body_with_query_params + api_client=api_client ) - - def __test_client_model( - self, - body, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.test_client_model = _Endpoint( + self.test_client_model_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -1179,93 +521,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_client_model + api_client=api_client ) - - def __test_endpoint_enums_length_one( - self, - query_integer=3, - query_string="brillig", - path_string="hello", - path_integer=34, - header_number=1.234, - **kwargs - ): - """test_endpoint_enums_length_one # noqa: E501 - - This route has required values with enums of 1 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) - >>> result = thread.get() - - Args: - query_integer (int): defaults to 3, must be one of [3] - query_string (str): defaults to "brillig", must be one of ["brillig"] - path_string (str): defaults to "hello", must be one of ["hello"] - path_integer (int): defaults to 34, must be one of [34] - header_number (float): defaults to 1.234, must be one of [1.234] - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query_integer'] = \ - query_integer - kwargs['query_string'] = \ - query_string - kwargs['path_string'] = \ - path_string - kwargs['path_integer'] = \ - path_integer - kwargs['header_number'] = \ - header_number - return self.call_with_http_info(**kwargs) - - self.test_endpoint_enums_length_one = _Endpoint( + self.test_endpoint_enums_length_one_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1359,99 +617,9 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__test_endpoint_enums_length_one + api_client=api_client ) - - def __test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.call_with_http_info(**kwargs) - - self.test_endpoint_parameters = _Endpoint( + self.test_endpoint_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -1617,80 +785,9 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_endpoint_parameters + api_client=api_client ) - - def __test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.test_enum_parameters = _Endpoint( + self.test_enum_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1824,88 +921,9 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_enum_parameters + api_client=api_client ) - - def __test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.call_with_http_info(**kwargs) - - self.test_group_parameters = _Endpoint( + self.test_group_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1977,76 +995,9 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__test_group_parameters + api_client=api_client ) - - def __test_inline_additional_properties( - self, - param, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - Args: - param ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - return self.call_with_http_info(**kwargs) - - self.test_inline_additional_properties = _Endpoint( + self.test_inline_additional_properties_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -2092,80 +1043,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_inline_additional_properties + api_client=api_client ) - - def __test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.call_with_http_info(**kwargs) - - self.test_json_form_data = _Endpoint( + self.test_json_form_data_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -2218,6 +1098,1095 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_json_form_data + api_client=api_client ) + + def array_model( + self, + **kwargs + ): + """array_model # noqa: E501 + + Test serialization of ArrayModel # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_model(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (AnimalFarm): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnimalFarm + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.array_model_endpoint.call_with_http_info(**kwargs) + + def boolean( + self, + **kwargs + ): + """boolean # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.boolean(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.boolean_endpoint.call_with_http_info(**kwargs) + + def create_xml_item( + self, + xml_item, + **kwargs + ): + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> result = thread.get() + + Args: + xml_item (XmlItem): XmlItem Body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['xml_item'] = \ + xml_item + return self.create_xml_item_endpoint.call_with_http_info(**kwargs) + + def number_with_validations( + self, + **kwargs + ): + """number_with_validations # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (NumberWithValidations): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + NumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.number_with_validations_endpoint.call_with_http_info(**kwargs) + + def object_model_with_ref_props( + self, + **kwargs + ): + """object_model_with_ref_props # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.object_model_with_ref_props(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (ObjectModelWithRefProps): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ObjectModelWithRefProps + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) + + def string( + self, + **kwargs + ): + """string # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.string_endpoint.call_with_http_info(**kwargs) + + def string_enum( + self, + **kwargs + ): + """string_enum # noqa: E501 + + Test serialization of outer enum # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string_enum(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (StringEnum): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + StringEnum + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.string_enum_endpoint.call_with_http_info(**kwargs) + + def test_body_with_file_schema( + self, + body, + **kwargs + ): + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_file_schema(body, async_req=True) + >>> result = thread.get() + + Args: + body (FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) + + def test_body_with_query_params( + self, + query, + body, + **kwargs + ): + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_query_params(query, body, async_req=True) + >>> result = thread.get() + + Args: + query (str): + body (User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query'] = \ + query + kwargs['body'] = \ + body + return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) + + def test_client_model( + self, + body, + **kwargs + ): + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_client_model(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.test_client_model_endpoint.call_with_http_info(**kwargs) + + def test_endpoint_enums_length_one( + self, + query_integer=3, + query_string="brillig", + path_string="hello", + path_integer=34, + header_number=1.234, + **kwargs + ): + """test_endpoint_enums_length_one # noqa: E501 + + This route has required values with enums of 1 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) + >>> result = thread.get() + + Args: + query_integer (int): defaults to 3, must be one of [3] + query_string (str): defaults to "brillig", must be one of ["brillig"] + path_string (str): defaults to "hello", must be one of ["hello"] + path_integer (int): defaults to 34, must be one of [34] + header_number (float): defaults to 1.234, must be one of [1.234] + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query_integer'] = \ + query_integer + kwargs['query_string'] = \ + query_string + kwargs['path_string'] = \ + path_string + kwargs['path_integer'] = \ + path_integer + kwargs['header_number'] = \ + header_number + return self.test_endpoint_enums_length_one_endpoint.call_with_http_info(**kwargs) + + def test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) + + def test_enum_parameters( + self, + **kwargs + ): + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) + + def test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) + + def test_inline_additional_properties( + self, + param, + **kwargs + ): + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_additional_properties(param, async_req=True) + >>> result = thread.get() + + Args: + param ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) + + def test_json_form_data( + self, + param, + param2, + **kwargs + ): + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py index 1f8275b9eec..54fdf7f892a 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py @@ -35,74 +35,7 @@ class FakeClassnameTags123Api(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __test_classname( - self, - body, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.test_classname = _Endpoint( + self.test_classname_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [ @@ -152,6 +85,72 @@ class FakeClassnameTags123Api(object): 'application/json' ] }, - api_client=api_client, - callable=__test_classname + api_client=api_client ) + + def test_classname( + self, + body, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.test_classname_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py index 52478be44a1..1a8a4c51fde 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py @@ -36,73 +36,7 @@ class PetApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __add_pet( - self, - body, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.add_pet = _Endpoint( + self.add_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -151,77 +85,9 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client, - callable=__add_pet + api_client=api_client ) - - def __delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.delete_pet = _Endpoint( + self.delete_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -273,77 +139,9 @@ class PetApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_pet + api_client=api_client ) - - def __find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['status'] = \ - status - return self.call_with_http_info(**kwargs) - - self.find_pets_by_status = _Endpoint( + self.find_pets_by_status_endpoint = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -401,77 +199,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__find_pets_by_status + api_client=api_client ) - - def __find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['tags'] = \ - tags - return self.call_with_http_info(**kwargs) - - self.find_pets_by_tags = _Endpoint( + self.find_pets_by_tags_endpoint = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -522,77 +252,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__find_pets_by_tags + api_client=api_client ) - - def __get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.get_pet_by_id = _Endpoint( + self.get_pet_by_id_endpoint = _Endpoint( settings={ 'response_type': (Pet,), 'auth': [ @@ -642,76 +304,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_pet_by_id + api_client=api_client ) - - def __update_pet( - self, - body, - **kwargs - ): - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.update_pet = _Endpoint( + self.update_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -760,78 +355,9 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client, - callable=__update_pet + api_client=api_client ) - - def __update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.update_pet_with_form = _Endpoint( + self.update_pet_with_form_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -890,79 +416,9 @@ class PetApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__update_pet_with_form + api_client=api_client ) - - def __upload_file( - self, - pet_id, - **kwargs - ): - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - file (file_type): file to upload. [optional] - files ([file_type]): files to upload. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.upload_file = _Endpoint( + self.upload_file_endpoint = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [ @@ -1029,81 +485,9 @@ class PetApi(object): 'multipart/form-data' ] }, - api_client=api_client, - callable=__upload_file + api_client=api_client ) - - def __upload_file_with_required_file( - self, - pet_id, - required_file, - **kwargs - ): - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - required_file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - kwargs['required_file'] = \ - required_file - return self.call_with_http_info(**kwargs) - - self.upload_file_with_required_file = _Endpoint( + self.upload_file_with_required_file_endpoint = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [ @@ -1165,6 +549,605 @@ class PetApi(object): 'multipart/form-data' ] }, - api_client=api_client, - callable=__upload_file_with_required_file + api_client=api_client ) + + def add_pet( + self, + body, + **kwargs + ): + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.add_pet_endpoint.call_with_http_info(**kwargs) + + def delete_pet( + self, + pet_id, + **kwargs + ): + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.delete_pet_endpoint.call_with_http_info(**kwargs) + + def find_pets_by_status( + self, + status, + **kwargs + ): + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['status'] = \ + status + return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) + + def find_pets_by_tags( + self, + tags, + **kwargs + ): + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tags'] = \ + tags + return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) + + def get_pet_by_id( + self, + pet_id, + **kwargs + ): + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) + + def update_pet( + self, + body, + **kwargs + ): + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.update_pet_endpoint.call_with_http_info(**kwargs) + + def update_pet_with_form( + self, + pet_id, + **kwargs + ): + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) + + def upload_file( + self, + pet_id, + **kwargs + ): + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file_type): file to upload. [optional] + files ([file_type]): files to upload. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.upload_file_endpoint.call_with_http_info(**kwargs) + + def upload_file_with_required_file( + self, + pet_id, + required_file, + **kwargs + ): + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + required_file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file + return self.upload_file_with_required_file_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py index 81f1779174b..cd573a91121 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py @@ -35,74 +35,7 @@ class StoreApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.call_with_http_info(**kwargs) - - self.delete_order = _Endpoint( + self.delete_order_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -147,72 +80,9 @@ class StoreApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_order + api_client=api_client ) - - def __get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.get_inventory = _Endpoint( + self.get_inventory_endpoint = _Endpoint( settings={ 'response_type': ({str: (int,)},), 'auth': [ @@ -254,77 +124,9 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_inventory + api_client=api_client ) - - def __get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.call_with_http_info(**kwargs) - - self.get_order_by_id = _Endpoint( + self.get_order_by_id_endpoint = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -378,76 +180,9 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_order_by_id + api_client=api_client ) - - def __place_order( - self, - body, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - Args: - body (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.place_order = _Endpoint( + self.place_order_endpoint = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -494,6 +229,264 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__place_order + api_client=api_client ) + + def delete_order( + self, + order_id, + **kwargs + ): + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.delete_order_endpoint.call_with_http_info(**kwargs) + + def get_inventory( + self, + **kwargs + ): + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_inventory_endpoint.call_with_http_info(**kwargs) + + def get_order_by_id( + self, + order_id, + **kwargs + ): + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) + + def place_order( + self, + body, + **kwargs + ): + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.place_order(body, async_req=True) + >>> result = thread.get() + + Args: + body (Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.place_order_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py index 931b31d5ef8..3088eb159f1 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py @@ -35,74 +35,7 @@ class UserApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_user( - self, - body, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - Args: - body (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.create_user = _Endpoint( + self.create_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -146,76 +79,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__create_user + api_client=api_client ) - - def __create_users_with_array_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.create_users_with_array_input = _Endpoint( + self.create_users_with_array_input_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -259,76 +125,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__create_users_with_array_input + api_client=api_client ) - - def __create_users_with_list_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.create_users_with_list_input = _Endpoint( + self.create_users_with_list_input_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -372,77 +171,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__create_users_with_list_input + api_client=api_client ) - - def __delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.call_with_http_info(**kwargs) - - self.delete_user = _Endpoint( + self.delete_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -487,76 +218,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_user + api_client=api_client ) - - def __get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.call_with_http_info(**kwargs) - - self.get_user_by_name = _Endpoint( + self.get_user_by_name_endpoint = _Endpoint( settings={ 'response_type': (User,), 'auth': [], @@ -604,80 +268,9 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_user_by_name + api_client=api_client ) - - def __login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.call_with_http_info(**kwargs) - - self.login_user = _Endpoint( + self.login_user_endpoint = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -731,71 +324,9 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__login_user + api_client=api_client ) - - def __logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.logout_user = _Endpoint( + self.logout_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -833,81 +364,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__logout_user + api_client=api_client ) - - def __update_user( - self, - username, - body, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - body (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.update_user = _Endpoint( + self.update_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -957,6 +416,532 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__update_user + api_client=api_client ) + + def create_user( + self, + body, + **kwargs + ): + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_user(body, async_req=True) + >>> result = thread.get() + + Args: + body (User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.create_user_endpoint.call_with_http_info(**kwargs) + + def create_users_with_array_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_array_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) + + def create_users_with_list_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_list_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) + + def delete_user( + self, + username, + **kwargs + ): + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.delete_user_endpoint.call_with_http_info(**kwargs) + + def get_user_by_name( + self, + username, + **kwargs + ): + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) + + def login_user( + self, + username, + password, + **kwargs + ): + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.login_user_endpoint.call_with_http_info(**kwargs) + + def logout_user( + self, + **kwargs + ): + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.logout_user_endpoint.call_with_http_info(**kwargs) + + def update_user( + self, + username, + body, + **kwargs + ): + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_user(username, body, async_req=True) + >>> result = thread.get() + + Args: + username (str): name that need to be deleted + body (User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['body'] = \ + body + return self.update_user_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py index 34d207f3c71..9275f2047c4 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py @@ -38,7 +38,7 @@ class TestFakeApi(unittest.TestCase): """Test case for boolean """ - endpoint = self.api.boolean + endpoint = self.api.boolean_endpoint assert endpoint.openapi_types['body'] == (bool,) assert endpoint.settings['response_type'] == (bool,) @@ -46,7 +46,7 @@ class TestFakeApi(unittest.TestCase): """Test case for string """ - endpoint = self.api.string + endpoint = self.api.string_endpoint assert endpoint.openapi_types['body'] == (str,) assert endpoint.settings['response_type'] == (str,) @@ -55,7 +55,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import object_model_with_ref_props - endpoint = self.api.object_model_with_ref_props + endpoint = self.api.object_model_with_ref_props_endpoint assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) @@ -64,7 +64,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import string_enum - endpoint = self.api.string_enum + endpoint = self.api.string_enum_endpoint assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) assert endpoint.settings['response_type'] == (string_enum.StringEnum,) @@ -73,7 +73,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import animal_farm - endpoint = self.api.array_model + endpoint = self.api.array_model_endpoint assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) @@ -82,7 +82,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import number_with_validations - endpoint = self.api.number_with_validations + endpoint = self.api.number_with_validations_endpoint assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) @@ -110,14 +110,14 @@ class TestFakeApi(unittest.TestCase): """ # when we omit the required enums of length one, they are still set - endpoint = self.api.test_endpoint_enums_length_one + endpoint = self.api.test_endpoint_enums_length_one_endpoint import six if six.PY3: from unittest.mock import patch else: from mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: - endpoint() + self.api.test_endpoint_enums_length_one() call_with_http_info.assert_called_with( _check_input_type=True, _check_return_type=True, @@ -139,7 +139,7 @@ class TestFakeApi(unittest.TestCase): Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 """ # check that we can access the endpoint's validations - endpoint = self.api.test_endpoint_parameters + endpoint = self.api.test_endpoint_parameters_endpoint assert endpoint.validations[('number',)] == { 'inclusive_maximum': 543.2, 'inclusive_minimum': 32.1, @@ -160,7 +160,7 @@ class TestFakeApi(unittest.TestCase): To test enum parameters # noqa: E501 """ # check that we can access the endpoint's allowed_values - endpoint = self.api.test_enum_parameters + endpoint = self.api.test_enum_parameters_endpoint assert endpoint.allowed_values[('enum_query_string',)] == { "_ABC": "_abc", "-EFG": "-efg", diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py index 865341d7c66..b9bc47de2b3 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py @@ -34,69 +34,7 @@ class UsageApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __any_key( - self, - **kwargs - ): - """Use any API key # noqa: E501 - - Use any API key # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.any_key(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.any_key = _Endpoint( + self.any_key_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ @@ -139,72 +77,9 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__any_key + api_client=api_client ) - - def __both_keys( - self, - **kwargs - ): - """Use both API keys # noqa: E501 - - Use both API keys # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.both_keys(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.both_keys = _Endpoint( + self.both_keys_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ @@ -247,72 +122,9 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__both_keys + api_client=api_client ) - - def __key_in_header( - self, - **kwargs - ): - """Use API key in header # noqa: E501 - - Use API key in header # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.key_in_header(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.key_in_header = _Endpoint( + self.key_in_header_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ @@ -354,72 +166,9 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__key_in_header + api_client=api_client ) - - def __key_in_query( - self, - **kwargs - ): - """Use API key in query # noqa: E501 - - Use API key in query # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.key_in_query(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.key_in_query = _Endpoint( + self.key_in_query_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ @@ -461,6 +210,250 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__key_in_query + api_client=api_client ) + + def any_key( + self, + **kwargs + ): + """Use any API key # noqa: E501 + + Use any API key # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.any_key(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.any_key_endpoint.call_with_http_info(**kwargs) + + def both_keys( + self, + **kwargs + ): + """Use both API keys # noqa: E501 + + Use both API keys # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.both_keys(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.both_keys_endpoint.call_with_http_info(**kwargs) + + def key_in_header( + self, + **kwargs + ): + """Use API key in header # noqa: E501 + + Use API key in header # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.key_in_header(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.key_in_header_endpoint.call_with_http_info(**kwargs) + + def key_in_query( + self, + **kwargs + ): + """Use API key in query # noqa: E501 + + Use API key in query # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.key_in_query(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.key_in_query_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py index c60c19b881b..d9e5929e14c 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py @@ -34,69 +34,7 @@ class UsageApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __custom_server( - self, - **kwargs - ): - """Use custom server # noqa: E501 - - Use custom server # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.custom_server(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.custom_server = _Endpoint( + self.custom_server_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [], @@ -185,72 +123,9 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__custom_server + api_client=api_client ) - - def __default_server( - self, - **kwargs - ): - """Use default server # noqa: E501 - - Use default server # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.default_server(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.default_server = _Endpoint( + self.default_server_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [], @@ -290,6 +165,128 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__default_server + api_client=api_client ) + + def custom_server( + self, + **kwargs + ): + """Use custom server # noqa: E501 + + Use custom server # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.custom_server(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.custom_server_endpoint.call_with_http_info(**kwargs) + + def default_server( + self, + **kwargs + ): + """Use default server # noqa: E501 + + Use default server # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.default_server(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.default_server_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index 4072532f378..c99ba19bce0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -35,74 +35,7 @@ class AnotherFakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __call_123_test_special_tags( - self, - client, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client'] = \ - client - return self.call_with_http_info(**kwargs) - - self.call_123_test_special_tags = _Endpoint( + self.call_123_test_special_tags_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -150,6 +83,72 @@ class AnotherFakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__call_123_test_special_tags + api_client=api_client ) + + def call_123_test_special_tags( + self, + client, + **kwargs + ): + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.call_123_test_special_tags(client, async_req=True) + >>> result = thread.get() + + Args: + client (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['client'] = \ + client + return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 21f9ca13b05..4d23104e6b0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -35,68 +35,7 @@ class DefaultApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __foo_get( - self, - **kwargs - ): - """foo_get # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.foo_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - InlineResponseDefault - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.foo_get = _Endpoint( + self.foo_get_endpoint = _Endpoint( settings={ 'response_type': (InlineResponseDefault,), 'auth': [], @@ -136,6 +75,66 @@ class DefaultApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__foo_get + api_client=api_client ) + + def foo_get( + self, + **kwargs + ): + """foo_get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.foo_get(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + InlineResponseDefault + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.foo_get_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 0f57f637f25..056c1f33f16 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -50,69 +50,7 @@ class FakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __additional_properties_with_array_of_enums( - self, - **kwargs - ): - """Additional Properties with Array of Enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.additional_properties_with_array_of_enums(async_req=True) - >>> result = thread.get() - - - Keyword Args: - additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AdditionalPropertiesWithArrayOfEnums - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.additional_properties_with_array_of_enums = _Endpoint( + self.additional_properties_with_array_of_enums_endpoint = _Endpoint( settings={ 'response_type': (AdditionalPropertiesWithArrayOfEnums,), 'auth': [], @@ -158,73 +96,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__additional_properties_with_array_of_enums + api_client=api_client ) - - def __array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.array_model = _Endpoint( + self.array_model_endpoint = _Endpoint( settings={ 'response_type': (AnimalFarm,), 'auth': [], @@ -270,72 +144,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__array_model + api_client=api_client ) - - def __array_of_enums( - self, - **kwargs - ): - """Array of Enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_of_enums(async_req=True) - >>> result = thread.get() - - - Keyword Args: - array_of_enums (ArrayOfEnums): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ArrayOfEnums - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.array_of_enums = _Endpoint( + self.array_of_enums_endpoint = _Endpoint( settings={ 'response_type': (ArrayOfEnums,), 'auth': [], @@ -381,73 +192,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__array_of_enums + api_client=api_client ) - - def __boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.boolean = _Endpoint( + self.boolean_endpoint = _Endpoint( settings={ 'response_type': (bool,), 'auth': [], @@ -493,73 +240,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__boolean + api_client=api_client ) - - def __composed_one_of_number_with_validations( - self, - **kwargs - ): - """composed_one_of_number_with_validations # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.composed_one_of_number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ComposedOneOfNumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.composed_one_of_number_with_validations = _Endpoint( + self.composed_one_of_number_with_validations_endpoint = _Endpoint( settings={ 'response_type': (ComposedOneOfNumberWithValidations,), 'auth': [], @@ -605,76 +288,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__composed_one_of_number_with_validations + api_client=api_client ) - - def __download_attachment( - self, - file_name, - **kwargs - ): - """downloads a file using Content-Disposition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.download_attachment(file_name, async_req=True) - >>> result = thread.get() - - Args: - file_name (str): file name - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['file_name'] = \ - file_name - return self.call_with_http_info(**kwargs) - - self.download_attachment = _Endpoint( + self.download_attachment_endpoint = _Endpoint( settings={ 'response_type': (file_type,), 'auth': [], @@ -726,72 +342,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__download_attachment + api_client=api_client ) - - def __enum_test( - self, - **kwargs - ): - """Object contains enum properties and array properties containing enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.enum_test(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_test (EnumTest): Input object. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - EnumTest - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.enum_test = _Endpoint( + self.enum_test_endpoint = _Endpoint( settings={ 'response_type': (EnumTest,), 'auth': [], @@ -837,71 +390,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__enum_test + api_client=api_client ) - - def __fake_health_get( - self, - **kwargs - ): - """Health check endpoint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_health_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - HealthCheckResult - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.fake_health_get = _Endpoint( + self.fake_health_get_endpoint = _Endpoint( settings={ 'response_type': (HealthCheckResult,), 'auth': [], @@ -941,77 +432,9 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__fake_health_get + api_client=api_client ) - - def __mammal( - self, - mammal, - **kwargs - ): - """mammal # noqa: E501 - - Test serialization of mammals # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mammal(mammal, async_req=True) - >>> result = thread.get() - - Args: - mammal (Mammal): Input mammal - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Mammal - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['mammal'] = \ - mammal - return self.call_with_http_info(**kwargs) - - self.mammal = _Endpoint( + self.mammal_endpoint = _Endpoint( settings={ 'response_type': (Mammal,), 'auth': [], @@ -1059,73 +482,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__mammal + api_client=api_client ) - - def __number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.number_with_validations = _Endpoint( + self.number_with_validations_endpoint = _Endpoint( settings={ 'response_type': (NumberWithValidations,), 'auth': [], @@ -1171,73 +530,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__number_with_validations + api_client=api_client ) - - def __object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.object_model_with_ref_props = _Endpoint( + self.object_model_with_ref_props_endpoint = _Endpoint( settings={ 'response_type': (ObjectModelWithRefProps,), 'auth': [], @@ -1283,72 +578,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__object_model_with_ref_props + api_client=api_client ) - - def __post_inline_additional_properties_payload( - self, - **kwargs - ): - """post_inline_additional_properties_payload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.post_inline_additional_properties_payload(async_req=True) - >>> result = thread.get() - - - Keyword Args: - inline_object6 (InlineObject6): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - InlineObject6 - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.post_inline_additional_properties_payload = _Endpoint( + self.post_inline_additional_properties_payload_endpoint = _Endpoint( settings={ 'response_type': (InlineObject6,), 'auth': [], @@ -1394,72 +626,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__post_inline_additional_properties_payload + api_client=api_client ) - - def __post_inline_additional_properties_ref_payload( - self, - **kwargs - ): - """post_inline_additional_properties_ref_payload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.post_inline_additional_properties_ref_payload(async_req=True) - >>> result = thread.get() - - - Keyword Args: - inline_additional_properties_ref_payload (InlineAdditionalPropertiesRefPayload): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - InlineAdditionalPropertiesRefPayload - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.post_inline_additional_properties_ref_payload = _Endpoint( + self.post_inline_additional_properties_ref_payload_endpoint = _Endpoint( settings={ 'response_type': (InlineAdditionalPropertiesRefPayload,), 'auth': [], @@ -1505,73 +674,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__post_inline_additional_properties_ref_payload + api_client=api_client ) - - def __string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.string = _Endpoint( + self.string_endpoint = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -1617,73 +722,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__string + api_client=api_client ) - - def __string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.string_enum = _Endpoint( + self.string_enum_endpoint = _Endpoint( settings={ 'response_type': (StringEnum,), 'auth': [], @@ -1730,77 +771,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__string_enum + api_client=api_client ) - - def __test_body_with_file_schema( - self, - file_schema_test_class, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) - >>> result = thread.get() - - Args: - file_schema_test_class (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['file_schema_test_class'] = \ - file_schema_test_class - return self.call_with_http_info(**kwargs) - - self.test_body_with_file_schema = _Endpoint( + self.test_body_with_file_schema_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1846,80 +819,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_body_with_file_schema + api_client=api_client ) - - def __test_body_with_query_params( - self, - query, - user, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, user, async_req=True) - >>> result = thread.get() - - Args: - query (str): - user (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query'] = \ - query - kwargs['user'] = \ - user - return self.call_with_http_info(**kwargs) - - self.test_body_with_query_params = _Endpoint( + self.test_body_with_query_params_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1971,77 +873,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_body_with_query_params + api_client=api_client ) - - def __test_client_model( - self, - client, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client'] = \ - client - return self.call_with_http_info(**kwargs) - - self.test_client_model = _Endpoint( + self.test_client_model_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -2089,99 +923,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_client_model + api_client=api_client ) - - def __test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00') - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.call_with_http_info(**kwargs) - - self.test_endpoint_parameters = _Endpoint( + self.test_endpoint_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -2347,80 +1091,9 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_endpoint_parameters + api_client=api_client ) - - def __test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.test_enum_parameters = _Endpoint( + self.test_enum_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -2554,88 +1227,9 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_enum_parameters + api_client=api_client ) - - def __test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.call_with_http_info(**kwargs) - - self.test_group_parameters = _Endpoint( + self.test_group_parameters_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -2709,76 +1303,9 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__test_group_parameters + api_client=api_client ) - - def __test_inline_additional_properties( - self, - request_body, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(request_body, async_req=True) - >>> result = thread.get() - - Args: - request_body ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['request_body'] = \ - request_body - return self.call_with_http_info(**kwargs) - - self.test_inline_additional_properties = _Endpoint( + self.test_inline_additional_properties_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -2824,80 +1351,9 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client, - callable=__test_inline_additional_properties + api_client=api_client ) - - def __test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.call_with_http_info(**kwargs) - - self.test_json_form_data = _Endpoint( + self.test_json_form_data_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -2950,93 +1406,9 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__test_json_form_data + api_client=api_client ) - - def __test_query_parameter_collection_format( - self, - pipe, - ioutil, - http, - url, - context, - **kwargs - ): - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - Args: - pipe ([str]): - ioutil ([str]): - http ([str]): - url ([str]): - context ([str]): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pipe'] = \ - pipe - kwargs['ioutil'] = \ - ioutil - kwargs['http'] = \ - http - kwargs['url'] = \ - url - kwargs['context'] = \ - context - return self.call_with_http_info(**kwargs) - - self.test_query_parameter_collection_format = _Endpoint( + self.test_query_parameter_collection_format_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -3110,76 +1482,9 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__test_query_parameter_collection_format + api_client=api_client ) - - def __upload_download_file( - self, - body, - **kwargs - ): - """uploads a file and downloads a file using application/octet-stream # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_download_file(body, async_req=True) - >>> result = thread.get() - - Args: - body (file_type): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_with_http_info(**kwargs) - - self.upload_download_file = _Endpoint( + self.upload_download_file_endpoint = _Endpoint( settings={ 'response_type': (file_type,), 'auth': [], @@ -3227,77 +1532,9 @@ class FakeApi(object): 'application/octet-stream' ] }, - api_client=api_client, - callable=__upload_download_file + api_client=api_client ) - - def __upload_file( - self, - file, - **kwargs - ): - """uploads a file using multipart/form-data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(file, async_req=True) - >>> result = thread.get() - - Args: - file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['file'] = \ - file - return self.call_with_http_info(**kwargs) - - self.upload_file = _Endpoint( + self.upload_file_endpoint = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [], @@ -3351,72 +1588,9 @@ class FakeApi(object): 'multipart/form-data' ] }, - api_client=api_client, - callable=__upload_file + api_client=api_client ) - - def __upload_files( - self, - **kwargs - ): - """uploads files using multipart/form-data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_files(async_req=True) - >>> result = thread.get() - - - Keyword Args: - files ([file_type]): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.upload_files = _Endpoint( + self.upload_files_endpoint = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [], @@ -3464,6 +1638,1779 @@ class FakeApi(object): 'multipart/form-data' ] }, - api_client=api_client, - callable=__upload_files + api_client=api_client ) + + def additional_properties_with_array_of_enums( + self, + **kwargs + ): + """Additional Properties with Array of Enums # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.additional_properties_with_array_of_enums(async_req=True) + >>> result = thread.get() + + + Keyword Args: + additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AdditionalPropertiesWithArrayOfEnums + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.additional_properties_with_array_of_enums_endpoint.call_with_http_info(**kwargs) + + def array_model( + self, + **kwargs + ): + """array_model # noqa: E501 + + Test serialization of ArrayModel # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_model(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (AnimalFarm): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnimalFarm + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.array_model_endpoint.call_with_http_info(**kwargs) + + def array_of_enums( + self, + **kwargs + ): + """Array of Enums # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_of_enums(async_req=True) + >>> result = thread.get() + + + Keyword Args: + array_of_enums (ArrayOfEnums): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ArrayOfEnums + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.array_of_enums_endpoint.call_with_http_info(**kwargs) + + def boolean( + self, + **kwargs + ): + """boolean # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.boolean(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.boolean_endpoint.call_with_http_info(**kwargs) + + def composed_one_of_number_with_validations( + self, + **kwargs + ): + """composed_one_of_number_with_validations # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.composed_one_of_number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ComposedOneOfNumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.composed_one_of_number_with_validations_endpoint.call_with_http_info(**kwargs) + + def download_attachment( + self, + file_name, + **kwargs + ): + """downloads a file using Content-Disposition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.download_attachment(file_name, async_req=True) + >>> result = thread.get() + + Args: + file_name (str): file name + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + file_type + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['file_name'] = \ + file_name + return self.download_attachment_endpoint.call_with_http_info(**kwargs) + + def enum_test( + self, + **kwargs + ): + """Object contains enum properties and array properties containing enums # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.enum_test(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_test (EnumTest): Input object. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + EnumTest + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.enum_test_endpoint.call_with_http_info(**kwargs) + + def fake_health_get( + self, + **kwargs + ): + """Health check endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fake_health_get(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + HealthCheckResult + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.fake_health_get_endpoint.call_with_http_info(**kwargs) + + def mammal( + self, + mammal, + **kwargs + ): + """mammal # noqa: E501 + + Test serialization of mammals # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.mammal(mammal, async_req=True) + >>> result = thread.get() + + Args: + mammal (Mammal): Input mammal + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Mammal + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['mammal'] = \ + mammal + return self.mammal_endpoint.call_with_http_info(**kwargs) + + def number_with_validations( + self, + **kwargs + ): + """number_with_validations # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (NumberWithValidations): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + NumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.number_with_validations_endpoint.call_with_http_info(**kwargs) + + def object_model_with_ref_props( + self, + **kwargs + ): + """object_model_with_ref_props # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.object_model_with_ref_props(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (ObjectModelWithRefProps): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ObjectModelWithRefProps + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) + + def post_inline_additional_properties_payload( + self, + **kwargs + ): + """post_inline_additional_properties_payload # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.post_inline_additional_properties_payload(async_req=True) + >>> result = thread.get() + + + Keyword Args: + inline_object6 (InlineObject6): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + InlineObject6 + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.post_inline_additional_properties_payload_endpoint.call_with_http_info(**kwargs) + + def post_inline_additional_properties_ref_payload( + self, + **kwargs + ): + """post_inline_additional_properties_ref_payload # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.post_inline_additional_properties_ref_payload(async_req=True) + >>> result = thread.get() + + + Keyword Args: + inline_additional_properties_ref_payload (InlineAdditionalPropertiesRefPayload): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + InlineAdditionalPropertiesRefPayload + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.post_inline_additional_properties_ref_payload_endpoint.call_with_http_info(**kwargs) + + def string( + self, + **kwargs + ): + """string # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.string_endpoint.call_with_http_info(**kwargs) + + def string_enum( + self, + **kwargs + ): + """string_enum # noqa: E501 + + Test serialization of outer enum # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string_enum(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (StringEnum): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + StringEnum + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.string_enum_endpoint.call_with_http_info(**kwargs) + + def test_body_with_file_schema( + self, + file_schema_test_class, + **kwargs + ): + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) + >>> result = thread.get() + + Args: + file_schema_test_class (FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['file_schema_test_class'] = \ + file_schema_test_class + return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) + + def test_body_with_query_params( + self, + query, + user, + **kwargs + ): + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_query_params(query, user, async_req=True) + >>> result = thread.get() + + Args: + query (str): + user (User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query'] = \ + query + kwargs['user'] = \ + user + return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) + + def test_client_model( + self, + client, + **kwargs + ): + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_client_model(client, async_req=True) + >>> result = thread.get() + + Args: + client (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['client'] = \ + client + return self.test_client_model_endpoint.call_with_http_info(**kwargs) + + def test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00') + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) + + def test_enum_parameters( + self, + **kwargs + ): + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) + + def test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) + + def test_inline_additional_properties( + self, + request_body, + **kwargs + ): + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_additional_properties(request_body, async_req=True) + >>> result = thread.get() + + Args: + request_body ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['request_body'] = \ + request_body + return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) + + def test_json_form_data( + self, + param, + param2, + **kwargs + ): + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) + + def test_query_parameter_collection_format( + self, + pipe, + ioutil, + http, + url, + context, + **kwargs + ): + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + Args: + pipe ([str]): + ioutil ([str]): + http ([str]): + url ([str]): + context ([str]): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pipe'] = \ + pipe + kwargs['ioutil'] = \ + ioutil + kwargs['http'] = \ + http + kwargs['url'] = \ + url + kwargs['context'] = \ + context + return self.test_query_parameter_collection_format_endpoint.call_with_http_info(**kwargs) + + def upload_download_file( + self, + body, + **kwargs + ): + """uploads a file and downloads a file using application/octet-stream # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_download_file(body, async_req=True) + >>> result = thread.get() + + Args: + body (file_type): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + file_type + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.upload_download_file_endpoint.call_with_http_info(**kwargs) + + def upload_file( + self, + file, + **kwargs + ): + """uploads a file using multipart/form-data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file(file, async_req=True) + >>> result = thread.get() + + Args: + file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['file'] = \ + file + return self.upload_file_endpoint.call_with_http_info(**kwargs) + + def upload_files( + self, + **kwargs + ): + """uploads files using multipart/form-data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_files(async_req=True) + >>> result = thread.get() + + + Keyword Args: + files ([file_type]): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.upload_files_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index dd702d316bf..efcf30af12d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -35,74 +35,7 @@ class FakeClassnameTags123Api(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __test_classname( - self, - client, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client'] = \ - client - return self.call_with_http_info(**kwargs) - - self.test_classname = _Endpoint( + self.test_classname_endpoint = _Endpoint( settings={ 'response_type': (Client,), 'auth': [ @@ -152,6 +85,72 @@ class FakeClassnameTags123Api(object): 'application/json' ] }, - api_client=api_client, - callable=__test_classname + api_client=api_client ) + + def test_classname( + self, + client, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(client, async_req=True) + >>> result = thread.get() + + Args: + client (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['client'] = \ + client + return self.test_classname_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index 102c1f26def..1ae658e16d4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -35,73 +35,7 @@ class PetApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __add_pet( - self, - pet, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(pet, async_req=True) - >>> result = thread.get() - - Args: - pet (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet'] = \ - pet - return self.call_with_http_info(**kwargs) - - self.add_pet = _Endpoint( + self.add_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -160,77 +94,9 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client, - callable=__add_pet + api_client=api_client ) - - def __delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.delete_pet = _Endpoint( + self.delete_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -282,77 +148,9 @@ class PetApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_pet + api_client=api_client ) - - def __find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['status'] = \ - status - return self.call_with_http_info(**kwargs) - - self.find_pets_by_status = _Endpoint( + self.find_pets_by_status_endpoint = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -411,77 +209,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__find_pets_by_status + api_client=api_client ) - - def __find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['tags'] = \ - tags - return self.call_with_http_info(**kwargs) - - self.find_pets_by_tags = _Endpoint( + self.find_pets_by_tags_endpoint = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -533,77 +263,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__find_pets_by_tags + api_client=api_client ) - - def __get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.get_pet_by_id = _Endpoint( + self.get_pet_by_id_endpoint = _Endpoint( settings={ 'response_type': (Pet,), 'auth': [ @@ -653,76 +315,9 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_pet_by_id + api_client=api_client ) - - def __update_pet( - self, - pet, - **kwargs - ): - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(pet, async_req=True) - >>> result = thread.get() - - Args: - pet (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet'] = \ - pet - return self.call_with_http_info(**kwargs) - - self.update_pet = _Endpoint( + self.update_pet_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -781,78 +376,9 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client, - callable=__update_pet + api_client=api_client ) - - def __update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.call_with_http_info(**kwargs) - - self.update_pet_with_form = _Endpoint( + self.update_pet_with_form_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -911,6 +437,467 @@ class PetApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client, - callable=__update_pet_with_form + api_client=api_client ) + + def add_pet( + self, + pet, + **kwargs + ): + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_pet(pet, async_req=True) + >>> result = thread.get() + + Args: + pet (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet'] = \ + pet + return self.add_pet_endpoint.call_with_http_info(**kwargs) + + def delete_pet( + self, + pet_id, + **kwargs + ): + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.delete_pet_endpoint.call_with_http_info(**kwargs) + + def find_pets_by_status( + self, + status, + **kwargs + ): + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['status'] = \ + status + return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) + + def find_pets_by_tags( + self, + tags, + **kwargs + ): + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tags'] = \ + tags + return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) + + def get_pet_by_id( + self, + pet_id, + **kwargs + ): + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) + + def update_pet( + self, + pet, + **kwargs + ): + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet(pet, async_req=True) + >>> result = thread.get() + + Args: + pet (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet'] = \ + pet + return self.update_pet_endpoint.call_with_http_info(**kwargs) + + def update_pet_with_form( + self, + pet_id, + **kwargs + ): + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index aa701fc3b15..26a6bfe2220 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -35,74 +35,7 @@ class StoreApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.call_with_http_info(**kwargs) - - self.delete_order = _Endpoint( + self.delete_order_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -147,72 +80,9 @@ class StoreApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_order + api_client=api_client ) - - def __get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.get_inventory = _Endpoint( + self.get_inventory_endpoint = _Endpoint( settings={ 'response_type': ({str: (int,)},), 'auth': [ @@ -254,77 +124,9 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_inventory + api_client=api_client ) - - def __get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.call_with_http_info(**kwargs) - - self.get_order_by_id = _Endpoint( + self.get_order_by_id_endpoint = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -378,76 +180,9 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_order_by_id + api_client=api_client ) - - def __place_order( - self, - order, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(order, async_req=True) - >>> result = thread.get() - - Args: - order (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order'] = \ - order - return self.call_with_http_info(**kwargs) - - self.place_order = _Endpoint( + self.place_order_endpoint = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -496,6 +231,264 @@ class StoreApi(object): 'application/json' ] }, - api_client=api_client, - callable=__place_order + api_client=api_client ) + + def delete_order( + self, + order_id, + **kwargs + ): + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.delete_order_endpoint.call_with_http_info(**kwargs) + + def get_inventory( + self, + **kwargs + ): + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_inventory_endpoint.call_with_http_info(**kwargs) + + def get_order_by_id( + self, + order_id, + **kwargs + ): + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) + + def place_order( + self, + order, + **kwargs + ): + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.place_order(order, async_req=True) + >>> result = thread.get() + + Args: + order (Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order'] = \ + order + return self.place_order_endpoint.call_with_http_info(**kwargs) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 8c8b26e26f6..67b33352dda 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -35,74 +35,7 @@ class UserApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_user( - self, - user, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(user, async_req=True) - >>> result = thread.get() - - Args: - user (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user'] = \ - user - return self.call_with_http_info(**kwargs) - - self.create_user = _Endpoint( + self.create_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -148,76 +81,9 @@ class UserApi(object): 'application/json' ] }, - api_client=api_client, - callable=__create_user + api_client=api_client ) - - def __create_users_with_array_input( - self, - user, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(user, async_req=True) - >>> result = thread.get() - - Args: - user ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user'] = \ - user - return self.call_with_http_info(**kwargs) - - self.create_users_with_array_input = _Endpoint( + self.create_users_with_array_input_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -263,76 +129,9 @@ class UserApi(object): 'application/json' ] }, - api_client=api_client, - callable=__create_users_with_array_input + api_client=api_client ) - - def __create_users_with_list_input( - self, - user, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(user, async_req=True) - >>> result = thread.get() - - Args: - user ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user'] = \ - user - return self.call_with_http_info(**kwargs) - - self.create_users_with_list_input = _Endpoint( + self.create_users_with_list_input_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -378,77 +177,9 @@ class UserApi(object): 'application/json' ] }, - api_client=api_client, - callable=__create_users_with_list_input + api_client=api_client ) - - def __delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.call_with_http_info(**kwargs) - - self.delete_user = _Endpoint( + self.delete_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -493,76 +224,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__delete_user + api_client=api_client ) - - def __get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.call_with_http_info(**kwargs) - - self.get_user_by_name = _Endpoint( + self.get_user_by_name_endpoint = _Endpoint( settings={ 'response_type': (User,), 'auth': [], @@ -610,80 +274,9 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__get_user_by_name + api_client=api_client ) - - def __login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.call_with_http_info(**kwargs) - - self.login_user = _Endpoint( + self.login_user_endpoint = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -737,71 +330,9 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client, - callable=__login_user + api_client=api_client ) - - def __logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.logout_user = _Endpoint( + self.logout_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -839,81 +370,9 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client, - callable=__logout_user + api_client=api_client ) - - def __update_user( - self, - username, - user, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, user, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - user (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['user'] = \ - user - return self.call_with_http_info(**kwargs) - - self.update_user = _Endpoint( + self.update_user_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -965,6 +424,532 @@ class UserApi(object): 'application/json' ] }, - api_client=api_client, - callable=__update_user + api_client=api_client ) + + def create_user( + self, + user, + **kwargs + ): + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_user(user, async_req=True) + >>> result = thread.get() + + Args: + user (User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['user'] = \ + user + return self.create_user_endpoint.call_with_http_info(**kwargs) + + def create_users_with_array_input( + self, + user, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_array_input(user, async_req=True) + >>> result = thread.get() + + Args: + user ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['user'] = \ + user + return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) + + def create_users_with_list_input( + self, + user, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_list_input(user, async_req=True) + >>> result = thread.get() + + Args: + user ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['user'] = \ + user + return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) + + def delete_user( + self, + username, + **kwargs + ): + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.delete_user_endpoint.call_with_http_info(**kwargs) + + def get_user_by_name( + self, + username, + **kwargs + ): + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) + + def login_user( + self, + username, + password, + **kwargs + ): + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.login_user_endpoint.call_with_http_info(**kwargs) + + def logout_user( + self, + **kwargs + ): + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.logout_user_endpoint.call_with_http_info(**kwargs) + + def update_user( + self, + username, + user, + **kwargs + ): + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_user(username, user, async_req=True) + >>> result = thread.get() + + Args: + username (str): name that need to be deleted + user (User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['user'] = \ + user + return self.update_user_endpoint.call_with_http_info(**kwargs) + From b258bba5ddaf151d2616611236f03f8bef05def2 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 6 Sep 2021 20:20:04 -0700 Subject: [PATCH 14/75] Revert "Updated template so that generated code now renders docstrings and function parameters nicely in IDE. (#10331)" (#10338) This reverts commit ae88cf14dae6404beeb7efb8ba881ea86c12f37c. --- .../src/main/resources/python/api.mustache | 199 +- .../petstore_api/api/another_fake_api.py | 139 +- .../python/petstore_api/api/fake_api.py | 2275 +++++----- .../api/fake_classname_tags_123_api.py | 139 +- .../python/petstore_api/api/pet_api.py | 1253 +++--- .../python/petstore_api/api/store_api.py | 541 +-- .../python/petstore_api/api/user_api.py | 1101 ++--- .../petstore/python/test/test_fake_api.py | 20 +- .../petstore_api/api/another_fake_api.py | 139 +- .../petstore_api/api/fake_api.py | 2275 +++++----- .../api/fake_classname_tags_123_api.py | 139 +- .../petstore_api/api/pet_api.py | 1253 +++--- .../petstore_api/api/store_api.py | 541 +-- .../petstore_api/api/user_api.py | 1101 ++--- .../test/test_fake_api.py | 20 +- .../python/x_auth_id_alias/api/usage_api.py | 513 +-- .../python/dynamic_servers/api/usage_api.py | 257 +- .../petstore_api/api/another_fake_api.py | 139 +- .../python/petstore_api/api/default_api.py | 127 +- .../python/petstore_api/api/fake_api.py | 3709 +++++++++-------- .../api/fake_classname_tags_123_api.py | 139 +- .../python/petstore_api/api/pet_api.py | 965 ++--- .../python/petstore_api/api/store_api.py | 541 +-- .../python/petstore_api/api/user_api.py | 1101 ++--- 24 files changed, 9434 insertions(+), 9192 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 841ac8bb855..573224455a9 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -18,6 +18,7 @@ from {{packageName}}.model_utils import ( # noqa: F401 {{/imports}} +{{#operations}} class {{classname}}(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -29,9 +30,102 @@ class {{classname}}(object): if api_client is None: api_client = ApiClient() self.api_client = api_client -{{#operations}} {{#operation}} - self.{{operationId}}_endpoint = _Endpoint( + + def __{{operationId}}( + self, +{{#requiredParams}} +{{^defaultValue}} + {{paramName}}, +{{/defaultValue}} +{{/requiredParams}} +{{#requiredParams}} +{{#defaultValue}} + {{paramName}}={{{defaultValue}}}, +{{/defaultValue}} +{{/requiredParams}} + **kwargs + ): + """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + +{{#notes}} + {{{.}}} # noqa: E501 +{{/notes}} + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) + >>> result = thread.get() + +{{#requiredParams}} +{{#-last}} + Args: +{{/-last}} +{{/requiredParams}} +{{#requiredParams}} +{{^defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{{.}}}{{/description}} +{{/defaultValue}} +{{/requiredParams}} +{{#requiredParams}} +{{#defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}] +{{/defaultValue}} +{{/requiredParams}} + + Keyword Args:{{#optionalParams}} + {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}{{/optionalParams}} + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {{returnType}}{{^returnType}}None{{/returnType}} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') +{{#requiredParams}} + kwargs['{{paramName}}'] = \ + {{paramName}} +{{/requiredParams}} + return self.call_with_http_info(**kwargs) + + self.{{operationId}} = _Endpoint( settings={ 'response_type': {{#returnType}}({{{.}}},){{/returnType}}{{^returnType}}None{{/returnType}}, {{#authMethods}} @@ -205,105 +299,8 @@ class {{classname}}(object): 'content_type': [], {{/hasConsumes}} }, - api_client=api_client + api_client=api_client, + callable=__{{operationId}} ) {{/operation}} {{/operations}} - -{{#operations}} -{{#operation}} - def {{operationId}}( - self, -{{#requiredParams}} -{{^defaultValue}} - {{paramName}}, -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}}={{{defaultValue}}}, -{{/defaultValue}} -{{/requiredParams}} - **kwargs - ): - """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{.}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) - >>> result = thread.get() - -{{#requiredParams}} -{{#-last}} - Args: -{{/-last}} -{{/requiredParams}} -{{#requiredParams}} -{{^defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}] -{{/defaultValue}} -{{/requiredParams}} - - Keyword Args:{{#optionalParams}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}{{/optionalParams}} - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {{returnType}}{{^returnType}}None{{/returnType}} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') -{{#requiredParams}} - kwargs['{{paramName}}'] = \ - {{paramName}} -{{/requiredParams}} - return self.{{operationId}}_endpoint.call_with_http_info(**kwargs) - -{{/operation}} -{{/operations}} diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index 2ae65760a36..3a4931f84d4 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -35,7 +35,74 @@ class AnotherFakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.call_123_test_special_tags_endpoint = _Endpoint( + + def __call_123_test_special_tags( + self, + body, + **kwargs + ): + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.call_123_test_special_tags(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -83,72 +150,6 @@ class AnotherFakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__call_123_test_special_tags ) - - def call_123_test_special_tags( - self, - body, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index 4afa17e3cb2..d821febabed 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -42,7 +42,70 @@ class FakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.array_model_endpoint = _Endpoint( + + def __array_model( + self, + **kwargs + ): + """array_model # noqa: E501 + + Test serialization of ArrayModel # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_model(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (AnimalFarm): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnimalFarm + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.array_model = _Endpoint( settings={ 'response_type': (AnimalFarm,), 'auth': [], @@ -86,9 +149,73 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__array_model ) - self.boolean_endpoint = _Endpoint( + + def __boolean( + self, + **kwargs + ): + """boolean # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.boolean(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.boolean = _Endpoint( settings={ 'response_type': (bool,), 'auth': [], @@ -132,9 +259,77 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__boolean ) - self.create_xml_item_endpoint = _Endpoint( + + def __create_xml_item( + self, + xml_item, + **kwargs + ): + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> result = thread.get() + + Args: + xml_item (XmlItem): XmlItem Body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['xml_item'] = \ + xml_item + return self.call_with_http_info(**kwargs) + + self.create_xml_item = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -185,9 +380,73 @@ class FakeApi(object): 'text/xml; charset=utf-16' ] }, - api_client=api_client + api_client=api_client, + callable=__create_xml_item ) - self.number_with_validations_endpoint = _Endpoint( + + def __number_with_validations( + self, + **kwargs + ): + """number_with_validations # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (NumberWithValidations): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + NumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.number_with_validations = _Endpoint( settings={ 'response_type': (NumberWithValidations,), 'auth': [], @@ -231,9 +490,73 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__number_with_validations ) - self.object_model_with_ref_props_endpoint = _Endpoint( + + def __object_model_with_ref_props( + self, + **kwargs + ): + """object_model_with_ref_props # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.object_model_with_ref_props(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (ObjectModelWithRefProps): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ObjectModelWithRefProps + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.object_model_with_ref_props = _Endpoint( settings={ 'response_type': (ObjectModelWithRefProps,), 'auth': [], @@ -277,9 +600,73 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__object_model_with_ref_props ) - self.string_endpoint = _Endpoint( + + def __string( + self, + **kwargs + ): + """string # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.string = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -323,9 +710,73 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__string ) - self.string_enum_endpoint = _Endpoint( + + def __string_enum( + self, + **kwargs + ): + """string_enum # noqa: E501 + + Test serialization of outer enum # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string_enum(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (StringEnum): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + StringEnum + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.string_enum = _Endpoint( settings={ 'response_type': (StringEnum,), 'auth': [], @@ -369,9 +820,77 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__string_enum ) - self.test_body_with_file_schema_endpoint = _Endpoint( + + def __test_body_with_file_schema( + self, + body, + **kwargs + ): + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_file_schema(body, async_req=True) + >>> result = thread.get() + + Args: + body (FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -417,9 +936,80 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_body_with_file_schema ) - self.test_body_with_query_params_endpoint = _Endpoint( + + def __test_body_with_query_params( + self, + query, + body, + **kwargs + ): + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_query_params(query, body, async_req=True) + >>> result = thread.get() + + Args: + query (str): + body (User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query'] = \ + query + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -471,9 +1061,77 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_body_with_query_params ) - self.test_client_model_endpoint = _Endpoint( + + def __test_client_model( + self, + body, + **kwargs + ): + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_client_model(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_client_model = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -521,9 +1179,93 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_client_model ) - self.test_endpoint_enums_length_one_endpoint = _Endpoint( + + def __test_endpoint_enums_length_one( + self, + query_integer=3, + query_string="brillig", + path_string="hello", + path_integer=34, + header_number=1.234, + **kwargs + ): + """test_endpoint_enums_length_one # noqa: E501 + + This route has required values with enums of 1 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) + >>> result = thread.get() + + Args: + query_integer (int): defaults to 3, must be one of [3] + query_string (str): defaults to "brillig", must be one of ["brillig"] + path_string (str): defaults to "hello", must be one of ["hello"] + path_integer (int): defaults to 34, must be one of [34] + header_number (float): defaults to 1.234, must be one of [1.234] + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query_integer'] = \ + query_integer + kwargs['query_string'] = \ + query_string + kwargs['path_string'] = \ + path_string + kwargs['path_integer'] = \ + path_integer + kwargs['header_number'] = \ + header_number + return self.call_with_http_info(**kwargs) + + self.test_endpoint_enums_length_one = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -617,9 +1359,99 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__test_endpoint_enums_length_one ) - self.test_endpoint_parameters_endpoint = _Endpoint( + + def __test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -785,9 +1617,80 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_endpoint_parameters ) - self.test_enum_parameters_endpoint = _Endpoint( + + def __test_enum_parameters( + self, + **kwargs + ): + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -921,9 +1824,88 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_enum_parameters ) - self.test_group_parameters_endpoint = _Endpoint( + + def __test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -995,9 +1977,76 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__test_group_parameters ) - self.test_inline_additional_properties_endpoint = _Endpoint( + + def __test_inline_additional_properties( + self, + param, + **kwargs + ): + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_additional_properties(param, async_req=True) + >>> result = thread.get() + + Args: + param ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1043,9 +2092,80 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_inline_additional_properties ) - self.test_json_form_data_endpoint = _Endpoint( + + def __test_json_form_data( + self, + param, + param2, + **kwargs + ): + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1098,1095 +2218,6 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_json_form_data ) - - def array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.array_model_endpoint.call_with_http_info(**kwargs) - - def boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.boolean_endpoint.call_with_http_info(**kwargs) - - def create_xml_item( - self, - xml_item, - **kwargs - ): - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - Args: - xml_item (XmlItem): XmlItem Body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['xml_item'] = \ - xml_item - return self.create_xml_item_endpoint.call_with_http_info(**kwargs) - - def number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.number_with_validations_endpoint.call_with_http_info(**kwargs) - - def object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) - - def string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.string_endpoint.call_with_http_info(**kwargs) - - def string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.string_enum_endpoint.call_with_http_info(**kwargs) - - def test_body_with_file_schema( - self, - body, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - Args: - body (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) - - def test_body_with_query_params( - self, - query, - body, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - Args: - query (str): - body (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query'] = \ - query - kwargs['body'] = \ - body - return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) - - def test_client_model( - self, - body, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.test_client_model_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_enums_length_one( - self, - query_integer=3, - query_string="brillig", - path_string="hello", - path_integer=34, - header_number=1.234, - **kwargs - ): - """test_endpoint_enums_length_one # noqa: E501 - - This route has required values with enums of 1 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) - >>> result = thread.get() - - Args: - query_integer (int): defaults to 3, must be one of [3] - query_string (str): defaults to "brillig", must be one of ["brillig"] - path_string (str): defaults to "hello", must be one of ["hello"] - path_integer (int): defaults to 34, must be one of [34] - header_number (float): defaults to 1.234, must be one of [1.234] - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query_integer'] = \ - query_integer - kwargs['query_string'] = \ - query_string - kwargs['path_string'] = \ - path_string - kwargs['path_integer'] = \ - path_integer - kwargs['header_number'] = \ - header_number - return self.test_endpoint_enums_length_one_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) - - def test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) - - def test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) - - def test_inline_additional_properties( - self, - param, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - Args: - param ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) - - def test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 54fdf7f892a..1f8275b9eec 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -35,7 +35,74 @@ class FakeClassnameTags123Api(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.test_classname_endpoint = _Endpoint( + + def __test_classname( + self, + body, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_classname = _Endpoint( settings={ 'response_type': (Client,), 'auth': [ @@ -85,72 +152,6 @@ class FakeClassnameTags123Api(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_classname ) - - def test_classname( - self, - body, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index 1a8a4c51fde..52478be44a1 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -36,7 +36,73 @@ class PetApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.add_pet_endpoint = _Endpoint( + + def __add_pet( + self, + body, + **kwargs + ): + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.add_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -85,9 +151,77 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client + api_client=api_client, + callable=__add_pet ) - self.delete_pet_endpoint = _Endpoint( + + def __delete_pet( + self, + pet_id, + **kwargs + ): + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -139,9 +273,77 @@ class PetApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_pet ) - self.find_pets_by_status_endpoint = _Endpoint( + + def __find_pets_by_status( + self, + status, + **kwargs + ): + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['status'] = \ + status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -199,9 +401,77 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__find_pets_by_status ) - self.find_pets_by_tags_endpoint = _Endpoint( + + def __find_pets_by_tags( + self, + tags, + **kwargs + ): + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tags'] = \ + tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -252,9 +522,77 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__find_pets_by_tags ) - self.get_pet_by_id_endpoint = _Endpoint( + + def __get_pet_by_id( + self, + pet_id, + **kwargs + ): + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = _Endpoint( settings={ 'response_type': (Pet,), 'auth': [ @@ -304,9 +642,76 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_pet_by_id ) - self.update_pet_endpoint = _Endpoint( + + def __update_pet( + self, + body, + **kwargs + ): + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.update_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -355,9 +760,78 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client + api_client=api_client, + callable=__update_pet ) - self.update_pet_with_form_endpoint = _Endpoint( + + def __update_pet_with_form( + self, + pet_id, + **kwargs + ): + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -416,9 +890,79 @@ class PetApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__update_pet_with_form ) - self.upload_file_endpoint = _Endpoint( + + def __upload_file( + self, + pet_id, + **kwargs + ): + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file_type): file to upload. [optional] + files ([file_type]): files to upload. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.upload_file = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [ @@ -485,9 +1029,81 @@ class PetApi(object): 'multipart/form-data' ] }, - api_client=api_client + api_client=api_client, + callable=__upload_file ) - self.upload_file_with_required_file_endpoint = _Endpoint( + + def __upload_file_with_required_file( + self, + pet_id, + required_file, + **kwargs + ): + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + required_file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file + return self.call_with_http_info(**kwargs) + + self.upload_file_with_required_file = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [ @@ -549,605 +1165,6 @@ class PetApi(object): 'multipart/form-data' ] }, - api_client=api_client + api_client=api_client, + callable=__upload_file_with_required_file ) - - def add_pet( - self, - body, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.add_pet_endpoint.call_with_http_info(**kwargs) - - def delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.delete_pet_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['status'] = \ - status - return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['tags'] = \ - tags - return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) - - def get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) - - def update_pet( - self, - body, - **kwargs - ): - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.update_pet_endpoint.call_with_http_info(**kwargs) - - def update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) - - def upload_file( - self, - pet_id, - **kwargs - ): - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - file (file_type): file to upload. [optional] - files ([file_type]): files to upload. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.upload_file_endpoint.call_with_http_info(**kwargs) - - def upload_file_with_required_file( - self, - pet_id, - required_file, - **kwargs - ): - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - required_file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - kwargs['required_file'] = \ - required_file - return self.upload_file_with_required_file_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index cd573a91121..81f1779174b 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -35,7 +35,74 @@ class StoreApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.delete_order_endpoint = _Endpoint( + + def __delete_order( + self, + order_id, + **kwargs + ): + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -80,9 +147,72 @@ class StoreApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_order ) - self.get_inventory_endpoint = _Endpoint( + + def __get_inventory( + self, + **kwargs + ): + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.get_inventory = _Endpoint( settings={ 'response_type': ({str: (int,)},), 'auth': [ @@ -124,9 +254,77 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_inventory ) - self.get_order_by_id_endpoint = _Endpoint( + + def __get_order_by_id( + self, + order_id, + **kwargs + ): + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -180,9 +378,76 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_order_by_id ) - self.place_order_endpoint = _Endpoint( + + def __place_order( + self, + body, + **kwargs + ): + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.place_order(body, async_req=True) + >>> result = thread.get() + + Args: + body (Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.place_order = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -229,264 +494,6 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__place_order ) - - def delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.delete_order_endpoint.call_with_http_info(**kwargs) - - def get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.get_inventory_endpoint.call_with_http_info(**kwargs) - - def get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) - - def place_order( - self, - body, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - Args: - body (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.place_order_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 3088eb159f1..931b31d5ef8 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -35,7 +35,74 @@ class UserApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.create_user_endpoint = _Endpoint( + + def __create_user( + self, + body, + **kwargs + ): + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_user(body, async_req=True) + >>> result = thread.get() + + Args: + body (User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -79,9 +146,76 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__create_user ) - self.create_users_with_array_input_endpoint = _Endpoint( + + def __create_users_with_array_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_array_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -125,9 +259,76 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__create_users_with_array_input ) - self.create_users_with_list_input_endpoint = _Endpoint( + + def __create_users_with_list_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_list_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -171,9 +372,77 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__create_users_with_list_input ) - self.delete_user_endpoint = _Endpoint( + + def __delete_user( + self, + username, + **kwargs + ): + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.delete_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -218,9 +487,76 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_user ) - self.get_user_by_name_endpoint = _Endpoint( + + def __get_user_by_name( + self, + username, + **kwargs + ): + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = _Endpoint( settings={ 'response_type': (User,), 'auth': [], @@ -268,9 +604,80 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_user_by_name ) - self.login_user_endpoint = _Endpoint( + + def __login_user( + self, + username, + password, + **kwargs + ): + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.call_with_http_info(**kwargs) + + self.login_user = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -324,9 +731,71 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__login_user ) - self.logout_user_endpoint = _Endpoint( + + def __logout_user( + self, + **kwargs + ): + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.logout_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -364,9 +833,81 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__logout_user ) - self.update_user_endpoint = _Endpoint( + + def __update_user( + self, + username, + body, + **kwargs + ): + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_user(username, body, async_req=True) + >>> result = thread.get() + + Args: + username (str): name that need to be deleted + body (User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.update_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -416,532 +957,6 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__update_user ) - - def create_user( - self, - body, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - Args: - body (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.create_user_endpoint.call_with_http_info(**kwargs) - - def create_users_with_array_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) - - def create_users_with_list_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) - - def delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.delete_user_endpoint.call_with_http_info(**kwargs) - - def get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) - - def login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.login_user_endpoint.call_with_http_info(**kwargs) - - def logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.logout_user_endpoint.call_with_http_info(**kwargs) - - def update_user( - self, - username, - body, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - body (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['body'] = \ - body - return self.update_user_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index 9275f2047c4..34d207f3c71 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -38,7 +38,7 @@ class TestFakeApi(unittest.TestCase): """Test case for boolean """ - endpoint = self.api.boolean_endpoint + endpoint = self.api.boolean assert endpoint.openapi_types['body'] == (bool,) assert endpoint.settings['response_type'] == (bool,) @@ -46,7 +46,7 @@ class TestFakeApi(unittest.TestCase): """Test case for string """ - endpoint = self.api.string_endpoint + endpoint = self.api.string assert endpoint.openapi_types['body'] == (str,) assert endpoint.settings['response_type'] == (str,) @@ -55,7 +55,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import object_model_with_ref_props - endpoint = self.api.object_model_with_ref_props_endpoint + endpoint = self.api.object_model_with_ref_props assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) @@ -64,7 +64,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import string_enum - endpoint = self.api.string_enum_endpoint + endpoint = self.api.string_enum assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) assert endpoint.settings['response_type'] == (string_enum.StringEnum,) @@ -73,7 +73,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import animal_farm - endpoint = self.api.array_model_endpoint + endpoint = self.api.array_model assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) @@ -82,7 +82,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import number_with_validations - endpoint = self.api.number_with_validations_endpoint + endpoint = self.api.number_with_validations assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) @@ -110,14 +110,14 @@ class TestFakeApi(unittest.TestCase): """ # when we omit the required enums of length one, they are still set - endpoint = self.api.test_endpoint_enums_length_one_endpoint + endpoint = self.api.test_endpoint_enums_length_one import six if six.PY3: from unittest.mock import patch else: from mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: - self.api.test_endpoint_enums_length_one() + endpoint() call_with_http_info.assert_called_with( _check_input_type=True, _check_return_type=True, @@ -139,7 +139,7 @@ class TestFakeApi(unittest.TestCase): Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 """ # check that we can access the endpoint's validations - endpoint = self.api.test_endpoint_parameters_endpoint + endpoint = self.api.test_endpoint_parameters assert endpoint.validations[('number',)] == { 'inclusive_maximum': 543.2, 'inclusive_minimum': 32.1, @@ -160,7 +160,7 @@ class TestFakeApi(unittest.TestCase): To test enum parameters # noqa: E501 """ # check that we can access the endpoint's allowed_values - endpoint = self.api.test_enum_parameters_endpoint + endpoint = self.api.test_enum_parameters assert endpoint.allowed_values[('enum_query_string',)] == { "_ABC": "_abc", "-EFG": "-efg", diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py index 2ae65760a36..3a4931f84d4 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py @@ -35,7 +35,74 @@ class AnotherFakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.call_123_test_special_tags_endpoint = _Endpoint( + + def __call_123_test_special_tags( + self, + body, + **kwargs + ): + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.call_123_test_special_tags(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -83,72 +150,6 @@ class AnotherFakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__call_123_test_special_tags ) - - def call_123_test_special_tags( - self, - body, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py index 4afa17e3cb2..d821febabed 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py @@ -42,7 +42,70 @@ class FakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.array_model_endpoint = _Endpoint( + + def __array_model( + self, + **kwargs + ): + """array_model # noqa: E501 + + Test serialization of ArrayModel # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_model(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (AnimalFarm): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnimalFarm + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.array_model = _Endpoint( settings={ 'response_type': (AnimalFarm,), 'auth': [], @@ -86,9 +149,73 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__array_model ) - self.boolean_endpoint = _Endpoint( + + def __boolean( + self, + **kwargs + ): + """boolean # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.boolean(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.boolean = _Endpoint( settings={ 'response_type': (bool,), 'auth': [], @@ -132,9 +259,77 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__boolean ) - self.create_xml_item_endpoint = _Endpoint( + + def __create_xml_item( + self, + xml_item, + **kwargs + ): + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> result = thread.get() + + Args: + xml_item (XmlItem): XmlItem Body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['xml_item'] = \ + xml_item + return self.call_with_http_info(**kwargs) + + self.create_xml_item = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -185,9 +380,73 @@ class FakeApi(object): 'text/xml; charset=utf-16' ] }, - api_client=api_client + api_client=api_client, + callable=__create_xml_item ) - self.number_with_validations_endpoint = _Endpoint( + + def __number_with_validations( + self, + **kwargs + ): + """number_with_validations # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (NumberWithValidations): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + NumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.number_with_validations = _Endpoint( settings={ 'response_type': (NumberWithValidations,), 'auth': [], @@ -231,9 +490,73 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__number_with_validations ) - self.object_model_with_ref_props_endpoint = _Endpoint( + + def __object_model_with_ref_props( + self, + **kwargs + ): + """object_model_with_ref_props # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.object_model_with_ref_props(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (ObjectModelWithRefProps): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ObjectModelWithRefProps + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.object_model_with_ref_props = _Endpoint( settings={ 'response_type': (ObjectModelWithRefProps,), 'auth': [], @@ -277,9 +600,73 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__object_model_with_ref_props ) - self.string_endpoint = _Endpoint( + + def __string( + self, + **kwargs + ): + """string # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.string = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -323,9 +710,73 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__string ) - self.string_enum_endpoint = _Endpoint( + + def __string_enum( + self, + **kwargs + ): + """string_enum # noqa: E501 + + Test serialization of outer enum # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string_enum(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (StringEnum): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + StringEnum + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.string_enum = _Endpoint( settings={ 'response_type': (StringEnum,), 'auth': [], @@ -369,9 +820,77 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__string_enum ) - self.test_body_with_file_schema_endpoint = _Endpoint( + + def __test_body_with_file_schema( + self, + body, + **kwargs + ): + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_file_schema(body, async_req=True) + >>> result = thread.get() + + Args: + body (FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -417,9 +936,80 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_body_with_file_schema ) - self.test_body_with_query_params_endpoint = _Endpoint( + + def __test_body_with_query_params( + self, + query, + body, + **kwargs + ): + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_query_params(query, body, async_req=True) + >>> result = thread.get() + + Args: + query (str): + body (User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query'] = \ + query + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -471,9 +1061,77 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_body_with_query_params ) - self.test_client_model_endpoint = _Endpoint( + + def __test_client_model( + self, + body, + **kwargs + ): + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_client_model(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_client_model = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -521,9 +1179,93 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_client_model ) - self.test_endpoint_enums_length_one_endpoint = _Endpoint( + + def __test_endpoint_enums_length_one( + self, + query_integer=3, + query_string="brillig", + path_string="hello", + path_integer=34, + header_number=1.234, + **kwargs + ): + """test_endpoint_enums_length_one # noqa: E501 + + This route has required values with enums of 1 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) + >>> result = thread.get() + + Args: + query_integer (int): defaults to 3, must be one of [3] + query_string (str): defaults to "brillig", must be one of ["brillig"] + path_string (str): defaults to "hello", must be one of ["hello"] + path_integer (int): defaults to 34, must be one of [34] + header_number (float): defaults to 1.234, must be one of [1.234] + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query_integer'] = \ + query_integer + kwargs['query_string'] = \ + query_string + kwargs['path_string'] = \ + path_string + kwargs['path_integer'] = \ + path_integer + kwargs['header_number'] = \ + header_number + return self.call_with_http_info(**kwargs) + + self.test_endpoint_enums_length_one = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -617,9 +1359,99 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__test_endpoint_enums_length_one ) - self.test_endpoint_parameters_endpoint = _Endpoint( + + def __test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -785,9 +1617,80 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_endpoint_parameters ) - self.test_enum_parameters_endpoint = _Endpoint( + + def __test_enum_parameters( + self, + **kwargs + ): + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -921,9 +1824,88 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_enum_parameters ) - self.test_group_parameters_endpoint = _Endpoint( + + def __test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -995,9 +1977,76 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__test_group_parameters ) - self.test_inline_additional_properties_endpoint = _Endpoint( + + def __test_inline_additional_properties( + self, + param, + **kwargs + ): + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_additional_properties(param, async_req=True) + >>> result = thread.get() + + Args: + param ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1043,9 +2092,80 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_inline_additional_properties ) - self.test_json_form_data_endpoint = _Endpoint( + + def __test_json_form_data( + self, + param, + param2, + **kwargs + ): + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1098,1095 +2218,6 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_json_form_data ) - - def array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.array_model_endpoint.call_with_http_info(**kwargs) - - def boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.boolean_endpoint.call_with_http_info(**kwargs) - - def create_xml_item( - self, - xml_item, - **kwargs - ): - """creates an XmlItem # noqa: E501 - - this route creates an XmlItem # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_xml_item(xml_item, async_req=True) - >>> result = thread.get() - - Args: - xml_item (XmlItem): XmlItem Body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['xml_item'] = \ - xml_item - return self.create_xml_item_endpoint.call_with_http_info(**kwargs) - - def number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.number_with_validations_endpoint.call_with_http_info(**kwargs) - - def object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) - - def string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.string_endpoint.call_with_http_info(**kwargs) - - def string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.string_enum_endpoint.call_with_http_info(**kwargs) - - def test_body_with_file_schema( - self, - body, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(body, async_req=True) - >>> result = thread.get() - - Args: - body (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) - - def test_body_with_query_params( - self, - query, - body, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, body, async_req=True) - >>> result = thread.get() - - Args: - query (str): - body (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query'] = \ - query - kwargs['body'] = \ - body - return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) - - def test_client_model( - self, - body, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.test_client_model_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_enums_length_one( - self, - query_integer=3, - query_string="brillig", - path_string="hello", - path_integer=34, - header_number=1.234, - **kwargs - ): - """test_endpoint_enums_length_one # noqa: E501 - - This route has required values with enums of 1 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string="brillig", path_string="hello", path_integer=34, header_number=1.234, async_req=True) - >>> result = thread.get() - - Args: - query_integer (int): defaults to 3, must be one of [3] - query_string (str): defaults to "brillig", must be one of ["brillig"] - path_string (str): defaults to "hello", must be one of ["hello"] - path_integer (int): defaults to 34, must be one of [34] - header_number (float): defaults to 1.234, must be one of [1.234] - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query_integer'] = \ - query_integer - kwargs['query_string'] = \ - query_string - kwargs['path_string'] = \ - path_string - kwargs['path_integer'] = \ - path_integer - kwargs['header_number'] = \ - header_number - return self.test_endpoint_enums_length_one_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) - - def test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) - - def test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) - - def test_inline_additional_properties( - self, - param, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(param, async_req=True) - >>> result = thread.get() - - Args: - param ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) - - def test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py index 54fdf7f892a..1f8275b9eec 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py @@ -35,7 +35,74 @@ class FakeClassnameTags123Api(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.test_classname_endpoint = _Endpoint( + + def __test_classname( + self, + body, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + Args: + body (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.test_classname = _Endpoint( settings={ 'response_type': (Client,), 'auth': [ @@ -85,72 +152,6 @@ class FakeClassnameTags123Api(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_classname ) - - def test_classname( - self, - body, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(body, async_req=True) - >>> result = thread.get() - - Args: - body (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py index 1a8a4c51fde..52478be44a1 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py @@ -36,7 +36,73 @@ class PetApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.add_pet_endpoint = _Endpoint( + + def __add_pet( + self, + body, + **kwargs + ): + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.add_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -85,9 +151,77 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client + api_client=api_client, + callable=__add_pet ) - self.delete_pet_endpoint = _Endpoint( + + def __delete_pet( + self, + pet_id, + **kwargs + ): + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -139,9 +273,77 @@ class PetApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_pet ) - self.find_pets_by_status_endpoint = _Endpoint( + + def __find_pets_by_status( + self, + status, + **kwargs + ): + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['status'] = \ + status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -199,9 +401,77 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__find_pets_by_status ) - self.find_pets_by_tags_endpoint = _Endpoint( + + def __find_pets_by_tags( + self, + tags, + **kwargs + ): + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tags'] = \ + tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -252,9 +522,77 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__find_pets_by_tags ) - self.get_pet_by_id_endpoint = _Endpoint( + + def __get_pet_by_id( + self, + pet_id, + **kwargs + ): + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = _Endpoint( settings={ 'response_type': (Pet,), 'auth': [ @@ -304,9 +642,76 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_pet_by_id ) - self.update_pet_endpoint = _Endpoint( + + def __update_pet( + self, + body, + **kwargs + ): + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet(body, async_req=True) + >>> result = thread.get() + + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.update_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -355,9 +760,78 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client + api_client=api_client, + callable=__update_pet ) - self.update_pet_with_form_endpoint = _Endpoint( + + def __update_pet_with_form( + self, + pet_id, + **kwargs + ): + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -416,9 +890,79 @@ class PetApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__update_pet_with_form ) - self.upload_file_endpoint = _Endpoint( + + def __upload_file( + self, + pet_id, + **kwargs + ): + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file_type): file to upload. [optional] + files ([file_type]): files to upload. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.upload_file = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [ @@ -485,9 +1029,81 @@ class PetApi(object): 'multipart/form-data' ] }, - api_client=api_client + api_client=api_client, + callable=__upload_file ) - self.upload_file_with_required_file_endpoint = _Endpoint( + + def __upload_file_with_required_file( + self, + pet_id, + required_file, + **kwargs + ): + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to update + required_file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file + return self.call_with_http_info(**kwargs) + + self.upload_file_with_required_file = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [ @@ -549,605 +1165,6 @@ class PetApi(object): 'multipart/form-data' ] }, - api_client=api_client + api_client=api_client, + callable=__upload_file_with_required_file ) - - def add_pet( - self, - body, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.add_pet_endpoint.call_with_http_info(**kwargs) - - def delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.delete_pet_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['status'] = \ - status - return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['tags'] = \ - tags - return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) - - def get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) - - def update_pet( - self, - body, - **kwargs - ): - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(body, async_req=True) - >>> result = thread.get() - - Args: - body (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.update_pet_endpoint.call_with_http_info(**kwargs) - - def update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) - - def upload_file( - self, - pet_id, - **kwargs - ): - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - file (file_type): file to upload. [optional] - files ([file_type]): files to upload. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.upload_file_endpoint.call_with_http_info(**kwargs) - - def upload_file_with_required_file( - self, - pet_id, - required_file, - **kwargs - ): - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to update - required_file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - kwargs['required_file'] = \ - required_file - return self.upload_file_with_required_file_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py index cd573a91121..81f1779174b 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py @@ -35,7 +35,74 @@ class StoreApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.delete_order_endpoint = _Endpoint( + + def __delete_order( + self, + order_id, + **kwargs + ): + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -80,9 +147,72 @@ class StoreApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_order ) - self.get_inventory_endpoint = _Endpoint( + + def __get_inventory( + self, + **kwargs + ): + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.get_inventory = _Endpoint( settings={ 'response_type': ({str: (int,)},), 'auth': [ @@ -124,9 +254,77 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_inventory ) - self.get_order_by_id_endpoint = _Endpoint( + + def __get_order_by_id( + self, + order_id, + **kwargs + ): + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -180,9 +378,76 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_order_by_id ) - self.place_order_endpoint = _Endpoint( + + def __place_order( + self, + body, + **kwargs + ): + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.place_order(body, async_req=True) + >>> result = thread.get() + + Args: + body (Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.place_order = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -229,264 +494,6 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__place_order ) - - def delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.delete_order_endpoint.call_with_http_info(**kwargs) - - def get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.get_inventory_endpoint.call_with_http_info(**kwargs) - - def get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) - - def place_order( - self, - body, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(body, async_req=True) - >>> result = thread.get() - - Args: - body (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.place_order_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py index 3088eb159f1..931b31d5ef8 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py @@ -35,7 +35,74 @@ class UserApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.create_user_endpoint = _Endpoint( + + def __create_user( + self, + body, + **kwargs + ): + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_user(body, async_req=True) + >>> result = thread.get() + + Args: + body (User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -79,9 +146,76 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__create_user ) - self.create_users_with_array_input_endpoint = _Endpoint( + + def __create_users_with_array_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_array_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -125,9 +259,76 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__create_users_with_array_input ) - self.create_users_with_list_input_endpoint = _Endpoint( + + def __create_users_with_list_input( + self, + body, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_list_input(body, async_req=True) + >>> result = thread.get() + + Args: + body ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -171,9 +372,77 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__create_users_with_list_input ) - self.delete_user_endpoint = _Endpoint( + + def __delete_user( + self, + username, + **kwargs + ): + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.delete_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -218,9 +487,76 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_user ) - self.get_user_by_name_endpoint = _Endpoint( + + def __get_user_by_name( + self, + username, + **kwargs + ): + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = _Endpoint( settings={ 'response_type': (User,), 'auth': [], @@ -268,9 +604,80 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_user_by_name ) - self.login_user_endpoint = _Endpoint( + + def __login_user( + self, + username, + password, + **kwargs + ): + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.call_with_http_info(**kwargs) + + self.login_user = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -324,9 +731,71 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__login_user ) - self.logout_user_endpoint = _Endpoint( + + def __logout_user( + self, + **kwargs + ): + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.logout_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -364,9 +833,81 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__logout_user ) - self.update_user_endpoint = _Endpoint( + + def __update_user( + self, + username, + body, + **kwargs + ): + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_user(username, body, async_req=True) + >>> result = thread.get() + + Args: + username (str): name that need to be deleted + body (User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.update_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -416,532 +957,6 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__update_user ) - - def create_user( - self, - body, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(body, async_req=True) - >>> result = thread.get() - - Args: - body (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.create_user_endpoint.call_with_http_info(**kwargs) - - def create_users_with_array_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) - - def create_users_with_list_input( - self, - body, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(body, async_req=True) - >>> result = thread.get() - - Args: - body ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) - - def delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.delete_user_endpoint.call_with_http_info(**kwargs) - - def get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) - - def login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.login_user_endpoint.call_with_http_info(**kwargs) - - def logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.logout_user_endpoint.call_with_http_info(**kwargs) - - def update_user( - self, - username, - body, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, body, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - body (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['body'] = \ - body - return self.update_user_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py index 9275f2047c4..34d207f3c71 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py @@ -38,7 +38,7 @@ class TestFakeApi(unittest.TestCase): """Test case for boolean """ - endpoint = self.api.boolean_endpoint + endpoint = self.api.boolean assert endpoint.openapi_types['body'] == (bool,) assert endpoint.settings['response_type'] == (bool,) @@ -46,7 +46,7 @@ class TestFakeApi(unittest.TestCase): """Test case for string """ - endpoint = self.api.string_endpoint + endpoint = self.api.string assert endpoint.openapi_types['body'] == (str,) assert endpoint.settings['response_type'] == (str,) @@ -55,7 +55,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import object_model_with_ref_props - endpoint = self.api.object_model_with_ref_props_endpoint + endpoint = self.api.object_model_with_ref_props assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) @@ -64,7 +64,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import string_enum - endpoint = self.api.string_enum_endpoint + endpoint = self.api.string_enum assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) assert endpoint.settings['response_type'] == (string_enum.StringEnum,) @@ -73,7 +73,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import animal_farm - endpoint = self.api.array_model_endpoint + endpoint = self.api.array_model assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) @@ -82,7 +82,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import number_with_validations - endpoint = self.api.number_with_validations_endpoint + endpoint = self.api.number_with_validations assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) @@ -110,14 +110,14 @@ class TestFakeApi(unittest.TestCase): """ # when we omit the required enums of length one, they are still set - endpoint = self.api.test_endpoint_enums_length_one_endpoint + endpoint = self.api.test_endpoint_enums_length_one import six if six.PY3: from unittest.mock import patch else: from mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: - self.api.test_endpoint_enums_length_one() + endpoint() call_with_http_info.assert_called_with( _check_input_type=True, _check_return_type=True, @@ -139,7 +139,7 @@ class TestFakeApi(unittest.TestCase): Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 """ # check that we can access the endpoint's validations - endpoint = self.api.test_endpoint_parameters_endpoint + endpoint = self.api.test_endpoint_parameters assert endpoint.validations[('number',)] == { 'inclusive_maximum': 543.2, 'inclusive_minimum': 32.1, @@ -160,7 +160,7 @@ class TestFakeApi(unittest.TestCase): To test enum parameters # noqa: E501 """ # check that we can access the endpoint's allowed_values - endpoint = self.api.test_enum_parameters_endpoint + endpoint = self.api.test_enum_parameters assert endpoint.allowed_values[('enum_query_string',)] == { "_ABC": "_abc", "-EFG": "-efg", diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py index b9bc47de2b3..865341d7c66 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py @@ -34,7 +34,69 @@ class UsageApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.any_key_endpoint = _Endpoint( + + def __any_key( + self, + **kwargs + ): + """Use any API key # noqa: E501 + + Use any API key # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.any_key(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.any_key = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ @@ -77,9 +139,72 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__any_key ) - self.both_keys_endpoint = _Endpoint( + + def __both_keys( + self, + **kwargs + ): + """Use both API keys # noqa: E501 + + Use both API keys # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.both_keys(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.both_keys = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ @@ -122,9 +247,72 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__both_keys ) - self.key_in_header_endpoint = _Endpoint( + + def __key_in_header( + self, + **kwargs + ): + """Use API key in header # noqa: E501 + + Use API key in header # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.key_in_header(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.key_in_header = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ @@ -166,9 +354,72 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__key_in_header ) - self.key_in_query_endpoint = _Endpoint( + + def __key_in_query( + self, + **kwargs + ): + """Use API key in query # noqa: E501 + + Use API key in query # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.key_in_query(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.key_in_query = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [ @@ -210,250 +461,6 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__key_in_query ) - - def any_key( - self, - **kwargs - ): - """Use any API key # noqa: E501 - - Use any API key # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.any_key(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.any_key_endpoint.call_with_http_info(**kwargs) - - def both_keys( - self, - **kwargs - ): - """Use both API keys # noqa: E501 - - Use both API keys # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.both_keys(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.both_keys_endpoint.call_with_http_info(**kwargs) - - def key_in_header( - self, - **kwargs - ): - """Use API key in header # noqa: E501 - - Use API key in header # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.key_in_header(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.key_in_header_endpoint.call_with_http_info(**kwargs) - - def key_in_query( - self, - **kwargs - ): - """Use API key in query # noqa: E501 - - Use API key in query # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.key_in_query(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.key_in_query_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py index d9e5929e14c..c60c19b881b 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py @@ -34,7 +34,69 @@ class UsageApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.custom_server_endpoint = _Endpoint( + + def __custom_server( + self, + **kwargs + ): + """Use custom server # noqa: E501 + + Use custom server # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.custom_server(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.custom_server = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [], @@ -123,9 +185,72 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__custom_server ) - self.default_server_endpoint = _Endpoint( + + def __default_server( + self, + **kwargs + ): + """Use default server # noqa: E501 + + Use default server # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.default_server(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.default_server = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), 'auth': [], @@ -165,128 +290,6 @@ class UsageApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__default_server ) - - def custom_server( - self, - **kwargs - ): - """Use custom server # noqa: E501 - - Use custom server # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.custom_server(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.custom_server_endpoint.call_with_http_info(**kwargs) - - def default_server( - self, - **kwargs - ): - """Use default server # noqa: E501 - - Use default server # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.default_server(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.default_server_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index c99ba19bce0..4072532f378 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -35,7 +35,74 @@ class AnotherFakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.call_123_test_special_tags_endpoint = _Endpoint( + + def __call_123_test_special_tags( + self, + client, + **kwargs + ): + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.call_123_test_special_tags(client, async_req=True) + >>> result = thread.get() + + Args: + client (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['client'] = \ + client + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -83,72 +150,6 @@ class AnotherFakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__call_123_test_special_tags ) - - def call_123_test_special_tags( - self, - client, - **kwargs - ): - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.call_123_test_special_tags(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client'] = \ - client - return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 4d23104e6b0..21f9ca13b05 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -35,7 +35,68 @@ class DefaultApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.foo_get_endpoint = _Endpoint( + + def __foo_get( + self, + **kwargs + ): + """foo_get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.foo_get(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + InlineResponseDefault + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.foo_get = _Endpoint( settings={ 'response_type': (InlineResponseDefault,), 'auth': [], @@ -75,66 +136,6 @@ class DefaultApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__foo_get ) - - def foo_get( - self, - **kwargs - ): - """foo_get # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.foo_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - InlineResponseDefault - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.foo_get_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 056c1f33f16..0f57f637f25 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -50,7 +50,69 @@ class FakeApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.additional_properties_with_array_of_enums_endpoint = _Endpoint( + + def __additional_properties_with_array_of_enums( + self, + **kwargs + ): + """Additional Properties with Array of Enums # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.additional_properties_with_array_of_enums(async_req=True) + >>> result = thread.get() + + + Keyword Args: + additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AdditionalPropertiesWithArrayOfEnums + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.additional_properties_with_array_of_enums = _Endpoint( settings={ 'response_type': (AdditionalPropertiesWithArrayOfEnums,), 'auth': [], @@ -96,9 +158,73 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__additional_properties_with_array_of_enums ) - self.array_model_endpoint = _Endpoint( + + def __array_model( + self, + **kwargs + ): + """array_model # noqa: E501 + + Test serialization of ArrayModel # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_model(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (AnimalFarm): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnimalFarm + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.array_model = _Endpoint( settings={ 'response_type': (AnimalFarm,), 'auth': [], @@ -144,9 +270,72 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__array_model ) - self.array_of_enums_endpoint = _Endpoint( + + def __array_of_enums( + self, + **kwargs + ): + """Array of Enums # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_of_enums(async_req=True) + >>> result = thread.get() + + + Keyword Args: + array_of_enums (ArrayOfEnums): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ArrayOfEnums + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.array_of_enums = _Endpoint( settings={ 'response_type': (ArrayOfEnums,), 'auth': [], @@ -192,9 +381,73 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__array_of_enums ) - self.boolean_endpoint = _Endpoint( + + def __boolean( + self, + **kwargs + ): + """boolean # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.boolean(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.boolean = _Endpoint( settings={ 'response_type': (bool,), 'auth': [], @@ -240,9 +493,73 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__boolean ) - self.composed_one_of_number_with_validations_endpoint = _Endpoint( + + def __composed_one_of_number_with_validations( + self, + **kwargs + ): + """composed_one_of_number_with_validations # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.composed_one_of_number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ComposedOneOfNumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.composed_one_of_number_with_validations = _Endpoint( settings={ 'response_type': (ComposedOneOfNumberWithValidations,), 'auth': [], @@ -288,9 +605,76 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__composed_one_of_number_with_validations ) - self.download_attachment_endpoint = _Endpoint( + + def __download_attachment( + self, + file_name, + **kwargs + ): + """downloads a file using Content-Disposition # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.download_attachment(file_name, async_req=True) + >>> result = thread.get() + + Args: + file_name (str): file name + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + file_type + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['file_name'] = \ + file_name + return self.call_with_http_info(**kwargs) + + self.download_attachment = _Endpoint( settings={ 'response_type': (file_type,), 'auth': [], @@ -342,9 +726,72 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__download_attachment ) - self.enum_test_endpoint = _Endpoint( + + def __enum_test( + self, + **kwargs + ): + """Object contains enum properties and array properties containing enums # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.enum_test(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_test (EnumTest): Input object. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + EnumTest + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.enum_test = _Endpoint( settings={ 'response_type': (EnumTest,), 'auth': [], @@ -390,9 +837,71 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__enum_test ) - self.fake_health_get_endpoint = _Endpoint( + + def __fake_health_get( + self, + **kwargs + ): + """Health check endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fake_health_get(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + HealthCheckResult + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.fake_health_get = _Endpoint( settings={ 'response_type': (HealthCheckResult,), 'auth': [], @@ -432,9 +941,77 @@ class FakeApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__fake_health_get ) - self.mammal_endpoint = _Endpoint( + + def __mammal( + self, + mammal, + **kwargs + ): + """mammal # noqa: E501 + + Test serialization of mammals # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.mammal(mammal, async_req=True) + >>> result = thread.get() + + Args: + mammal (Mammal): Input mammal + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Mammal + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['mammal'] = \ + mammal + return self.call_with_http_info(**kwargs) + + self.mammal = _Endpoint( settings={ 'response_type': (Mammal,), 'auth': [], @@ -482,9 +1059,73 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__mammal ) - self.number_with_validations_endpoint = _Endpoint( + + def __number_with_validations( + self, + **kwargs + ): + """number_with_validations # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (NumberWithValidations): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + NumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.number_with_validations = _Endpoint( settings={ 'response_type': (NumberWithValidations,), 'auth': [], @@ -530,9 +1171,73 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__number_with_validations ) - self.object_model_with_ref_props_endpoint = _Endpoint( + + def __object_model_with_ref_props( + self, + **kwargs + ): + """object_model_with_ref_props # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.object_model_with_ref_props(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (ObjectModelWithRefProps): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ObjectModelWithRefProps + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.object_model_with_ref_props = _Endpoint( settings={ 'response_type': (ObjectModelWithRefProps,), 'auth': [], @@ -578,9 +1283,72 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__object_model_with_ref_props ) - self.post_inline_additional_properties_payload_endpoint = _Endpoint( + + def __post_inline_additional_properties_payload( + self, + **kwargs + ): + """post_inline_additional_properties_payload # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.post_inline_additional_properties_payload(async_req=True) + >>> result = thread.get() + + + Keyword Args: + inline_object6 (InlineObject6): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + InlineObject6 + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.post_inline_additional_properties_payload = _Endpoint( settings={ 'response_type': (InlineObject6,), 'auth': [], @@ -626,9 +1394,72 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__post_inline_additional_properties_payload ) - self.post_inline_additional_properties_ref_payload_endpoint = _Endpoint( + + def __post_inline_additional_properties_ref_payload( + self, + **kwargs + ): + """post_inline_additional_properties_ref_payload # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.post_inline_additional_properties_ref_payload(async_req=True) + >>> result = thread.get() + + + Keyword Args: + inline_additional_properties_ref_payload (InlineAdditionalPropertiesRefPayload): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + InlineAdditionalPropertiesRefPayload + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.post_inline_additional_properties_ref_payload = _Endpoint( settings={ 'response_type': (InlineAdditionalPropertiesRefPayload,), 'auth': [], @@ -674,9 +1505,73 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__post_inline_additional_properties_ref_payload ) - self.string_endpoint = _Endpoint( + + def __string( + self, + **kwargs + ): + """string # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.string = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -722,9 +1617,73 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__string ) - self.string_enum_endpoint = _Endpoint( + + def __string_enum( + self, + **kwargs + ): + """string_enum # noqa: E501 + + Test serialization of outer enum # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.string_enum(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (StringEnum): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + StringEnum + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.string_enum = _Endpoint( settings={ 'response_type': (StringEnum,), 'auth': [], @@ -771,9 +1730,77 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__string_enum ) - self.test_body_with_file_schema_endpoint = _Endpoint( + + def __test_body_with_file_schema( + self, + file_schema_test_class, + **kwargs + ): + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) + >>> result = thread.get() + + Args: + file_schema_test_class (FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['file_schema_test_class'] = \ + file_schema_test_class + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -819,9 +1846,80 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_body_with_file_schema ) - self.test_body_with_query_params_endpoint = _Endpoint( + + def __test_body_with_query_params( + self, + query, + user, + **kwargs + ): + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_body_with_query_params(query, user, async_req=True) + >>> result = thread.get() + + Args: + query (str): + user (User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['query'] = \ + query + kwargs['user'] = \ + user + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -873,9 +1971,77 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_body_with_query_params ) - self.test_client_model_endpoint = _Endpoint( + + def __test_client_model( + self, + client, + **kwargs + ): + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_client_model(client, async_req=True) + >>> result = thread.get() + + Args: + client (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['client'] = \ + client + return self.call_with_http_info(**kwargs) + + self.test_client_model = _Endpoint( settings={ 'response_type': (Client,), 'auth': [], @@ -923,9 +2089,99 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_client_model ) - self.test_endpoint_parameters_endpoint = _Endpoint( + + def __test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00') + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -1091,9 +2347,80 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_endpoint_parameters ) - self.test_enum_parameters_endpoint = _Endpoint( + + def __test_enum_parameters( + self, + **kwargs + ): + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1227,9 +2554,88 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_enum_parameters ) - self.test_group_parameters_endpoint = _Endpoint( + + def __test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -1303,9 +2709,76 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__test_group_parameters ) - self.test_inline_additional_properties_endpoint = _Endpoint( + + def __test_inline_additional_properties( + self, + request_body, + **kwargs + ): + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_inline_additional_properties(request_body, async_req=True) + >>> result = thread.get() + + Args: + request_body ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['request_body'] = \ + request_body + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1351,9 +2824,80 @@ class FakeApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_inline_additional_properties ) - self.test_json_form_data_endpoint = _Endpoint( + + def __test_json_form_data( + self, + param, + param2, + **kwargs + ): + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1406,9 +2950,93 @@ class FakeApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__test_json_form_data ) - self.test_query_parameter_collection_format_endpoint = _Endpoint( + + def __test_query_parameter_collection_format( + self, + pipe, + ioutil, + http, + url, + context, + **kwargs + ): + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + Args: + pipe ([str]): + ioutil ([str]): + http ([str]): + url ([str]): + context ([str]): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pipe'] = \ + pipe + kwargs['ioutil'] = \ + ioutil + kwargs['http'] = \ + http + kwargs['url'] = \ + url + kwargs['context'] = \ + context + return self.call_with_http_info(**kwargs) + + self.test_query_parameter_collection_format = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -1482,9 +3110,76 @@ class FakeApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__test_query_parameter_collection_format ) - self.upload_download_file_endpoint = _Endpoint( + + def __upload_download_file( + self, + body, + **kwargs + ): + """uploads a file and downloads a file using application/octet-stream # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_download_file(body, async_req=True) + >>> result = thread.get() + + Args: + body (file_type): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + file_type + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.upload_download_file = _Endpoint( settings={ 'response_type': (file_type,), 'auth': [], @@ -1532,9 +3227,77 @@ class FakeApi(object): 'application/octet-stream' ] }, - api_client=api_client + api_client=api_client, + callable=__upload_download_file ) - self.upload_file_endpoint = _Endpoint( + + def __upload_file( + self, + file, + **kwargs + ): + """uploads a file using multipart/form-data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_file(file, async_req=True) + >>> result = thread.get() + + Args: + file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['file'] = \ + file + return self.call_with_http_info(**kwargs) + + self.upload_file = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [], @@ -1588,9 +3351,72 @@ class FakeApi(object): 'multipart/form-data' ] }, - api_client=api_client + api_client=api_client, + callable=__upload_file ) - self.upload_files_endpoint = _Endpoint( + + def __upload_files( + self, + **kwargs + ): + """uploads files using multipart/form-data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.upload_files(async_req=True) + >>> result = thread.get() + + + Keyword Args: + files ([file_type]): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.upload_files = _Endpoint( settings={ 'response_type': (ApiResponse,), 'auth': [], @@ -1638,1779 +3464,6 @@ class FakeApi(object): 'multipart/form-data' ] }, - api_client=api_client + api_client=api_client, + callable=__upload_files ) - - def additional_properties_with_array_of_enums( - self, - **kwargs - ): - """Additional Properties with Array of Enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.additional_properties_with_array_of_enums(async_req=True) - >>> result = thread.get() - - - Keyword Args: - additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AdditionalPropertiesWithArrayOfEnums - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.additional_properties_with_array_of_enums_endpoint.call_with_http_info(**kwargs) - - def array_model( - self, - **kwargs - ): - """array_model # noqa: E501 - - Test serialization of ArrayModel # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_model(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (AnimalFarm): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnimalFarm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.array_model_endpoint.call_with_http_info(**kwargs) - - def array_of_enums( - self, - **kwargs - ): - """Array of Enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.array_of_enums(async_req=True) - >>> result = thread.get() - - - Keyword Args: - array_of_enums (ArrayOfEnums): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ArrayOfEnums - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.array_of_enums_endpoint.call_with_http_info(**kwargs) - - def boolean( - self, - **kwargs - ): - """boolean # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.boolean(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (bool): Input boolean as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.boolean_endpoint.call_with_http_info(**kwargs) - - def composed_one_of_number_with_validations( - self, - **kwargs - ): - """composed_one_of_number_with_validations # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.composed_one_of_number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ComposedOneOfNumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.composed_one_of_number_with_validations_endpoint.call_with_http_info(**kwargs) - - def download_attachment( - self, - file_name, - **kwargs - ): - """downloads a file using Content-Disposition # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.download_attachment(file_name, async_req=True) - >>> result = thread.get() - - Args: - file_name (str): file name - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['file_name'] = \ - file_name - return self.download_attachment_endpoint.call_with_http_info(**kwargs) - - def enum_test( - self, - **kwargs - ): - """Object contains enum properties and array properties containing enums # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.enum_test(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_test (EnumTest): Input object. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - EnumTest - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.enum_test_endpoint.call_with_http_info(**kwargs) - - def fake_health_get( - self, - **kwargs - ): - """Health check endpoint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.fake_health_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - HealthCheckResult - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.fake_health_get_endpoint.call_with_http_info(**kwargs) - - def mammal( - self, - mammal, - **kwargs - ): - """mammal # noqa: E501 - - Test serialization of mammals # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.mammal(mammal, async_req=True) - >>> result = thread.get() - - Args: - mammal (Mammal): Input mammal - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Mammal - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['mammal'] = \ - mammal - return self.mammal_endpoint.call_with_http_info(**kwargs) - - def number_with_validations( - self, - **kwargs - ): - """number_with_validations # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.number_with_validations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (NumberWithValidations): Input number as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - NumberWithValidations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.number_with_validations_endpoint.call_with_http_info(**kwargs) - - def object_model_with_ref_props( - self, - **kwargs - ): - """object_model_with_ref_props # noqa: E501 - - Test serialization of object with $refed properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.object_model_with_ref_props(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (ObjectModelWithRefProps): Input model. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ObjectModelWithRefProps - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) - - def post_inline_additional_properties_payload( - self, - **kwargs - ): - """post_inline_additional_properties_payload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.post_inline_additional_properties_payload(async_req=True) - >>> result = thread.get() - - - Keyword Args: - inline_object6 (InlineObject6): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - InlineObject6 - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.post_inline_additional_properties_payload_endpoint.call_with_http_info(**kwargs) - - def post_inline_additional_properties_ref_payload( - self, - **kwargs - ): - """post_inline_additional_properties_ref_payload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.post_inline_additional_properties_ref_payload(async_req=True) - >>> result = thread.get() - - - Keyword Args: - inline_additional_properties_ref_payload (InlineAdditionalPropertiesRefPayload): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - InlineAdditionalPropertiesRefPayload - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.post_inline_additional_properties_ref_payload_endpoint.call_with_http_info(**kwargs) - - def string( - self, - **kwargs - ): - """string # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (str): Input string as post body. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.string_endpoint.call_with_http_info(**kwargs) - - def string_enum( - self, - **kwargs - ): - """string_enum # noqa: E501 - - Test serialization of outer enum # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.string_enum(async_req=True) - >>> result = thread.get() - - - Keyword Args: - body (StringEnum): Input enum. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - StringEnum - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.string_enum_endpoint.call_with_http_info(**kwargs) - - def test_body_with_file_schema( - self, - file_schema_test_class, - **kwargs - ): - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) - >>> result = thread.get() - - Args: - file_schema_test_class (FileSchemaTestClass): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['file_schema_test_class'] = \ - file_schema_test_class - return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) - - def test_body_with_query_params( - self, - query, - user, - **kwargs - ): - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_body_with_query_params(query, user, async_req=True) - >>> result = thread.get() - - Args: - query (str): - user (User): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query'] = \ - query - kwargs['user'] = \ - user - return self.test_body_with_query_params_endpoint.call_with_http_info(**kwargs) - - def test_client_model( - self, - client, - **kwargs - ): - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_client_model(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client'] = \ - client - return self.test_client_model_endpoint.call_with_http_info(**kwargs) - - def test_endpoint_parameters( - self, - number, - double, - pattern_without_delimiter, - byte, - **kwargs - ): - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - integer (int): None. [optional] - int32 (int): None. [optional] - int64 (int): None. [optional] - float (float): None. [optional] - string (str): None. [optional] - binary (file_type): None. [optional] - date (date): None. [optional] - date_time (datetime): None. [optional] if omitted the server will use the default value of dateutil_parser('2010-02-01T10:20:10.11111+01:00') - password (str): None. [optional] - param_callback (str): None. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['number'] = \ - number - kwargs['double'] = \ - double - kwargs['pattern_without_delimiter'] = \ - pattern_without_delimiter - kwargs['byte'] = \ - byte - return self.test_endpoint_parameters_endpoint.call_with_http_info(**kwargs) - - def test_enum_parameters( - self, - **kwargs - ): - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - - Keyword Args: - enum_header_string_array ([str]): Header parameter enum test (string array). [optional] - enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_string_array ([str]): Query parameter enum test (string array). [optional] - enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - enum_query_integer (int): Query parameter enum test (double). [optional] - enum_query_double (float): Query parameter enum test (double). [optional] - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of "$" - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of "-efg" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) - - def test_group_parameters( - self, - required_string_group, - required_boolean_group, - required_int64_group, - **kwargs - ): - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - Args: - required_string_group (int): Required String in group parameters - required_boolean_group (bool): Required Boolean in group parameters - required_int64_group (int): Required Integer in group parameters - - Keyword Args: - string_group (int): String in group parameters. [optional] - boolean_group (bool): Boolean in group parameters. [optional] - int64_group (int): Integer in group parameters. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['required_string_group'] = \ - required_string_group - kwargs['required_boolean_group'] = \ - required_boolean_group - kwargs['required_int64_group'] = \ - required_int64_group - return self.test_group_parameters_endpoint.call_with_http_info(**kwargs) - - def test_inline_additional_properties( - self, - request_body, - **kwargs - ): - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_inline_additional_properties(request_body, async_req=True) - >>> result = thread.get() - - Args: - request_body ({str: (str,)}): request body - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['request_body'] = \ - request_body - return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) - - def test_json_form_data( - self, - param, - param2, - **kwargs - ): - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['param'] = \ - param - kwargs['param2'] = \ - param2 - return self.test_json_form_data_endpoint.call_with_http_info(**kwargs) - - def test_query_parameter_collection_format( - self, - pipe, - ioutil, - http, - url, - context, - **kwargs - ): - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - Args: - pipe ([str]): - ioutil ([str]): - http ([str]): - url ([str]): - context ([str]): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pipe'] = \ - pipe - kwargs['ioutil'] = \ - ioutil - kwargs['http'] = \ - http - kwargs['url'] = \ - url - kwargs['context'] = \ - context - return self.test_query_parameter_collection_format_endpoint.call_with_http_info(**kwargs) - - def upload_download_file( - self, - body, - **kwargs - ): - """uploads a file and downloads a file using application/octet-stream # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_download_file(body, async_req=True) - >>> result = thread.get() - - Args: - body (file_type): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['body'] = \ - body - return self.upload_download_file_endpoint.call_with_http_info(**kwargs) - - def upload_file( - self, - file, - **kwargs - ): - """uploads a file using multipart/form-data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_file(file, async_req=True) - >>> result = thread.get() - - Args: - file (file_type): file to upload - - Keyword Args: - additional_metadata (str): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['file'] = \ - file - return self.upload_file_endpoint.call_with_http_info(**kwargs) - - def upload_files( - self, - **kwargs - ): - """uploads files using multipart/form-data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_files(async_req=True) - >>> result = thread.get() - - - Keyword Args: - files ([file_type]): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.upload_files_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index efcf30af12d..dd702d316bf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -35,7 +35,74 @@ class FakeClassnameTags123Api(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.test_classname_endpoint = _Endpoint( + + def __test_classname( + self, + client, + **kwargs + ): + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.test_classname(client, async_req=True) + >>> result = thread.get() + + Args: + client (Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['client'] = \ + client + return self.call_with_http_info(**kwargs) + + self.test_classname = _Endpoint( settings={ 'response_type': (Client,), 'auth': [ @@ -85,72 +152,6 @@ class FakeClassnameTags123Api(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__test_classname ) - - def test_classname( - self, - client, - **kwargs - ): - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.test_classname(client, async_req=True) - >>> result = thread.get() - - Args: - client (Client): client model - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client'] = \ - client - return self.test_classname_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index 1ae658e16d4..102c1f26def 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -35,7 +35,73 @@ class PetApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.add_pet_endpoint = _Endpoint( + + def __add_pet( + self, + pet, + **kwargs + ): + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_pet(pet, async_req=True) + >>> result = thread.get() + + Args: + pet (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet'] = \ + pet + return self.call_with_http_info(**kwargs) + + self.add_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -94,9 +160,77 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client + api_client=api_client, + callable=__add_pet ) - self.delete_pet_endpoint = _Endpoint( + + def __delete_pet( + self, + pet_id, + **kwargs + ): + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -148,9 +282,77 @@ class PetApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_pet ) - self.find_pets_by_status_endpoint = _Endpoint( + + def __find_pets_by_status( + self, + status, + **kwargs + ): + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['status'] = \ + status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -209,9 +411,77 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__find_pets_by_status ) - self.find_pets_by_tags_endpoint = _Endpoint( + + def __find_pets_by_tags( + self, + tags, + **kwargs + ): + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tags'] = \ + tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = _Endpoint( settings={ 'response_type': ([Pet],), 'auth': [ @@ -263,9 +533,77 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__find_pets_by_tags ) - self.get_pet_by_id_endpoint = _Endpoint( + + def __get_pet_by_id( + self, + pet_id, + **kwargs + ): + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = _Endpoint( settings={ 'response_type': (Pet,), 'auth': [ @@ -315,9 +653,76 @@ class PetApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_pet_by_id ) - self.update_pet_endpoint = _Endpoint( + + def __update_pet( + self, + pet, + **kwargs + ): + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet(pet, async_req=True) + >>> result = thread.get() + + Args: + pet (Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet'] = \ + pet + return self.call_with_http_info(**kwargs) + + self.update_pet = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -376,9 +781,78 @@ class PetApi(object): 'application/xml' ] }, - api_client=api_client + api_client=api_client, + callable=__update_pet ) - self.update_pet_with_form_endpoint = _Endpoint( + + def __update_pet_with_form( + self, + pet_id, + **kwargs + ): + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = _Endpoint( settings={ 'response_type': None, 'auth': [ @@ -437,467 +911,6 @@ class PetApi(object): 'application/x-www-form-urlencoded' ] }, - api_client=api_client + api_client=api_client, + callable=__update_pet_with_form ) - - def add_pet( - self, - pet, - **kwargs - ): - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pet(pet, async_req=True) - >>> result = thread.get() - - Args: - pet (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet'] = \ - pet - return self.add_pet_endpoint.call_with_http_info(**kwargs) - - def delete_pet( - self, - pet_id, - **kwargs - ): - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): Pet id to delete - - Keyword Args: - api_key (str): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.delete_pet_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_status( - self, - status, - **kwargs - ): - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - Args: - status ([str]): Status values that need to be considered for filter - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['status'] = \ - status - return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) - - def find_pets_by_tags( - self, - tags, - **kwargs - ): - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - Args: - tags ([str]): Tags to filter by - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['tags'] = \ - tags - return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) - - def get_pet_by_id( - self, - pet_id, - **kwargs - ): - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) - - def update_pet( - self, - pet, - **kwargs - ): - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet(pet, async_req=True) - >>> result = thread.get() - - Args: - pet (Pet): Pet object that needs to be added to the store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet'] = \ - pet - return self.update_pet_endpoint.call_with_http_info(**kwargs) - - def update_pet_with_form( - self, - pet_id, - **kwargs - ): - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - Args: - pet_id (int): ID of pet that needs to be updated - - Keyword Args: - name (str): Updated name of the pet. [optional] - status (str): Updated status of the pet. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_id'] = \ - pet_id - return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index 26a6bfe2220..aa701fc3b15 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -35,7 +35,74 @@ class StoreApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.delete_order_endpoint = _Endpoint( + + def __delete_order( + self, + order_id, + **kwargs + ): + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -80,9 +147,72 @@ class StoreApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_order ) - self.get_inventory_endpoint = _Endpoint( + + def __get_inventory( + self, + **kwargs + ): + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.get_inventory = _Endpoint( settings={ 'response_type': ({str: (int,)},), 'auth': [ @@ -124,9 +254,77 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_inventory ) - self.get_order_by_id_endpoint = _Endpoint( + + def __get_order_by_id( + self, + order_id, + **kwargs + ): + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -180,9 +378,76 @@ class StoreApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_order_by_id ) - self.place_order_endpoint = _Endpoint( + + def __place_order( + self, + order, + **kwargs + ): + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.place_order(order, async_req=True) + >>> result = thread.get() + + Args: + order (Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['order'] = \ + order + return self.call_with_http_info(**kwargs) + + self.place_order = _Endpoint( settings={ 'response_type': (Order,), 'auth': [], @@ -231,264 +496,6 @@ class StoreApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__place_order ) - - def delete_order( - self, - order_id, - **kwargs - ): - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (str): ID of the order that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.delete_order_endpoint.call_with_http_info(**kwargs) - - def get_inventory( - self, - **kwargs - ): - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.get_inventory_endpoint.call_with_http_info(**kwargs) - - def get_order_by_id( - self, - order_id, - **kwargs - ): - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - Args: - order_id (int): ID of pet that needs to be fetched - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_id'] = \ - order_id - return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) - - def place_order( - self, - order, - **kwargs - ): - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.place_order(order, async_req=True) - >>> result = thread.get() - - Args: - order (Order): order placed for purchasing the pet - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order'] = \ - order - return self.place_order_endpoint.call_with_http_info(**kwargs) - diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 67b33352dda..8c8b26e26f6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -35,7 +35,74 @@ class UserApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.create_user_endpoint = _Endpoint( + + def __create_user( + self, + user, + **kwargs + ): + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_user(user, async_req=True) + >>> result = thread.get() + + Args: + user (User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['user'] = \ + user + return self.call_with_http_info(**kwargs) + + self.create_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -81,9 +148,76 @@ class UserApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__create_user ) - self.create_users_with_array_input_endpoint = _Endpoint( + + def __create_users_with_array_input( + self, + user, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_array_input(user, async_req=True) + >>> result = thread.get() + + Args: + user ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['user'] = \ + user + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -129,9 +263,76 @@ class UserApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__create_users_with_array_input ) - self.create_users_with_list_input_endpoint = _Endpoint( + + def __create_users_with_list_input( + self, + user, + **kwargs + ): + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_users_with_list_input(user, async_req=True) + >>> result = thread.get() + + Args: + user ([User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['user'] = \ + user + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -177,9 +378,77 @@ class UserApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__create_users_with_list_input ) - self.delete_user_endpoint = _Endpoint( + + def __delete_user( + self, + username, + **kwargs + ): + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.delete_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -224,9 +493,76 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__delete_user ) - self.get_user_by_name_endpoint = _Endpoint( + + def __get_user_by_name( + self, + username, + **kwargs + ): + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = _Endpoint( settings={ 'response_type': (User,), 'auth': [], @@ -274,9 +610,80 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__get_user_by_name ) - self.login_user_endpoint = _Endpoint( + + def __login_user( + self, + username, + password, + **kwargs + ): + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.call_with_http_info(**kwargs) + + self.login_user = _Endpoint( settings={ 'response_type': (str,), 'auth': [], @@ -330,9 +737,71 @@ class UserApi(object): ], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__login_user ) - self.logout_user_endpoint = _Endpoint( + + def __logout_user( + self, + **kwargs + ): + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.logout_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -370,9 +839,81 @@ class UserApi(object): 'accept': [], 'content_type': [], }, - api_client=api_client + api_client=api_client, + callable=__logout_user ) - self.update_user_endpoint = _Endpoint( + + def __update_user( + self, + username, + user, + **kwargs + ): + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_user(username, user, async_req=True) + >>> result = thread.get() + + Args: + username (str): name that need to be deleted + user (User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['username'] = \ + username + kwargs['user'] = \ + user + return self.call_with_http_info(**kwargs) + + self.update_user = _Endpoint( settings={ 'response_type': None, 'auth': [], @@ -424,532 +965,6 @@ class UserApi(object): 'application/json' ] }, - api_client=api_client + api_client=api_client, + callable=__update_user ) - - def create_user( - self, - user, - **kwargs - ): - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(user, async_req=True) - >>> result = thread.get() - - Args: - user (User): Created user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user'] = \ - user - return self.create_user_endpoint.call_with_http_info(**kwargs) - - def create_users_with_array_input( - self, - user, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_array_input(user, async_req=True) - >>> result = thread.get() - - Args: - user ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user'] = \ - user - return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) - - def create_users_with_list_input( - self, - user, - **kwargs - ): - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_users_with_list_input(user, async_req=True) - >>> result = thread.get() - - Args: - user ([User]): List of user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user'] = \ - user - return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) - - def delete_user( - self, - username, - **kwargs - ): - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be deleted - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.delete_user_endpoint.call_with_http_info(**kwargs) - - def get_user_by_name( - self, - username, - **kwargs - ): - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - Args: - username (str): The name that needs to be fetched. Use user1 for testing. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) - - def login_user( - self, - username, - password, - **kwargs - ): - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - Args: - username (str): The user name for login - password (str): The password for login in clear text - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['password'] = \ - password - return self.login_user_endpoint.call_with_http_info(**kwargs) - - def logout_user( - self, - **kwargs - ): - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.logout_user_endpoint.call_with_http_info(**kwargs) - - def update_user( - self, - username, - user, - **kwargs - ): - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(username, user, async_req=True) - >>> result = thread.get() - - Args: - username (str): name that need to be deleted - user (User): Updated user object - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['username'] = \ - username - kwargs['user'] = \ - user - return self.update_user_endpoint.call_with_http_info(**kwargs) - From bc3ee3249899cc26567da77cf08ba85a64cf5049 Mon Sep 17 00:00:00 2001 From: andrew-matteson Date: Tue, 7 Sep 2021 02:23:52 -0400 Subject: [PATCH 15/75] Angular 12 Support: Typescript upgrade + HttpContext (#10336) * Basic Angular 12 support. * Make samples * Pass HTTP Context for Angular client * Generate samples for Angular-v12 * Add all samples --- ...angular-v12-provided-in-root-with-npm.yaml | 10 + ...pescript-angular-v12-provided-in-root.yaml | 6 + docs/generators/typescript-angular.md | 2 +- .../TypeScriptAngularClientCodegen.java | 24 +- .../typescript-angular/api.service.mustache | 21 +- .../builds/default/api/pet.service.ts | 75 +- .../builds/default/api/store.service.ts | 39 +- .../builds/default/api/user.service.ts | 75 +- .../builds/with-npm/api/pet.service.ts | 75 +- .../builds/with-npm/api/store.service.ts | 39 +- .../builds/with-npm/api/user.service.ts | 75 +- .../builds/default/api/default.service.ts | 12 +- .../builds/default/api/pet.service.ts | 75 +- .../builds/default/api/store.service.ts | 39 +- .../builds/default/api/user.service.ts | 75 +- .../builds/with-npm/api/pet.service.ts | 75 +- .../builds/with-npm/api/store.service.ts | 39 +- .../builds/with-npm/api/user.service.ts | 75 +- .../builds/default/.gitignore | 4 + .../builds/default/.openapi-generator-ignore | 23 + .../builds/default/.openapi-generator/FILES | 19 + .../builds/default/.openapi-generator/VERSION | 1 + .../builds/default/README.md | 203 ++++++ .../builds/default/api.module.ts | 33 + .../builds/default/api/api.ts | 7 + .../builds/default/api/pet.service.ts | 647 ++++++++++++++++++ .../builds/default/api/store.service.ts | 308 +++++++++ .../builds/default/api/user.service.ts | 546 +++++++++++++++ .../builds/default/configuration.ts | 141 ++++ .../builds/default/encoder.ts | 20 + .../builds/default/git_push.sh | 57 ++ .../builds/default/index.ts | 5 + .../builds/default/model/apiResponse.ts | 22 + .../builds/default/model/category.ts | 21 + .../builds/default/model/models.ts | 6 + .../builds/default/model/order.ts | 37 + .../builds/default/model/pet.ts | 39 ++ .../builds/default/model/tag.ts | 21 + .../builds/default/model/user.ts | 30 + .../builds/default/variables.ts | 9 + .../builds/with-npm/.gitignore | 4 + .../builds/with-npm/.openapi-generator-ignore | 23 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../with-npm/.openapi-generator/VERSION | 1 + .../builds/with-npm/README.md | 203 ++++++ .../builds/with-npm/api.module.ts | 33 + .../builds/with-npm/api/api.ts | 7 + .../builds/with-npm/api/pet.service.ts | 647 ++++++++++++++++++ .../builds/with-npm/api/store.service.ts | 308 +++++++++ .../builds/with-npm/api/user.service.ts | 546 +++++++++++++++ .../builds/with-npm/configuration.ts | 141 ++++ .../builds/with-npm/encoder.ts | 20 + .../builds/with-npm/git_push.sh | 57 ++ .../builds/with-npm/index.ts | 5 + .../builds/with-npm/model/apiResponse.ts | 22 + .../builds/with-npm/model/category.ts | 21 + .../builds/with-npm/model/models.ts | 6 + .../builds/with-npm/model/order.ts | 37 + .../builds/with-npm/model/pet.ts | 39 ++ .../builds/with-npm/model/tag.ts | 21 + .../builds/with-npm/model/user.ts | 30 + .../builds/with-npm/ng-package.json | 6 + .../builds/with-npm/package.json | 34 + .../builds/with-npm/tsconfig.json | 28 + .../builds/with-npm/variables.ts | 9 + .../builds/default/api/pet.service.ts | 75 +- .../builds/default/api/store.service.ts | 39 +- .../builds/default/api/user.service.ts | 75 +- .../builds/with-npm/api/pet.service.ts | 75 +- .../builds/with-npm/api/store.service.ts | 39 +- .../builds/with-npm/api/user.service.ts | 75 +- .../builds/default/api/pet.service.ts | 75 +- .../builds/default/api/store.service.ts | 39 +- .../builds/default/api/user.service.ts | 75 +- .../builds/with-npm/api/pet.service.ts | 75 +- .../builds/with-npm/api/store.service.ts | 39 +- .../builds/with-npm/api/user.service.ts | 75 +- .../builds/default/api/pet.service.ts | 75 +- .../builds/default/api/store.service.ts | 39 +- .../builds/default/api/user.service.ts | 75 +- .../builds/with-npm/api/pet.service.ts | 75 +- .../builds/with-npm/api/store.service.ts | 39 +- .../builds/with-npm/api/user.service.ts | 75 +- .../builds/default/api/pet.service.ts | 75 +- .../builds/default/api/store.service.ts | 39 +- .../builds/default/api/user.service.ts | 75 +- .../builds/with-npm/api/pet.service.ts | 75 +- .../builds/with-npm/api/store.service.ts | 39 +- .../builds/with-npm/api/user.service.ts | 75 +- .../api/pet.service.ts | 75 +- .../api/store.service.ts | 39 +- .../api/user.service.ts | 75 +- .../builds/with-npm/api/pet.service.ts | 75 +- .../builds/with-npm/api/store.service.ts | 39 +- .../builds/with-npm/api/user.service.ts | 75 +- .../api/pet.service.ts | 75 +- .../api/store.service.ts | 39 +- .../api/user.service.ts | 75 +- .../builds/default/api/pet.service.ts | 75 +- .../builds/default/api/store.service.ts | 39 +- .../builds/default/api/user.service.ts | 75 +- .../builds/default/api/pet.service.ts | 75 +- .../builds/default/api/store.service.ts | 39 +- .../builds/default/api/user.service.ts | 75 +- .../builds/with-npm/api/pet.service.ts | 75 +- .../builds/with-npm/api/store.service.ts | 39 +- .../builds/with-npm/api/user.service.ts | 75 +- .../builds/with-npm-version/package-lock.json | 93 +++ .../tests/default/package-lock.json | 1 - 109 files changed, 6529 insertions(+), 1511 deletions(-) create mode 100644 bin/configs/typescript-angular-v12-provided-in-root-with-npm.yaml create mode 100644 bin/configs/typescript-angular-v12-provided-in-root.yaml create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/README.md create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/index.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/variables.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/README.md create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/index.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/ng-package.json create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/package.json create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/tsconfig.json create mode 100644 samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/variables.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-npm-version/package-lock.json diff --git a/bin/configs/typescript-angular-v12-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v12-provided-in-root-with-npm.yaml new file mode 100644 index 00000000000..85973a9a5df --- /dev/null +++ b/bin/configs/typescript-angular-v12-provided-in-root-with-npm.yaml @@ -0,0 +1,10 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 12.0.0 + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-angular-v12-provided-in-root.yaml b/bin/configs/typescript-angular-v12-provided-in-root.yaml new file mode 100644 index 00000000000..466282bf228 --- /dev/null +++ b/bin/configs/typescript-angular-v12-provided-in-root.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 12.0.0 diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 67341026ceb..126ccd5ae38 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |modelSuffix|The suffix of the generated model.| |null| -|ngVersion|The version of Angular. (At least 6.0.0)| |11.0.0| +|ngVersion|The version of Angular. (At least 6.0.0)| |12.0.0| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 8773634e93b..0c83302f7c4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -53,6 +53,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String PROVIDED_IN_ROOT = "providedInRoot"; public static final String PROVIDED_IN = "providedIn"; public static final String ENFORCE_GENERIC_MODULE_WITH_PROVIDERS = "enforceGenericModuleWithProviders"; + public static final String HTTP_CONTEXT_IN_OPTIONS = "httpContextInOptions"; public static final String API_MODULE_PREFIX = "apiModulePrefix"; public static final String CONFIGURATION_PREFIX = "configurationPrefix"; public static final String SERVICE_SUFFIX = "serviceSuffix"; @@ -64,7 +65,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; public static final String QUERY_PARAM_OBJECT_FORMAT = "queryParamObjectFormat"; - protected String ngVersion = "11.0.0"; + protected String ngVersion = "12.0.0"; protected String npmRepository = null; private boolean useSingleRequestParameter = false; protected String serviceSuffix = "Service"; @@ -143,7 +144,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode @Override public String getHelp() { - return "Generates a TypeScript Angular (6.x - 11.x) client library."; + return "Generates a TypeScript Angular (6.x - 12.x) client library."; } @Override @@ -229,6 +230,12 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode additionalProperties.put(ENFORCE_GENERIC_MODULE_WITH_PROVIDERS, false); } + if (ngVersion.atLeast("12.0.0")) { + additionalProperties.put(HTTP_CONTEXT_IN_OPTIONS, true); + } else { + additionalProperties.put(HTTP_CONTEXT_IN_OPTIONS, false); + } + additionalProperties.put(NG_VERSION, ngVersion); if (additionalProperties.containsKey(API_MODULE_PREFIX)) { @@ -285,7 +292,9 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode } // Set the typescript version compatible to the Angular version - if (ngVersion.atLeast("11.0.0")) { + if (ngVersion.atLeast("12.0.0")) { + additionalProperties.put("tsVersion", ">=4.2.3 <4.3.0"); + } else if (ngVersion.atLeast("11.0.0")) { additionalProperties.put("tsVersion", ">=4.0.0 <4.1.0"); } else if (ngVersion.atLeast("10.0.0")) { additionalProperties.put("tsVersion", ">=3.9.2 <4.0.0"); @@ -317,7 +326,10 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode supportingFiles.add(new SupportingFile("ng-package.mustache", getIndexDirectory(), "ng-package.json")); // Specific ng-packagr configuration - if (ngVersion.atLeast("11.0.0")) { + if (ngVersion.atLeast("12.0.0")) { + additionalProperties.put("ngPackagrVersion", "12.2.1"); + additionalProperties.put("tsickleVersion", "0.43.0"); + } else if (ngVersion.atLeast("11.0.0")) { additionalProperties.put("ngPackagrVersion", "11.0.2"); additionalProperties.put("tsickleVersion", "0.39.1"); } else if (ngVersion.atLeast("10.0.0")) { @@ -341,7 +353,9 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode } // set zone.js version - if (ngVersion.atLeast("11.0.0")) { + if (ngVersion.atLeast("12.0.0")) { + additionalProperties.put("zonejsVersion", "0.11.4"); + } else if (ngVersion.atLeast("11.0.0")) { additionalProperties.put("zonejsVersion", "0.11.3"); } else if (ngVersion.atLeast("9.0.0")) { additionalProperties.put("zonejsVersion", "0.10.2"); diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 84160ac4167..2ff5a17bb29 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -3,7 +3,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec{{#httpContextInOptions}}, HttpContext {{/httpContextInOptions}} + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -162,10 +163,10 @@ export class {{classname}} { * @deprecated {{/isDeprecated}} */ - public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; - public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}}}): Observable>; - public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}}}): Observable>; - public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}}}): Observable { + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}}): Observable>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}}): Observable>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}}): Observable { {{#allParams}} {{#useSingleRequestParameter}} const {{paramName}} = requestParameters.{{paramName}}; @@ -266,6 +267,13 @@ export class {{classname}} { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } +{{#httpContextInOptions}} + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } +{{/httpContextInOptions}} + {{#bodyParam}} {{- duplicated below, don't forget to change}} // to determine the Content-Type header @@ -348,6 +356,9 @@ export class {{classname}} { return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.configuration.basePath}{{{path}}}`,{{#isBodyAllowed}} {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isBodyAllowed}} { + {{#httpContextInOptions}} + context: localVarHttpContext, + {{/httpContextInOptions}} {{#hasQueryParams}} params: localVarQueryParameters, {{/hasQueryParams}} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts index d69044b5ce7..ac873acd096 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -88,10 +89,10 @@ export class DefaultService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public rootGet(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public rootGet(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public rootGet(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public rootGet(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public rootGet(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public rootGet(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public rootGet(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public rootGet(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -108,6 +109,7 @@ export class DefaultService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 00000000000..7f8ebffb302 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/apiResponse.ts +model/category.ts +model/models.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION new file mode 100644 index 00000000000..4b448de535c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/README.md new file mode 100644 index 00000000000..f2e5a1c1ee2 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/README.md @@ -0,0 +1,203 @@ +## @ + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @ --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from ''; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from ''; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api.module.ts new file mode 100644 index 00000000000..2afb8f64e92 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/api.ts new file mode 100644 index 00000000000..8e44b64083d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts new file mode 100644 index 00000000000..d8009ed719c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts @@ -0,0 +1,647 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let localVarHeaders = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + localVarHeaders = localVarHeaders.set('api_key', String(apiKey)); + } + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts new file mode 100644 index 00000000000..2f3ced393cc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts @@ -0,0 +1,308 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { Order } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param body order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts new file mode 100644 index 00000000000..a1daecfe0d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts @@ -0,0 +1,546 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { User } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + password, 'password'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts new file mode 100644 index 00000000000..6fc0f80d973 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/configuration.ts @@ -0,0 +1,141 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/encoder.ts new file mode 100644 index 00000000000..138c4d5cf2c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/git_push.sh new file mode 100644 index 00000000000..18f86b99e82 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/index.ts new file mode 100644 index 00000000000..c312b70fa3e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/apiResponse.ts new file mode 100644 index 00000000000..682ba478921 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/category.ts new file mode 100644 index 00000000000..b988b6827a0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/category.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/models.ts new file mode 100644 index 00000000000..8607c5dabd0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/order.ts new file mode 100644 index 00000000000..a29bebe4906 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/order.ts @@ -0,0 +1,37 @@ +/** + * 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. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/pet.ts new file mode 100644 index 00000000000..e0404395f91 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/pet.ts @@ -0,0 +1,39 @@ +/** + * 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 { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/tag.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/tag.ts new file mode 100644 index 00000000000..b6ff210e8df --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/tag.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/user.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/user.ts new file mode 100644 index 00000000000..fce51005300 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/model/user.ts @@ -0,0 +1,30 @@ +/** + * 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. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/variables.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/variables.ts new file mode 100644 index 00000000000..6fe58549f39 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.gitignore b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 00000000000..5db7bd76369 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/apiResponse.ts +model/category.ts +model/models.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION new file mode 100644 index 00000000000..4b448de535c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/README.md new file mode 100644 index 00000000000..000c51d694b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/README.md @@ -0,0 +1,203 @@ +## @openapitools/typescript-angular-petstore@1.0.0 + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @openapitools/typescript-angular-petstore@1.0.0 --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link @openapitools/typescript-angular-petstore +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from '@openapitools/typescript-angular-petstore'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from '@openapitools/typescript-angular-petstore'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api.module.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api.module.ts new file mode 100644 index 00000000000..2afb8f64e92 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/api.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/api.ts new file mode 100644 index 00000000000..8e44b64083d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts new file mode 100644 index 00000000000..d8009ed719c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts @@ -0,0 +1,647 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let localVarHeaders = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + localVarHeaders = localVarHeaders.set('api_key', String(apiKey)); + } + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts new file mode 100644 index 00000000000..2f3ced393cc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts @@ -0,0 +1,308 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { Order } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param body order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts new file mode 100644 index 00000000000..a1daecfe0d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts @@ -0,0 +1,546 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { User } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + password, 'password'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts new file mode 100644 index 00000000000..6fc0f80d973 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/configuration.ts @@ -0,0 +1,141 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/encoder.ts new file mode 100644 index 00000000000..138c4d5cf2c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/git_push.sh new file mode 100644 index 00000000000..18f86b99e82 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/index.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/index.ts new file mode 100644 index 00000000000..c312b70fa3e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/apiResponse.ts new file mode 100644 index 00000000000..682ba478921 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/category.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/category.ts new file mode 100644 index 00000000000..b988b6827a0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/category.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/models.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/models.ts new file mode 100644 index 00000000000..8607c5dabd0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/order.ts new file mode 100644 index 00000000000..a29bebe4906 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/order.ts @@ -0,0 +1,37 @@ +/** + * 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. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/pet.ts new file mode 100644 index 00000000000..e0404395f91 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/pet.ts @@ -0,0 +1,39 @@ +/** + * 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 { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/tag.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/tag.ts new file mode 100644 index 00000000000..b6ff210e8df --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/tag.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/user.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/user.ts new file mode 100644 index 00000000000..fce51005300 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/model/user.ts @@ -0,0 +1,30 @@ +/** + * 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. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/ng-package.json b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/ng-package.json new file mode 100644 index 00000000000..3b17900dc9c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/package.json b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/package.json new file mode 100644 index 00000000000..8c565707886 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/package.json @@ -0,0 +1,34 @@ +{ + "name": "@openapitools/typescript-angular-petstore", + "version": "1.0.0", + "description": "OpenAPI client for @openapitools/typescript-angular-petstore", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^12.0.0", + "rxjs": "^6.6.0" + }, + "devDependencies": { + "@angular/common": "^12.0.0", + "@angular/compiler": "^12.0.0", + "@angular/compiler-cli": "^12.0.0", + "@angular/core": "^12.0.0", + "@angular/platform-browser": "^12.0.0", + "ng-packagr": "^12.2.1", + "reflect-metadata": "^0.1.3", + "rxjs": "^6.6.0", + "tsickle": "^0.43.0", + "typescript": ">=4.2.3 <4.3.0", + "zone.js": "^0.11.4" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/tsconfig.json new file mode 100644 index 00000000000..c01ebe255d4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/variables.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/variables.ts new file mode 100644 index 00000000000..6fe58549f39 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 7ceaa500f47..6307beedbe6 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -102,10 +103,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -131,6 +132,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -165,10 +167,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -197,6 +199,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -220,10 +223,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -257,6 +260,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -282,10 +286,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -319,6 +323,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -343,10 +348,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -374,6 +379,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -396,10 +402,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -425,6 +431,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -460,10 +467,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -488,6 +495,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -530,10 +538,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -559,6 +567,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index ed52f65749f..df5eb10d6dd 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -89,10 +90,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -111,6 +112,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -133,10 +135,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -160,6 +162,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -183,10 +186,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -207,6 +210,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -229,10 +233,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -253,6 +257,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index afcd446ae02..22cdfe1be90 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -89,10 +90,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -111,6 +112,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -142,10 +144,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -164,6 +166,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -195,10 +198,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -217,6 +220,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -249,10 +253,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -271,6 +275,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -293,10 +298,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -317,6 +322,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -340,10 +346,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -377,6 +383,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -399,10 +406,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -418,6 +425,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -442,10 +450,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -467,6 +475,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 7ceaa500f47..6307beedbe6 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -102,10 +103,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -131,6 +132,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -165,10 +167,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -197,6 +199,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -220,10 +223,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -257,6 +260,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -282,10 +286,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -319,6 +323,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -343,10 +348,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -374,6 +379,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -396,10 +402,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -425,6 +431,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -460,10 +467,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -488,6 +495,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -530,10 +538,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -559,6 +567,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index ed52f65749f..df5eb10d6dd 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -89,10 +90,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -111,6 +112,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -133,10 +135,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -160,6 +162,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -183,10 +186,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -207,6 +210,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -229,10 +233,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -253,6 +257,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index afcd446ae02..22cdfe1be90 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -89,10 +90,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -111,6 +112,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -142,10 +144,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -164,6 +166,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -195,10 +198,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -217,6 +220,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -249,10 +253,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -271,6 +275,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -293,10 +298,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -317,6 +322,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -340,10 +346,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -377,6 +383,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -399,10 +406,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -418,6 +425,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -442,10 +450,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -467,6 +475,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 7ceaa500f47..6307beedbe6 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -102,10 +103,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -131,6 +132,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -165,10 +167,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -197,6 +199,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -220,10 +223,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -257,6 +260,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -282,10 +286,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -319,6 +323,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -343,10 +348,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -374,6 +379,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -396,10 +402,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -425,6 +431,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -460,10 +467,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -488,6 +495,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -530,10 +538,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -559,6 +567,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index ed52f65749f..df5eb10d6dd 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -89,10 +90,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -111,6 +112,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -133,10 +135,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -160,6 +162,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -183,10 +186,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -207,6 +210,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -229,10 +233,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -253,6 +257,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index afcd446ae02..22cdfe1be90 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -89,10 +90,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -111,6 +112,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -142,10 +144,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -164,6 +166,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -195,10 +198,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -217,6 +220,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -249,10 +253,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -271,6 +275,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -293,10 +298,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -317,6 +322,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -340,10 +346,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -377,6 +383,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -399,10 +406,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -418,6 +425,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -442,10 +450,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -467,6 +475,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 7ceaa500f47..6307beedbe6 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -102,10 +103,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -131,6 +132,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -165,10 +167,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -197,6 +199,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -220,10 +223,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -257,6 +260,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -282,10 +286,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -319,6 +323,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -343,10 +348,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -374,6 +379,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -396,10 +402,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -425,6 +431,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -460,10 +467,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -488,6 +495,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -530,10 +538,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -559,6 +567,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index ed52f65749f..df5eb10d6dd 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -89,10 +90,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -111,6 +112,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -133,10 +135,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -160,6 +162,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -183,10 +186,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -207,6 +210,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -229,10 +233,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -253,6 +257,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index afcd446ae02..22cdfe1be90 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -89,10 +90,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -111,6 +112,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -142,10 +144,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -164,6 +166,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -195,10 +198,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -217,6 +220,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -249,10 +253,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -271,6 +275,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -293,10 +298,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -317,6 +322,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -340,10 +346,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -377,6 +383,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -399,10 +406,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -418,6 +425,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -442,10 +450,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -467,6 +475,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index f20e3a89355..e0b1b6f5c7e 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -153,10 +154,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(requestParameters: AddPetRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(requestParameters: AddPetRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(requestParameters: AddPetRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(requestParameters: AddPetRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(requestParameters: AddPetRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(requestParameters: AddPetRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(requestParameters: AddPetRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(requestParameters: AddPetRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const body = requestParameters.body; if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); @@ -183,6 +184,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -216,10 +218,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(requestParameters: DeletePetRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(requestParameters: DeletePetRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(requestParameters: DeletePetRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(requestParameters: DeletePetRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(requestParameters: DeletePetRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(requestParameters: DeletePetRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const petId = requestParameters.petId; if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); @@ -250,6 +252,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -273,10 +276,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(requestParameters: FindPetsByStatusRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { const status = requestParameters.status; if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); @@ -311,6 +314,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -336,10 +340,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { const tags = requestParameters.tags; if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); @@ -374,6 +378,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +403,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(requestParameters: GetPetByIdRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(requestParameters: GetPetByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(requestParameters: GetPetByIdRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { const petId = requestParameters.petId; if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); @@ -430,6 +435,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -452,10 +458,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(requestParameters: UpdatePetRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(requestParameters: UpdatePetRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(requestParameters: UpdatePetRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const body = requestParameters.body; if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); @@ -482,6 +488,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -515,10 +522,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(requestParameters: UpdatePetWithFormRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const petId = requestParameters.petId; if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); @@ -546,6 +553,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -586,10 +594,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(requestParameters: UploadFileRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(requestParameters: UploadFileRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(requestParameters: UploadFileRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { const petId = requestParameters.petId; if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); @@ -618,6 +626,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts index 32a78bf6a05..1bfb6c2e277 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -106,10 +107,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(requestParameters: DeleteOrderRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(requestParameters: DeleteOrderRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const orderId = requestParameters.orderId; if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); @@ -129,6 +130,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -151,10 +153,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -178,6 +180,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -201,10 +204,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(requestParameters: GetOrderByIdRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(requestParameters: GetOrderByIdRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { const orderId = requestParameters.orderId; if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); @@ -226,6 +229,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -248,10 +252,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(requestParameters: PlaceOrderRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(requestParameters: PlaceOrderRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { const body = requestParameters.body; if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); @@ -273,6 +277,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts index 695b3f71d79..971e87a39ae 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -130,10 +131,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(requestParameters: CreateUserRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(requestParameters: CreateUserRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(requestParameters: CreateUserRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(requestParameters: CreateUserRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(requestParameters: CreateUserRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(requestParameters: CreateUserRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(requestParameters: CreateUserRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(requestParameters: CreateUserRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const body = requestParameters.body; if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); @@ -153,6 +154,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -184,10 +186,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const body = requestParameters.body; if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); @@ -207,6 +209,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -238,10 +241,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(requestParameters: CreateUsersWithListInputRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const body = requestParameters.body; if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); @@ -261,6 +264,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -293,10 +297,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(requestParameters: DeleteUserRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(requestParameters: DeleteUserRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(requestParameters: DeleteUserRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const username = requestParameters.username; if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); @@ -316,6 +320,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -338,10 +343,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(requestParameters: GetUserByNameRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(requestParameters: GetUserByNameRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { const username = requestParameters.username; if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); @@ -363,6 +368,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -385,10 +391,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(requestParameters: LoginUserRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(requestParameters: LoginUserRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(requestParameters: LoginUserRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(requestParameters: LoginUserRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(requestParameters: LoginUserRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(requestParameters: LoginUserRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { const username = requestParameters.username; if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); @@ -424,6 +430,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -446,10 +453,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -465,6 +472,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -488,10 +496,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(requestParameters: UpdateUserRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(requestParameters: UpdateUserRequestParams, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(requestParameters: UpdateUserRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { const username = requestParameters.username; if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); @@ -515,6 +523,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index 87e935b3363..2d8ef08dd39 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index 3485d8a8011..ac3e175914e 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts index d2ab9aa3bd8..8c07bd3cf32 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts index 7370e9f6f90..014e9610fd7 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts index cf51ae3a904..ff7748156a8 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts index 92579ee0ec2..21931307519 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts index f00d48685a1..800853664a0 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -104,10 +105,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -133,6 +134,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -167,10 +169,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } @@ -199,6 +201,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -222,10 +225,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -259,6 +262,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -284,10 +288,10 @@ export class PetService { * @param reportProgress flag to report request and response progress. * @deprecated */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -321,6 +325,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -345,10 +350,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -376,6 +381,7 @@ export class PetService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -398,10 +404,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -427,6 +433,7 @@ export class PetService { } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -462,10 +469,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } @@ -490,6 +497,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/x-www-form-urlencoded' @@ -532,10 +540,10 @@ export class PetService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } @@ -561,6 +569,7 @@ export class PetService { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts index 82d1bfa0442..1397ffd2d02 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -113,6 +114,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -135,10 +137,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable { let localVarHeaders = this.defaultHeaders; @@ -162,6 +164,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -185,10 +188,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -209,6 +212,7 @@ export class StoreService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -231,10 +235,10 @@ export class StoreService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -255,6 +259,7 @@ export class StoreService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts index da70088349d..9809f730029 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts @@ -13,7 +13,8 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; + HttpResponse, HttpEvent, HttpParameterCodec + } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -91,10 +92,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -144,10 +146,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -166,6 +168,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -197,10 +200,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -219,6 +222,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -251,10 +255,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -273,6 +277,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -295,10 +300,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -319,6 +324,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -342,10 +348,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; - public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; - public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -379,6 +385,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -401,10 +408,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { let localVarHeaders = this.defaultHeaders; @@ -420,6 +427,7 @@ export class UserService { } + let responseType_: 'text' | 'json' = 'json'; if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; @@ -444,10 +452,10 @@ export class UserService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -469,6 +477,7 @@ export class UserService { } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/package-lock.json b/samples/client/petstore/typescript-axios/builds/with-npm-version/package-lock.json new file mode 100644 index 00000000000..a0dd2ce1c3d --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/package-lock.json @@ -0,0 +1,93 @@ +{ + "name": "@openapitools/typescript-axios-petstore", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@openapitools/typescript-axios-petstore", + "version": "1.0.0", + "license": "Unlicense", + "dependencies": { + "axios": "^0.21.1" + }, + "devDependencies": { + "@types/node": "^12.11.5", + "typescript": "^3.6.4" + } + }, + "node_modules/@types/node": { + "version": "12.20.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.23.tgz", + "integrity": "sha512-FW0q7NI8UnjbKrJK8NGr6QXY69ATw9IFe6ItIo5yozPwA9DU/xkhiPddctUVyrmFXvyFYerYgQak/qu200UBDw==", + "dev": true + }, + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "node_modules/follow-redirects": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", + "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + } + }, + "dependencies": { + "@types/node": { + "version": "12.20.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.23.tgz", + "integrity": "sha512-FW0q7NI8UnjbKrJK8NGr6QXY69ATw9IFe6ItIo5yozPwA9DU/xkhiPddctUVyrmFXvyFYerYgQak/qu200UBDw==", + "dev": true + }, + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "requires": { + "follow-redirects": "^1.14.0" + } + }, + "follow-redirects": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", + "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==" + }, + "typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "dev": true + } + } +} diff --git a/samples/client/petstore/typescript-axios/tests/default/package-lock.json b/samples/client/petstore/typescript-axios/tests/default/package-lock.json index d3d562a3522..f8363dd1ece 100644 --- a/samples/client/petstore/typescript-axios/tests/default/package-lock.json +++ b/samples/client/petstore/typescript-axios/tests/default/package-lock.json @@ -1574,7 +1574,6 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", From 85767829cb8f893eb2b88ba649a6ee485c8f77be Mon Sep 17 00:00:00 2001 From: ahjota <3588606+ahjota@users.noreply.github.com> Date: Tue, 7 Sep 2021 18:58:34 -0700 Subject: [PATCH 16/75] [R] Fix shellcheck violations in git_push.sh.template (#10345) * shellcheck * regenerated sample --- .../src/main/resources/r/git_push.sh.mustache | 4 ++-- samples/client/petstore/R/git_push.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/r/git_push.sh.mustache index 305f9c115ce..0e3776ae6dd 100755 --- a/modules/openapi-generator/src/main/resources/r/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/r/git_push.sh.mustache @@ -38,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git remote` +git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi diff --git a/samples/client/petstore/R/git_push.sh b/samples/client/petstore/R/git_push.sh index 18f86b99e82..f53a75d4fab 100644 --- a/samples/client/petstore/R/git_push.sh +++ b/samples/client/petstore/R/git_push.sh @@ -38,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git remote` +git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi From 8eed5d0c8925d21509d9d525ad50d8f4ac4e3704 Mon Sep 17 00:00:00 2001 From: hackerman <3372410+aeneasr@users.noreply.github.com> Date: Wed, 8 Sep 2021 04:59:42 +0300 Subject: [PATCH 17/75] [csharp-netcore] verbose null checking (#10333) This patch addresses an issue where csharp-netcore failed to generate compilable code when required attributes were of complex types. By using the non-shorthand syntax for checking if the value is set, and throwing an error in that case, the compile issues have been resolved. Closes #9442 Closes #5442 --- .../resources/csharp-netcore/modelGeneric.mustache | 10 ++++++++-- .../src/Org.OpenAPITools/Model/Animal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/AppleReq.cs | 5 ++++- .../src/Org.OpenAPITools/Model/BasquePig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Category.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/DanishPig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/EquilateralTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/FormatTest.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/GrandparentAnimal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/IsoscelesTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/Pet.cs | 10 ++++++++-- .../Org.OpenAPITools/Model/QuadrilateralInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ScaleneTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/ShapeInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/TriangleInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Whale.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Zebra.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Animal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/AppleReq.cs | 5 ++++- .../src/Org.OpenAPITools/Model/BasquePig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Category.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/DanishPig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/EquilateralTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/FormatTest.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/GrandparentAnimal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/IsoscelesTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/Pet.cs | 10 ++++++++-- .../Org.OpenAPITools/Model/QuadrilateralInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ScaleneTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/ShapeInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/TriangleInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Whale.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Zebra.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Animal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/AppleReq.cs | 5 ++++- .../src/Org.OpenAPITools/Model/BasquePig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Category.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/DanishPig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/EquilateralTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/FormatTest.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/GrandparentAnimal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/IsoscelesTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/Pet.cs | 10 ++++++++-- .../Org.OpenAPITools/Model/QuadrilateralInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ScaleneTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/ShapeInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/TriangleInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Whale.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Zebra.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Animal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/AppleReq.cs | 5 ++++- .../src/Org.OpenAPITools/Model/BasquePig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Category.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/DanishPig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/EquilateralTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/FormatTest.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/GrandparentAnimal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/IsoscelesTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/Pet.cs | 10 ++++++++-- .../Org.OpenAPITools/Model/QuadrilateralInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ScaleneTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/ShapeInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/TriangleInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Whale.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Zebra.cs | 5 ++++- .../OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/AppleReq.cs | 5 ++++- .../src/Org.OpenAPITools/Model/BasquePig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Category.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/DanishPig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/EquilateralTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/FormatTest.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/GrandparentAnimal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/IsoscelesTriangle.cs | 10 ++++++++-- .../OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs | 10 ++++++++-- .../Org.OpenAPITools/Model/QuadrilateralInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ScaleneTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/ShapeInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/TriangleInterface.cs | 5 ++++- .../OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs | 5 ++++- .../OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Animal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/AppleReq.cs | 5 ++++- .../src/Org.OpenAPITools/Model/BasquePig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Category.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/DanishPig.cs | 5 ++++- .../src/Org.OpenAPITools/Model/EquilateralTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/FormatTest.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/GrandparentAnimal.cs | 5 ++++- .../src/Org.OpenAPITools/Model/IsoscelesTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/Pet.cs | 10 ++++++++-- .../Org.OpenAPITools/Model/QuadrilateralInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/ScaleneTriangle.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/ShapeInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs | 10 ++++++++-- .../src/Org.OpenAPITools/Model/TriangleInterface.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Whale.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Zebra.cs | 5 ++++- .../src/Org.OpenAPITools/Model/Pet.cs | 10 ++++++++-- 110 files changed, 616 insertions(+), 154 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache index aaff4be3e25..4d80ca9783c 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache @@ -132,7 +132,10 @@ {{^conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) { + throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + } + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; @@ -141,7 +144,10 @@ {{#conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) { + throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + } + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs index fbc617b2363..f7aae620ed3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs @@ -52,7 +52,10 @@ namespace Org.OpenAPITools.Model public Animal(string className = default(string), string color = "red") { // to ensure "className" is required (not null) - this._ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this._ClassName = className; // use default value if no "color" provided this.Color = color ?? "red"; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs index 246f212a314..b37df3ab5a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs @@ -45,7 +45,10 @@ namespace Org.OpenAPITools.Model public AppleReq(string cultivar = default(string), bool mealy = default(bool)) { // to ensure "cultivar" is required (not null) - this._Cultivar = cultivar ?? throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this._Cultivar = cultivar; this._Mealy = mealy; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs index ef4518f3fea..da20790401e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public BasquePig(string className = default(string)) { // to ensure "className" is required (not null) - this._ClassName = className ?? throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this._ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs index 198799ca386..8875c897419 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) - this._Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this._Name = name; this._Id = id; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index ffc1728777e..e1ef5fcb765 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this._ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this._ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this._QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this._QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs index 15c5d0feba6..b7895a821f8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public DanishPig(string className = default(string)) { // to ensure "className" is required (not null) - this._ClassName = className ?? throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this._ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 7df9b39a535..df53986949a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this._ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this._ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this._TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this._TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs index 601a027e57a..367e8528dda 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs @@ -63,10 +63,16 @@ namespace Org.OpenAPITools.Model { this._Number = number; // to ensure "_byte" is required (not null) - this._Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this._Byte = _byte; this._Date = date; // to ensure "password" is required (not null) - this._Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this._Password = password; this._Integer = integer; this._Int32 = int32; this._Int64 = int64; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index a32b734acb3..12656a127fa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -51,7 +51,10 @@ namespace Org.OpenAPITools.Model public GrandparentAnimal(string petType = default(string)) { // to ensure "petType" is required (not null) - this._PetType = petType ?? throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this._PetType = petType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index f1c29435e5d..abe433bbed9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this._ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this._ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this._TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this._TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs index cfdd6000e06..e53e978243a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs @@ -106,9 +106,15 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - this._Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this._Name = name; // to ensure "photoUrls" is required (not null) - this._PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this._PhotoUrls = photoUrls; this._Id = id; this._Category = category; this._Tags = tags; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 43953913572..8ee739b8e68 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public QuadrilateralInterface(string quadrilateralType = default(string)) { // to ensure "quadrilateralType" is required (not null) - this._QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this._QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 5fa9b4b2293..d6d8491bede 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this._ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this._ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this._TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this._TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs index 42db332d22d..da94a6af384 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public ShapeInterface(string shapeType = default(string)) { // to ensure "shapeType" is required (not null) - this._ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this._ShapeType = shapeType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 000a2f40a2a..466236f3c6f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this._ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this._ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this._QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this._QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs index 7f0a072a962..5596a507d52 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public TriangleInterface(string triangleType = default(string)) { // to ensure "triangleType" is required (not null) - this._TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this._TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs index eeda8ca8b42..5dabcc70271 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs @@ -49,7 +49,10 @@ namespace Org.OpenAPITools.Model public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) { // to ensure "className" is required (not null) - this._ClassName = className ?? throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this._ClassName = className; this._HasBaleen = hasBaleen; this._HasTeeth = hasTeeth; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs index 7b94ce7ec6f..609d3f854b5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs @@ -100,7 +100,10 @@ namespace Org.OpenAPITools.Model public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() { // to ensure "className" is required (not null) - this._ClassName = className ?? throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this._ClassName = className; this._Type = type; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs index c39799127da..65c86866733 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs @@ -53,7 +53,10 @@ namespace Org.OpenAPITools.Model public Animal(string className = default(string), string color = "red") { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this.ClassName = className; // use default value if no "color" provided this.Color = color ?? "red"; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs index 3354d6a5932..a1904b75692 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs @@ -46,7 +46,10 @@ namespace Org.OpenAPITools.Model public AppleReq(string cultivar = default(string), bool mealy = default(bool)) { // to ensure "cultivar" is required (not null) - this.Cultivar = cultivar ?? throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this.Cultivar = cultivar; this.Mealy = mealy; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs index ade2a65ef24..d61c969fe08 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public BasquePig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs index 35dd2674695..1accd46bf8f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs @@ -49,7 +49,10 @@ namespace Org.OpenAPITools.Model public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; this.Id = id; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index cccb856a650..6c5b4111351 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -49,9 +49,15 @@ namespace Org.OpenAPITools.Model public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs index 68bf604b95f..6b0403d4cdc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public DanishPig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 751b3b8a99a..88c6c2cafd0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -49,9 +49,15 @@ namespace Org.OpenAPITools.Model public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs index c2dd5cc4d71..55b0c81637e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -64,10 +64,16 @@ namespace Org.OpenAPITools.Model { this.Number = number; // to ensure "_byte" is required (not null) - this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; this.Date = date; // to ensure "password" is required (not null) - this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this.Password = password; this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 129aae28554..14718e098bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -52,7 +52,10 @@ namespace Org.OpenAPITools.Model public GrandparentAnimal(string petType = default(string)) { // to ensure "petType" is required (not null) - this.PetType = petType ?? throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this.PetType = petType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index a7416acf77b..c0195426384 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -46,9 +46,15 @@ namespace Org.OpenAPITools.Model public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this.TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs index 88c2fb08970..75498273522 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs @@ -87,9 +87,15 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; // to ensure "photoUrls" is required (not null) - this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; this.Id = id; this.Category = category; this.Tags = tags; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 555fb636825..89a60a823a2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public QuadrilateralInterface(string quadrilateralType = default(string)) { // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 527bcfab54c..a6855b780b0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -49,9 +49,15 @@ namespace Org.OpenAPITools.Model public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs index 6d2208e202f..06d20fe9c06 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public ShapeInterface(string shapeType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this.ShapeType = shapeType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 33787f755a7..0c4dad0125b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -49,9 +49,15 @@ namespace Org.OpenAPITools.Model public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs index 66f49d7c2de..ef42d0223f2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public TriangleInterface(string triangleType = default(string)) { // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs index 2abe262ebbd..000ad3e534b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs @@ -50,7 +50,10 @@ namespace Org.OpenAPITools.Model public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this.ClassName = className; this.HasBaleen = hasBaleen; this.HasTeeth = hasTeeth; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs index 91dce88b923..3c1c2f09eff 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs @@ -81,7 +81,10 @@ namespace Org.OpenAPITools.Model public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this.ClassName = className; this.Type = type; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs index 95c79122ad7..ac5d9e8c063 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs @@ -52,7 +52,10 @@ namespace Org.OpenAPITools.Model public Animal(string className = default(string), string color = "red") { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this.ClassName = className; // use default value if no "color" provided this.Color = color ?? "red"; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs index a1203358492..6840cce39cb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs @@ -45,7 +45,10 @@ namespace Org.OpenAPITools.Model public AppleReq(string cultivar = default(string), bool mealy = default(bool)) { // to ensure "cultivar" is required (not null) - this.Cultivar = cultivar ?? throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this.Cultivar = cultivar; this.Mealy = mealy; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs index 5c6f9a0e83d..a4d64bc2d3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public BasquePig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs index 581a23ef2a5..12b4ddae8de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; this.Id = id; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 78f3c6c03e3..52fe96efd45 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs index dd2de1d038a..e6d26369a79 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public DanishPig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index ed443f68cf7..6c8c00585fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs index 9e7466bb502..70942bcc923 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs @@ -63,10 +63,16 @@ namespace Org.OpenAPITools.Model { this.Number = number; // to ensure "_byte" is required (not null) - this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; this.Date = date; // to ensure "password" is required (not null) - this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this.Password = password; this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 9352d27022f..546394f16b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -51,7 +51,10 @@ namespace Org.OpenAPITools.Model public GrandparentAnimal(string petType = default(string)) { // to ensure "petType" is required (not null) - this.PetType = petType ?? throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this.PetType = petType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 46963173f71..f3f87f96ed8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this.TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs index db3cdd72606..bd2f983341c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs @@ -86,9 +86,15 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; // to ensure "photoUrls" is required (not null) - this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; this.Id = id; this.Category = category; this.Tags = tags; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index e7727cf856c..25cdf55043c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public QuadrilateralInterface(string quadrilateralType = default(string)) { // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index c539590907c..52e4e879cb9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs index 051100b4e6c..ceff687dca7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public ShapeInterface(string shapeType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this.ShapeType = shapeType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 5280a0c308a..caa6971e7ca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs index 4b7274465ce..88b865c6792 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public TriangleInterface(string triangleType = default(string)) { // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs index 80fbf9c368c..ca813a615c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs @@ -49,7 +49,10 @@ namespace Org.OpenAPITools.Model public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this.ClassName = className; this.HasBaleen = hasBaleen; this.HasTeeth = hasTeeth; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs index cfa92d1b708..c0021b400c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs @@ -80,7 +80,10 @@ namespace Org.OpenAPITools.Model public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this.ClassName = className; this.Type = type; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs index 95c79122ad7..ac5d9e8c063 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs @@ -52,7 +52,10 @@ namespace Org.OpenAPITools.Model public Animal(string className = default(string), string color = "red") { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this.ClassName = className; // use default value if no "color" provided this.Color = color ?? "red"; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs index a1203358492..6840cce39cb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -45,7 +45,10 @@ namespace Org.OpenAPITools.Model public AppleReq(string cultivar = default(string), bool mealy = default(bool)) { // to ensure "cultivar" is required (not null) - this.Cultivar = cultivar ?? throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this.Cultivar = cultivar; this.Mealy = mealy; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs index 5c6f9a0e83d..a4d64bc2d3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public BasquePig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs index 581a23ef2a5..12b4ddae8de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; this.Id = id; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 78f3c6c03e3..52fe96efd45 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs index dd2de1d038a..e6d26369a79 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public DanishPig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index ed443f68cf7..6c8c00585fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs index 9e7466bb502..70942bcc923 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -63,10 +63,16 @@ namespace Org.OpenAPITools.Model { this.Number = number; // to ensure "_byte" is required (not null) - this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; this.Date = date; // to ensure "password" is required (not null) - this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this.Password = password; this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 9352d27022f..546394f16b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -51,7 +51,10 @@ namespace Org.OpenAPITools.Model public GrandparentAnimal(string petType = default(string)) { // to ensure "petType" is required (not null) - this.PetType = petType ?? throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this.PetType = petType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 46963173f71..f3f87f96ed8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this.TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs index db3cdd72606..bd2f983341c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs @@ -86,9 +86,15 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; // to ensure "photoUrls" is required (not null) - this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; this.Id = id; this.Category = category; this.Tags = tags; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index e7727cf856c..25cdf55043c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public QuadrilateralInterface(string quadrilateralType = default(string)) { // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index c539590907c..52e4e879cb9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index 051100b4e6c..ceff687dca7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public ShapeInterface(string shapeType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this.ShapeType = shapeType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 5280a0c308a..caa6971e7ca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index 4b7274465ce..88b865c6792 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public TriangleInterface(string triangleType = default(string)) { // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs index 80fbf9c368c..ca813a615c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs @@ -49,7 +49,10 @@ namespace Org.OpenAPITools.Model public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this.ClassName = className; this.HasBaleen = hasBaleen; this.HasTeeth = hasTeeth; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs index cfa92d1b708..c0021b400c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -80,7 +80,10 @@ namespace Org.OpenAPITools.Model public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this.ClassName = className; this.Type = type; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index 95c79122ad7..ac5d9e8c063 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -52,7 +52,10 @@ namespace Org.OpenAPITools.Model public Animal(string className = default(string), string color = "red") { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this.ClassName = className; // use default value if no "color" provided this.Color = color ?? "red"; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs index a1203358492..6840cce39cb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs @@ -45,7 +45,10 @@ namespace Org.OpenAPITools.Model public AppleReq(string cultivar = default(string), bool mealy = default(bool)) { // to ensure "cultivar" is required (not null) - this.Cultivar = cultivar ?? throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this.Cultivar = cultivar; this.Mealy = mealy; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs index 5c6f9a0e83d..a4d64bc2d3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public BasquePig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs index 581a23ef2a5..12b4ddae8de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; this.Id = id; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 78f3c6c03e3..52fe96efd45 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs index dd2de1d038a..e6d26369a79 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public DanishPig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this.ClassName = className; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index ed443f68cf7..6c8c00585fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index 9e7466bb502..70942bcc923 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -63,10 +63,16 @@ namespace Org.OpenAPITools.Model { this.Number = number; // to ensure "_byte" is required (not null) - this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; this.Date = date; // to ensure "password" is required (not null) - this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this.Password = password; this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 9352d27022f..546394f16b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -51,7 +51,10 @@ namespace Org.OpenAPITools.Model public GrandparentAnimal(string petType = default(string)) { // to ensure "petType" is required (not null) - this.PetType = petType ?? throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this.PetType = petType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 46963173f71..f3f87f96ed8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this.TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs index db3cdd72606..bd2f983341c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs @@ -86,9 +86,15 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; // to ensure "photoUrls" is required (not null) - this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; this.Id = id; this.Category = category; this.Tags = tags; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index e7727cf856c..25cdf55043c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public QuadrilateralInterface(string quadrilateralType = default(string)) { // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index c539590907c..52e4e879cb9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs index 051100b4e6c..ceff687dca7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public ShapeInterface(string shapeType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this.ShapeType = shapeType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 5280a0c308a..caa6971e7ca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -48,9 +48,15 @@ namespace Org.OpenAPITools.Model public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs index 4b7274465ce..88b865c6792 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -47,7 +47,10 @@ namespace Org.OpenAPITools.Model public TriangleInterface(string triangleType = default(string)) { // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this.TriangleType = triangleType; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs index 80fbf9c368c..ca813a615c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs @@ -49,7 +49,10 @@ namespace Org.OpenAPITools.Model public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this.ClassName = className; this.HasBaleen = hasBaleen; this.HasTeeth = hasTeeth; this.AdditionalProperties = new Dictionary(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs index cfa92d1b708..c0021b400c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs @@ -80,7 +80,10 @@ namespace Org.OpenAPITools.Model public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this.ClassName = className; this.Type = type; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs index 809df84aa23..2e27b62eb84 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs @@ -49,7 +49,10 @@ namespace Org.OpenAPITools.Model public Animal(string className = default(string), string color = "red") { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this.ClassName = className; // use default value if no "color" provided this.Color = color ?? "red"; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs index a1203358492..6840cce39cb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -45,7 +45,10 @@ namespace Org.OpenAPITools.Model public AppleReq(string cultivar = default(string), bool mealy = default(bool)) { // to ensure "cultivar" is required (not null) - this.Cultivar = cultivar ?? throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + if (cultivar == null) { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this.Cultivar = cultivar; this.Mealy = mealy; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs index ef8076cda4e..00c38840cc9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -44,7 +44,10 @@ namespace Org.OpenAPITools.Model public BasquePig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this.ClassName = className; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs index 4ce3332bb69..223a91c9bd7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs @@ -45,7 +45,10 @@ namespace Org.OpenAPITools.Model public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; this.Id = id; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 64217511870..8c8621c7fa3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs index 1c53adbe337..4307db88c8c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -44,7 +44,10 @@ namespace Org.OpenAPITools.Model public DanishPig(string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this.ClassName = className; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index e16ced021f3..4cfd67e1154 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this.TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs index dbc146413be..013f06afcad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -60,10 +60,16 @@ namespace Org.OpenAPITools.Model { this.Number = number; // to ensure "_byte" is required (not null) - this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + if (_byte == null) { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; this.Date = date; // to ensure "password" is required (not null) - this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + if (password == null) { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this.Password = password; this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index a5b3dc0cfe7..a82a4a0e7ff 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -48,7 +48,10 @@ namespace Org.OpenAPITools.Model public GrandparentAnimal(string petType = default(string)) { // to ensure "petType" is required (not null) - this.PetType = petType ?? throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + if (petType == null) { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this.PetType = petType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 46963173f71..f3f87f96ed8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this.TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs index 6e72b768fb0..0550a5eed82 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs @@ -83,9 +83,15 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; // to ensure "photoUrls" is required (not null) - this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; this.Id = id; this.Category = category; this.Tags = tags; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index e9657108be8..0866f2a943a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -44,7 +44,10 @@ namespace Org.OpenAPITools.Model public QuadrilateralInterface(string quadrilateralType = default(string)) { // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 46b9eaf7afc..68b4df15bd0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this.TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs index 187e9d72d6a..b050a70e90e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -44,7 +44,10 @@ namespace Org.OpenAPITools.Model public ShapeInterface(string shapeType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this.ShapeType = shapeType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index f16798ec1d1..af5849dbe65 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -45,9 +45,15 @@ namespace Org.OpenAPITools.Model public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) { // to ensure "shapeType" is required (not null) - this.ShapeType = shapeType ?? throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + if (shapeType == null) { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; // to ensure "quadrilateralType" is required (not null) - this.QuadrilateralType = quadrilateralType ?? throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + if (quadrilateralType == null) { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs index 4eb30bbeb3d..307789c68a4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -44,7 +44,10 @@ namespace Org.OpenAPITools.Model public TriangleInterface(string triangleType = default(string)) { // to ensure "triangleType" is required (not null) - this.TriangleType = triangleType ?? throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + if (triangleType == null) { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this.TriangleType = triangleType; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs index 15277d507ab..170acaba214 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs @@ -46,7 +46,10 @@ namespace Org.OpenAPITools.Model public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this.ClassName = className; this.HasBaleen = hasBaleen; this.HasTeeth = hasTeeth; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs index cfa92d1b708..c0021b400c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs @@ -80,7 +80,10 @@ namespace Org.OpenAPITools.Model public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() { // to ensure "className" is required (not null) - this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + if (className == null) { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this.ClassName = className; this.Type = type; this.AdditionalProperties = new Dictionary(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs index beb04e50af9..9d6ce0987d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs @@ -84,9 +84,15 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; // to ensure "photoUrls" is required (not null) - this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + if (photoUrls == null) { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; this.Id = id; this.Category = category; this.Tags = tags; From 2c5943d32f0350f6598e66cd289c19b170cbfef9 Mon Sep 17 00:00:00 2001 From: MATSUBARA Nobutada Date: Wed, 8 Sep 2021 11:00:13 +0900 Subject: [PATCH 18/75] Fix response array and dict in elm template (#10310) --- .../src/main/resources/elm/recordFieldValueDecoder.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/elm/recordFieldValueDecoder.mustache b/modules/openapi-generator/src/main/resources/elm/recordFieldValueDecoder.mustache index d01b75352d4..31d811eb5fe 100644 --- a/modules/openapi-generator/src/main/resources/elm/recordFieldValueDecoder.mustache +++ b/modules/openapi-generator/src/main/resources/elm/recordFieldValueDecoder.mustache @@ -1 +1 @@ -{{#isArray}}(Json.Decode.list {{/isArray}}{{#isMap}}(Json.Decode.dict {{/isMap}}{{#items}}{{>recordFieldValueDecoder}}{{/items}}{{^isArray}}{{#isCircularReference}}(Json.Decode.lazy (\_ -> {{/isCircularReference}}{{>fieldDecoder}}{{#isCircularReference}})){{/isCircularReference}}{{/isArray}}{{#isArray}}){{/isArray}}{{#isMap}}){{/isMap}} \ No newline at end of file +{{#isArray}}(Json.Decode.list {{#items}}{{>recordFieldValueDecoder}}{{/items}}{{/isArray}}{{#isMap}}(Json.Decode.dict {{#AdditionalProperties}}{{>recordFieldValueDecoder}}{{/AdditionalProperties}}{{/isMap}}{{^isArray}}{{^isMap}}{{#isCircularReference}}(Json.Decode.lazy (\_ -> {{/isCircularReference}}{{>fieldDecoder}}{{#isCircularReference}})){{/isCircularReference}}{{/isMap}}{{/isArray}}{{#isArray}}){{/isArray}}{{#isMap}}){{/isMap}} \ No newline at end of file From 2640c369e8a5641b8a9fa3c84304498701978eb4 Mon Sep 17 00:00:00 2001 From: Matthias Wimmer Date: Wed, 8 Sep 2021 04:04:48 +0200 Subject: [PATCH 19/75] [elm] fix generated invalid code for enums (#10328) As described in https://github.com/OpenAPITools/openapi-generator/issues/8343 invalid code was generated when the OpenAPI uses enums. With this the decoders/encoders are called at the correct place. --- .../src/main/resources/elm/fieldDecoder.mustache | 1 + .../src/main/resources/elm/fieldEncoder.mustache | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/elm/fieldDecoder.mustache b/modules/openapi-generator/src/main/resources/elm/fieldDecoder.mustache index 964b3cf9a84..3bec7786ccf 100644 --- a/modules/openapi-generator/src/main/resources/elm/fieldDecoder.mustache +++ b/modules/openapi-generator/src/main/resources/elm/fieldDecoder.mustache @@ -10,6 +10,7 @@ {{#isFloat}}Json.Decode.float{{/isFloat}} {{#isDouble}}Json.Decode.float{{/isDouble}} {{#isBoolean}}Json.Decode.bool{{/isBoolean}} +{{#isEnum}}{{#lambda.camelcase}}{{classname}}{{enumName}}Decoder{{/lambda.camelcase}}{{/isEnum}} {{#isUuid}}Uuid.decoder{{/isUuid}} {{^isDateTime}}{{^isDate}}{{^isByteArray}}{{^isBinary}}{{^isString}}{{^isNumeric}}{{^isBoolean}}{{^isUuid}} {{#is2xx}}Api.Data.{{/is2xx}}{{#is3xx}}Api.Data.{{/is3xx}}{{#lambda.camelcase}}{{#isEnum}}{{classname}}{{enumName}}{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}}{{/lambda.camelcase}}Decoder diff --git a/modules/openapi-generator/src/main/resources/elm/fieldEncoder.mustache b/modules/openapi-generator/src/main/resources/elm/fieldEncoder.mustache index 9ae836c6169..85f4b2da879 100644 --- a/modules/openapi-generator/src/main/resources/elm/fieldEncoder.mustache +++ b/modules/openapi-generator/src/main/resources/elm/fieldEncoder.mustache @@ -10,6 +10,7 @@ {{#isFloat}}Json.Encode.float{{/isFloat}} {{#isDouble}}Json.Encode.float{{/isDouble}} {{#isBoolean}}Json.Encode.bool{{/isBoolean}} +{{#isEnum}}{{#lambda.camelcase}}encode{{classname}}{{enumName}}{{/lambda.camelcase}}{{/isEnum}} {{#isUuid}}Uuid.encode{{/isUuid}} {{^isDateTime}}{{^isDate}}{{^isByteArray}}{{^isBinary}}{{^isString}}{{^isNumeric}}{{^isBoolean}}{{^isUuid}} {{#lambda.camelcase}}encode{{#isEnum}}{{classname}}{{enumName}}{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}}{{/lambda.camelcase}} From a24e7e2af32cc74b03e955558f047572d56eeff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Rodr=C3=ADguez=20Mart=C3=ADn?= Date: Wed, 8 Sep 2021 04:16:00 +0200 Subject: [PATCH 20/75] Fix default value for enum type in RequestParameter was not added (#10332) --- .../languages/AbstractJavaCodegen.java | 2 +- .../java/spring/SpringCodegenTest.java | 33 ++++++ .../resources/3_0/spring/issue_10278.yaml | 112 ++++++++++++++++++ 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/issue_10278.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index dbe0af28fb2..748e3081549 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -1001,7 +1001,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code @Override public String toDefaultParameterValue(final Schema schema) { - Object defaultValue = schema.getDefault(); + Object defaultValue = schema.get$ref() != null ? ModelUtils.getReferencedSchema(openAPI, schema).getDefault() : schema.getDefault(); if (defaultValue == null) { return null; } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 99606af840b..66817e5dbc7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -690,4 +690,37 @@ public class SpringCodegenTest { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GirafesApi.java"), "allowableValues = \"0, 1\""); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GirafesApi.java"), "@PathVariable"); } + + @Test + public void shouldGenerateDefaultValueForEnumRequestParameter() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/issue_10278.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(SpringCodegen.DELEGATE_PATTERN, "true"); + codegen.additionalProperties().put(SpringCodegen.REACTIVE, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GetApi.java"), + "@RequestParam(value = \"testParameter1\", required = false, defaultValue = \"BAR\")", + "@RequestParam(value = \"TestParameter2\", required = false, defaultValue = \"BAR\")"); + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_10278.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_10278.yaml new file mode 100644 index 00000000000..aca62e52d12 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_10278.yaml @@ -0,0 +1,112 @@ +openapi: 3.0.1 +info: + title: Swagger Petstore + description: 'This is a sample server Petstore server. You can find out more about Swagger + at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For + this sample, you can use the api key `special-key` to test the authorization filters.' + termsOfService: http://swagger.io/terms/ + contact: + email: apiteam@swagger.io + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io +servers: + - url: https://petstore.swagger.io/v2 + - url: http://petstore.swagger.io/v2 +tags: + - name: pet + description: Everything about your Pets + externalDocs: + description: Find out more + url: http://swagger.io + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user + externalDocs: + description: Find out more about our store + url: http://swagger.io +paths: + /get: + put: + tags: + - pet + summary: Update an existing pet + operationId: getPet + parameters: + - $ref: '#/components/parameters/TestParameter1' + - in: query + name: TestParameter2 + schema: + type: string + enum: [ FOO, BAR ] + default: BAR + responses: + 400: + description: Invalid ID supplied + content: {} + 404: + description: Pet not found + content: {} + 405: + description: Validation exception + content: {} + security: + - petstore_auth: + - write:pets + - read:pets + x-codegen-request-body-name: body + +components: + parameters: + TestParameter1: + name: testParameter1 + in: query + description: | + Type of token + schema: + $ref: '#/components/schemas/TestParameter1' + schemas: + TestParameter1: + type: string + enum: + - FOO + - BAR + default: BAR + Category: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Category + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + api_key: + type: apiKey + name: api_key + in: header \ No newline at end of file From 86ead27a409bf88118148d5dc11cb74915742347 Mon Sep 17 00:00:00 2001 From: Ahmed Yarub Hani Al Nuaimi Date: Tue, 7 Sep 2021 23:55:49 -0300 Subject: [PATCH 21/75] Windows adaptations and installer configuration (#10326) * Undefine reserved keywords Cast to correct type when applicable to be compilable on C++ compilers Add conditional instllation of configuration files * Update samples * Use default installation method if no configuration script is provided * Undefine stdin/stderr/stdout only for model files * Undefine stdin/stderr/stdout only for model files in samples * Remove #undef directives * Add stdin/stderr/stdout to reserved words for libcurl-C generator * Expose all symbols when compiling libcurl as a shared library on Windows Install header files Set correct flags for target link libraries * Remove line * Regenerate samples * Add comment * Update documentations * Revert "Update documentations" This reverts commit 0e25659de2d68753e1e033eaa83e769c028de5cb. * Update documentations * Add versioning support * Add versioning support * Add comment --- docs/generators/c.md | 3 + .../languages/CLibcurlClientCodegen.java | 7 ++- .../C-libcurl/CMakeLists.txt.mustache | 62 +++++++++++++++++-- .../resources/C-libcurl/apiClient.c.mustache | 2 +- samples/client/petstore/c/src/apiClient.c | 2 +- 5 files changed, 69 insertions(+), 7 deletions(-) diff --git a/docs/generators/c.md b/docs/generators/c.md index c3a79bad9fc..98f84c45876 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -135,6 +135,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • static
  • static_assert
  • static_cast
  • +
  • stderr
  • +
  • stdin
  • +
  • stdout
  • struct
  • switch
  • synchronized
  • diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index 07b16ca17b4..58803d150a1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -245,7 +245,12 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf "final", "override", "transaction_safe", - "transaction_safe_dynamic") + "transaction_safe_dynamic", + + // VC++ reserved keywords + "stdin", + "stdout", + "stderr") ); instantiationTypes.clear(); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache index 2e6d8480fa0..33d82b5786d 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache @@ -6,6 +6,7 @@ cmake_policy(SET CMP0063 NEW) set(CMAKE_C_VISIBILITY_PRESET default) set(CMAKE_CXX_VISIBILITY_PRESET default) set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) option(BUILD_SHARED_LIBS "Build using shared libraries" ON) @@ -27,6 +28,7 @@ else() endif() set(pkgName "{{projectName}}") +set(VERSION 0.0.1) # this default version can be overridden in PreTarget.cmake find_package(CURL 7.58.0 REQUIRED) if(CURL_FOUND) @@ -86,14 +88,66 @@ include(PreTarget.cmake OPTIONAL) add_library(${pkgName} ${SRCS} ${HDRS}) # Link dependent libraries if(NOT CMAKE_VERSION VERSION_LESS 3.4) - target_link_libraries(${pkgName} OpenSSL::SSL OpenSSL::Crypto) + target_link_libraries(${pkgName} PRIVATE OpenSSL::SSL OpenSSL::Crypto) endif() -target_link_libraries(${pkgName} ${CURL_LIBRARIES} ) +target_link_libraries(${pkgName} PUBLIC ${CURL_LIBRARIES} ) +target_include_directories( + ${pkgName} PUBLIC $ + $ +) include(PostTarget.cmake OPTIONAL) -#install library to destination -install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX}) +# installation of libraries, headers, and config files +if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in) + install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX}) +else() + include(GNUInstallDirs) + install(TARGETS ${pkgName} + EXPORT ${pkgName}Targets + ) + + foreach(HDR_FILE ${HDRS}) + get_filename_component(HDR_DIRECTORY ${HDR_FILE} DIRECTORY) + get_filename_component(ABSOLUTE_HDR_DIRECTORY ${HDR_DIRECTORY} ABSOLUTE) + file(RELATIVE_PATH RELATIVE_HDR_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${ABSOLUTE_HDR_DIRECTORY}) + install(FILES ${HDR_FILE} DESTINATION include/${RELATIVE_HDR_PATH}) + endforeach() + + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}ConfigVersion.cmake" + VERSION "${VERSION}" + COMPATIBILITY AnyNewerVersion + ) + + export(EXPORT ${pkgName}Targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}Targets.cmake" + NAMESPACE ${pkgName}:: + ) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}Config.cmake" + @ONLY + ) + + set(ConfigPackageLocation lib/cmake/${pkgName}) + install(EXPORT ${pkgName}Targets + FILE + ${pkgName}Targets.cmake + NAMESPACE + ${pkgName}:: + DESTINATION + ${ConfigPackageLocation} + ) + install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}ConfigVersion.cmake" + DESTINATION + ${ConfigPackageLocation} + ) +endif() # Setting file variables to null set(SRCS "") diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache index d4d387f8f05..38656a5615b 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache @@ -570,7 +570,7 @@ size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp) { size_t size_this_time = nmemb * size; apiClient_t *apiClient = (apiClient_t *)userp; apiClient->dataReceived = (char *)realloc( apiClient->dataReceived, apiClient->dataReceivedLen + size_this_time + 1); - memcpy(apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time); + memcpy((char *)apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time); apiClient->dataReceivedLen += size_this_time; ((char*)apiClient->dataReceived)[apiClient->dataReceivedLen] = '\0'; // the space size of (apiClient->dataReceived) = dataReceivedLen + 1 if (apiClient->data_callback_func) { diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index 2ab296b2e63..ce2f522cda2 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -476,7 +476,7 @@ size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp) { size_t size_this_time = nmemb * size; apiClient_t *apiClient = (apiClient_t *)userp; apiClient->dataReceived = (char *)realloc( apiClient->dataReceived, apiClient->dataReceivedLen + size_this_time + 1); - memcpy(apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time); + memcpy((char *)apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time); apiClient->dataReceivedLen += size_this_time; ((char*)apiClient->dataReceived)[apiClient->dataReceivedLen] = '\0'; // the space size of (apiClient->dataReceived) = dataReceivedLen + 1 if (apiClient->data_callback_func) { From 2239ca36fdcedd865a3d9ccd3381f5031cdf8dbe Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Wed, 8 Sep 2021 10:10:28 +0200 Subject: [PATCH 22/75] cpp-qt-client: Fix cppcheck warnings (#10322) * Fix cppcheck warnings * Improve coding style * Add 4 spaces --- .../resources/cpp-qt-client/api-body.mustache | 147 +++++------ .../cpp-qt-client/api-header.mustache | 12 +- .../petstore/cpp-qt/client/PFXPetApi.cpp | 248 ++++++++---------- .../client/petstore/cpp-qt/client/PFXPetApi.h | 12 +- .../petstore/cpp-qt/client/PFXStoreApi.cpp | 162 ++++++------ .../petstore/cpp-qt/client/PFXStoreApi.h | 12 +- .../petstore/cpp-qt/client/PFXUserApi.cpp | 230 ++++++++-------- .../petstore/cpp-qt/client/PFXUserApi.h | 12 +- 8 files changed, 398 insertions(+), 437 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache index 39c55843a74..c4655177968 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache @@ -11,19 +11,21 @@ namespace {{this}} { {{classname}}::{{classname}}(const int timeOut) : _timeOut(timeOut), _manager(nullptr), - isResponseCompressionEnabled(false), - isRequestCompressionEnabled(false) { + _isResponseCompressionEnabled(false), + _isRequestCompressionEnabled(false) { initializeServerConfigs(); } {{classname}}::~{{classname}}() { } -void {{classname}}::initializeServerConfigs(){ +void {{classname}}::initializeServerConfigs() { //Default server QList<{{prefix}}ServerConfiguration> defaultConf = QList<{{prefix}}ServerConfiguration>(); //varying endpoint server + {{#servers}} QList<{{prefix}}ServerConfiguration> serverConf = QList<{{prefix}}ServerConfiguration>(); + {{/servers}} {{#vendorExtensions.x-cpp-global-server-list}} defaultConf.append({{prefix}}ServerConfiguration( QUrl("{{{url}}}"), @@ -58,23 +60,24 @@ void {{classname}}::initializeServerConfigs(){ * returns 0 on success and -1, -2 or -3 on failure. * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found */ -int {{classname}}::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value){ +int {{classname}}::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); - if(it != _serverConfigs.end() && serverIndex < it.value().size() ){ + if (it != _serverConfigs.end() && serverIndex < it.value().size()) { return _serverConfigs[operation][serverIndex].setDefaultValue(variable,value); } return -3; } -void {{classname}}::setServerIndex(const QString &operation, int serverIndex){ - if(_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size() ) +void {{classname}}::setServerIndex(const QString &operation, int serverIndex) { + if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; + } } -void {{classname}}::setApiKey(const QString &apiKeyName, const QString &apiKey){ +void {{classname}}::setApiKey(const QString &apiKeyName, const QString &apiKey) { _apiKeys.insert(apiKeyName,apiKey); } -void {{classname}}::setBearerToken(const QString &token){ +void {{classname}}::setBearerToken(const QString &token) { _bearerToken = token; } @@ -107,14 +110,14 @@ void {{classname}}::setNetworkAccessManager(QNetworkAccessManager* manager) { * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. * returns the index of the new server config on success and -1 if the operation is not found */ -int {{classname}}::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables){ - if(_serverConfigs.contains(operation)){ +int {{classname}}::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { + if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append({{prefix}}ServerConfiguration( url, description, variables)); return _serverConfigs[operation].size()-1; - }else{ + } else { return -1; } } @@ -125,9 +128,9 @@ int {{classname}}::addServerConfiguration(const QString &operation, const QUrl & * @param description A String that describes the server * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ -void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables){ - for(auto e : _serverIndices.keys()){ - setServerIndex(e, addServerConfiguration(e, url, description, variables)); +void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { + for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { + setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } } @@ -137,85 +140,85 @@ void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString * @param description A String that describes the server * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ -void {{classname}}::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables){ +void {{classname}}::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } void {{classname}}::addHeaders(const QString &key, const QString &value) { - defaultHeaders.insert(key, value); + _defaultHeaders.insert(key, value); } void {{classname}}::enableRequestCompression() { - isRequestCompressionEnabled = true; + _isRequestCompressionEnabled = true; } void {{classname}}::enableResponseCompression() { - isResponseCompressionEnabled = true; + _isResponseCompressionEnabled = true; } -void {{classname}}::abortRequests(){ +void {{classname}}::abortRequests() { emit abortRequestsSignal(); } -QString {{classname}}::getParamStylePrefix(QString style){ - if(style == "matrix"){ +QString {{classname}}::getParamStylePrefix(const QString &style) { + if (style == "matrix") { return ";"; - }else if(style == "label"){ + } else if (style == "label") { return "."; - }else if(style == "form"){ + } else if (style == "form") { return "&"; - }else if(style == "simple"){ + } else if (style == "simple") { return ""; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return "&"; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return "&"; - }else{ + } else { return "none"; } } -QString {{classname}}::getParamStyleSuffix(QString style){ - if(style == "matrix"){ +QString {{classname}}::getParamStyleSuffix(const QString &style) { + if (style == "matrix") { return "="; - }else if(style == "label"){ + } else if (style == "label") { return ""; - }else if(style == "form"){ + } else if (style == "form") { return "="; - }else if(style == "simple"){ + } else if (style == "simple") { return ""; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return "="; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return "="; - }else{ + } else { return "none"; } } -QString {{classname}}::getParamStyleDelimiter(QString style, QString name, bool isExplode){ +QString {{classname}}::getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode) { - if(style == "matrix"){ + if (style == "matrix") { return (isExplode) ? ";" + name + "=" : ","; - }else if(style == "label"){ + } else if (style == "label") { return (isExplode) ? "." : ","; - }else if(style == "form"){ + } else if (style == "form") { return (isExplode) ? "&" + name + "=" : ","; - }else if(style == "simple"){ + } else if (style == "simple") { return ","; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return (isExplode) ? "&" + name + "=" : " "; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return (isExplode) ? "&" + name + "=" : "|"; - }else if(style == "deepObject"){ + } else if (style == "deepObject") { return (isExplode) ? "&" : "none"; - }else { + } else { return "none"; } } @@ -225,11 +228,11 @@ QString {{classname}}::getParamStyleDelimiter(QString style, QString name, bool void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} &{{/required}}{{^required}}const ::{{cppNamespace}}::OptionalParam<{{{dataType}}}> &{{/required}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { QString fullPath = QString(_serverConfigs["{{nickname}}"][_serverIndices.value("{{nickname}}")].URL()+"{{{path}}}"); {{#authMethods}}{{#isApiKey}}{{#isKeyInHeader}} - if(_apiKeys.contains("{{name}}")){ + if (_apiKeys.contains("{{name}}")) { addHeaders("{{name}}",_apiKeys.find("{{name}}").value()); } {{/isKeyInHeader}}{{#isKeyInQuery}} - if(_apiKeys.contains("{{name}}")){ + if (_apiKeys.contains("{{name}}")) { if (fullPath.indexOf("?") > 0) fullPath.append("&"); else @@ -237,22 +240,22 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} fullPath.append("{{{name}}}=").append(_apiKeys.find("{{name}}").value()); } {{/isKeyInQuery}}{{/isApiKey}}{{#isBasicBearer}} - if(!_bearerToken.isEmpty()) + if (!_bearerToken.isEmpty()) addHeaders("Authorization", "Bearer " + _bearerToken); {{/isBasicBearer}}{{#isBasicBasic}} - if(!_username.isEmpty() && !_password.isEmpty()){ + if (!_username.isEmpty() && !_password.isEmpty()) { QByteArray b64; b64.append(_username.toUtf8() + ":" + _password.toUtf8()); addHeaders("Authorization","Basic " + b64.toBase64()); }{{/isBasicBasic}}{{/authMethods}} {{#pathParams}} - {{^required}}if({{paramName}}.hasValue()){{/required}} + {{^required}}if ({{paramName}}.hasValue()) {{/required}} { QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{baseName}}").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = "{{style}}"; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -308,7 +311,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} {{/isPrimitiveType}} {{/collectionFormat}} {{#collectionFormat}} - if({{{paramName}}}{{^required}}.value(){{/required}}.size() > 0) { + if ({{{paramName}}}{{^required}}.value(){{/required}}.size() > 0) { QString paramString = (pathStyle == "matrix") ? pathPrefix+"{{baseName}}"+pathSuffix : pathPrefix; qint32 count = 0; foreach ({{{baseType}}} t, {{paramName}}{{^required}}.value(){{/required}}) { @@ -327,10 +330,10 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} QString queryPrefix, querySuffix, queryDelimiter, queryStyle; {{/hasQueryParams}} {{#queryParams}} - {{^required}}if({{paramName}}.hasValue()){{/required}} + {{^required}}if ({{paramName}}.hasValue()){{/required}} { queryStyle = "{{style}}"; - if(queryStyle == "") + if (queryStyle == "") queryStyle = "form"; queryPrefix = getParamStylePrefix(queryStyle); querySuffix = getParamStyleSuffix(queryStyle); @@ -392,7 +395,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} {{/isPrimitiveType}} {{/collectionFormat}} {{#collectionFormat}} - if({{{paramName}}}{{^required}}.value(){{/required}}.size() > 0) { + if ({{{paramName}}}{{^required}}.value(){{/required}}.size() > 0) { if (QString("{{collectionFormat}}").indexOf("multi") == 0) { foreach ({{{baseType}}} t, {{paramName}}{{^required}}.value(){{/required}}) { if (fullPath.indexOf("?") > 0) @@ -474,21 +477,21 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} {{prefix}}HttpRequestWorker *worker = new {{prefix}}HttpRequestWorker(this, _manager); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory);{{#contentCompression}} - worker->setResponseCompressionEnabled(isResponseCompressionEnabled); - worker->setRequestCompressionEnabled(isRequestCompressionEnabled);{{/contentCompression}} + worker->setResponseCompressionEnabled(_isResponseCompressionEnabled); + worker->setRequestCompressionEnabled(_isRequestCompressionEnabled);{{/contentCompression}} {{prefix}}HttpRequestInput input(fullPath, "{{httpMethod}}"); {{#formParams}} {{#first}} QString formPrefix,formSuffix, formDelimiter; QString formStyle = "{{style}}"; - if(formStyle == "") + if (formStyle == "") formStyle = "form"; formPrefix = getParamStylePrefix(formStyle); formSuffix = getParamStyleSuffix(formStyle); formDelimiter = getParamStyleDelimiter(formStyle, "{{baseName}}", {{isExplode}}); {{/first}} - {{^required}}if({{paramName}}.hasValue()){{/required}} + {{^required}}if ({{paramName}}.hasValue()){{/required}} { {{^isFile}} input.add_var("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}{{^required}}.value(){{/required}})); @@ -499,7 +502,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} } {{/formParams}} {{#bodyParams}} - {{^required}}if({{paramName}}.hasValue()){{/required}}{ + {{^required}}if ({{paramName}}.hasValue()){{/required}}{ {{#isContainer}} {{#isArray}} QJsonDocument doc(::{{cppNamespace}}::toJsonValue({{paramName}}{{^required}}.value(){{/required}}).toArray());{{/isArray}}{{#isMap}} @@ -514,7 +517,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} {{/isContainer}} }{{/bodyParams}} {{#headerParams}} - {{^required}}if({{paramName}}.hasValue()){{/required}} + {{^required}}if ({{paramName}}.hasValue()){{/required}} { {{^collectionFormat}} {{^isPrimitiveType}} @@ -581,9 +584,9 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} } {{/headerParams}} {{#cookieParams}} - {{^required}}if({{paramName}}.hasValue()){{/required}} + {{^required}}if ({{paramName}}.hasValue()){{/required}} { - if(QString("{{style}}").indexOf("form") == 0){ + if (QString("{{style}}").indexOf("form") == 0) { {{^collectionFormat}} {{^isPrimitiveType}} {{^isExplode}} @@ -630,7 +633,7 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} {{/isExplode}} {{/isPrimitiveType}} {{#isPrimitiveType}} - if(!::{{cppNamespace}}::toStringValue({{paramName}}{{^required}}.value(){{/required}}).isEmpty()) { + if (!::{{cppNamespace}}::toStringValue({{paramName}}{{^required}}.value(){{/required}}).isEmpty()) { input.headers.insert("Cookie", "{{baseName}}="+::{{cppNamespace}}::toStringValue({{paramName}}{{^required}}.value(){{/required}})); } {{/isPrimitiveType}} @@ -653,12 +656,14 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} } } {{/cookieParams}} - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback); connect(this, &{{classname}}::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren<{{prefix}}HttpRequestWorker*>().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren<{{prefix}}HttpRequestWorker*>().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -667,15 +672,11 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} } void {{classname}}::{{nickname}}Callback({{prefix}}HttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } {{#returnType}} {{#isArray}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache index 09449281ecd..6823ab05ec5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache @@ -43,9 +43,9 @@ public: void enableRequestCompression(); void enableResponseCompression(); void abortRequests(); - QString getParamStylePrefix(QString style); - QString getParamStyleSuffix(QString style); - QString getParamStyleDelimiter(QString style, QString name, bool isExplode); + QString getParamStylePrefix(const QString &style); + QString getParamStyleSuffix(const QString &style); + QString getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode); {{#operations}}{{#operation}} {{#hasParams}} /** {{#allParams}} @@ -70,9 +70,9 @@ private: int _timeOut; QString _workingDirectory; QNetworkAccessManager* _manager; - QMap defaultHeaders; - bool isResponseCompressionEnabled; - bool isRequestCompressionEnabled; + QMap _defaultHeaders; + bool _isResponseCompressionEnabled; + bool _isRequestCompressionEnabled; {{#operations}}{{#operation}} void {{nickname}}Callback({{prefix}}HttpRequestWorker *worker);{{/operation}}{{/operations}} diff --git a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp index 136f71708ba..8dd0658865d 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp @@ -19,19 +19,18 @@ namespace test_namespace { PFXPetApi::PFXPetApi(const int timeOut) : _timeOut(timeOut), _manager(nullptr), - isResponseCompressionEnabled(false), - isRequestCompressionEnabled(false) { + _isResponseCompressionEnabled(false), + _isRequestCompressionEnabled(false) { initializeServerConfigs(); } PFXPetApi::~PFXPetApi() { } -void PFXPetApi::initializeServerConfigs(){ +void PFXPetApi::initializeServerConfigs() { //Default server QList defaultConf = QList(); //varying endpoint server - QList serverConf = QList(); defaultConf.append(PFXServerConfiguration( QUrl("http://petstore.swagger.io/v2"), "No description provided", @@ -58,23 +57,24 @@ void PFXPetApi::initializeServerConfigs(){ * returns 0 on success and -1, -2 or -3 on failure. * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found */ -int PFXPetApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value){ +int PFXPetApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); - if(it != _serverConfigs.end() && serverIndex < it.value().size() ){ + if (it != _serverConfigs.end() && serverIndex < it.value().size()) { return _serverConfigs[operation][serverIndex].setDefaultValue(variable,value); } return -3; } -void PFXPetApi::setServerIndex(const QString &operation, int serverIndex){ - if(_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size() ) +void PFXPetApi::setServerIndex(const QString &operation, int serverIndex) { + if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; + } } -void PFXPetApi::setApiKey(const QString &apiKeyName, const QString &apiKey){ +void PFXPetApi::setApiKey(const QString &apiKeyName, const QString &apiKey) { _apiKeys.insert(apiKeyName,apiKey); } -void PFXPetApi::setBearerToken(const QString &token){ +void PFXPetApi::setBearerToken(const QString &token) { _bearerToken = token; } @@ -107,14 +107,14 @@ void PFXPetApi::setNetworkAccessManager(QNetworkAccessManager* manager) { * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. * returns the index of the new server config on success and -1 if the operation is not found */ -int PFXPetApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables){ - if(_serverConfigs.contains(operation)){ +int PFXPetApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { + if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( url, description, variables)); return _serverConfigs[operation].size()-1; - }else{ + } else { return -1; } } @@ -125,9 +125,9 @@ int PFXPetApi::addServerConfiguration(const QString &operation, const QUrl &url, * @param description A String that describes the server * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ -void PFXPetApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables){ - for(auto e : _serverIndices.keys()){ - setServerIndex(e, addServerConfiguration(e, url, description, variables)); +void PFXPetApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { + for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { + setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } } @@ -137,85 +137,85 @@ void PFXPetApi::setNewServerForAllOperations(const QUrl &url, const QString &des * @param description A String that describes the server * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ -void PFXPetApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables){ +void PFXPetApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } void PFXPetApi::addHeaders(const QString &key, const QString &value) { - defaultHeaders.insert(key, value); + _defaultHeaders.insert(key, value); } void PFXPetApi::enableRequestCompression() { - isRequestCompressionEnabled = true; + _isRequestCompressionEnabled = true; } void PFXPetApi::enableResponseCompression() { - isResponseCompressionEnabled = true; + _isResponseCompressionEnabled = true; } -void PFXPetApi::abortRequests(){ +void PFXPetApi::abortRequests() { emit abortRequestsSignal(); } -QString PFXPetApi::getParamStylePrefix(QString style){ - if(style == "matrix"){ +QString PFXPetApi::getParamStylePrefix(const QString &style) { + if (style == "matrix") { return ";"; - }else if(style == "label"){ + } else if (style == "label") { return "."; - }else if(style == "form"){ + } else if (style == "form") { return "&"; - }else if(style == "simple"){ + } else if (style == "simple") { return ""; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return "&"; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return "&"; - }else{ + } else { return "none"; } } -QString PFXPetApi::getParamStyleSuffix(QString style){ - if(style == "matrix"){ +QString PFXPetApi::getParamStyleSuffix(const QString &style) { + if (style == "matrix") { return "="; - }else if(style == "label"){ + } else if (style == "label") { return ""; - }else if(style == "form"){ + } else if (style == "form") { return "="; - }else if(style == "simple"){ + } else if (style == "simple") { return ""; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return "="; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return "="; - }else{ + } else { return "none"; } } -QString PFXPetApi::getParamStyleDelimiter(QString style, QString name, bool isExplode){ +QString PFXPetApi::getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode) { - if(style == "matrix"){ + if (style == "matrix") { return (isExplode) ? ";" + name + "=" : ","; - }else if(style == "label"){ + } else if (style == "label") { return (isExplode) ? "." : ","; - }else if(style == "form"){ + } else if (style == "form") { return (isExplode) ? "&" + name + "=" : ","; - }else if(style == "simple"){ + } else if (style == "simple") { return ","; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return (isExplode) ? "&" + name + "=" : " "; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return (isExplode) ? "&" + name + "=" : "|"; - }else if(style == "deepObject"){ + } else if (style == "deepObject") { return (isExplode) ? "&" : "none"; - }else { + } else { return "none"; } } @@ -233,12 +233,14 @@ void PFXPetApi::addPet(const PFXPet &body) { QByteArray output = body.asJson().toUtf8(); input.request_body.append(output); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::addPetCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -247,15 +249,11 @@ void PFXPetApi::addPet(const PFXPet &body) { } void PFXPetApi::addPetCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -277,7 +275,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional pet_idPathParam.append("petId").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -291,18 +289,20 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional PFXHttpRequestInput input(fullPath, "DELETE"); - if(api_key.hasValue()) + if (api_key.hasValue()) { if (!::test_namespace::toStringValue(api_key.value()).isEmpty()) { input.headers.insert("api_key", ::test_namespace::toStringValue(api_key.value())); } } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::deletePetCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -311,15 +311,11 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional } void PFXPetApi::deletePetCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -339,12 +335,12 @@ void PFXPetApi::findPetsByStatus(const QList &status) { { queryStyle = "form"; - if(queryStyle == "") + if (queryStyle == "") queryStyle = "form"; queryPrefix = getParamStylePrefix(queryStyle); querySuffix = getParamStyleSuffix(queryStyle); queryDelimiter = getParamStyleDelimiter(queryStyle, "status", false); - if(status.size() > 0) { + if (status.size() > 0) { if (QString("csv").indexOf("multi") == 0) { foreach (QString t, status) { if (fullPath.indexOf("?") > 0) @@ -427,12 +423,14 @@ void PFXPetApi::findPetsByStatus(const QList &status) { PFXHttpRequestInput input(fullPath, "GET"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByStatusCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -441,15 +439,11 @@ void PFXPetApi::findPetsByStatus(const QList &status) { } void PFXPetApi::findPetsByStatusCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } QList output; QString json(worker->response); @@ -479,12 +473,12 @@ void PFXPetApi::findPetsByTags(const QList &tags) { { queryStyle = "form"; - if(queryStyle == "") + if (queryStyle == "") queryStyle = "form"; queryPrefix = getParamStylePrefix(queryStyle); querySuffix = getParamStyleSuffix(queryStyle); queryDelimiter = getParamStyleDelimiter(queryStyle, "tags", false); - if(tags.size() > 0) { + if (tags.size() > 0) { if (QString("csv").indexOf("multi") == 0) { foreach (QString t, tags) { if (fullPath.indexOf("?") > 0) @@ -567,12 +561,14 @@ void PFXPetApi::findPetsByTags(const QList &tags) { PFXHttpRequestInput input(fullPath, "GET"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByTagsCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -581,15 +577,11 @@ void PFXPetApi::findPetsByTags(const QList &tags) { } void PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } QList output; QString json(worker->response); @@ -615,7 +607,7 @@ void PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker *worker) { void PFXPetApi::getPetById(const qint64 &pet_id) { QString fullPath = QString(_serverConfigs["getPetById"][_serverIndices.value("getPetById")].URL()+"/pet/{petId}"); - if(_apiKeys.contains("api_key")){ + if (_apiKeys.contains("api_key")) { addHeaders("api_key",_apiKeys.find("api_key").value()); } @@ -625,7 +617,7 @@ void PFXPetApi::getPetById(const qint64 &pet_id) { pet_idPathParam.append("petId").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -639,12 +631,14 @@ void PFXPetApi::getPetById(const qint64 &pet_id) { PFXHttpRequestInput input(fullPath, "GET"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::getPetByIdCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -653,15 +647,11 @@ void PFXPetApi::getPetById(const qint64 &pet_id) { } void PFXPetApi::getPetByIdCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } PFXPet output(QString(worker->response)); worker->deleteLater(); @@ -688,12 +678,14 @@ void PFXPetApi::updatePet(const PFXPet &body) { QByteArray output = body.asJson().toUtf8(); input.request_body.append(output); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -702,15 +694,11 @@ void PFXPetApi::updatePet(const PFXPet &body) { } void PFXPetApi::updatePetCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -732,7 +720,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: pet_idPathParam.append("petId").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -745,21 +733,23 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: worker->setWorkingDirectory(_workingDirectory); PFXHttpRequestInput input(fullPath, "POST"); - if(name.hasValue()) + if (name.hasValue()) { input.add_var("name", ::test_namespace::toStringValue(name.value())); } - if(status.hasValue()) + if (status.hasValue()) { input.add_var("status", ::test_namespace::toStringValue(status.value())); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetWithFormCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -768,15 +758,11 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: } void PFXPetApi::updatePetWithFormCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -798,7 +784,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona pet_idPathParam.append("petId").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -811,21 +797,23 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona worker->setWorkingDirectory(_workingDirectory); PFXHttpRequestInput input(fullPath, "POST"); - if(additional_metadata.hasValue()) + if (additional_metadata.hasValue()) { input.add_var("additionalMetadata", ::test_namespace::toStringValue(additional_metadata.value())); } - if(file.hasValue()) + if (file.hasValue()) { input.add_file("file", file.value().local_filename, file.value().request_filename, file.value().mime_type); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::uploadFileCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -834,15 +822,11 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona } void PFXPetApi::uploadFileCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } PFXApiResponse output(QString(worker->response)); worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt/client/PFXPetApi.h b/samples/client/petstore/cpp-qt/client/PFXPetApi.h index 2c4d472306b..4007bd2e942 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPetApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXPetApi.h @@ -53,9 +53,9 @@ public: void enableRequestCompression(); void enableResponseCompression(); void abortRequests(); - QString getParamStylePrefix(QString style); - QString getParamStyleSuffix(QString style); - QString getParamStyleDelimiter(QString style, QString name, bool isExplode); + QString getParamStylePrefix(const QString &style); + QString getParamStyleSuffix(const QString &style); + QString getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode); /** * @param[in] body PFXPet [required] @@ -113,9 +113,9 @@ private: int _timeOut; QString _workingDirectory; QNetworkAccessManager* _manager; - QMap defaultHeaders; - bool isResponseCompressionEnabled; - bool isRequestCompressionEnabled; + QMap _defaultHeaders; + bool _isResponseCompressionEnabled; + bool _isRequestCompressionEnabled; void addPetCallback(PFXHttpRequestWorker *worker); void deletePetCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp index 723af6e80c2..5766052aafd 100644 --- a/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp @@ -19,19 +19,18 @@ namespace test_namespace { PFXStoreApi::PFXStoreApi(const int timeOut) : _timeOut(timeOut), _manager(nullptr), - isResponseCompressionEnabled(false), - isRequestCompressionEnabled(false) { + _isResponseCompressionEnabled(false), + _isRequestCompressionEnabled(false) { initializeServerConfigs(); } PFXStoreApi::~PFXStoreApi() { } -void PFXStoreApi::initializeServerConfigs(){ +void PFXStoreApi::initializeServerConfigs() { //Default server QList defaultConf = QList(); //varying endpoint server - QList serverConf = QList(); defaultConf.append(PFXServerConfiguration( QUrl("http://petstore.swagger.io/v2"), "No description provided", @@ -50,23 +49,24 @@ void PFXStoreApi::initializeServerConfigs(){ * returns 0 on success and -1, -2 or -3 on failure. * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found */ -int PFXStoreApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value){ +int PFXStoreApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); - if(it != _serverConfigs.end() && serverIndex < it.value().size() ){ + if (it != _serverConfigs.end() && serverIndex < it.value().size()) { return _serverConfigs[operation][serverIndex].setDefaultValue(variable,value); } return -3; } -void PFXStoreApi::setServerIndex(const QString &operation, int serverIndex){ - if(_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size() ) +void PFXStoreApi::setServerIndex(const QString &operation, int serverIndex) { + if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; + } } -void PFXStoreApi::setApiKey(const QString &apiKeyName, const QString &apiKey){ +void PFXStoreApi::setApiKey(const QString &apiKeyName, const QString &apiKey) { _apiKeys.insert(apiKeyName,apiKey); } -void PFXStoreApi::setBearerToken(const QString &token){ +void PFXStoreApi::setBearerToken(const QString &token) { _bearerToken = token; } @@ -99,14 +99,14 @@ void PFXStoreApi::setNetworkAccessManager(QNetworkAccessManager* manager) { * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. * returns the index of the new server config on success and -1 if the operation is not found */ -int PFXStoreApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables){ - if(_serverConfigs.contains(operation)){ +int PFXStoreApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { + if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( url, description, variables)); return _serverConfigs[operation].size()-1; - }else{ + } else { return -1; } } @@ -117,9 +117,9 @@ int PFXStoreApi::addServerConfiguration(const QString &operation, const QUrl &ur * @param description A String that describes the server * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ -void PFXStoreApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables){ - for(auto e : _serverIndices.keys()){ - setServerIndex(e, addServerConfiguration(e, url, description, variables)); +void PFXStoreApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { + for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { + setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } } @@ -129,85 +129,85 @@ void PFXStoreApi::setNewServerForAllOperations(const QUrl &url, const QString &d * @param description A String that describes the server * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ -void PFXStoreApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables){ +void PFXStoreApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } void PFXStoreApi::addHeaders(const QString &key, const QString &value) { - defaultHeaders.insert(key, value); + _defaultHeaders.insert(key, value); } void PFXStoreApi::enableRequestCompression() { - isRequestCompressionEnabled = true; + _isRequestCompressionEnabled = true; } void PFXStoreApi::enableResponseCompression() { - isResponseCompressionEnabled = true; + _isResponseCompressionEnabled = true; } -void PFXStoreApi::abortRequests(){ +void PFXStoreApi::abortRequests() { emit abortRequestsSignal(); } -QString PFXStoreApi::getParamStylePrefix(QString style){ - if(style == "matrix"){ +QString PFXStoreApi::getParamStylePrefix(const QString &style) { + if (style == "matrix") { return ";"; - }else if(style == "label"){ + } else if (style == "label") { return "."; - }else if(style == "form"){ + } else if (style == "form") { return "&"; - }else if(style == "simple"){ + } else if (style == "simple") { return ""; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return "&"; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return "&"; - }else{ + } else { return "none"; } } -QString PFXStoreApi::getParamStyleSuffix(QString style){ - if(style == "matrix"){ +QString PFXStoreApi::getParamStyleSuffix(const QString &style) { + if (style == "matrix") { return "="; - }else if(style == "label"){ + } else if (style == "label") { return ""; - }else if(style == "form"){ + } else if (style == "form") { return "="; - }else if(style == "simple"){ + } else if (style == "simple") { return ""; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return "="; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return "="; - }else{ + } else { return "none"; } } -QString PFXStoreApi::getParamStyleDelimiter(QString style, QString name, bool isExplode){ +QString PFXStoreApi::getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode) { - if(style == "matrix"){ + if (style == "matrix") { return (isExplode) ? ";" + name + "=" : ","; - }else if(style == "label"){ + } else if (style == "label") { return (isExplode) ? "." : ","; - }else if(style == "form"){ + } else if (style == "form") { return (isExplode) ? "&" + name + "=" : ","; - }else if(style == "simple"){ + } else if (style == "simple") { return ","; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return (isExplode) ? "&" + name + "=" : " "; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return (isExplode) ? "&" + name + "=" : "|"; - }else if(style == "deepObject"){ + } else if (style == "deepObject") { return (isExplode) ? "&" : "none"; - }else { + } else { return "none"; } } @@ -221,7 +221,7 @@ void PFXStoreApi::deleteOrder(const QString &order_id) { order_idPathParam.append("orderId").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -235,12 +235,14 @@ void PFXStoreApi::deleteOrder(const QString &order_id) { PFXHttpRequestInput input(fullPath, "DELETE"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::deleteOrderCallback); connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -249,15 +251,11 @@ void PFXStoreApi::deleteOrder(const QString &order_id) { } void PFXStoreApi::deleteOrderCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -273,7 +271,7 @@ void PFXStoreApi::deleteOrderCallback(PFXHttpRequestWorker *worker) { void PFXStoreApi::getInventory() { QString fullPath = QString(_serverConfigs["getInventory"][_serverIndices.value("getInventory")].URL()+"/store/inventory"); - if(_apiKeys.contains("api_key")){ + if (_apiKeys.contains("api_key")) { addHeaders("api_key",_apiKeys.find("api_key").value()); } @@ -283,12 +281,14 @@ void PFXStoreApi::getInventory() { PFXHttpRequestInput input(fullPath, "GET"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::getInventoryCallback); connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -297,15 +297,11 @@ void PFXStoreApi::getInventory() { } void PFXStoreApi::getInventoryCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } QMap output; QString json(worker->response); @@ -337,7 +333,7 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) { order_idPathParam.append("orderId").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -351,12 +347,14 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) { PFXHttpRequestInput input(fullPath, "GET"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::getOrderByIdCallback); connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -365,15 +363,11 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) { } void PFXStoreApi::getOrderByIdCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } PFXOrder output(QString(worker->response)); worker->deleteLater(); @@ -400,12 +394,14 @@ void PFXStoreApi::placeOrder(const PFXOrder &body) { QByteArray output = body.asJson().toUtf8(); input.request_body.append(output); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::placeOrderCallback); connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -414,15 +410,11 @@ void PFXStoreApi::placeOrder(const PFXOrder &body) { } void PFXStoreApi::placeOrderCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } PFXOrder output(QString(worker->response)); worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt/client/PFXStoreApi.h index 7f0fa92b27b..a31a6e3a74e 100644 --- a/samples/client/petstore/cpp-qt/client/PFXStoreApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXStoreApi.h @@ -52,9 +52,9 @@ public: void enableRequestCompression(); void enableResponseCompression(); void abortRequests(); - QString getParamStylePrefix(QString style); - QString getParamStyleSuffix(QString style); - QString getParamStyleDelimiter(QString style, QString name, bool isExplode); + QString getParamStylePrefix(const QString &style); + QString getParamStyleSuffix(const QString &style); + QString getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode); /** * @param[in] order_id QString [required] @@ -85,9 +85,9 @@ private: int _timeOut; QString _workingDirectory; QNetworkAccessManager* _manager; - QMap defaultHeaders; - bool isResponseCompressionEnabled; - bool isRequestCompressionEnabled; + QMap _defaultHeaders; + bool _isResponseCompressionEnabled; + bool _isRequestCompressionEnabled; void deleteOrderCallback(PFXHttpRequestWorker *worker); void getInventoryCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp index 1ea5c6e602d..dd42999d701 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp @@ -19,19 +19,18 @@ namespace test_namespace { PFXUserApi::PFXUserApi(const int timeOut) : _timeOut(timeOut), _manager(nullptr), - isResponseCompressionEnabled(false), - isRequestCompressionEnabled(false) { + _isResponseCompressionEnabled(false), + _isRequestCompressionEnabled(false) { initializeServerConfigs(); } PFXUserApi::~PFXUserApi() { } -void PFXUserApi::initializeServerConfigs(){ +void PFXUserApi::initializeServerConfigs() { //Default server QList defaultConf = QList(); //varying endpoint server - QList serverConf = QList(); defaultConf.append(PFXServerConfiguration( QUrl("http://petstore.swagger.io/v2"), "No description provided", @@ -58,23 +57,24 @@ void PFXUserApi::initializeServerConfigs(){ * returns 0 on success and -1, -2 or -3 on failure. * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found */ -int PFXUserApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value){ +int PFXUserApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); - if(it != _serverConfigs.end() && serverIndex < it.value().size() ){ + if (it != _serverConfigs.end() && serverIndex < it.value().size()) { return _serverConfigs[operation][serverIndex].setDefaultValue(variable,value); } return -3; } -void PFXUserApi::setServerIndex(const QString &operation, int serverIndex){ - if(_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size() ) +void PFXUserApi::setServerIndex(const QString &operation, int serverIndex) { + if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; + } } -void PFXUserApi::setApiKey(const QString &apiKeyName, const QString &apiKey){ +void PFXUserApi::setApiKey(const QString &apiKeyName, const QString &apiKey) { _apiKeys.insert(apiKeyName,apiKey); } -void PFXUserApi::setBearerToken(const QString &token){ +void PFXUserApi::setBearerToken(const QString &token) { _bearerToken = token; } @@ -107,14 +107,14 @@ void PFXUserApi::setNetworkAccessManager(QNetworkAccessManager* manager) { * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. * returns the index of the new server config on success and -1 if the operation is not found */ -int PFXUserApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables){ - if(_serverConfigs.contains(operation)){ +int PFXUserApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { + if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( url, description, variables)); return _serverConfigs[operation].size()-1; - }else{ + } else { return -1; } } @@ -125,9 +125,9 @@ int PFXUserApi::addServerConfiguration(const QString &operation, const QUrl &url * @param description A String that describes the server * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ -void PFXUserApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables){ - for(auto e : _serverIndices.keys()){ - setServerIndex(e, addServerConfiguration(e, url, description, variables)); +void PFXUserApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { + for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { + setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } } @@ -137,85 +137,85 @@ void PFXUserApi::setNewServerForAllOperations(const QUrl &url, const QString &de * @param description A String that describes the server * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ -void PFXUserApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables){ +void PFXUserApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } void PFXUserApi::addHeaders(const QString &key, const QString &value) { - defaultHeaders.insert(key, value); + _defaultHeaders.insert(key, value); } void PFXUserApi::enableRequestCompression() { - isRequestCompressionEnabled = true; + _isRequestCompressionEnabled = true; } void PFXUserApi::enableResponseCompression() { - isResponseCompressionEnabled = true; + _isResponseCompressionEnabled = true; } -void PFXUserApi::abortRequests(){ +void PFXUserApi::abortRequests() { emit abortRequestsSignal(); } -QString PFXUserApi::getParamStylePrefix(QString style){ - if(style == "matrix"){ +QString PFXUserApi::getParamStylePrefix(const QString &style) { + if (style == "matrix") { return ";"; - }else if(style == "label"){ + } else if (style == "label") { return "."; - }else if(style == "form"){ + } else if (style == "form") { return "&"; - }else if(style == "simple"){ + } else if (style == "simple") { return ""; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return "&"; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return "&"; - }else{ + } else { return "none"; } } -QString PFXUserApi::getParamStyleSuffix(QString style){ - if(style == "matrix"){ +QString PFXUserApi::getParamStyleSuffix(const QString &style) { + if (style == "matrix") { return "="; - }else if(style == "label"){ + } else if (style == "label") { return ""; - }else if(style == "form"){ + } else if (style == "form") { return "="; - }else if(style == "simple"){ + } else if (style == "simple") { return ""; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return "="; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return "="; - }else{ + } else { return "none"; } } -QString PFXUserApi::getParamStyleDelimiter(QString style, QString name, bool isExplode){ +QString PFXUserApi::getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode) { - if(style == "matrix"){ + if (style == "matrix") { return (isExplode) ? ";" + name + "=" : ","; - }else if(style == "label"){ + } else if (style == "label") { return (isExplode) ? "." : ","; - }else if(style == "form"){ + } else if (style == "form") { return (isExplode) ? "&" + name + "=" : ","; - }else if(style == "simple"){ + } else if (style == "simple") { return ","; - }else if(style == "spaceDelimited"){ + } else if (style == "spaceDelimited") { return (isExplode) ? "&" + name + "=" : " "; - }else if(style == "pipeDelimited"){ + } else if (style == "pipeDelimited") { return (isExplode) ? "&" + name + "=" : "|"; - }else if(style == "deepObject"){ + } else if (style == "deepObject") { return (isExplode) ? "&" : "none"; - }else { + } else { return "none"; } } @@ -233,12 +233,14 @@ void PFXUserApi::createUser(const PFXUser &body) { QByteArray output = body.asJson().toUtf8(); input.request_body.append(output); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -247,15 +249,11 @@ void PFXUserApi::createUser(const PFXUser &body) { } void PFXUserApi::createUserCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -281,12 +279,14 @@ void PFXUserApi::createUsersWithArrayInput(const QList &body) { QByteArray bytes = doc.toJson(); input.request_body.append(bytes); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithArrayInputCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -295,15 +295,11 @@ void PFXUserApi::createUsersWithArrayInput(const QList &body) { } void PFXUserApi::createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -329,12 +325,14 @@ void PFXUserApi::createUsersWithListInput(const QList &body) { QByteArray bytes = doc.toJson(); input.request_body.append(bytes); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithListInputCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -343,15 +341,11 @@ void PFXUserApi::createUsersWithListInput(const QList &body) { } void PFXUserApi::createUsersWithListInputCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -373,7 +367,7 @@ void PFXUserApi::deleteUser(const QString &username) { usernamePathParam.append("username").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -387,12 +381,14 @@ void PFXUserApi::deleteUser(const QString &username) { PFXHttpRequestInput input(fullPath, "DELETE"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::deleteUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -401,15 +397,11 @@ void PFXUserApi::deleteUser(const QString &username) { } void PFXUserApi::deleteUserCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -431,7 +423,7 @@ void PFXUserApi::getUserByName(const QString &username) { usernamePathParam.append("username").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -445,12 +437,14 @@ void PFXUserApi::getUserByName(const QString &username) { PFXHttpRequestInput input(fullPath, "GET"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::getUserByNameCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -459,15 +453,11 @@ void PFXUserApi::getUserByName(const QString &username) { } void PFXUserApi::getUserByNameCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } PFXUser output(QString(worker->response)); worker->deleteLater(); @@ -488,7 +478,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { { queryStyle = ""; - if(queryStyle == "") + if (queryStyle == "") queryStyle = "form"; queryPrefix = getParamStylePrefix(queryStyle); querySuffix = getParamStyleSuffix(queryStyle); @@ -503,7 +493,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { { queryStyle = ""; - if(queryStyle == "") + if (queryStyle == "") queryStyle = "form"; queryPrefix = getParamStylePrefix(queryStyle); querySuffix = getParamStyleSuffix(queryStyle); @@ -521,12 +511,14 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { PFXHttpRequestInput input(fullPath, "GET"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::loginUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -535,15 +527,11 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { } void PFXUserApi::loginUserCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } QString output; ::test_namespace::fromStringValue(QString(worker->response), output); @@ -567,12 +555,14 @@ void PFXUserApi::logoutUser() { PFXHttpRequestInput input(fullPath, "GET"); - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::logoutUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -581,15 +571,11 @@ void PFXUserApi::logoutUser() { } void PFXUserApi::logoutUserCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); @@ -611,7 +597,7 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &body) { usernamePathParam.append("username").append("}"); QString pathPrefix, pathSuffix, pathDelimiter; QString pathStyle = ""; - if(pathStyle == "") + if (pathStyle == "") pathStyle = "simple"; pathPrefix = getParamStylePrefix(pathStyle); pathSuffix = getParamStyleSuffix(pathStyle); @@ -629,12 +615,14 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &body) { QByteArray output = body.asJson().toUtf8(); input.request_body.append(output); } - foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } + for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { + input.headers.insert(keyValueIt->first, keyValueIt->second); + } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::updateUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); - connect(worker, &QObject::destroyed, [this](){ - if(findChildren().count() == 0){ + connect(worker, &QObject::destroyed, this, [this]() { + if (findChildren().count() == 0) { emit allPendingRequestsCompleted(); } }); @@ -643,15 +631,11 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &body) { } void PFXUserApi::updateUserCallback(PFXHttpRequestWorker *worker) { - QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } else { - msg = "Error: " + worker->error_str; - error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); + if (worker->error_type != QNetworkReply::NoError) { + error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response)); } worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt/client/PFXUserApi.h b/samples/client/petstore/cpp-qt/client/PFXUserApi.h index ab974de0622..b216ec3fff3 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUserApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXUserApi.h @@ -52,9 +52,9 @@ public: void enableRequestCompression(); void enableResponseCompression(); void abortRequests(); - QString getParamStylePrefix(QString style); - QString getParamStyleSuffix(QString style); - QString getParamStyleDelimiter(QString style, QString name, bool isExplode); + QString getParamStylePrefix(const QString &style); + QString getParamStyleSuffix(const QString &style); + QString getParamStyleDelimiter(const QString &style, const QString &name, bool isExplode); /** * @param[in] body PFXUser [required] @@ -107,9 +107,9 @@ private: int _timeOut; QString _workingDirectory; QNetworkAccessManager* _manager; - QMap defaultHeaders; - bool isResponseCompressionEnabled; - bool isRequestCompressionEnabled; + QMap _defaultHeaders; + bool _isResponseCompressionEnabled; + bool _isRequestCompressionEnabled; void createUserCallback(PFXHttpRequestWorker *worker); void createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker); From 02371d08d604a43f09b014f77ac325bdc6759b19 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 9 Sep 2021 11:05:06 +0800 Subject: [PATCH 23/75] comment out cpp qt test --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 41eef786716..07a261fb0d2 100644 --- a/pom.xml +++ b/pom.xml @@ -1214,7 +1214,9 @@ + samples/client/petstore/rust samples/client/petstore/rust/reqwest/petstore samples/client/petstore/rust/reqwest/petstore-async From 6629f8f9965734106d748b39655396f4da91c787 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 9 Sep 2021 11:22:14 +0800 Subject: [PATCH 24/75] Show an error instead of NPE when schema is not defined (#10348) * show warning instead of npe when schema is not defined * better error message --- .../org/openapitools/codegen/DefaultCodegen.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 53154f1af80..ae44011fb70 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -3030,13 +3030,16 @@ public class DefaultCodegen implements CodegenConfig { MappedModel mm = new MappedModel(modelName, toModelName(modelName)); descendentSchemas.add(mm); Schema cs = ModelUtils.getSchema(openAPI, modelName); - Map vendorExtensions = cs.getExtensions(); - if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { - String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); - mm = new MappedModel(xDiscriminatorValue, toModelName(modelName)); - descendentSchemas.add(mm); + if (cs == null) { // cannot lookup the model based on the name + LOGGER.error("Failed to lookup the schema '{}' when processing oneOf/anyOf. Please check to ensure it's defined properly.", modelName); + } else { + Map vendorExtensions = cs.getExtensions(); + if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { + String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); + mm = new MappedModel(xDiscriminatorValue, toModelName(modelName)); + descendentSchemas.add(mm); + } } - } } return descendentSchemas; From 0eba15f042e8b5fe187552b800e5032cce400e27 Mon Sep 17 00:00:00 2001 From: Kraust Date: Wed, 8 Sep 2021 23:24:13 -0400 Subject: [PATCH 25/75] Updated the HTML2 Doc Curl Examples to provide sample Request Body & Query Param examples. (#10323) * Updated the HTML2 Doc Curl Examples to provide sample Request Body & Query Param examples. * Updated the HTML2 Doc Curl Examples to provide sample Request Body & Query Param examples. Co-authored-by: Kraust --- .../src/main/resources/htmlDocs2/index.mustache | 6 +----- .../src/main/resources/htmlDocs2/sample_curl.mustache | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/htmlDocs2/sample_curl.mustache diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache index 10af1ef7d19..ff06be66f3e 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache @@ -248,11 +248,7 @@
    -
    curl -X {{vendorExtensions.x-codegen-http-method-upper-case}}{{#authMethods}}\
    -{{#isApiKey}}{{#isKeyInHeader}}-H "{{keyParamName}}: [[apiKey]]"{{/isKeyInHeader}}{{/isApiKey}}{{^isBasicBearer}}{{#isBasic}} -H "Authorization: Basic [[basicHash]]"{{/isBasic}}{{/isBasicBearer}}{{#isBasicBearer}} -H "Authorization: Bearer [[accessToken]]"{{/isBasicBearer}}{{/authMethods}}{{#hasProduces}}\
    - -H "Accept: {{#produces}}{{{mediaType}}}{{^-last}},{{/-last}}{{/produces}}"{{/hasProduces}}{{#hasConsumes}}\
    - -H "Content-Type: {{#consumes}}{{{mediaType}}}{{^-last}},{{/-last}}{{/consumes}}"{{/hasConsumes}}\
    - "{{basePath}}{{path}}{{#hasQueryParams}}?{{#queryParams}}{{^-first}}&{{/-first}}{{baseName}}={{vendorExtensions.x-eg}}{{/queryParams}}{{/hasQueryParams}}"
    +
    {{>sample_curl}}
    {{>sample_java}}
    diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/sample_curl.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/sample_curl.mustache new file mode 100644 index 00000000000..616db848841 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/sample_curl.mustache @@ -0,0 +1,6 @@ +curl -X {{vendorExtensions.x-codegen-http-method-upper-case}}{{#authMethods}} \ +{{#isApiKey}}{{#isKeyInHeader}}-H "{{keyParamName}}: [[apiKey]]"{{/isKeyInHeader}}{{/isApiKey}}{{^isBasicBearer}}{{#isBasic}} -H "Authorization: Basic [[basicHash]]"{{/isBasic}}{{/isBasicBearer}}{{#isBasicBearer}} -H "Authorization: Bearer [[accessToken]]"{{/isBasicBearer}}{{/authMethods}}{{#hasProduces}} \ + -H "Accept: {{#produces}}{{{mediaType}}}{{^-last}},{{/-last}}{{/produces}}"{{/hasProduces}}{{#hasConsumes}} \ + -H "Content-Type: {{#consumes}}{{{mediaType}}}{{^-last}},{{/-last}}{{/consumes}}"{{/hasConsumes}} \ + "{{basePath}}{{path}}{{#hasQueryParams}}?{{#queryParams}}{{^-first}}&{{/-first}}{{baseName}}={{{example}}}{{/queryParams}}{{/hasQueryParams}}"{{#requestBodyExamples}} \ + -d '{{example}}'{{/requestBodyExamples}} From 66f86d890d6036b7973f8c2fc2af68d25450cf33 Mon Sep 17 00:00:00 2001 From: klhmeyer Date: Thu, 9 Sep 2021 05:26:26 +0200 Subject: [PATCH 26/75] Update pojo.mustache (#10353) For setters the Jackson based property name conversion (e. g. from _-separated to CamelCase) is missing. So I propose this. --- .../src/main/resources/JavaJaxRS/spec/pojo.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache index 5e008a5de88..e9adb6f601a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -47,6 +47,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return {{name}}; } + @JsonProperty("{{baseName}}") public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } From 54e98c86bb650871daa4f6dd5f118ac537a8c3b6 Mon Sep 17 00:00:00 2001 From: Bas Huisman Date: Thu, 9 Sep 2021 05:27:52 +0200 Subject: [PATCH 27/75] make updateParamsForAuth protected for java webclient (#10351) Co-authored-by: Bas Huisman --- .../main/resources/Java/libraries/webclient/ApiClient.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index bf3eb952083..67d8e3a4fba 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -724,7 +724,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param headerParams The header parameters * @param cookieParams the cookie parameters */ - private void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { From 36ae0b9ffe8da0edb12af126895e8a7aef91c46a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Thu, 9 Sep 2021 05:53:23 +0200 Subject: [PATCH 28/75] Handle nullable items in Go arrays (#10268) If an item in a go array is nullable, we want to represent it as a pointer, otherwise it will be deserialized with a default value and it will be impossible to differentiate it from null. --- .../codegen/languages/AbstractGoCodegen.java | 3 +++ .../codegen/languages/GoClientCodegen.java | 4 ++++ .../go/go-petstore/docs/NullableClass.md | 12 +++++----- .../go/go-petstore/model_nullable_class.go | 24 +++++++++---------- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 5ef7f430c52..aa32091193e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -350,6 +350,9 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege } else { typDecl = "interface{}"; } + if (Boolean.TRUE.equals(inner.getNullable())) { + typDecl = "*" + typDecl; + } return "[]" + typDecl; } else if (ModelUtils.isMapSchema(p)) { Schema inner = getAdditionalProperties(p); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 60c0d9117db..5f556a45671 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -544,6 +544,10 @@ public class GoClientCodegen extends AbstractGoCodegen { if (modelMaps.containsKey(dataType)) { prefix = "[]" + goImportAlias + "." + dataType; } + if (codegenProperty.items.isNullable) { + // We can't easily generate a pointer inline, so just use nil in that case + return prefix + "{nil}"; + } return prefix + "{" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "}"; } else if (codegenProperty.isMap) { // map String prefix = codegenProperty.dataType; diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/NullableClass.md b/samples/openapi3/client/petstore/go/go-petstore/docs/NullableClass.md index 118278f7483..b248c6f5d9c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/NullableClass.md @@ -283,20 +283,20 @@ HasArrayNullableProp returns a boolean if a field has been set. UnsetArrayNullableProp ensures that no value is present for ArrayNullableProp, not even an explicit nil ### GetArrayAndItemsNullableProp -`func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{}` +`func (o *NullableClass) GetArrayAndItemsNullableProp() []*map[string]interface{}` GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field if non-nil, zero value otherwise. ### GetArrayAndItemsNullablePropOk -`func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]map[string]interface{}, bool)` +`func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]*map[string]interface{}, bool)` GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetArrayAndItemsNullableProp -`func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{})` +`func (o *NullableClass) SetArrayAndItemsNullableProp(v []*map[string]interface{})` SetArrayAndItemsNullableProp sets ArrayAndItemsNullableProp field to given value. @@ -318,20 +318,20 @@ HasArrayAndItemsNullableProp returns a boolean if a field has been set. UnsetArrayAndItemsNullableProp ensures that no value is present for ArrayAndItemsNullableProp, not even an explicit nil ### GetArrayItemsNullable -`func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{}` +`func (o *NullableClass) GetArrayItemsNullable() []*map[string]interface{}` GetArrayItemsNullable returns the ArrayItemsNullable field if non-nil, zero value otherwise. ### GetArrayItemsNullableOk -`func (o *NullableClass) GetArrayItemsNullableOk() (*[]map[string]interface{}, bool)` +`func (o *NullableClass) GetArrayItemsNullableOk() (*[]*map[string]interface{}, bool)` GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetArrayItemsNullable -`func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{})` +`func (o *NullableClass) SetArrayItemsNullable(v []*map[string]interface{})` SetArrayItemsNullable sets ArrayItemsNullable field to given value. diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go index acb1a75ed61..b46f891329e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go @@ -24,8 +24,8 @@ type NullableClass struct { DateProp NullableString `json:"date_prop,omitempty"` DatetimeProp NullableTime `json:"datetime_prop,omitempty"` ArrayNullableProp []map[string]interface{} `json:"array_nullable_prop,omitempty"` - ArrayAndItemsNullableProp []map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` - ArrayItemsNullable *[]map[string]interface{} `json:"array_items_nullable,omitempty"` + ArrayAndItemsNullableProp []*map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + ArrayItemsNullable *[]*map[string]interface{} `json:"array_items_nullable,omitempty"` ObjectNullableProp map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` ObjectAndItemsNullableProp map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` ObjectItemsNullable *map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` @@ -338,9 +338,9 @@ func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{}) { } // GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{} { +func (o *NullableClass) GetArrayAndItemsNullableProp() []*map[string]interface{} { if o == nil { - var ret []map[string]interface{} + var ret []*map[string]interface{} return ret } return o.ArrayAndItemsNullableProp @@ -349,7 +349,7 @@ func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{} // GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]map[string]interface{}, bool) { +func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]*map[string]interface{}, bool) { if o == nil || o.ArrayAndItemsNullableProp == nil { return nil, false } @@ -365,15 +365,15 @@ func (o *NullableClass) HasArrayAndItemsNullableProp() bool { return false } -// SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. -func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{}) { +// SetArrayAndItemsNullableProp gets a reference to the given []*map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. +func (o *NullableClass) SetArrayAndItemsNullableProp(v []*map[string]interface{}) { o.ArrayAndItemsNullableProp = v } // GetArrayItemsNullable returns the ArrayItemsNullable field value if set, zero value otherwise. -func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{} { +func (o *NullableClass) GetArrayItemsNullable() []*map[string]interface{} { if o == nil || o.ArrayItemsNullable == nil { - var ret []map[string]interface{} + var ret []*map[string]interface{} return ret } return *o.ArrayItemsNullable @@ -381,7 +381,7 @@ func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{} { // GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NullableClass) GetArrayItemsNullableOk() (*[]map[string]interface{}, bool) { +func (o *NullableClass) GetArrayItemsNullableOk() (*[]*map[string]interface{}, bool) { if o == nil || o.ArrayItemsNullable == nil { return nil, false } @@ -397,8 +397,8 @@ func (o *NullableClass) HasArrayItemsNullable() bool { return false } -// SetArrayItemsNullable gets a reference to the given []map[string]interface{} and assigns it to the ArrayItemsNullable field. -func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{}) { +// SetArrayItemsNullable gets a reference to the given []*map[string]interface{} and assigns it to the ArrayItemsNullable field. +func (o *NullableClass) SetArrayItemsNullable(v []*map[string]interface{}) { o.ArrayItemsNullable = &v } From d2d06f0503bb1e196e318a7dd3581b984e945e49 Mon Sep 17 00:00:00 2001 From: agilob Date: Thu, 9 Sep 2021 04:54:51 +0100 Subject: [PATCH 29/75] Add ArchUnit to test format of loggers and Abstract classes (#10335) * Add archunit to programatically test format and scope of loggers * Fix use of loggers * Update error message * Add check for abstract class * Test if classes with abstract in name are abstract * Make abstract class abstract * Rename test class * Make logger private final * Make logger private --- modules/openapi-generator/pom.xml | 13 +++++ .../languages/AbstractDartCodegen.java | 2 +- .../languages/AspNetCoreServerCodegen.java | 2 +- .../languages/CSharpNetCoreClientCodegen.java | 5 +- .../languages/CppQtAbstractCodegen.java | 3 +- .../languages/CppRestbedServerCodegen.java | 3 -- .../languages/CppTinyClientCodegen.java | 2 +- .../languages/DartDioNextClientCodegen.java | 2 +- .../languages/FsharpGiraffeServerCodegen.java | 2 +- .../languages/GoEchoServerCodegen.java | 16 +++--- .../languages/HaskellYesodServerCodegen.java | 2 +- .../languages/KotlinSpringServerCodegen.java | 2 +- .../codegen/languages/KtormSchemaCodegen.java | 2 +- .../languages/ScalaAkkaClientCodegen.java | 2 +- .../languages/ScalaAkkaHttpServerCodegen.java | 4 +- .../codegen/languages/WsdlSchemaCodegen.java | 23 ++------ .../codegen/ArchUnitRulesTest.java | 52 +++++++++++++++++++ 17 files changed, 93 insertions(+), 44 deletions(-) create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 7dfb3b8712a..0b487252a6c 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -334,6 +334,18 @@ jackson-core ${jackson-version} + + com.tngtech.archunit + archunit + 0.20.1 + test + + + com.tngtech.archunit + archunit-junit4 + 0.20.1 + test + org.testng testng @@ -433,6 +445,7 @@ caffeine 2.8.1 + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index c5d8f65516d..c456b0438e3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -26,7 +26,7 @@ import static org.openapitools.codegen.utils.StringUtils.*; public abstract class AbstractDartCodegen extends DefaultCodegen { - private static final Logger LOGGER = LoggerFactory.getLogger(AbstractDartCodegen.class); + private final Logger LOGGER = LoggerFactory.getLogger(AbstractDartCodegen.class); protected static final List DEFAULT_SUPPORTED_CONTENT_TYPES = Arrays.asList( "application/json", "application/x-www-form-urlencoded", "multipart/form-data"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index 0ce832feb3b..f27d9c452a7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -64,7 +64,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; private String userSecretsGuid = randomUUID().toString(); - protected Logger LOGGER = LoggerFactory.getLogger(AspNetCoreServerCodegen.class); + protected final Logger LOGGER = LoggerFactory.getLogger(AspNetCoreServerCodegen.class); private boolean useSwashbuckle = true; protected int serverPort = 8080; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index bedc111b3ea..9a86368bb39 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -56,7 +56,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { protected static final String TARGET_FRAMEWORK_VERSION = "targetFrameworkVersion"; @SuppressWarnings({"hiding"}) - private static final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); + private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); private static final List frameworkStrategies = Arrays.asList( FrameworkStrategy.NETSTANDARD_1_3, FrameworkStrategy.NETSTANDARD_1_4, @@ -973,6 +973,9 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { // https://docs.microsoft.com/en-us/dotnet/standard/net-standard @SuppressWarnings("Duplicates") private static abstract class FrameworkStrategy { + + private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); + static FrameworkStrategy NETSTANDARD_1_3 = new FrameworkStrategy("netstandard1.3", ".NET Standard 1.3 compatible", "netcoreapp2.0") { }; static FrameworkStrategy NETSTANDARD_1_4 = new FrameworkStrategy("netstandard1.4", ".NET Standard 1.4 compatible", "netcoreapp2.0") { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java index 0ddf552ad9a..859ab9d69cd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java @@ -13,7 +13,8 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; -public class CppQtAbstractCodegen extends AbstractCppCodegen implements CodegenConfig { +public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements CodegenConfig { + private final Logger LOGGER = LoggerFactory.getLogger(CppQtAbstractCodegen.class); protected final String PREFIX = "OAI"; protected String apiVersion = "1.0.0"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java index 9d9bc5932c9..a6d17cbfbff 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java @@ -23,7 +23,6 @@ import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; -import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; @@ -33,8 +32,6 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; public class CppRestbedServerCodegen extends AbstractCppCodegen { - private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(CppRestbedServerCodegen.class); - public static final String DECLSPEC = "declspec"; public static final String DEFAULT_INCLUDE = "defaultInclude"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTinyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTinyClientCodegen.java index 3229730bfa6..5f5b7ca5b94 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTinyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTinyClientCodegen.java @@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory; public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenConfig { public static final String PROJECT_NAME = "TinyClient"; - static final Logger LOGGER = LoggerFactory.getLogger(CppTinyClientCodegen.class); + final Logger LOGGER = LoggerFactory.getLogger(CppTinyClientCodegen.class); public static final String MICROCONTROLLER = "controller"; public static final String rootFolder = ""; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index d4375982bcd..07d11e4e721 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -37,7 +37,7 @@ import static org.openapitools.codegen.utils.StringUtils.underscore; public class DartDioNextClientCodegen extends AbstractDartCodegen { - private static final Logger LOGGER = LoggerFactory.getLogger(DartDioNextClientCodegen.class); + private final Logger LOGGER = LoggerFactory.getLogger(DartDioNextClientCodegen.class); public static final String DATE_LIBRARY = "dateLibrary"; public static final String DATE_LIBRARY_CORE = "core"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java index 3764f2c4b72..bf670711c32 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java @@ -50,7 +50,7 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen { private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; @SuppressWarnings("hiding") - protected Logger LOGGER = LoggerFactory.getLogger(FsharpGiraffeServerCodegen.class); + protected final Logger LOGGER = LoggerFactory.getLogger(FsharpGiraffeServerCodegen.class); private boolean useSwashbuckle = false; protected int serverPort = 8080; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java index 3bd2a37a5e5..2089bd15bf3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java @@ -17,19 +17,17 @@ package org.openapitools.codegen.languages; import org.openapitools.codegen.*; - -import java.io.File; -import java.util.*; - -import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.openapitools.codegen.meta.features.*; + +import java.io.File; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; public class GoEchoServerCodegen extends AbstractGoCodegen { - static final Logger LOGGER = LoggerFactory.getLogger(GoEchoServerCodegen.class); - protected String apiVersion = "1.0.0"; protected int serverPort = 8080; protected String projectName = "openapi-go-echo-server"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java index 3c67e423044..dea598e0499 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java @@ -46,7 +46,7 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen private static final Pattern LEADING_UNDERSCORE = Pattern.compile("^_+"); - static final Logger LOGGER = LoggerFactory.getLogger(HaskellYesodServerCodegen.class); + private final Logger LOGGER = LoggerFactory.getLogger(HaskellYesodServerCodegen.class); protected String projectName; protected String apiModuleName; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 4af648fbac4..b4c47af501c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -43,7 +43,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; public class KotlinSpringServerCodegen extends AbstractKotlinCodegen implements BeanValidationFeatures { - private static Logger LOGGER = + private final Logger LOGGER = LoggerFactory.getLogger(KotlinSpringServerCodegen.class); private static final HashSet VARIABLE_RESERVED_WORDS = diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java index b3036c93ff0..2db0bd7af88 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java @@ -39,7 +39,7 @@ import static org.openapitools.codegen.utils.StringUtils.*; @SuppressWarnings("unchecked") public class KtormSchemaCodegen extends AbstractKotlinCodegen { - static Logger LOGGER = LoggerFactory.getLogger(KtormSchemaCodegen.class); + private final Logger LOGGER = LoggerFactory.getLogger(KtormSchemaCodegen.class); public static final String VENDOR_EXTENSION_SCHEMA = "x-ktorm-schema"; public static final String DEFAULT_DATABASE_NAME = "defaultDatabaseName"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java index a5e293c9879..e646f0127bb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java @@ -51,7 +51,7 @@ public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements Code protected boolean removeOAuthSecurities = true; @SuppressWarnings("hiding") - protected Logger LOGGER = LoggerFactory.getLogger(ScalaAkkaClientCodegen.class); + protected final Logger LOGGER = LoggerFactory.getLogger(ScalaAkkaClientCodegen.class); public ScalaAkkaClientCodegen() { super(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java index 35a308f639a..e669b229788 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java @@ -50,7 +50,7 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements public static final String GENERATE_AS_MANAGED_SOURCES_DESC = "Resulting files cab be used as managed resources. No build files or default controllers will be generated"; public static final boolean DEFAULT_GENERATE_AS_MANAGED_SOURCES = false; - static final Logger LOGGER = LoggerFactory.getLogger(ScalaAkkaHttpServerCodegen.class); + final Logger LOGGER = LoggerFactory.getLogger(ScalaAkkaHttpServerCodegen.class); public CodegenType getTag() { return CodegenType.SERVER; @@ -305,7 +305,7 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements .put("String", "Segment") .build(); - protected static void addPathMatcher(CodegenOperation codegenOperation) { + protected void addPathMatcher(CodegenOperation codegenOperation) { LinkedList allPaths = new LinkedList<>(Arrays.asList(codegenOperation.path.split("/"))); allPaths.removeIf(""::equals); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java index 49868be9971..435494d8f3a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java @@ -18,35 +18,20 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import java.io.File; import java.text.Normalizer; -import java.util.List; import java.util.ArrayList; +import java.util.List; import java.util.Locale; import java.util.Map; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.SupportingFile; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig { public static final String PROJECT_NAME = "projectName"; - static final Logger LOGGER = LoggerFactory.getLogger(WsdlSchemaCodegen.class); - public CodegenType getTag() { return CodegenType.SCHEMA; } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java new file mode 100644 index 00000000000..0a9d7a95abf --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java @@ -0,0 +1,52 @@ +package org.openapitools.codegen; + +import com.tngtech.archunit.core.domain.JavaClasses; +import com.tngtech.archunit.core.domain.JavaModifier; +import com.tngtech.archunit.core.importer.ClassFileImporter; +import com.tngtech.archunit.lang.ArchRule; +import org.junit.Test; +import org.slf4j.Logger; + +import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.*; + +public class ArchUnitRulesTest { + + @Test + public void testLoggersAreNotPublicFinalAndNotStatic() { + final JavaClasses importedClasses = new ClassFileImporter() + .importPackages("org.openapitools.codegen.languages"); + + ArchUnitRulesTest.LOGGERS_SHOULD_BE_NOT_PUBLIC_NOT_STATIC_AND_FINAL.check(importedClasses); + } + + @Test + public void abstractClassesAreAbstract() { + final JavaClasses importedClasses = new ClassFileImporter() + .importPackages("org.openapitools.codegen.languages"); + + ArchUnitRulesTest.ABSTRACT_CLASS_MUST_BE_ABSTRACT.check(importedClasses); + } + + /** + * Making loggers not static decreases memory consumption when running generator: + * https://github.com/OpenAPITools/openapi-generator/pull/8799 + */ + public static final ArchRule LOGGERS_SHOULD_BE_NOT_PUBLIC_NOT_STATIC_AND_FINAL = + fields() + .that() + .haveRawType(Logger.class) + .should().notBePublic() + .andShould().notBeStatic() + .andShould().beFinal() + .because("Code generators are most often used once per program lifetime, " + + "so making them all static will cause higher memory consumption. " + + "See PR #8799"); + + + public static final ArchRule ABSTRACT_CLASS_MUST_BE_ABSTRACT = + classes() + .that() + .haveSimpleNameContaining("Abstract").or().haveSimpleNameContaining("abstract") + .should() + .haveModifier(JavaModifier.ABSTRACT); +} From 4626b185fe0aacd3a5cac3a83135484073bf6e7b Mon Sep 17 00:00:00 2001 From: shayan-eftekhari <86353115+shayan-eftekhari@users.noreply.github.com> Date: Thu, 9 Sep 2021 05:57:45 +0200 Subject: [PATCH 30/75] [cpp-restsdk] Fix ModelBase::fromJson(const web::json::value&, int64_t&) bug which incorrectly returns zero (#10300) * BUG FIX: A missing semicolon in cpp-pistache-server generated code. * BUG FIX: Provide default values of schema in cpp-pistache-server generated code. * BUG FIX: Provide default values of schema in cpp-pistache-server generated code. * Fix a bug in cpprest-sdk generator (Issue #8450) * Fix a bug in cpprest-sdk generator (Issue #8450) * Fix a bug in cpprest-sdk generator (Issue #8450) * Revert "Fix a bug in cpprest-sdk generator (Issue #8450)" This reverts commit 7d8f842860f94deb78fb519716f9984e1efad878. * Fix a bug in cpprest-sdk generator (Issue #8450) --- .../resources/cpp-rest-sdk-client/modelbase-source.mustache | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache index faa2333603a..160f6ce89de 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache @@ -264,7 +264,7 @@ bool ModelBase::fromJson( const web::json::value& val, int32_t & outVal ) } bool ModelBase::fromJson( const web::json::value& val, int64_t & outVal ) { - outVal = !val.is_null() ? std::numeric_limits::quiet_NaN() : val.as_number().to_int64(); + outVal = !val.is_number() ? std::numeric_limits::quiet_NaN() : val.as_number().to_int64(); return val.is_number(); } bool ModelBase::fromJson( const web::json::value& val, utility::string_t & outVal ) diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp index 7807662a936..97f2120f35d 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp @@ -275,7 +275,7 @@ bool ModelBase::fromJson( const web::json::value& val, int32_t & outVal ) } bool ModelBase::fromJson( const web::json::value& val, int64_t & outVal ) { - outVal = !val.is_null() ? std::numeric_limits::quiet_NaN() : val.as_number().to_int64(); + outVal = !val.is_number() ? std::numeric_limits::quiet_NaN() : val.as_number().to_int64(); return val.is_number(); } bool ModelBase::fromJson( const web::json::value& val, utility::string_t & outVal ) From 1231b1ab0420a37b47a9c95e76c6ab617f4eba97 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 9 Sep 2021 12:09:38 +0800 Subject: [PATCH 31/75] update samples, update html doc --- .../org/openapitools/client/ApiClient.java | 2 +- .../org/openapitools/client/ApiClient.java | 2 +- .../html.md/.openapi-generator/VERSION | 2 +- samples/documentation/html.md/index.html | 2 +- .../html/.openapi-generator/VERSION | 2 +- samples/documentation/html/index.html | 18 - .../html2/.openapi-generator/VERSION | 2 +- samples/documentation/html2/index.html | 620 ++++++++++-------- .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 11 + .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../java/org/openapitools/model/Animal.java | 2 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../openapitools/model/ArrayOfNumberOnly.java | 1 + .../org/openapitools/model/ArrayTest.java | 3 + .../java/org/openapitools/model/BigCat.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../openapitools/model/Capitalization.java | 6 + .../gen/java/org/openapitools/model/Cat.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/Category.java | 2 + .../org/openapitools/model/ClassModel.java | 1 + .../java/org/openapitools/model/Client.java | 1 + .../gen/java/org/openapitools/model/Dog.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../org/openapitools/model/EnumArrays.java | 2 + .../java/org/openapitools/model/EnumTest.java | 5 + .../model/FileSchemaTestClass.java | 2 + .../org/openapitools/model/FormatTest.java | 14 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../java/org/openapitools/model/MapTest.java | 4 + ...ropertiesAndAdditionalPropertiesClass.java | 3 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 3 + .../org/openapitools/model/ModelReturn.java | 1 + .../gen/java/org/openapitools/model/Name.java | 4 + .../org/openapitools/model/NumberOnly.java | 1 + .../java/org/openapitools/model/Order.java | 6 + .../openapitools/model/OuterComposite.java | 3 + .../gen/java/org/openapitools/model/Pet.java | 6 + .../org/openapitools/model/ReadOnlyFirst.java | 2 + .../openapitools/model/SpecialModelName.java | 1 + .../gen/java/org/openapitools/model/Tag.java | 2 + .../openapitools/model/TypeHolderDefault.java | 5 + .../openapitools/model/TypeHolderExample.java | 6 + .../gen/java/org/openapitools/model/User.java | 8 + .../java/org/openapitools/model/XmlItem.java | 29 + .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 11 + .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../java/org/openapitools/model/Animal.java | 2 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../openapitools/model/ArrayOfNumberOnly.java | 1 + .../org/openapitools/model/ArrayTest.java | 3 + .../java/org/openapitools/model/BigCat.java | 1 + .../org/openapitools/model/BigCatAllOf.java | 1 + .../openapitools/model/Capitalization.java | 6 + .../gen/java/org/openapitools/model/Cat.java | 1 + .../java/org/openapitools/model/CatAllOf.java | 1 + .../java/org/openapitools/model/Category.java | 2 + .../org/openapitools/model/ClassModel.java | 1 + .../java/org/openapitools/model/Client.java | 1 + .../gen/java/org/openapitools/model/Dog.java | 1 + .../java/org/openapitools/model/DogAllOf.java | 1 + .../org/openapitools/model/EnumArrays.java | 2 + .../java/org/openapitools/model/EnumTest.java | 5 + .../model/FileSchemaTestClass.java | 2 + .../org/openapitools/model/FormatTest.java | 14 + .../openapitools/model/HasOnlyReadOnly.java | 2 + .../java/org/openapitools/model/MapTest.java | 4 + ...ropertiesAndAdditionalPropertiesClass.java | 3 + .../openapitools/model/Model200Response.java | 2 + .../openapitools/model/ModelApiResponse.java | 3 + .../org/openapitools/model/ModelReturn.java | 1 + .../gen/java/org/openapitools/model/Name.java | 4 + .../org/openapitools/model/NumberOnly.java | 1 + .../java/org/openapitools/model/Order.java | 6 + .../openapitools/model/OuterComposite.java | 3 + .../gen/java/org/openapitools/model/Pet.java | 6 + .../org/openapitools/model/ReadOnlyFirst.java | 2 + .../openapitools/model/SpecialModelName.java | 1 + .../gen/java/org/openapitools/model/Tag.java | 2 + .../openapitools/model/TypeHolderDefault.java | 5 + .../openapitools/model/TypeHolderExample.java | 6 + .../gen/java/org/openapitools/model/User.java | 8 + .../java/org/openapitools/model/XmlItem.java | 29 + 96 files changed, 668 insertions(+), 286 deletions(-) diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java index 711e3ce865b..087da74084b 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java @@ -690,7 +690,7 @@ public class ApiClient extends JavaTimeFormatter { * @param headerParams The header parameters * @param cookieParams the cookie parameters */ - private void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java index ba5abc0153a..2320997a57c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java @@ -711,7 +711,7 @@ public class ApiClient extends JavaTimeFormatter { * @param headerParams The header parameters * @param cookieParams the cookie parameters */ - private void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { diff --git a/samples/documentation/html.md/.openapi-generator/VERSION b/samples/documentation/html.md/.openapi-generator/VERSION index d99e7162d01..4b448de535c 100644 --- a/samples/documentation/html.md/.openapi-generator/VERSION +++ b/samples/documentation/html.md/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html.md/index.html b/samples/documentation/html.md/index.html index 63ef7f704b0..0c79800a1e0 100644 --- a/samples/documentation/html.md/index.html +++ b/samples/documentation/html.md/index.html @@ -180,7 +180,7 @@ font-style: italic;

    An API with more Markdown in summary, description, and other text

    -

    Not really a pseudo-randum number generator API. This API uses Markdown in text:

    +

    Not really a pseudo-random number generator API. This API uses Markdown in text:

    1. in this API description
    2. in operation summaries
    3. diff --git a/samples/documentation/html/.openapi-generator/VERSION b/samples/documentation/html/.openapi-generator/VERSION index d99e7162d01..4b448de535c 100644 --- a/samples/documentation/html/.openapi-generator/VERSION +++ b/samples/documentation/html/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html/index.html b/samples/documentation/html/index.html index 3d50eb596c6..2d744efa666 100644 --- a/samples/documentation/html/index.html +++ b/samples/documentation/html/index.html @@ -1323,8 +1323,6 @@ font-style: italic;
    4. Pet - a Pet
    5. Tag - Pet Tag
    6. User - a User
    7. -
    8. inline_object -
    9. -
    10. inline_object_1 -
    @@ -1394,21 +1392,5 @@ font-style: italic;
    userStatus (optional)
    Integer User Status format: int32
    -
    -

    inline_object - Up

    -
    -
    -
    name (optional)
    String Updated name of the pet
    -
    status (optional)
    String Updated status of the pet
    -
    -
    -
    -

    inline_object_1 - Up

    -
    -
    -
    additionalMetadata (optional)
    String Additional data to pass to server
    -
    file (optional)
    File file to upload format: binary
    -
    -
    diff --git a/samples/documentation/html2/.openapi-generator/VERSION b/samples/documentation/html2/.openapi-generator/VERSION index d99e7162d01..4b448de535c 100644 --- a/samples/documentation/html2/.openapi-generator/VERSION +++ b/samples/documentation/html2/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index 8b2d69320c3..cce1eb7dd34 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -766,7 +766,7 @@ ul.nav-tabs { .json-schema-view.collapsed .description, .json-schema-view.collapsed .property, json-schema-view.collapsed .description, json-schema-view.collapsed .property { display: none } -.json-schema-view.collapsed .closeing.brace, json-schema-view.collapsed .closeing.brace { +.json-schema-view.collapsed .closing.brace, json-schema-view.collapsed .closing.brace { display: inline-block } .json-schema-view.collapsed .toggle-handle, json-schema-view.collapsed .toggle-handle { @@ -831,7 +831,7 @@ ul.nav-tabs { .json-schema-view.json-schema-view-dark.collapsed .description, .json-schema-view.json-schema-view-dark.collapsed .property, json-schema-view[json-schema-view-dark].collapsed .description, json-schema-view[json-schema-view-dark].collapsed .property { display: none } -.json-schema-view.json-schema-view-dark.collapsed .closeing.brace, json-schema-view[json-schema-view-dark].collapsed .closeing.brace { +.json-schema-view.json-schema-view-dark.collapsed .closing.brace, json-schema-view[json-schema-view-dark].collapsed .closing.brace { display: inline-block } .json-schema-view.json-schema-view-dark.collapsed .toggle-handle, json-schema-view[json-schema-view-dark].collapsed .toggle-handle { @@ -880,33 +880,6 @@ ul.nav-tabs { "xml" : { "name" : "Category" } -}; - defs["inline_object"] = { - "type" : "object", - "properties" : { - "name" : { - "type" : "string", - "description" : "Updated name of the pet" - }, - "status" : { - "type" : "string", - "description" : "Updated status of the pet" - } - } -}; - defs["inline_object_1"] = { - "type" : "object", - "properties" : { - "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" - }, - "file" : { - "type" : "string", - "description" : "file to upload", - "format" : "binary" - } - } }; defs["Order"] = { "title" : "Pet Order", @@ -982,6 +955,7 @@ ul.nav-tabs { "status" : { "type" : "string", "description" : "pet status in the store", + "deprecated" : true, "enum" : [ "available", "pending", "sold" ] } }, @@ -1181,11 +1155,39 @@ ul.nav-tabs {
    -
    curl -X POST\
    -\
    - -H "Accept: application/xml,application/json"\
    - -H "Content-Type: application/json,application/xml"\
    - "http://petstore.swagger.io/v2/pet"
    +
    curl -X POST \
    + \
    + -H "Accept: application/xml,application/json" \
    + -H "Content-Type: application/json,application/xml" \
    + "http://petstore.swagger.io/v2/pet" \
    + -d '{
    +  "photoUrls" : [ "photoUrls", "photoUrls" ],
    +  "name" : "doggie",
    +  "id" : 0,
    +  "category" : {
    +    "name" : "name",
    +    "id" : 6
    +  },
    +  "tags" : [ {
    +    "name" : "name",
    +    "id" : 1
    +  }, {
    +    "name" : "name",
    +    "id" : 1
    +  } ],
    +  "status" : "available"
    +}' \
    + -d '<Pet>
    +  <id>123456789</id>
    +  <name>doggie</name>
    +  <photoUrls>
    +    <photoUrls>aeiou</photoUrls>
    +  </photoUrls>
    +  <tags>
    +  </tags>
    +  <status>aeiou</status>
    +</Pet>'
    +
    import org.openapitools.client.*;
    @@ -1203,11 +1205,11 @@ public class PetApiExample {
             // Configure OAuth2 access token for authorization: petstore_auth
             OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
             petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    -        
    +
             // Create an instance of the API class
             PetApi apiInstance = new PetApi();
             Pet pet = ; // Pet | 
    -        
    +
             try {
                 Pet result = apiInstance.addPet(pet);
                 System.out.println(result);
    @@ -1227,7 +1229,7 @@ public class PetApiExample {
         public static void main(String[] args) {
             PetApi apiInstance = new PetApi();
             Pet pet = ; // Pet | 
    -        
    +
             try {
                 Pet result = apiInstance.addPet(pet);
                 System.out.println(result);
    @@ -1307,7 +1309,7 @@ namespace Example
             {
                 // Configure OAuth2 access token for authorization: petstore_auth
                 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new PetApi();
                 var pet = new Pet(); // Pet | 
    @@ -1357,7 +1359,7 @@ $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
     my $api_instance = WWW::OPenAPIClient::PetApi->new();
     my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | 
     
    -eval { 
    +eval {
         my $result = $api_instance->addPet(pet => $pet);
         print Dumper($result);
     };
    @@ -1380,7 +1382,7 @@ openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
     api_instance = openapi_client.PetApi()
     pet =  # Pet | 
     
    -try: 
    +try:
         # Add a new pet to the store
         api_response = api_instance.add_pet(pet)
         pprint(api_response)
    @@ -1607,9 +1609,10 @@ $(document).ready(function() {
     
                             
    -
    curl -X DELETE\
    -\
    - "http://petstore.swagger.io/v2/pet/{petId}"
    +
    curl -X DELETE \
    + \
    + "http://petstore.swagger.io/v2/pet/{petId}"
    +
    import org.openapitools.client.*;
    @@ -1627,12 +1630,12 @@ public class PetApiExample {
             // Configure OAuth2 access token for authorization: petstore_auth
             OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
             petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    -        
    +
             // Create an instance of the API class
             PetApi apiInstance = new PetApi();
             Long petId = 789; // Long | Pet id to delete
             String apiKey = apiKey_example; // String | 
    -        
    +
             try {
                 apiInstance.deletePet(petId, apiKey);
             } catch (ApiException e) {
    @@ -1652,7 +1655,7 @@ public class PetApiExample {
             PetApi apiInstance = new PetApi();
             Long petId = 789; // Long | Pet id to delete
             String apiKey = apiKey_example; // String | 
    -        
    +
             try {
                 apiInstance.deletePet(petId, apiKey);
             } catch (ApiException e) {
    @@ -1733,7 +1736,7 @@ namespace Example
             {
                 // Configure OAuth2 access token for authorization: petstore_auth
                 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new PetApi();
                 var petId = 789;  // Long | Pet id to delete (default to null)
    @@ -1784,7 +1787,7 @@ my $api_instance = WWW::OPenAPIClient::PetApi->new();
     my $petId = 789; # Long | Pet id to delete
     my $apiKey = apiKey_example; # String | 
     
    -eval { 
    +eval {
         $api_instance->deletePet(petId => $petId, apiKey => $apiKey);
     };
     if ($@) {
    @@ -1807,7 +1810,7 @@ api_instance = openapi_client.PetApi()
     petId = 789 # Long | Pet id to delete (default to null)
     apiKey = apiKey_example # String |  (optional) (default to null)
     
    -try: 
    +try:
         # Deletes a pet
         api_instance.delete_pet(petId, apiKey=apiKey)
     except ApiException as e:
    @@ -1968,10 +1971,11 @@ Pet id to delete
     
                             
    -
    curl -X GET\
    -\
    - -H "Accept: application/xml,application/json"\
    - "http://petstore.swagger.io/v2/pet/findByStatus?status="
    +
    curl -X GET \
    + \
    + -H "Accept: application/xml,application/json" \
    + "http://petstore.swagger.io/v2/pet/findByStatus?status="
    +
    import org.openapitools.client.*;
    @@ -1989,11 +1993,11 @@ public class PetApiExample {
             // Configure OAuth2 access token for authorization: petstore_auth
             OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
             petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    -        
    +
             // Create an instance of the API class
             PetApi apiInstance = new PetApi();
             array[String] status = ; // array[String] | Status values that need to be considered for filter
    -        
    +
             try {
                 array[Pet] result = apiInstance.findPetsByStatus(status);
                 System.out.println(result);
    @@ -2013,7 +2017,7 @@ public class PetApiExample {
         public static void main(String[] args) {
             PetApi apiInstance = new PetApi();
             array[String] status = ; // array[String] | Status values that need to be considered for filter
    -        
    +
             try {
                 array[Pet] result = apiInstance.findPetsByStatus(status);
                 System.out.println(result);
    @@ -2093,7 +2097,7 @@ namespace Example
             {
                 // Configure OAuth2 access token for authorization: petstore_auth
                 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new PetApi();
                 var status = new array[String](); // array[String] | Status values that need to be considered for filter (default to null)
    @@ -2143,7 +2147,7 @@ $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
     my $api_instance = WWW::OPenAPIClient::PetApi->new();
     my $status = []; # array[String] | Status values that need to be considered for filter
     
    -eval { 
    +eval {
         my $result = $api_instance->findPetsByStatus(status => $status);
         print Dumper($result);
     };
    @@ -2166,7 +2170,7 @@ openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
     api_instance = openapi_client.PetApi()
     status =  # array[String] | Status values that need to be considered for filter (default to null)
     
    -try: 
    +try:
         # Finds Pets by status
         api_response = api_instance.find_pets_by_status(status)
         pprint(api_response)
    @@ -2372,10 +2376,11 @@ Status values that need to be considered for filter
     
                             
    -
    curl -X GET\
    -\
    - -H "Accept: application/xml,application/json"\
    - "http://petstore.swagger.io/v2/pet/findByTags?tags="
    +
    curl -X GET \
    + \
    + -H "Accept: application/xml,application/json" \
    + "http://petstore.swagger.io/v2/pet/findByTags?tags="
    +
    import org.openapitools.client.*;
    @@ -2393,11 +2398,11 @@ public class PetApiExample {
             // Configure OAuth2 access token for authorization: petstore_auth
             OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
             petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    -        
    +
             // Create an instance of the API class
             PetApi apiInstance = new PetApi();
             array[String] tags = ; // array[String] | Tags to filter by
    -        
    +
             try {
                 array[Pet] result = apiInstance.findPetsByTags(tags);
                 System.out.println(result);
    @@ -2417,7 +2422,7 @@ public class PetApiExample {
         public static void main(String[] args) {
             PetApi apiInstance = new PetApi();
             array[String] tags = ; // array[String] | Tags to filter by
    -        
    +
             try {
                 array[Pet] result = apiInstance.findPetsByTags(tags);
                 System.out.println(result);
    @@ -2497,7 +2502,7 @@ namespace Example
             {
                 // Configure OAuth2 access token for authorization: petstore_auth
                 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new PetApi();
                 var tags = new array[String](); // array[String] | Tags to filter by (default to null)
    @@ -2547,7 +2552,7 @@ $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
     my $api_instance = WWW::OPenAPIClient::PetApi->new();
     my $tags = []; # array[String] | Tags to filter by
     
    -eval { 
    +eval {
         my $result = $api_instance->findPetsByTags(tags => $tags);
         print Dumper($result);
     };
    @@ -2570,7 +2575,7 @@ openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
     api_instance = openapi_client.PetApi()
     tags =  # array[String] | Tags to filter by (default to null)
     
    -try: 
    +try:
         # Finds Pets by tags
         api_response = api_instance.find_pets_by_tags(tags)
         pprint(api_response)
    @@ -2776,10 +2781,11 @@ Tags to filter by
     
                             
    -
    curl -X GET\
    --H "api_key: [[apiKey]]"\
    - -H "Accept: application/xml,application/json"\
    - "http://petstore.swagger.io/v2/pet/{petId}"
    +
    curl -X GET \
    +-H "api_key: [[apiKey]]" \
    + -H "Accept: application/xml,application/json" \
    + "http://petstore.swagger.io/v2/pet/{petId}"
    +
    import org.openapitools.client.*;
    @@ -2799,11 +2805,11 @@ public class PetApiExample {
             api_key.setApiKey("YOUR API KEY");
             // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
             //api_key.setApiKeyPrefix("Token");
    -        
    +
             // Create an instance of the API class
             PetApi apiInstance = new PetApi();
             Long petId = 789; // Long | ID of pet to return
    -        
    +
             try {
                 Pet result = apiInstance.getPetById(petId);
                 System.out.println(result);
    @@ -2823,7 +2829,7 @@ public class PetApiExample {
         public static void main(String[] args) {
             PetApi apiInstance = new PetApi();
             Long petId = 789; // Long | ID of pet to return
    -        
    +
             try {
                 Pet result = apiInstance.getPetById(petId);
                 System.out.println(result);
    @@ -2909,7 +2915,7 @@ namespace Example
                 Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
                 // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                 // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new PetApi();
                 var petId = 789;  // Long | ID of pet to return (default to null)
    @@ -2963,7 +2969,7 @@ $WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
     my $api_instance = WWW::OPenAPIClient::PetApi->new();
     my $petId = 789; # Long | ID of pet to return
     
    -eval { 
    +eval {
         my $result = $api_instance->getPetById(petId => $petId);
         print Dumper($result);
     };
    @@ -2988,7 +2994,7 @@ openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
     api_instance = openapi_client.PetApi()
     petId = 789 # Long | ID of pet to return (default to null)
     
    -try: 
    +try:
         # Find pet by ID
         api_response = api_instance.get_pet_by_id(petId)
         pprint(api_response)
    @@ -3208,11 +3214,39 @@ ID of pet to return
     
                             
    -
    curl -X PUT\
    -\
    - -H "Accept: application/xml,application/json"\
    - -H "Content-Type: application/json,application/xml"\
    - "http://petstore.swagger.io/v2/pet"
    +
    curl -X PUT \
    + \
    + -H "Accept: application/xml,application/json" \
    + -H "Content-Type: application/json,application/xml" \
    + "http://petstore.swagger.io/v2/pet" \
    + -d '{
    +  "photoUrls" : [ "photoUrls", "photoUrls" ],
    +  "name" : "doggie",
    +  "id" : 0,
    +  "category" : {
    +    "name" : "name",
    +    "id" : 6
    +  },
    +  "tags" : [ {
    +    "name" : "name",
    +    "id" : 1
    +  }, {
    +    "name" : "name",
    +    "id" : 1
    +  } ],
    +  "status" : "available"
    +}' \
    + -d '<Pet>
    +  <id>123456789</id>
    +  <name>doggie</name>
    +  <photoUrls>
    +    <photoUrls>aeiou</photoUrls>
    +  </photoUrls>
    +  <tags>
    +  </tags>
    +  <status>aeiou</status>
    +</Pet>'
    +
    import org.openapitools.client.*;
    @@ -3230,11 +3264,11 @@ public class PetApiExample {
             // Configure OAuth2 access token for authorization: petstore_auth
             OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
             petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    -        
    +
             // Create an instance of the API class
             PetApi apiInstance = new PetApi();
             Pet pet = ; // Pet | 
    -        
    +
             try {
                 Pet result = apiInstance.updatePet(pet);
                 System.out.println(result);
    @@ -3254,7 +3288,7 @@ public class PetApiExample {
         public static void main(String[] args) {
             PetApi apiInstance = new PetApi();
             Pet pet = ; // Pet | 
    -        
    +
             try {
                 Pet result = apiInstance.updatePet(pet);
                 System.out.println(result);
    @@ -3334,7 +3368,7 @@ namespace Example
             {
                 // Configure OAuth2 access token for authorization: petstore_auth
                 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new PetApi();
                 var pet = new Pet(); // Pet | 
    @@ -3384,7 +3418,7 @@ $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
     my $api_instance = WWW::OPenAPIClient::PetApi->new();
     my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | 
     
    -eval { 
    +eval {
         my $result = $api_instance->updatePet(pet => $pet);
         print Dumper($result);
     };
    @@ -3407,7 +3441,7 @@ openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
     api_instance = openapi_client.PetApi()
     pet =  # Pet | 
     
    -try: 
    +try:
         # Update an existing pet
         api_response = api_instance.update_pet(pet)
         pprint(api_response)
    @@ -3678,10 +3712,11 @@ $(document).ready(function() {
     
                             
    -
    curl -X POST\
    -\
    - -H "Content-Type: application/x-www-form-urlencoded"\
    - "http://petstore.swagger.io/v2/pet/{petId}"
    +
    curl -X POST \
    + \
    + -H "Content-Type: application/x-www-form-urlencoded" \
    + "http://petstore.swagger.io/v2/pet/{petId}"
    +
    import org.openapitools.client.*;
    @@ -3699,13 +3734,13 @@ public class PetApiExample {
             // Configure OAuth2 access token for authorization: petstore_auth
             OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
             petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    -        
    +
             // Create an instance of the API class
             PetApi apiInstance = new PetApi();
             Long petId = 789; // Long | ID of pet that needs to be updated
             String name = name_example; // String | Updated name of the pet
             String status = status_example; // String | Updated status of the pet
    -        
    +
             try {
                 apiInstance.updatePetWithForm(petId, name, status);
             } catch (ApiException e) {
    @@ -3726,7 +3761,7 @@ public class PetApiExample {
             Long petId = 789; // Long | ID of pet that needs to be updated
             String name = name_example; // String | Updated name of the pet
             String status = status_example; // String | Updated status of the pet
    -        
    +
             try {
                 apiInstance.updatePetWithForm(petId, name, status);
             } catch (ApiException e) {
    @@ -3810,7 +3845,7 @@ namespace Example
             {
                 // Configure OAuth2 access token for authorization: petstore_auth
                 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new PetApi();
                 var petId = 789;  // Long | ID of pet that needs to be updated (default to null)
    @@ -3864,7 +3899,7 @@ my $petId = 789; # Long | ID of pet that needs to be updated
     my $name = name_example; # String | Updated name of the pet
     my $status = status_example; # String | Updated status of the pet
     
    -eval { 
    +eval {
         $api_instance->updatePetWithForm(petId => $petId, name => $name, status => $status);
     };
     if ($@) {
    @@ -3888,7 +3923,7 @@ petId = 789 # Long | ID of pet that needs to be updated (default to null)
     name = name_example # String | Updated name of the pet (optional) (default to null)
     status = status_example # String | Updated status of the pet (optional) (default to null)
     
    -try: 
    +try:
         # Updates a pet in the store with form data
         api_instance.update_pet_with_form(petId, name=name, status=status)
     except ApiException as e:
    @@ -4073,11 +4108,12 @@ Updated status of the pet
     
                             
    -
    curl -X POST\
    -\
    - -H "Accept: application/json"\
    - -H "Content-Type: multipart/form-data"\
    - "http://petstore.swagger.io/v2/pet/{petId}/uploadImage"
    +
    curl -X POST \
    + \
    + -H "Accept: application/json" \
    + -H "Content-Type: multipart/form-data" \
    + "http://petstore.swagger.io/v2/pet/{petId}/uploadImage"
    +
    import org.openapitools.client.*;
    @@ -4095,13 +4131,13 @@ public class PetApiExample {
             // Configure OAuth2 access token for authorization: petstore_auth
             OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
             petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    -        
    +
             // Create an instance of the API class
             PetApi apiInstance = new PetApi();
             Long petId = 789; // Long | ID of pet to update
             String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
             File file = BINARY_DATA_HERE; // File | file to upload
    -        
    +
             try {
                 ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
                 System.out.println(result);
    @@ -4123,7 +4159,7 @@ public class PetApiExample {
             Long petId = 789; // Long | ID of pet to update
             String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
             File file = BINARY_DATA_HERE; // File | file to upload
    -        
    +
             try {
                 ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
                 System.out.println(result);
    @@ -4211,7 +4247,7 @@ namespace Example
             {
                 // Configure OAuth2 access token for authorization: petstore_auth
                 Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new PetApi();
                 var petId = 789;  // Long | ID of pet to update (default to null)
    @@ -4267,7 +4303,7 @@ my $petId = 789; # Long | ID of pet to update
     my $additionalMetadata = additionalMetadata_example; # String | Additional data to pass to server
     my $file = BINARY_DATA_HERE; # File | file to upload
     
    -eval { 
    +eval {
         my $result = $api_instance->uploadFile(petId => $petId, additionalMetadata => $additionalMetadata, file => $file);
         print Dumper($result);
     };
    @@ -4292,7 +4328,7 @@ petId = 789 # Long | ID of pet to update (default to null)
     additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional) (default to null)
     file = BINARY_DATA_HERE # File | file to upload (optional) (default to null)
     
    -try: 
    +try:
         # uploads an image
         api_response = api_instance.upload_file(petId, additionalMetadata=additionalMetadata, file=file)
         pprint(api_response)
    @@ -4528,8 +4564,9 @@ file to upload
     
                             
    -
    curl -X DELETE\
    - "http://petstore.swagger.io/v2/store/order/{orderId}"
    +
    curl -X DELETE \
    + "http://petstore.swagger.io/v2/store/order/{orderId}"
    +
    import org.openapitools.client.*;
    @@ -4542,11 +4579,11 @@ import java.util.*;
     
     public class StoreApiExample {
         public static void main(String[] args) {
    -        
    +
             // Create an instance of the API class
             StoreApi apiInstance = new StoreApi();
             String orderId = orderId_example; // String | ID of the order that needs to be deleted
    -        
    +
             try {
                 apiInstance.deleteOrder(orderId);
             } catch (ApiException e) {
    @@ -4565,7 +4602,7 @@ public class StoreApiExample {
         public static void main(String[] args) {
             StoreApi apiInstance = new StoreApi();
             String orderId = orderId_example; // String | ID of the order that needs to be deleted
    -        
    +
             try {
                 apiInstance.deleteOrder(orderId);
             } catch (ApiException e) {
    @@ -4630,7 +4667,7 @@ namespace Example
         {
             public void main()
             {
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new StoreApi();
                 var orderId = orderId_example;  // String | ID of the order that needs to be deleted (default to null)
    @@ -4672,7 +4709,7 @@ use WWW::OPenAPIClient::StoreApi;
     my $api_instance = WWW::OPenAPIClient::StoreApi->new();
     my $orderId = orderId_example; # String | ID of the order that needs to be deleted
     
    -eval { 
    +eval {
         $api_instance->deleteOrder(orderId => $orderId);
     };
     if ($@) {
    @@ -4691,7 +4728,7 @@ from pprint import pprint
     api_instance = openapi_client.StoreApi()
     orderId = orderId_example # String | ID of the order that needs to be deleted (default to null)
     
    -try: 
    +try:
         # Delete purchase order by ID
         api_instance.delete_order(orderId)
     except ApiException as e:
    @@ -4836,10 +4873,11 @@ ID of the order that needs to be deleted
     
                             
    -
    curl -X GET\
    --H "api_key: [[apiKey]]"\
    - -H "Accept: application/json"\
    - "http://petstore.swagger.io/v2/store/inventory"
    +
    curl -X GET \
    +-H "api_key: [[apiKey]]" \
    + -H "Accept: application/json" \
    + "http://petstore.swagger.io/v2/store/inventory"
    +
    import org.openapitools.client.*;
    @@ -4859,10 +4897,10 @@ public class StoreApiExample {
             api_key.setApiKey("YOUR API KEY");
             // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
             //api_key.setApiKeyPrefix("Token");
    -        
    +
             // Create an instance of the API class
             StoreApi apiInstance = new StoreApi();
    -        
    +
             try {
                 map['String', 'Integer'] result = apiInstance.getInventory();
                 System.out.println(result);
    @@ -4881,7 +4919,7 @@ public class StoreApiExample {
     public class StoreApiExample {
         public static void main(String[] args) {
             StoreApi apiInstance = new StoreApi();
    -        
    +
             try {
                 map['String', 'Integer'] result = apiInstance.getInventory();
                 System.out.println(result);
    @@ -4964,7 +5002,7 @@ namespace Example
                 Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
                 // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                 // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new StoreApi();
     
    @@ -5015,7 +5053,7 @@ $WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
     # Create an instance of the API class
     my $api_instance = WWW::OPenAPIClient::StoreApi->new();
     
    -eval { 
    +eval {
         my $result = $api_instance->getInventory();
         print Dumper($result);
     };
    @@ -5039,7 +5077,7 @@ openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
     # Create an instance of the API class
     api_instance = openapi_client.StoreApi()
     
    -try: 
    +try:
         # Returns pet inventories by status
         api_response = api_instance.get_inventory()
         pprint(api_response)
    @@ -5180,9 +5218,10 @@ pub fn main() {
     
                             
    -
    curl -X GET\
    - -H "Accept: application/xml,application/json"\
    - "http://petstore.swagger.io/v2/store/order/{orderId}"
    +
    curl -X GET \
    + -H "Accept: application/xml,application/json" \
    + "http://petstore.swagger.io/v2/store/order/{orderId}"
    +
    import org.openapitools.client.*;
    @@ -5195,11 +5234,11 @@ import java.util.*;
     
     public class StoreApiExample {
         public static void main(String[] args) {
    -        
    +
             // Create an instance of the API class
             StoreApi apiInstance = new StoreApi();
             Long orderId = 789; // Long | ID of pet that needs to be fetched
    -        
    +
             try {
                 Order result = apiInstance.getOrderById(orderId);
                 System.out.println(result);
    @@ -5219,7 +5258,7 @@ public class StoreApiExample {
         public static void main(String[] args) {
             StoreApi apiInstance = new StoreApi();
             Long orderId = 789; // Long | ID of pet that needs to be fetched
    -        
    +
             try {
                 Order result = apiInstance.getOrderById(orderId);
                 System.out.println(result);
    @@ -5288,7 +5327,7 @@ namespace Example
         {
             public void main()
             {
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new StoreApi();
                 var orderId = 789;  // Long | ID of pet that needs to be fetched (default to null)
    @@ -5332,7 +5371,7 @@ use WWW::OPenAPIClient::StoreApi;
     my $api_instance = WWW::OPenAPIClient::StoreApi->new();
     my $orderId = 789; # Long | ID of pet that needs to be fetched
     
    -eval { 
    +eval {
         my $result = $api_instance->getOrderById(orderId => $orderId);
         print Dumper($result);
     };
    @@ -5352,7 +5391,7 @@ from pprint import pprint
     api_instance = openapi_client.StoreApi()
     orderId = 789 # Long | ID of pet that needs to be fetched (default to null)
     
    -try: 
    +try:
         # Find purchase order by ID
         api_response = api_instance.get_order_by_id(orderId)
         pprint(api_response)
    @@ -5572,10 +5611,19 @@ ID of pet that needs to be fetched
     
                             
    -
    curl -X POST\
    - -H "Accept: application/xml,application/json"\
    - -H "Content-Type: application/json"\
    - "http://petstore.swagger.io/v2/store/order"
    +
    curl -X POST \
    + -H "Accept: application/xml,application/json" \
    + -H "Content-Type: application/json" \
    + "http://petstore.swagger.io/v2/store/order" \
    + -d '{
    +  "petId" : 6,
    +  "quantity" : 1,
    +  "id" : 0,
    +  "shipDate" : "2000-01-23T04:56:07.000+00:00",
    +  "complete" : false,
    +  "status" : "placed"
    +}'
    +
    import org.openapitools.client.*;
    @@ -5588,11 +5636,11 @@ import java.util.*;
     
     public class StoreApiExample {
         public static void main(String[] args) {
    -        
    +
             // Create an instance of the API class
             StoreApi apiInstance = new StoreApi();
             Order order = ; // Order | 
    -        
    +
             try {
                 Order result = apiInstance.placeOrder(order);
                 System.out.println(result);
    @@ -5612,7 +5660,7 @@ public class StoreApiExample {
         public static void main(String[] args) {
             StoreApi apiInstance = new StoreApi();
             Order order = ; // Order | 
    -        
    +
             try {
                 Order result = apiInstance.placeOrder(order);
                 System.out.println(result);
    @@ -5681,7 +5729,7 @@ namespace Example
         {
             public void main()
             {
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new StoreApi();
                 var order = new Order(); // Order | 
    @@ -5725,7 +5773,7 @@ use WWW::OPenAPIClient::StoreApi;
     my $api_instance = WWW::OPenAPIClient::StoreApi->new();
     my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | 
     
    -eval { 
    +eval {
         my $result = $api_instance->placeOrder(order => $order);
         print Dumper($result);
     };
    @@ -5745,7 +5793,7 @@ from pprint import pprint
     api_instance = openapi_client.StoreApi()
     order =  # Order | 
     
    -try: 
    +try:
         # Place an order for a pet
         api_response = api_instance.place_order(order)
         pprint(api_response)
    @@ -5960,10 +6008,21 @@ $(document).ready(function() {
     
                             
    -
    curl -X POST\
    --H "api_key: [[apiKey]]"\
    - -H "Content-Type: application/json"\
    - "http://petstore.swagger.io/v2/user"
    +
    curl -X POST \
    +-H "api_key: [[apiKey]]" \
    + -H "Content-Type: application/json" \
    + "http://petstore.swagger.io/v2/user" \
    + -d '{
    +  "firstName" : "firstName",
    +  "lastName" : "lastName",
    +  "password" : "password",
    +  "userStatus" : 6,
    +  "phone" : "phone",
    +  "id" : 0,
    +  "email" : "email",
    +  "username" : "username"
    +}'
    +
    import org.openapitools.client.*;
    @@ -5983,11 +6042,11 @@ public class UserApiExample {
             api_key.setApiKey("YOUR API KEY");
             // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
             //api_key.setApiKeyPrefix("Token");
    -        
    +
             // Create an instance of the API class
             UserApi apiInstance = new UserApi();
             User user = ; // User | 
    -        
    +
             try {
                 apiInstance.createUser(user);
             } catch (ApiException e) {
    @@ -6006,7 +6065,7 @@ public class UserApiExample {
         public static void main(String[] args) {
             UserApi apiInstance = new UserApi();
             User user = ; // User | 
    -        
    +
             try {
                 apiInstance.createUser(user);
             } catch (ApiException e) {
    @@ -6088,7 +6147,7 @@ namespace Example
                 Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
                 // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                 // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new UserApi();
                 var user = new User(); // User | 
    @@ -6140,7 +6199,7 @@ $WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
     my $api_instance = WWW::OPenAPIClient::UserApi->new();
     my $user = WWW::OPenAPIClient::Object::User->new(); # User | 
     
    -eval { 
    +eval {
         $api_instance->createUser(user => $user);
     };
     if ($@) {
    @@ -6164,7 +6223,7 @@ openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
     api_instance = openapi_client.UserApi()
     user =  # User | 
     
    -try: 
    +try:
         # Create user
         api_instance.create_user(user)
     except ApiException as e:
    @@ -6304,10 +6363,21 @@ $(document).ready(function() {
     
                             
    -
    curl -X POST\
    --H "api_key: [[apiKey]]"\
    - -H "Content-Type: application/json"\
    - "http://petstore.swagger.io/v2/user/createWithArray"
    +
    curl -X POST \
    +-H "api_key: [[apiKey]]" \
    + -H "Content-Type: application/json" \
    + "http://petstore.swagger.io/v2/user/createWithArray" \
    + -d '{
    +  "firstName" : "firstName",
    +  "lastName" : "lastName",
    +  "password" : "password",
    +  "userStatus" : 6,
    +  "phone" : "phone",
    +  "id" : 0,
    +  "email" : "email",
    +  "username" : "username"
    +}'
    +
    import org.openapitools.client.*;
    @@ -6327,11 +6397,11 @@ public class UserApiExample {
             api_key.setApiKey("YOUR API KEY");
             // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
             //api_key.setApiKeyPrefix("Token");
    -        
    +
             // Create an instance of the API class
             UserApi apiInstance = new UserApi();
             array[User] user = ; // array[User] | 
    -        
    +
             try {
                 apiInstance.createUsersWithArrayInput(user);
             } catch (ApiException e) {
    @@ -6350,7 +6420,7 @@ public class UserApiExample {
         public static void main(String[] args) {
             UserApi apiInstance = new UserApi();
             array[User] user = ; // array[User] | 
    -        
    +
             try {
                 apiInstance.createUsersWithArrayInput(user);
             } catch (ApiException e) {
    @@ -6432,7 +6502,7 @@ namespace Example
                 Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
                 // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                 // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new UserApi();
                 var user = new array[User](); // array[User] | 
    @@ -6484,7 +6554,7 @@ $WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
     my $api_instance = WWW::OPenAPIClient::UserApi->new();
     my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | 
     
    -eval { 
    +eval {
         $api_instance->createUsersWithArrayInput(user => $user);
     };
     if ($@) {
    @@ -6508,7 +6578,7 @@ openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
     api_instance = openapi_client.UserApi()
     user =  # array[User] | 
     
    -try: 
    +try:
         # Creates list of users with given input array
         api_instance.create_users_with_array_input(user)
     except ApiException as e:
    @@ -6651,10 +6721,21 @@ $(document).ready(function() {
     
                             
    -
    curl -X POST\
    --H "api_key: [[apiKey]]"\
    - -H "Content-Type: application/json"\
    - "http://petstore.swagger.io/v2/user/createWithList"
    +
    curl -X POST \
    +-H "api_key: [[apiKey]]" \
    + -H "Content-Type: application/json" \
    + "http://petstore.swagger.io/v2/user/createWithList" \
    + -d '{
    +  "firstName" : "firstName",
    +  "lastName" : "lastName",
    +  "password" : "password",
    +  "userStatus" : 6,
    +  "phone" : "phone",
    +  "id" : 0,
    +  "email" : "email",
    +  "username" : "username"
    +}'
    +
    import org.openapitools.client.*;
    @@ -6674,11 +6755,11 @@ public class UserApiExample {
             api_key.setApiKey("YOUR API KEY");
             // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
             //api_key.setApiKeyPrefix("Token");
    -        
    +
             // Create an instance of the API class
             UserApi apiInstance = new UserApi();
             array[User] user = ; // array[User] | 
    -        
    +
             try {
                 apiInstance.createUsersWithListInput(user);
             } catch (ApiException e) {
    @@ -6697,7 +6778,7 @@ public class UserApiExample {
         public static void main(String[] args) {
             UserApi apiInstance = new UserApi();
             array[User] user = ; // array[User] | 
    -        
    +
             try {
                 apiInstance.createUsersWithListInput(user);
             } catch (ApiException e) {
    @@ -6779,7 +6860,7 @@ namespace Example
                 Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
                 // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                 // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new UserApi();
                 var user = new array[User](); // array[User] | 
    @@ -6831,7 +6912,7 @@ $WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
     my $api_instance = WWW::OPenAPIClient::UserApi->new();
     my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | 
     
    -eval { 
    +eval {
         $api_instance->createUsersWithListInput(user => $user);
     };
     if ($@) {
    @@ -6855,7 +6936,7 @@ openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
     api_instance = openapi_client.UserApi()
     user =  # array[User] | 
     
    -try: 
    +try:
         # Creates list of users with given input array
         api_instance.create_users_with_list_input(user)
     except ApiException as e:
    @@ -6998,9 +7079,10 @@ $(document).ready(function() {
     
                             
    -
    curl -X DELETE\
    --H "api_key: [[apiKey]]"\
    - "http://petstore.swagger.io/v2/user/{username}"
    +
    curl -X DELETE \
    +-H "api_key: [[apiKey]]" \
    + "http://petstore.swagger.io/v2/user/{username}"
    +
    import org.openapitools.client.*;
    @@ -7020,11 +7102,11 @@ public class UserApiExample {
             api_key.setApiKey("YOUR API KEY");
             // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
             //api_key.setApiKeyPrefix("Token");
    -        
    +
             // Create an instance of the API class
             UserApi apiInstance = new UserApi();
             String username = username_example; // String | The name that needs to be deleted
    -        
    +
             try {
                 apiInstance.deleteUser(username);
             } catch (ApiException e) {
    @@ -7043,7 +7125,7 @@ public class UserApiExample {
         public static void main(String[] args) {
             UserApi apiInstance = new UserApi();
             String username = username_example; // String | The name that needs to be deleted
    -        
    +
             try {
                 apiInstance.deleteUser(username);
             } catch (ApiException e) {
    @@ -7125,7 +7207,7 @@ namespace Example
                 Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
                 // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                 // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new UserApi();
                 var username = username_example;  // String | The name that needs to be deleted (default to null)
    @@ -7177,7 +7259,7 @@ $WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
     my $api_instance = WWW::OPenAPIClient::UserApi->new();
     my $username = username_example; # String | The name that needs to be deleted
     
    -eval { 
    +eval {
         $api_instance->deleteUser(username => $username);
     };
     if ($@) {
    @@ -7201,7 +7283,7 @@ openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
     api_instance = openapi_client.UserApi()
     username = username_example # String | The name that needs to be deleted (default to null)
     
    -try: 
    +try:
         # Delete user
         api_instance.delete_user(username)
     except ApiException as e:
    @@ -7346,9 +7428,10 @@ The name that needs to be deleted
     
                             
    -
    curl -X GET\
    - -H "Accept: application/xml,application/json"\
    - "http://petstore.swagger.io/v2/user/{username}"
    +
    curl -X GET \
    + -H "Accept: application/xml,application/json" \
    + "http://petstore.swagger.io/v2/user/{username}"
    +
    import org.openapitools.client.*;
    @@ -7361,11 +7444,11 @@ import java.util.*;
     
     public class UserApiExample {
         public static void main(String[] args) {
    -        
    +
             // Create an instance of the API class
             UserApi apiInstance = new UserApi();
             String username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
    -        
    +
             try {
                 User result = apiInstance.getUserByName(username);
                 System.out.println(result);
    @@ -7385,7 +7468,7 @@ public class UserApiExample {
         public static void main(String[] args) {
             UserApi apiInstance = new UserApi();
             String username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
    -        
    +
             try {
                 User result = apiInstance.getUserByName(username);
                 System.out.println(result);
    @@ -7454,7 +7537,7 @@ namespace Example
         {
             public void main()
             {
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new UserApi();
                 var username = username_example;  // String | The name that needs to be fetched. Use user1 for testing. (default to null)
    @@ -7498,7 +7581,7 @@ use WWW::OPenAPIClient::UserApi;
     my $api_instance = WWW::OPenAPIClient::UserApi->new();
     my $username = username_example; # String | The name that needs to be fetched. Use user1 for testing.
     
    -eval { 
    +eval {
         my $result = $api_instance->getUserByName(username => $username);
         print Dumper($result);
     };
    @@ -7518,7 +7601,7 @@ from pprint import pprint
     api_instance = openapi_client.UserApi()
     username = username_example # String | The name that needs to be fetched. Use user1 for testing. (default to null)
     
    -try: 
    +try:
         # Get user by user name
         api_response = api_instance.get_user_by_name(username)
         pprint(api_response)
    @@ -7735,9 +7818,10 @@ The name that needs to be fetched. Use user1 for testing.
     
                             
    -
    curl -X GET\
    - -H "Accept: application/xml,application/json"\
    - "http://petstore.swagger.io/v2/user/login?username=&password="
    +
    curl -X GET \
    + -H "Accept: application/xml,application/json" \
    + "http://petstore.swagger.io/v2/user/login?username=username_example&password=password_example"
    +
    import org.openapitools.client.*;
    @@ -7750,12 +7834,12 @@ import java.util.*;
     
     public class UserApiExample {
         public static void main(String[] args) {
    -        
    +
             // Create an instance of the API class
             UserApi apiInstance = new UserApi();
             String username = username_example; // String | The user name for login
             String password = password_example; // String | The password for login in clear text
    -        
    +
             try {
                 'String' result = apiInstance.loginUser(username, password);
                 System.out.println(result);
    @@ -7776,7 +7860,7 @@ public class UserApiExample {
             UserApi apiInstance = new UserApi();
             String username = username_example; // String | The user name for login
             String password = password_example; // String | The password for login in clear text
    -        
    +
             try {
                 'String' result = apiInstance.loginUser(username, password);
                 System.out.println(result);
    @@ -7848,7 +7932,7 @@ namespace Example
         {
             public void main()
             {
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new UserApi();
                 var username = username_example;  // String | The user name for login (default to null)
    @@ -7895,7 +7979,7 @@ my $api_instance = WWW::OPenAPIClient::UserApi->new();
     my $username = username_example; # String | The user name for login
     my $password = password_example; # String | The password for login in clear text
     
    -eval { 
    +eval {
         my $result = $api_instance->loginUser(username => $username, password => $password);
         print Dumper($result);
     };
    @@ -7916,7 +8000,7 @@ api_instance = openapi_client.UserApi()
     username = username_example # String | The user name for login (default to null)
     password = password_example # String | The password for login in clear text (default to null)
     
    -try: 
    +try:
         # Logs user into the system
         api_response = api_instance.login_user(username, password)
         pprint(api_response)
    @@ -8061,7 +8145,7 @@ The password for login in clear text
           }
         },
         "X-Expires-After" : {
    -      "description" : "date in UTC when toekn expires",
    +      "description" : "date in UTC when token expires",
           "style" : "simple",
           "explode" : false,
           "schema" : {
    @@ -8132,7 +8216,7 @@ The password for login in clear text
                                                       XMinusExpiresMinusAfter
                                                       Date
                                                       date-time
    -                                                  date in UTC when toekn expires
    +                                                  date in UTC when token expires
                                                   
                                           
                                       
    @@ -8195,9 +8279,10 @@ The password for login in clear text
    -
    curl -X GET\
    --H "api_key: [[apiKey]]"\
    - "http://petstore.swagger.io/v2/user/logout"
    +
    curl -X GET \
    +-H "api_key: [[apiKey]]" \
    + "http://petstore.swagger.io/v2/user/logout"
    +
    import org.openapitools.client.*;
    @@ -8217,10 +8302,10 @@ public class UserApiExample {
             api_key.setApiKey("YOUR API KEY");
             // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
             //api_key.setApiKeyPrefix("Token");
    -        
    +
             // Create an instance of the API class
             UserApi apiInstance = new UserApi();
    -        
    +
             try {
                 apiInstance.logoutUser();
             } catch (ApiException e) {
    @@ -8238,7 +8323,7 @@ public class UserApiExample {
     public class UserApiExample {
         public static void main(String[] args) {
             UserApi apiInstance = new UserApi();
    -        
    +
             try {
                 apiInstance.logoutUser();
             } catch (ApiException e) {
    @@ -8317,7 +8402,7 @@ namespace Example
                 Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
                 // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                 // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new UserApi();
     
    @@ -8366,7 +8451,7 @@ $WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
     # Create an instance of the API class
     my $api_instance = WWW::OPenAPIClient::UserApi->new();
     
    -eval { 
    +eval {
         $api_instance->logoutUser();
     };
     if ($@) {
    @@ -8389,7 +8474,7 @@ openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
     # Create an instance of the API class
     api_instance = openapi_client.UserApi()
     
    -try: 
    +try:
         # Logs out current logged in user session
         api_instance.logout_user()
     except ApiException as e:
    @@ -8481,10 +8566,21 @@ pub fn main() {
     
                             
    -
    curl -X PUT\
    --H "api_key: [[apiKey]]"\
    - -H "Content-Type: application/json"\
    - "http://petstore.swagger.io/v2/user/{username}"
    +
    curl -X PUT \
    +-H "api_key: [[apiKey]]" \
    + -H "Content-Type: application/json" \
    + "http://petstore.swagger.io/v2/user/{username}" \
    + -d '{
    +  "firstName" : "firstName",
    +  "lastName" : "lastName",
    +  "password" : "password",
    +  "userStatus" : 6,
    +  "phone" : "phone",
    +  "id" : 0,
    +  "email" : "email",
    +  "username" : "username"
    +}'
    +
    import org.openapitools.client.*;
    @@ -8504,12 +8600,12 @@ public class UserApiExample {
             api_key.setApiKey("YOUR API KEY");
             // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
             //api_key.setApiKeyPrefix("Token");
    -        
    +
             // Create an instance of the API class
             UserApi apiInstance = new UserApi();
             String username = username_example; // String | name that need to be deleted
             User user = ; // User | 
    -        
    +
             try {
                 apiInstance.updateUser(username, user);
             } catch (ApiException e) {
    @@ -8529,7 +8625,7 @@ public class UserApiExample {
             UserApi apiInstance = new UserApi();
             String username = username_example; // String | name that need to be deleted
             User user = ; // User | 
    -        
    +
             try {
                 apiInstance.updateUser(username, user);
             } catch (ApiException e) {
    @@ -8614,7 +8710,7 @@ namespace Example
                 Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
                 // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                 // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    -            
    +
                 // Create an instance of the API class
                 var apiInstance = new UserApi();
                 var username = username_example;  // String | name that need to be deleted (default to null)
    @@ -8669,7 +8765,7 @@ my $api_instance = WWW::OPenAPIClient::UserApi->new();
     my $username = username_example; # String | name that need to be deleted
     my $user = WWW::OPenAPIClient::Object::User->new(); # User | 
     
    -eval { 
    +eval {
         $api_instance->updateUser(username => $username, user => $user);
     };
     if ($@) {
    @@ -8694,7 +8790,7 @@ api_instance = openapi_client.UserApi()
     username = username_example # String | name that need to be deleted (default to null)
     user =  # User | 
     
    -try: 
    +try:
         # Updated user
         api_instance.update_user(username, user)
     except ApiException as e:
    @@ -8939,7 +9035,7 @@ return /******/ (function(modules) { // webpackBootstrap
     	var DATE_STRING_REGEX = /(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/;
     	var PARTIAL_DATE_REGEX = /\d{2}:\d{2}:\d{2} GMT-\d{4}/;
     	var JSON_DATE_REGEX = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
    -	// When toggleing, don't animated removal or addition of more than a few items
    +	// When toggling, don't animated removal or addition of more than a few items
     	var MAX_ANIMATED_TOGGLE_ITEMS = 10;
     	var requestAnimationFrame = window.requestAnimationFrame || function (cb) { cb(); return 0; };
     	;
    @@ -9368,7 +9464,7 @@ return /******/ (function(modules) { // webpackBootstrap
     /***/ function(module, exports, __webpack_require__) {
     
     	// style-loader: Adds some css to the DOM by adding a