diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java index 45a60ee823e..719ae753682 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java @@ -394,7 +394,7 @@ public interface CodegenConfig { boolean getAddSuffixToDuplicateOperationNicknames(); - String toRefClass(String ref, String sourceJsonPath); + String toRefClass(String ref, String sourceJsonPath, String expectedComponentType); CodegenRequestBody fromRequestBody(RequestBody body, String sourceJsonPath); diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenHeader.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenHeader.java index cc0d4a9c33c..f2e902ec0fb 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenHeader.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenHeader.java @@ -38,45 +38,6 @@ public class CodegenHeader extends CodegenRequestBody { public boolean isDeprecated; protected CodegenSchema schema; - public CodegenHeader copy() { - CodegenHeader output = new CodegenHeader(); - output.description = this.description; - output.unescapedDescription = this.unescapedDescription; - output.required = this.required; - output.jsonSchema = this.jsonSchema; - output.example = this.example; - - if (this.name != null) { - output.setName(this.name); - } - if (this.content != null) { - output.setContent(this.content); - } - if (this.schema != null) { - output.setSchema(this.schema); - } - if (this.vendorExtensions != null) { - output.vendorExtensions = new HashMap(this.vendorExtensions); - } - if (this.ref != null) { - output.setRef(this.ref); - } - if (this.refModule != null) { - output.setRefModule(this.refModule); - } - if (this.imports != null) { - output.imports = imports; - } - if (this.componentModule != null) { - output.componentModule = componentModule; - } - output.isDeprecated = this.isDeprecated; - output.isExplode = this.isExplode; - output.style = this.style; - - return output; - } - public CodegenSchema getSetSchema() { if (schema != null) { return schema; @@ -105,7 +66,7 @@ public String getSetSchemaJsonPath(String jsonPath) { } @Override public int hashCode() { - return Objects.hash(name, isExplode, description, unescapedDescription, style, example, jsonSchema, vendorExtensions, isDeprecated, required, schema, content, ref, refModule, imports, componentModule); + return Objects.hash(refClass, name, isExplode, description, unescapedDescription, style, example, jsonSchema, vendorExtensions, isDeprecated, required, schema, content, ref, refModule, imports, componentModule); } @Override diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index c1ab4150745..b03fe53df47 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -30,57 +30,9 @@ public class CodegenParameter extends CodegenHeader { // stores the openapi name property public String baseName; - public CodegenParameter copy() { - CodegenParameter output = new CodegenParameter(); - output.baseName = this.baseName; - output.description = this.description; - output.unescapedDescription = this.unescapedDescription; - output.isFormParam = this.isFormParam; - output.isQueryParam = this.isQueryParam; - output.isPathParam = this.isPathParam; - output.isHeaderParam = this.isHeaderParam; - output.isCookieParam = this.isCookieParam; - output.isBodyParam = this.isBodyParam; - output.required = this.required; - output.jsonSchema = this.jsonSchema; - output.example = this.example; - - if (this.name != null) { - output.name = this.name; - } - if (this.content != null) { - output.setContent(this.content); - } - if (this.schema != null) { - output.setSchema(this.schema); - } - if (this.vendorExtensions != null) { - output.vendorExtensions = new HashMap<>(this.vendorExtensions); - } - if (this.ref != null) { - output.setRef(this.ref); - } - if (this.refModule != null) { - output.setRefModule(this.refModule); - } - if (this.imports != null) { - output.imports = imports; - } - if (this.componentModule != null) { - output.componentModule = componentModule; - } - output.isDeprecated = this.isDeprecated; - output.isExplode = this.isExplode; - output.style = this.style; - output.isDeepObject = this.isDeepObject; - output.isAllowEmptyValue = this.isAllowEmptyValue; - - return output; - } - @Override public int hashCode() { - return Objects.hash(name, isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isExplode, baseName, description, unescapedDescription, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, vendorExtensions, isDeprecated, required, schema, content, ref, refModule, imports, componentModule); + return Objects.hash(refClass, name, isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isExplode, baseName, description, unescapedDescription, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, vendorExtensions, isDeprecated, required, schema, content, ref, refModule, imports, componentModule); } @Override diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenRequestBody.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenRequestBody.java index 7ac7b8d88f6..27453523055 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenRequestBody.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenRequestBody.java @@ -49,6 +49,7 @@ public class CodegenRequestBody implements OpenapiComponent { protected String refModule; protected Set imports = new HashSet(); protected String componentModule; + protected String refClass; public String getComponentModule() { return componentModule; @@ -58,9 +59,17 @@ public void setComponentModule(String componentModule) { this.componentModule = componentModule; } + public String getRefClass() { + return refClass; + } + + public void setRefClass(String refClass) { + this.refClass = refClass; + } + @Override public int hashCode() { - return Objects.hash(description, unescapedDescription, name, example, jsonSchema, vendorExtensions, required, content, ref, refModule, imports, componentModule); + return Objects.hash(refClass, description, unescapedDescription, name, example, jsonSchema, vendorExtensions, required, content, ref, refModule, imports, componentModule); } @Override @@ -69,6 +78,7 @@ public boolean equals(Object o) { if (!(o instanceof CodegenRequestBody)) return false; CodegenRequestBody that = (CodegenRequestBody) o; return required == that.required && + Objects.equals(refClass, that.refClass) && Objects.equals(name, that.name) && Objects.equals(componentModule, that.componentModule) && Objects.equals(ref, that.getRef()) && @@ -93,6 +103,7 @@ protected void addInstanceInfo(StringBuilder sb) { sb.append(", content=").append(content); sb.append(", ref=").append(ref); sb.append(", refModule=").append(refModule); + sb.append(", refClass=").append(refClass); sb.append(", imports=").append(imports); sb.append(", componentModule=").append(componentModule); } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index 67dbec9e4af..d23c5c09211 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -30,11 +30,12 @@ public class CodegenResponse implements OpenapiComponent { private String ref; public Set imports = new TreeSet<>(); private String refModule; + private String refClass; private String componentModule; @Override public int hashCode() { - return Objects.hash(name, message, examples, + return Objects.hash(refClass, name, message, examples, jsonSchema, vendorExtensions, headers, content, ref, imports, refModule, componentModule); @@ -46,6 +47,7 @@ public boolean equals(Object o) { if (!(o instanceof CodegenResponse)) return false; CodegenResponse that = (CodegenResponse) o; return Objects.equals(name, that.name) && + Objects.equals(refClass, that.refClass) && Objects.equals(imports, that.imports) && Objects.equals(ref, that.getRef()) && Objects.equals(content, that.getContent()) && @@ -94,6 +96,7 @@ public String toString() { sb.append(", content=").append(content); sb.append(", ref=").append(ref); sb.append(", refModule=").append(refModule); + sb.append(", refClass=").append(refClass); sb.append(", imports=").append(imports); sb.append(", componentModule=").append(componentModule); sb.append('}'); @@ -108,6 +111,14 @@ public String toString() { public void setRefModule(String refModule) { this.refModule=refModule; } + public String getRefClass() { + return refClass; + } + + public void setRefClass(String refClass) { + this.refClass = refClass; + } + public CodegenKey getName() { return name; } public void setName(CodegenKey name) { this.name=name; } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index a9b530ee1fa..789efd5d3e7 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -2458,7 +2458,7 @@ protected List getOneOfAnyOfDescendants(String composedSchemaName, LOGGER.warn("'{}' defines discriminator '{}', but the referenced schema '{}' is incorrect. {}", composedSchemaName, discPropName, modelName, msgSuffix); } - MappedModel mm = new MappedModel(modelName, getRefClassWithModule("#/components/schemas/" + modelName, sourceJsonPath)); + MappedModel mm = new MappedModel(modelName, getRefClassWithModule("#/components/schemas/" + modelName, sourceJsonPath, "schemas")); descendentSchemas.add(mm); Schema cs = ModelUtils.getSchema(openAPI, modelName); if (cs == null) { // cannot lookup the model based on the name @@ -2467,7 +2467,7 @@ protected List getOneOfAnyOfDescendants(String composedSchemaName, 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, getRefClassWithModule("#/components/schemas/" + modelName, sourceJsonPath)); + mm = new MappedModel(xDiscriminatorValue, getRefClassWithModule("#/components/schemas/" + modelName, sourceJsonPath, "schemas")); descendentSchemas.add(mm); } } @@ -2520,21 +2520,21 @@ protected List getAllOfDescendants(String thisSchemaName, OpenAPI o break; } currentSchemaName = queue.remove(0); - MappedModel mm = new MappedModel(currentSchemaName, getRefClassWithModule("#/components/schemas/" + currentSchemaName, sourceJsonPath)); + MappedModel mm = new MappedModel(currentSchemaName, getRefClassWithModule("#/components/schemas/" + currentSchemaName, sourceJsonPath, "schemas")); descendentSchemas.add(mm); Schema cs = schemas.get(currentSchemaName); 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, getRefClassWithModule("#/components/schemas/" + currentSchemaName, sourceJsonPath)); + mm = new MappedModel(xDiscriminatorValue, getRefClassWithModule("#/components/schemas/" + currentSchemaName, sourceJsonPath, "schemas")); descendentSchemas.add(mm); } } return descendentSchemas; } - protected String getRefClassWithModule(String ref, String sourceJsonPath) { - String refClass = toRefClass(ref, sourceJsonPath); + protected String getRefClassWithModule(String ref, String sourceJsonPath, String expectedComponentType) { + String refClass = toRefClass(ref, sourceJsonPath, expectedComponentType); return refClass; } @@ -2572,11 +2572,11 @@ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema sch if (ModelUtils.getSchema(openAPI, name) == null) { LOGGER.error("Failed to lookup the schema '{}' when processing the discriminator mapping of oneOf/anyOf. Please check to ensure it's defined properly.", name); } else { - modelName = getRefClassWithModule(e.getValue(), sourceJsonPath); + modelName = getRefClassWithModule(e.getValue(), sourceJsonPath, "schemas"); } } else { String ref = "#/components/schemas/" + value; - modelName = getRefClassWithModule(ref, sourceJsonPath); + modelName = getRefClassWithModule(ref, sourceJsonPath, "schemas"); } if (modelName != null) { uniqueDescendants.add(new MappedModel(e.getKey(), modelName)); @@ -3087,9 +3087,10 @@ public CodegenSchema fromSchema(Schema p, String sourceJsonPath, String currentJ property.setRef(ref); property.setRefClass(toRefClass( ref, - sourceJsonPath + sourceJsonPath, + "schemas" )); - property.setRefModule(toRefModule(ref, "schemas", sourceJsonPath)); + property.setRefModule(toRefModule(ref, sourceJsonPath, "schemas")); } String example = toExampleValue(p); property.setExample(example); @@ -3103,7 +3104,7 @@ public CodegenSchema fromSchema(Schema p, String sourceJsonPath, String currentJ return property; } - public String toRefClass(String ref, String sourceJsonPath) { + public String toRefClass(String ref, String sourceJsonPath, String expectedComponentType) { String[] refPieces = ref.split("/"); return toModelName(refPieces[refPieces.length-1]); } @@ -3324,13 +3325,13 @@ public CodegenOperation fromOperation(String path, i++; if (p.isQueryParam) { - queryParams.add(p.copy()); + queryParams.add(p); } else if (p.isPathParam) { - pathParams.add(p.copy()); + pathParams.add(p); } else if (p.isHeaderParam) { - headerParams.add(p.copy()); + headerParams.add(p); } else if (p.isCookieParam) { - cookieParams.add(p.copy()); + cookieParams.add(p); } else { LOGGER.warn("Unknown parameter type for {}", p.baseName); } @@ -3341,9 +3342,9 @@ public CodegenOperation fromOperation(String path, // create optional, required parameters for (CodegenParameter cp : allParams) { if (cp.required) { //required parameters - requiredParams.add(cp.copy()); + requiredParams.add(cp); } else { // optional parameters - optionalParams.add(cp.copy()); + optionalParams.add(cp); } } @@ -5024,7 +5025,7 @@ public String toRequestBodyFilename(String componentName) { return toModuleFilename(componentName); } - protected String toRefModule(String ref, String expectedComponentType, String sourceJsonPath) { + protected String toRefModule(String ref, String sourceJsonPath, String expectedComponentType) { // ref #/components/schemas/SomeModel -> some_model // ref #/components/requestBodies/SomeBody -> some_body // ref #/components/parameters/SomeParam -> some_param @@ -5062,8 +5063,10 @@ protected String toRefModule(String ref, String expectedComponentType, String so private void setLocationInfo(String ref, OpenapiComponent instance, String sourceJsonPath, String expectedComponentType) { if (ref != null) { instance.setRef(ref); - String refModule = toRefModule(ref, expectedComponentType, sourceJsonPath); + String refModule = toRefModule(ref, sourceJsonPath, expectedComponentType); instance.setRefModule(refModule); + String refClass = toRefClass(ref, sourceJsonPath, expectedComponentType); + instance.setRefClass(refClass); } String[] refPieces = sourceJsonPath.split("/"); if (sourceJsonPath.startsWith("#/components/") && refPieces.length == 4) { diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/OpenapiComponent.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/OpenapiComponent.java index b557ee686e6..d631ca3ac45 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/OpenapiComponent.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/OpenapiComponent.java @@ -37,5 +37,7 @@ public interface OpenapiComponent { void setRefModule(String refModule); - // TODO add refClass here when all components use classes in their python definition + String getRefClass(); + + void setRefClass(String refClass); } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 7a8c2604c25..66acef4d150 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -1051,10 +1051,10 @@ public String getSchemaType(Schema schema) { return toModelName(openAPIType); } - public String getSchemaRefClass(Schema sc) { + public String getRefClassWithRefModule(Schema sc) { String ref = sc.get$ref(); if (ref != null) { - return toRefModule(ref, "schemas", null) + "." + toRefClass(ref, null); + return toRefModule(ref, null, "schemas") + "." + toRefClass(ref, null, "schemas"); } return null; } @@ -1115,14 +1115,14 @@ private String ensureQuotes(String in) { @Override public String toExampleValue(Schema schema) { - String modelName = getSchemaRefClass(schema); + String modelName = getRefClassWithRefModule(schema); Object objExample = getObjectExample(schema); return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); } @Override public String toExampleValue(Schema schema, Object objExample) { - String modelName = getSchemaRefClass(schema); + String modelName = getRefClassWithRefModule(schema); return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); } @@ -1220,7 +1220,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o LOGGER.warn("Unable to find referenced schema " + schema.get$ref() + "\n"); return fullPrefix + "None" + closeChars; } - String refModelName = getSchemaRefClass(schema); + String refModelName = getRefClassWithRefModule(schema); return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, includedSchemas); } else if (ModelUtils.isNullType(schema)) { // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, @@ -1393,7 +1393,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o } ArraySchema arrayschema = (ArraySchema) schema; Schema itemSchema = arrayschema.getItems(); - String itemModelName = getSchemaRefClass(itemSchema); + String itemModelName = getRefClassWithRefModule(itemSchema); if(includedSchemas.contains(schema)) { return ""; } @@ -1474,7 +1474,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o if (modelName == null) { addPropPrefix = ensureQuotes(key) + ": "; } - String addPropsModelName = getSchemaRefClass(addPropsSchema); + String addPropsModelName = getRefClassWithRefModule(addPropsSchema); if(includedSchemas.contains(schema)) { return ""; } @@ -1522,7 +1522,7 @@ private String exampleForObjectModel(Schema schema, String fullPrefix, String cl propModelName = null; propExample = discProp.example; } else { - propModelName = getSchemaRefClass(propSchema); + propModelName = getRefClassWithRefModule(propSchema); propExample = exampleFromStringOrArraySchema( propSchema, null, @@ -2012,9 +2012,9 @@ protected String getImport(String className, CodegenSchema schema) { } @Override - protected String getRefClassWithModule(String ref, String sourceJsonPath) { - String refModule = toRefModule(ref, "schemas", sourceJsonPath); - String refClass = toRefClass(ref, sourceJsonPath); + protected String getRefClassWithModule(String ref, String sourceJsonPath, String expectedComponentType) { + String refModule = toRefModule(ref, sourceJsonPath, expectedComponentType); + String refClass = toRefClass(ref, sourceJsonPath, expectedComponentType); if (refModule == null) { return refClass; } @@ -2058,7 +2058,7 @@ protected String toComponentModule(String componentName, String priorJsonPathSeg return null; } - public String toRefClass(String ref, String sourceJsonPath) { + private String toSchemaRefClass(String ref, String sourceJsonPath) { String[] refPieces = ref.split("/"); if (ref.equals(sourceJsonPath)) { // self reference, no import needed @@ -2096,6 +2096,59 @@ public String toRefClass(String ref, String sourceJsonPath) { return null; } + private String toRequestBodyRefClass(String ref, String sourceJsonPath) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/requestBodies/") && refPieces.length == 4) { + String refClass = toModelName(refPieces[3]); + return refClass; + } + return null; + } + + private String toResponseRefClass(String ref, String sourceJsonPath) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/responses/") && refPieces.length == 4) { + String refClass = toModelName(refPieces[3]); + return refClass; + } + return null; + } + + private String toHeaderRefClass(String ref, String sourceJsonPath) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/headers/") && refPieces.length == 4) { + String refClass = toModelName(refPieces[3]); + return refClass; + } + return null; + } + + private String toParameterRefClass(String ref, String sourceJsonPath) { + String[] refPieces = ref.split("/"); + if (ref.startsWith("#/components/parameters/") && refPieces.length == 4) { + String refClass = toModelName(refPieces[3]); + return refClass; + } + return null; + } + + @Override + public String toRefClass(String ref, String sourceJsonPath, String expectedComponentType) { + switch (expectedComponentType) { + case "schemas": + return toSchemaRefClass(ref, sourceJsonPath); + case "requestBodies": + return toRequestBodyRefClass(ref, sourceJsonPath); + case "responses": + return toResponseRefClass(ref, sourceJsonPath); + case "headers": + return toHeaderRefClass(ref, sourceJsonPath); + case "parameters": + return toParameterRefClass(ref, sourceJsonPath); + } + return null; + } + @Override public void postProcess() { System.out.println("################################################################################"); diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars index 9d7555172e3..bf3ee989069 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars @@ -114,10 +114,6 @@ class PrefixSeparatorIterator: class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - @staticmethod def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): """ @@ -279,13 +275,8 @@ class ParameterSerializerBase: class StyleFormSerializer(ParameterSerializerBase): @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - def _serialize_form( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, @@ -294,7 +285,7 @@ class StyleFormSerializer(ParameterSerializerBase): ) -> str: if prefix_separator_iterator is None: prefix_separator_iterator = PrefixSeparatorIterator('', '&') - return self._ref6570_expansion( + return cls._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, @@ -305,15 +296,16 @@ class StyleFormSerializer(ParameterSerializerBase): class StyleSimpleSerializer(ParameterSerializerBase): + @classmethod def _serialize_simple( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, percent_encode: bool ) -> str: prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( + return cls._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, @@ -321,8 +313,9 @@ class StyleSimpleSerializer(ParameterSerializerBase): prefix_separator_iterator=prefix_separator_iterator ) + @classmethod def _deserialize_simple( - self, + cls, in_data: str, name: str, explode: bool, @@ -361,144 +354,88 @@ class ParameterBase(JSONDetector): schema: typing.Optional[typing.Type[Schema]] content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } _json_encoder = JSONEncoder() - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + @classmethod def _serialize_json( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], eliminate_whitespace: bool = False ) -> str: if eliminate_whitespace: - return json.dumps(in_data, separators=self._json_encoder.compact_separators) + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) return json.dumps(in_data) class PathParameter(ParameterBase, StyleSimpleSerializer): name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - self.name = name - super().__init__( - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def __serialize_label( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_matrix( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_simple( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], ) -> typing.Dict[str, str]: - value = self._serialize_simple( + value = cls._serialize_simple( in_data=in_data, - name=self.name, - explode=self.explode, + name=cls.name, + explode=cls.explode, percent_encode=True ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ simple -> path path: @@ -508,115 +445,103 @@ class PathParameter(ParameterBase, StyleSimpleSerializer): matrix -> path returns path_params """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class QueryParameter(ParameterBase, StyleFormSerializer): name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - self.name = name - super().__init__( - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def __serialize_space_delimited( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_pipe_delimited( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_form( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( in_data, - name=self.name, - explode=self.explode, + name=cls.name, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if self.style is ParameterStyle.FORM: + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: + elif cls.style is ParameterStyle.SPACE_DELIMITED: return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: + elif cls.style is ParameterStyle.PIPE_DELIMITED: return PrefixSeparatorIterator('', '|') + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ form -> query query: @@ -630,111 +555,83 @@ class QueryParameter(ParameterBase, StyleFormSerializer): deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 returns fields """ - if self.style: + if cls.style: # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - for content_type, schema in self.content.items(): + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data, eliminate_whitespace=True) - return self._to_dict( - self.name, - next(prefix_separator_iterator) + self.name + '=' + quote(value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + quote(value) ) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class CookieParameter(ParameterBase, StyleFormSerializer): name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - self.name = name - super().__init__( - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ form -> cookie returns fields: tuple """ - if self.style: + if cls.style: """ TODO add escaping of comma, space, equals or turn encoding on """ - value = self._serialize_form( + value = cls._serialize_form( cast_in_data, - explode=self.explode, - name=self.name, + explode=cls.explode, + name=cls.name, percent_encode=False, prefix_separator_iterator=PrefixSeparatorIterator('', '&') ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None @staticmethod def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: @@ -745,49 +642,51 @@ class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): headers.extend(data) return headers + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], name: str ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ simple -> header headers: PoolManager needs a mapping, tuple is close returns headers: dict """ - if self.style: - value = self._serialize_simple(cast_in_data, name, self.explode, False) - return self.__to_headers(((name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self.__to_headers(((name, value),)) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + @classmethod def deserialize( - self, + cls, in_data: str, name: str ) -> Schema: - if self.schema: + if cls.schema: """ simple -> header headers: PoolManager needs a mapping, tuple is close returns headers: dict """ - if self.style: - extracted_data = self._deserialize_simple(in_data, name, self.explode, False) + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) return schema.from_openapi_data_oapg(extracted_data) - # self.content will be length one - for content_type, schema in self.content.items(): - if self._content_type_is_json(content_type): + # cls.content will be length one + for content_type, schema in cls.content.items(): + if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) return schema.from_openapi_data_oapg(cast_in_data) raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) @@ -795,38 +694,16 @@ class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): class HeaderParameter(HeaderParameterWithoutName): name: str - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if name in self.__disallowed_header_names: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.name = name - super().__init__( - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> HTTPHeaderDict: return super().serialize( in_data, - self.name + cls.name ) @@ -939,20 +816,8 @@ T = typing.TypeVar("T") class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): __filename_content_disposition_pattern = re.compile('filename="(.+?)"') response_cls: typing.Type[T] - content: typing.Optional[typing.Dict[str, MediaType]] - headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] - - def __init__( - self, - response_cls: typing.Type[T], - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None @staticmethod def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: @@ -981,8 +846,9 @@ class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): return None return match.group(1) + @classmethod def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse + cls, response: urllib3.HTTPResponse ) -> typing.Union[bytes, io.BufferedReader]: """ urllib3 use cases: @@ -992,8 +858,8 @@ class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): """ if response.supports_chunked_reads(): file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) ) if file_name is None: @@ -1029,14 +895,15 @@ class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): for part in msg.get_payload() } - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> T: + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: Configuration) -> T: content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() deserialized_headers = unset - if self.headers is not None: - self._verify_typed_dict_inputs_oapg(self.response_cls.headers, response.headers) + if cls.headers is not None: + cls._verify_typed_dict_inputs_oapg(cls.response_cls.headers, response.headers) deserialized_headers = {} for header_name, header_param in self.headers.items(): header_value = response.getheader(header_name) @@ -1045,27 +912,27 @@ class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): header_value = header_param.deserialize(header_value, header_name) deserialized_headers[header_name] = header_value - if self.content is not None: - if content_type not in self.content: + if cls.content is not None: + if content_type not in cls.content: raise ApiValueError( f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" ) - body_schema = self.content[content_type].schema + body_schema = cls.content[content_type].schema if body_schema is None: # some specs do not define response content media type schemas - return self.response_cls( + return cls.response_cls( response=response, headers=deserialized_headers, body=unset ) - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) + body_data = cls.__deserialize_application_octet_stream(response) elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) + body_data = cls.__deserialize_multipart_form_data(response) content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) @@ -1074,7 +941,7 @@ class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): elif streamed: response.release_conn() - return self.response_cls( + return cls.response_cls( response=response, headers=deserialized_headers, body=deserialized_body @@ -1446,22 +1313,15 @@ class RequestBody(StyleFormSerializer, JSONDetector): content: content_type to MediaType Schema info """ __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - + @classmethod def __serialize_json( - self, + cls, in_data: typing.Any ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) + in_data = cls.__json_encoder.default(in_data) json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( "utf-8" ) @@ -1479,13 +1339,15 @@ class RequestBody(StyleFormSerializer, JSONDetector): raise ValueError('Unable to serialize type BoolClass to text/plain') return dict(body=str(in_data)) - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) + @classmethod + def __multipart_json_item(cls, key: str, value: Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) request_field = RequestField(name=key, data=json.dumps(json_value)) request_field.make_multipart(content_type='application/json') return request_field - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: + @classmethod + def __multipart_form_item(cls, key: str, value: Schema) -> RequestField: if isinstance(value, str): request_field = RequestField(name=key, data=str(value)) request_field.make_multipart(content_type='text/plain') @@ -1497,11 +1359,12 @@ class RequestBody(StyleFormSerializer, JSONDetector): request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) value.close() else: - request_field = self.__multipart_json_item(key=key, value=value) + request_field = cls.__multipart_json_item(key=key, value=value) return request_field + @classmethod def __serialize_multipart_form_data( - self, in_data: Schema + cls, in_data: Schema ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: if not isinstance(in_data, frozendict.frozendict): raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') @@ -1524,19 +1387,20 @@ class RequestBody(StyleFormSerializer, JSONDetector): if value: # values use explode = True, so the code makes a RequestField for each item with name=key for item in value: - request_field = self.__multipart_form_item(key=key, value=item) + request_field = cls.__multipart_form_item(key=key, value=item) fields.append(request_field) else: # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) + request_field = cls.__multipart_json_item(key=key, value=value) fields.append(request_field) else: - request_field = self.__multipart_form_item(key=key, value=value) + request_field = cls.__multipart_form_item(key=key, value=value) fields.append(request_field) return dict(fields=tuple(fields)) - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: + @staticmethod + def __serialize_application_octet_stream(in_data: BinarySchema) -> typing.Dict[str, bytes]: if isinstance(in_data, bytes): return dict(body=in_data) # FileIO type @@ -1544,8 +1408,9 @@ class RequestBody(StyleFormSerializer, JSONDetector): in_data.close() return result + @classmethod def __serialize_application_x_www_form_data( - self, in_data: typing.Any + cls, in_data: typing.Any ) -> SerializedRequestBody: """ POST submission of form data in body @@ -1553,12 +1418,13 @@ class RequestBody(StyleFormSerializer, JSONDetector): if not isinstance(in_data, frozendict.frozendict): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) + @classmethod def serialize( - self, in_data: typing.Any, content_type: str + cls, in_data: typing.Any, content_type: str ) -> SerializedRequestBody: """ If a str is returned then the result will be assigned to data when making the request @@ -1569,7 +1435,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): - body for application/json - encode_multipart and fields for multipart/form-data """ - media_type = self.content[content_type] + media_type = cls.content[content_type] if isinstance(in_data, media_type.schema): cast_in_data = in_data elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: @@ -1578,14 +1444,14 @@ class RequestBody(StyleFormSerializer, JSONDetector): cast_in_data = media_type.schema(in_data) # TODO check for and use encoding if it exists # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) + return cls.__serialize_text_plain(cast_in_data) elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) + return cls.__serialize_multipart_form_data(cast_in_data) elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) + return cls.__serialize_application_x_www_form_data(cast_in_data) elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) + return cls.__serialize_application_octet_stream(cast_in_data) raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars index 02347abb0c1..255d4dd8ffa 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars @@ -116,20 +116,22 @@ _servers = ( {{#if defaultResponse}} -default_response = response_for_default.response +{{#with defaultResponse}} +default_response = response_for_default.{{#if refClass}}{{refClass}}{{else}}{{name.getCamelCaseName}}{{/if}} +{{/with}} {{/if}} {{#if nonDefaultResponses}} __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { {{#each nonDefaultResponses}} - '{{@key}}': api_client.OpenApiResponse[response_for_{{@key}}.ApiResponse], + '{{@key}}': response_for_{{@key}}.{{#if refClass}}{{refClass}}{{else}}{{name.getCamelCaseName}}{{/if}}, {{/each}} } ) _status_code_to_response = __StatusCodeToResponse({ {{#each nonDefaultResponses}} - '{{@key}}': response_for_{{@key}}.response, + '{{@key}}': response_for_{{@key}}.{{#if refClass}}{{refClass}}{{else}}{{name.getCamelCaseName}}{{/if}}, {{/each}} }) {{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars index 16be1b59f70..f525bfe5d9e 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_body_serialization.handlebars @@ -1,4 +1,4 @@ -serialized_data = request_body.parameter_oapg.serialize(body, content_type) +serialized_data = request_body.{{#if refClass}}{{refClass}}{{else}}{{name.getCamelCaseName}}{{/if}}.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter_schema_and_def.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter_schema_and_def.handlebars index e182a640b59..8f34a30aa17 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter_schema_and_def.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint_parameter_schema_and_def.handlebars @@ -38,6 +38,6 @@ class {{xParamsName}}: parameters = [ {{#each xParams}} - {{#if refModule}}{{refModule}}{{else}}{{name.getSnakeCaseName}}{{/if}}.parameter_oapg, + {{#if refModule}}{{refModule}}{{else}}{{name.getSnakeCaseName}}{{/if}}.{{#if refClass}}{{refClass}}{{else}}{{name.getCamelCaseName}}{{/if}}, {{/each}} ] \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/parameter_instance.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/parameter_instance.handlebars index 0f9e27c18ea..564f0db5daf 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/parameter_instance.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/parameter_instance.handlebars @@ -1,50 +1,49 @@ -parameter_oapg = api_client.{{#if noName}}Header{{/if}}{{#if isQueryParam}}Query{{/if}}{{#if isPathParam}}Path{{/if}}{{#if isHeaderParam}}Header{{/if}}{{#if isCookieParam}}Cookie{{/if}}Parameter{{#if noName}}WithoutName{{/if}}( +class {{name.getCamelCaseName}}(api_client.{{#if noName}}Header{{/if}}{{#if isQueryParam}}Query{{/if}}{{#if isPathParam}}Path{{/if}}{{#if isHeaderParam}}Header{{/if}}{{#if isCookieParam}}Cookie{{/if}}Parameter{{#if noName}}WithoutName{{/if}}): {{#unless noName}} - name="{{baseName}}", + name = "{{baseName}}" {{/unless}} {{#if style}} {{#eq style "matrix"}} - style=api_client.ParameterStyle.MATRIX, + style = api_client.ParameterStyle.MATRIX {{/eq}} {{#eq style "label"}} - style=api_client.ParameterStyle.LABEL, + style = api_client.ParameterStyle.LABEL {{/eq}} {{#eq style "form"}} - style=api_client.ParameterStyle.FORM, + style = api_client.ParameterStyle.FORM {{/eq}} {{#eq style "simple"}} - style=api_client.ParameterStyle.SIMPLE, + style = api_client.ParameterStyle.SIMPLE {{/eq}} {{#eq style "spaceDelimited"}} - style=api_client.ParameterStyle.SPACE_DELIMITED, + style = api_client.ParameterStyle.SPACE_DELIMITED {{/eq}} {{#eq style "pipeDelimited"}} - style=api_client.ParameterStyle.PIPE_DELIMITED, + style=api_client.ParameterStyle.PIPE_DELIMITED {{/eq}} {{#eq style "deepObject"}} - style=api_client.ParameterStyle.DEEP_OBJECT, + style=api_client.ParameterStyle.DEEP_OBJECT {{/eq}} {{/if}} {{#if schema}} {{#with schema}} {{#if getRefModule}} - schema={{getRefModule}}.{{getRefClass}}, + schema = {{getRefModule}}.{{getRefClass}} {{else}} - schema={{name.getSnakeCaseName}}.{{name.getCamelCaseName}}, + schema = {{name.getSnakeCaseName}}.{{name.getCamelCaseName}} {{/if}} {{/with}} {{/if}} {{#if getContent}} - content={ + content = { {{#each getContent}} "{{@key}}": {{#with this}}{{#with schema}}{{#if getRefModule}}{{getRefModule}}.{{getRefClass}}{{else}}{{name.getSnakeCaseName}}.{{name.getCamelCaseName}}{{/if}}{{/with}}{{/with}}, {{/each}} - }, + } {{/if}} {{#if required}} - required=True, + required = True {{/if}} {{#if isExplode}} - explode=True, + explode = True {{/if}} -) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/request_body.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/request_body.handlebars index 8d5e91fb7e5..0695618736a 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/request_body.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/request_body.handlebars @@ -15,8 +15,8 @@ from . import {{name.getSnakeCaseName}} {{/with}} {{/each}} -parameter_oapg = api_client.RequestBody( - content={ +class {{name.getCamelCaseName}}(api_client.RequestBody): + content = { {{#each content}} '{{{@key}}}': api_client.MediaType( {{#with this}} @@ -30,9 +30,8 @@ parameter_oapg = api_client.RequestBody( {{/with}} ), {{/each}} - }, + } {{#if required}} - required=True, + required = True {{/if}} -) {{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/response.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/response.handlebars index 5ca496ceb26..8b043c610b0 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/response.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/response.handlebars @@ -87,11 +87,11 @@ class ApiResponse(api_client.ApiResponse): {{/unless}} -response = api_client.OpenApiResponse( - response_cls=ApiResponse, +class {{name.getCamelCaseName}}(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse {{#each content}} {{#if @first}} - content={ + content = { {{/if}} '{{{@key}}}': api_client.MediaType( {{#if this.schema}} @@ -105,11 +105,10 @@ response = api_client.OpenApiResponse( {{/if}} ), {{#if @last}} - }, + } {{/if}} {{/each}} {{#if headers}} headers=Header.parameters {{/if}} -) {{/with}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/response_header_schema_and_def.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/response_header_schema_and_def.handlebars index e4d1dc299b6..4e166b3ea37 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/response_header_schema_and_def.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/response_header_schema_and_def.handlebars @@ -42,6 +42,6 @@ class {{xParamsName}}: parameters = [ {{#each xParams}} - {{#if refModule}}{{refModule}}{{else}}{{name.getSnakeCaseName}}{{/if}}.parameter_oapg, + {{#if refModule}}{{refModule}}{{else}}{{name.getSnakeCaseName}}{{/if}}.{{#if refClass}}{{refClass}}{{else}}{{name.getCamelCaseName}}{{/if}}, {{/each}} ] \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py index 67adf403f9c..26642aff7aa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py @@ -118,10 +118,6 @@ def __next__(self): class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - @staticmethod def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): """ @@ -283,13 +279,8 @@ def _ref6570_expansion( class StyleFormSerializer(ParameterSerializerBase): @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - def _serialize_form( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, @@ -298,7 +289,7 @@ def _serialize_form( ) -> str: if prefix_separator_iterator is None: prefix_separator_iterator = PrefixSeparatorIterator('', '&') - return self._ref6570_expansion( + return cls._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, @@ -309,15 +300,16 @@ def _serialize_form( class StyleSimpleSerializer(ParameterSerializerBase): + @classmethod def _serialize_simple( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, percent_encode: bool ) -> str: prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( + return cls._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, @@ -325,8 +317,9 @@ def _serialize_simple( prefix_separator_iterator=prefix_separator_iterator ) + @classmethod def _deserialize_simple( - self, + cls, in_data: str, name: str, explode: bool, @@ -365,144 +358,88 @@ class ParameterBase(JSONDetector): schema: typing.Optional[typing.Type[Schema]] content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } _json_encoder = JSONEncoder() - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + @classmethod def _serialize_json( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], eliminate_whitespace: bool = False ) -> str: if eliminate_whitespace: - return json.dumps(in_data, separators=self._json_encoder.compact_separators) + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) return json.dumps(in_data) class PathParameter(ParameterBase, StyleSimpleSerializer): name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - self.name = name - super().__init__( - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def __serialize_label( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_matrix( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_simple( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], ) -> typing.Dict[str, str]: - value = self._serialize_simple( + value = cls._serialize_simple( in_data=in_data, - name=self.name, - explode=self.explode, + name=cls.name, + explode=cls.explode, percent_encode=True ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ simple -> path path: @@ -512,115 +449,103 @@ def serialize( matrix -> path returns path_params """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class QueryParameter(ParameterBase, StyleFormSerializer): name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - self.name = name - super().__init__( - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def __serialize_space_delimited( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_pipe_delimited( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_form( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( in_data, - name=self.name, - explode=self.explode, + name=cls.name, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if self.style is ParameterStyle.FORM: + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: + elif cls.style is ParameterStyle.SPACE_DELIMITED: return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: + elif cls.style is ParameterStyle.PIPE_DELIMITED: return PrefixSeparatorIterator('', '|') + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ form -> query query: @@ -634,111 +559,83 @@ def serialize( deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 returns fields """ - if self.style: + if cls.style: # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - for content_type, schema in self.content.items(): + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data, eliminate_whitespace=True) - return self._to_dict( - self.name, - next(prefix_separator_iterator) + self.name + '=' + quote(value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + quote(value) ) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class CookieParameter(ParameterBase, StyleFormSerializer): name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - self.name = name - super().__init__( - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ form -> cookie returns fields: tuple """ - if self.style: + if cls.style: """ TODO add escaping of comma, space, equals or turn encoding on """ - value = self._serialize_form( + value = cls._serialize_form( cast_in_data, - explode=self.explode, - name=self.name, + explode=cls.explode, + name=cls.name, percent_encode=False, prefix_separator_iterator=PrefixSeparatorIterator('', '&') ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None @staticmethod def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: @@ -749,49 +646,51 @@ def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHead headers.extend(data) return headers + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], name: str ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ simple -> header headers: PoolManager needs a mapping, tuple is close returns headers: dict """ - if self.style: - value = self._serialize_simple(cast_in_data, name, self.explode, False) - return self.__to_headers(((name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self.__to_headers(((name, value),)) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + @classmethod def deserialize( - self, + cls, in_data: str, name: str ) -> Schema: - if self.schema: + if cls.schema: """ simple -> header headers: PoolManager needs a mapping, tuple is close returns headers: dict """ - if self.style: - extracted_data = self._deserialize_simple(in_data, name, self.explode, False) + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) return schema.from_openapi_data_oapg(extracted_data) - # self.content will be length one - for content_type, schema in self.content.items(): - if self._content_type_is_json(content_type): + # cls.content will be length one + for content_type, schema in cls.content.items(): + if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) return schema.from_openapi_data_oapg(cast_in_data) raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) @@ -799,38 +698,16 @@ def deserialize( class HeaderParameter(HeaderParameterWithoutName): name: str - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if name in self.__disallowed_header_names: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.name = name - super().__init__( - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> HTTPHeaderDict: return super().serialize( in_data, - self.name + cls.name ) @@ -943,20 +820,8 @@ def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict] class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): __filename_content_disposition_pattern = re.compile('filename="(.+?)"') response_cls: typing.Type[T] - content: typing.Optional[typing.Dict[str, MediaType]] - headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] - - def __init__( - self, - response_cls: typing.Type[T], - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None @staticmethod def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: @@ -985,8 +850,9 @@ def __file_name_from_content_disposition(cls, content_disposition: typing.Option return None return match.group(1) + @classmethod def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse + cls, response: urllib3.HTTPResponse ) -> typing.Union[bytes, io.BufferedReader]: """ urllib3 use cases: @@ -996,8 +862,8 @@ def __deserialize_application_octet_stream( """ if response.supports_chunked_reads(): file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) ) if file_name is None: @@ -1033,14 +899,15 @@ def __deserialize_multipart_form_data( for part in msg.get_payload() } - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> T: + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: Configuration) -> T: content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() deserialized_headers = unset - if self.headers is not None: - self._verify_typed_dict_inputs_oapg(self.response_cls.headers, response.headers) + if cls.headers is not None: + cls._verify_typed_dict_inputs_oapg(cls.response_cls.headers, response.headers) deserialized_headers = {} for header_name, header_param in self.headers.items(): header_value = response.getheader(header_name) @@ -1049,27 +916,27 @@ def deserialize(self, response: urllib3.HTTPResponse, configuration: Configurati header_value = header_param.deserialize(header_value, header_name) deserialized_headers[header_name] = header_value - if self.content is not None: - if content_type not in self.content: + if cls.content is not None: + if content_type not in cls.content: raise ApiValueError( f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" ) - body_schema = self.content[content_type].schema + body_schema = cls.content[content_type].schema if body_schema is None: # some specs do not define response content media type schemas - return self.response_cls( + return cls.response_cls( response=response, headers=deserialized_headers, body=unset ) - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) + body_data = cls.__deserialize_application_octet_stream(response) elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) + body_data = cls.__deserialize_multipart_form_data(response) content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) @@ -1078,7 +945,7 @@ def deserialize(self, response: urllib3.HTTPResponse, configuration: Configurati elif streamed: response.release_conn() - return self.response_cls( + return cls.response_cls( response=response, headers=deserialized_headers, body=deserialized_body @@ -1436,22 +1303,15 @@ class RequestBody(StyleFormSerializer, JSONDetector): content: content_type to MediaType Schema info """ __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - + @classmethod def __serialize_json( - self, + cls, in_data: typing.Any ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) + in_data = cls.__json_encoder.default(in_data) json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( "utf-8" ) @@ -1469,13 +1329,15 @@ def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: raise ValueError('Unable to serialize type BoolClass to text/plain') return dict(body=str(in_data)) - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) + @classmethod + def __multipart_json_item(cls, key: str, value: Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) request_field = RequestField(name=key, data=json.dumps(json_value)) request_field.make_multipart(content_type='application/json') return request_field - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: + @classmethod + def __multipart_form_item(cls, key: str, value: Schema) -> RequestField: if isinstance(value, str): request_field = RequestField(name=key, data=str(value)) request_field.make_multipart(content_type='text/plain') @@ -1487,11 +1349,12 @@ def __multipart_form_item(self, key: str, value: Schema) -> RequestField: request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) value.close() else: - request_field = self.__multipart_json_item(key=key, value=value) + request_field = cls.__multipart_json_item(key=key, value=value) return request_field + @classmethod def __serialize_multipart_form_data( - self, in_data: Schema + cls, in_data: Schema ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: if not isinstance(in_data, frozendict.frozendict): raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') @@ -1514,19 +1377,20 @@ def __serialize_multipart_form_data( if value: # values use explode = True, so the code makes a RequestField for each item with name=key for item in value: - request_field = self.__multipart_form_item(key=key, value=item) + request_field = cls.__multipart_form_item(key=key, value=item) fields.append(request_field) else: # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) + request_field = cls.__multipart_json_item(key=key, value=value) fields.append(request_field) else: - request_field = self.__multipart_form_item(key=key, value=value) + request_field = cls.__multipart_form_item(key=key, value=value) fields.append(request_field) return dict(fields=tuple(fields)) - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: + @staticmethod + def __serialize_application_octet_stream(in_data: BinarySchema) -> typing.Dict[str, bytes]: if isinstance(in_data, bytes): return dict(body=in_data) # FileIO type @@ -1534,8 +1398,9 @@ def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing. in_data.close() return result + @classmethod def __serialize_application_x_www_form_data( - self, in_data: typing.Any + cls, in_data: typing.Any ) -> SerializedRequestBody: """ POST submission of form data in body @@ -1543,12 +1408,13 @@ def __serialize_application_x_www_form_data( if not isinstance(in_data, frozendict.frozendict): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) + @classmethod def serialize( - self, in_data: typing.Any, content_type: str + cls, in_data: typing.Any, content_type: str ) -> SerializedRequestBody: """ If a str is returned then the result will be assigned to data when making the request @@ -1559,7 +1425,7 @@ def serialize( - body for application/json - encode_multipart and fields for multipart/form-data """ - media_type = self.content[content_type] + media_type = cls.content[content_type] if isinstance(in_data, media_type.schema): cast_in_data = in_data elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: @@ -1568,14 +1434,14 @@ def serialize( cast_in_data = media_type.schema(in_data) # TODO check for and use encoding if it exists # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) + return cls.__serialize_text_plain(cast_in_data) elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) + return cls.__serialize_multipart_form_data(cast_in_data) elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) + return cls.__serialize_application_x_www_form_data(cast_in_data) elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) + return cls.__serialize_application_octet_stream(cast_in_data) raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py index bd1efdf1751..1202b1cb060 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi index b6ba113f129..e4a3bd3e7f5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/__init__.py index a72b627b432..a75ff83ff8e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import additionalproperties_allows_a_schema_which_should_validate -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py index 05027390205..9ab40fd2f45 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi index 3914ffb3503..b77d4b59d31 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/__init__.py index 5a6f781a2d7..ddb7179f791 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import additionalproperties_are_allowed_by_default -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=additionalproperties_are_allowed_by_default.AdditionalpropertiesAreAllowedByDefault, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py index 63a3a2a9eaf..2f11fecf84e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi index 27890ebddbb..55476520447 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/__init__.py index 72dfed157d6..c87a28c8c0f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import additionalproperties_can_exist_by_itself -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=additionalproperties_can_exist_by_itself.AdditionalpropertiesCanExistByItself, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py index c2fe3403f8a..136e5e6557b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi index 117014734fe..102fd2539f6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/__init__.py index 8a6e3b2c25c..040563c12b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import additionalproperties_should_not_look_in_applicators -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=additionalproperties_should_not_look_in_applicators.AdditionalpropertiesShouldNotLookInApplicators, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py index 72ebcddf4bf..7e6d3482155 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi index a2c5481d0c8..a390f9ea78c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/__init__.py index 70ca38ecd9c..602fc8400dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import allof_combined_with_anyof_oneof -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=allof_combined_with_anyof_oneof.AllofCombinedWithAnyofOneof, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py index 3e4f851ea1b..d0122891b53 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi index c4cab2b3ab1..27b5c846a61 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/__init__.py index bb90f5ab534..c18c6efb1ee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import allof -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=allof.Allof, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py index 510dd338b16..728b40af863 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi index 482b4a58c8c..284eb1727c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/__init__.py index 7a4ded49258..6f0a7668887 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import allof_simple_types -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=allof_simple_types.AllofSimpleTypes, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py index 5b968eb560c..52723a6ce29 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi index aa50a4a36f5..370a07f6414 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/__init__.py index 5f18ebf7d58..8e81a6fc6c7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import allof_with_base_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=allof_with_base_schema.AllofWithBaseSchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py index f0b525da15d..d19688e69a4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi index dac8653e5b4..dc285cfc6d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/__init__.py index 7c0a8f09195..56f87a3c16d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import allof_with_one_empty_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=allof_with_one_empty_schema.AllofWithOneEmptySchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py index 8a55f3720f2..92159acfc03 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi index 5b221b878f6..31f5529e63c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/__init__.py index aa217528cd3..99b7e34998b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import allof_with_the_first_empty_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=allof_with_the_first_empty_schema.AllofWithTheFirstEmptySchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py index 33c6e3a83b9..0402e040131 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi index 73e8fa734c2..bceb7bdb7e6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/__init__.py index 22739556acb..6238a08bc22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import allof_with_the_last_empty_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=allof_with_the_last_empty_schema.AllofWithTheLastEmptySchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py index 2aad29de665..243d19cd531 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi index 679ae79c8ec..6c2838cfa17 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/__init__.py index 7a24a40f30f..cb0d7c2a32c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import allof_with_two_empty_schemas -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=allof_with_two_empty_schemas.AllofWithTwoEmptySchemas, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py index a6926045fe6..4c1c0f2f8bb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi index 54073434976..d86758afc04 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/__init__.py index 562ca51990e..37ed5c17879 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import anyof_complex_types -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=anyof_complex_types.AnyofComplexTypes, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py index ce1eb69932b..ca8be418056 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi index ff832b8096a..b9f75a054b0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/__init__.py index eab2c69eccf..129df3f4644 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import anyof -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=anyof.Anyof, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py index 4fbbd7d4b3c..045f04609d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi index d206013df1b..a1ee771747d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/__init__.py index 7fd77204d71..ef5678e4324 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import anyof_with_base_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=anyof_with_base_schema.AnyofWithBaseSchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py index 9556cd8cab0..f922785121a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi index d0133809dae..35364689b36 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/__init__.py index 3f6a5b38634..8a25d2fcc13 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import anyof_with_one_empty_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=anyof_with_one_empty_schema.AnyofWithOneEmptySchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py index b32430cbb40..00075979e20 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi index 7c96751f143..4ce30fe432b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/__init__.py index ba4abe309ff..8c7b0703d17 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import array_type_matches_arrays -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=array_type_matches_arrays.ArrayTypeMatchesArrays, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py index be84883c3ce..e0e8d2d333b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi index c4a25a68b68..9246492a0c7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/__init__.py index 4194ebd815c..0f90edd37f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import boolean_type_matches_booleans -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=boolean_type_matches_booleans.BooleanTypeMatchesBooleans, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py index 8a5a68feee2..8a5453c2e35 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi index d3c3f2f8e03..303494fcefa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/__init__.py index fbc0377155a..01e9912e204 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import by_int -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=by_int.ByInt, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py index 53bf5ad4389..e0403106527 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi index 0708b4c9ab1..1c52970d159 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/__init__.py index 74b7ad57583..9884ca627bf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import by_number -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=by_number.ByNumber, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py index 585a6617c61..b8fa20b1490 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi index 4f0c4693a3e..ed00ef66093 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/__init__.py index a7577d6f028..e7519b2b55e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import by_small_number -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=by_small_number.BySmallNumber, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py index 1dd9d635124..4dad6f2b3e1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi index 62a844e610d..0d319f0fe3d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/__init__.py index 1dded700694..217997d48a0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import date_time_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=date_time_format.DateTimeFormat, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py index c4f06cd2a2f..71da6dc9818 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi index b9df725d62f..fa9121be33b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/__init__.py index b47c51def94..15473639bde 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import email_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=email_format.EmailFormat, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py index 9e87391a1a1..a588ff7bfc3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi index 91f38fbda0e..c1d684aa370 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/__init__.py index 912a6b8b94f..97a98a48b4d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import enum_with0_does_not_match_false -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=enum_with0_does_not_match_false.EnumWith0DoesNotMatchFalse, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py index 37e227a31c5..93ec3852067 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi index 8aba08c3588..41f80fb9f4c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/__init__.py index 356d671bdba..4e3f3a7d4c2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import enum_with1_does_not_match_true -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=enum_with1_does_not_match_true.EnumWith1DoesNotMatchTrue, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py index 24e67543b5e..d331c44e686 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi index 7086c1c82f5..b0298a693f0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/__init__.py index 4376f2a81ef..2a61385706f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import enum_with_escaped_characters -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=enum_with_escaped_characters.EnumWithEscapedCharacters, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py index e8875ba240a..f5bd16125d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi index 2e14a391b7c..ee81db8fc09 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/__init__.py index cb8b3efedd6..4f2ef74df5f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import enum_with_false_does_not_match0 -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=enum_with_false_does_not_match0.EnumWithFalseDoesNotMatch0, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py index 6b3ec9a4f03..ed32ae7eb54 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi index 0a684ee1f65..96413719084 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/__init__.py index 64a673a0635..d81bb0d9a68 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import enum_with_true_does_not_match1 -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=enum_with_true_does_not_match1.EnumWithTrueDoesNotMatch1, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py index 313043ff833..a3387dd4670 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi index b06d397d10e..9bfd225c1ea 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/__init__.py index 676a9001241..086da2dc5eb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import enums_in_properties -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=enums_in_properties.EnumsInProperties, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py index cdfa633dbad..80d16348bfd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi index 054abaf8351..707eb316382 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/__init__.py index 79d64630cd9..4ed1532ab14 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import forbidden_property -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=forbidden_property.ForbiddenProperty, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py index dc657c2a777..7a3bd961266 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi index 0233f15a7d2..fbbb903a091 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/__init__.py index 8e53e0c986c..f248948bfca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import hostname_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=hostname_format.HostnameFormat, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py index 5003d2ce750..c75e5d1ea3a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi index 9181985086b..ae2cba02a46 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/__init__.py index 93b1a584ba9..69bf33447bc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import integer_type_matches_integers -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=integer_type_matches_integers.IntegerTypeMatchesIntegers, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py index 084e9561bce..d21a67e4137 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi index 772a5cd6063..efa1bd776e7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/__init__.py index 57c44a5e5d2..4cb21a29d53 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import invalid_instance_should_not_raise_error_when_float_division_inf -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=invalid_instance_should_not_raise_error_when_float_division_inf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py index 56da6b6bb6c..27a096b0f85 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi index ecdfffc2533..1fdd2797070 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/__init__.py index f90298a6424..671a5aac67b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import invalid_string_value_for_default -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=invalid_string_value_for_default.InvalidStringValueForDefault, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py index f7679bfca84..2f53cc553cc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi index cd431a6d15b..899dcc7b4cd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/__init__.py index 62dae5ef1cf..973e702551b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ipv4_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ipv4_format.Ipv4Format, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py index 600860662e6..c3862aa8ab8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi index 1818e919be8..93114f6e549 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/__init__.py index ff9c4f13565..5b918dc1d22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ipv6_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ipv6_format.Ipv6Format, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py index 3273c86d0e6..ea82f5fce37 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi index f85a39b21f2..7bbea7b613c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/__init__.py index d9143b94aeb..a7f32fe6217 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import json_pointer_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=json_pointer_format.JsonPointerFormat, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py index b5dc7dbb899..e723b976c44 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi index bac08837e61..a5da258a44f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/__init__.py index 6f7cac9d786..2b8cfe7abe5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import maximum_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=maximum_validation.MaximumValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py index a880e16ca9e..b62ca470caa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi index d8ca7be93ef..bdd98ef8adb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/__init__.py index 258e52df635..fb10053fc44 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import maximum_validation_with_unsigned_integer -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=maximum_validation_with_unsigned_integer.MaximumValidationWithUnsignedInteger, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py index f8cc8ee3510..b5322ba9289 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi index 55db2338c7f..40373ad2129 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/__init__.py index 1e361bd8f8e..fd60863848b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import maxitems_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=maxitems_validation.MaxitemsValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py index feb13b12f13..d94abe9c731 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi index 5abbca33902..490079cdd37 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/__init__.py index 880ba237956..c76bb79aca1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import maxlength_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=maxlength_validation.MaxlengthValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py index f9f011e9c67..89f1be29082 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi index 64acdec7cd6..830eabd8b1d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/__init__.py index ed7c5b1e562..0f85e3c0d2e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import maxproperties0_means_the_object_is_empty -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=maxproperties0_means_the_object_is_empty.Maxproperties0MeansTheObjectIsEmpty, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py index 0c5082159cf..4cf2cd29d08 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi index 11e891acc43..24a99c861d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/__init__.py index 1c4b3f85ca9..809358e6a91 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import maxproperties_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=maxproperties_validation.MaxpropertiesValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py index cca5ef3ab02..34acdcb76f7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi index 4e88eb30b81..df42d1ac24c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/__init__.py index d0e0d702e07..9a37f654039 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import minimum_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=minimum_validation.MinimumValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py index 1c5c06b04aa..8b61ae7829a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi index 041f98a8235..6db32998439 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/__init__.py index c5f25634a4c..11b168721d9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import minimum_validation_with_signed_integer -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=minimum_validation_with_signed_integer.MinimumValidationWithSignedInteger, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py index 39c086fb294..4f4755ce124 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi index aa41d286116..66f2caa3074 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/__init__.py index f7f8eb94319..4fe911e4a00 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import minitems_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=minitems_validation.MinitemsValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py index cd5762ff8df..99ebca1145d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi index 1c3b97488e7..e4387af2694 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/__init__.py index c0703505ac3..85523d76f87 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import minlength_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=minlength_validation.MinlengthValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py index 363837becdd..b7b62317241 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi index 0a51e505edc..1609813daa6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/__init__.py index 6fd429049f7..d6fdb34f5e6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import minproperties_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=minproperties_validation.MinpropertiesValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py index c7748353b63..6945e5add6c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi index 51532da44a1..ceaa7f9c494 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/__init__.py index e9c42614ce8..6036c8e0396 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import nested_allof_to_check_validation_semantics -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=nested_allof_to_check_validation_semantics.NestedAllofToCheckValidationSemantics, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py index 7c1695d647a..8737065caf3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi index 3bf88d04089..96d2cd40082 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/__init__.py index b609573cc8e..2c64e8dcfcd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import nested_anyof_to_check_validation_semantics -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=nested_anyof_to_check_validation_semantics.NestedAnyofToCheckValidationSemantics, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py index 9b12ea6285a..32117eedec1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi index 938d1dc9817..5e6acb6cdda 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/__init__.py index 771e27178c5..02d7d80cd13 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import nested_items -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=nested_items.NestedItems, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py index 617a75d7962..fec29342dae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi index 96e64ffd2d8..da1a089c273 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/__init__.py index e86168b096d..7c4feabd018 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import nested_oneof_to_check_validation_semantics -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=nested_oneof_to_check_validation_semantics.NestedOneofToCheckValidationSemantics, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py index f79ee1694d4..61e24805bed 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi index 0e3255f1a04..b2924428726 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/__init__.py index c141a11c7d4..f7f0fc0970b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import not_more_complex_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=not_more_complex_schema.NotMoreComplexSchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py index d4c3791854d..6e9bc669c24 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi index b7056919429..cf951101117 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/request_body/__init__.py index bac646a6f54..4b8d3efae18 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import _not -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=_not._Not, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py index 8e99cf9e101..aec11be0cb8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi index 11aee031ac6..a07e3f44808 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/__init__.py index 3b5bb2c0991..22bbb68a942 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import nul_characters_in_strings -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=nul_characters_in_strings.NulCharactersInStrings, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py index 13933f1c063..44cd360be66 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi index 99c936d5e53..f1b4574a13a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/__init__.py index ab28924c088..58b1676afda 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import null_type_matches_only_the_null_object -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=null_type_matches_only_the_null_object.NullTypeMatchesOnlyTheNullObject, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py index 3bbf02d1f82..0bfcc505000 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi index dbaa8f270c3..a2df6da3484 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/__init__.py index 352bbd6917c..7fff29ef8e8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import number_type_matches_numbers -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=number_type_matches_numbers.NumberTypeMatchesNumbers, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py index 2b1c3a516d2..03db84b5f30 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi index d58f81e7d19..356f4fb2876 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/__init__.py index d3475d5d841..6988c7f087e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import object_properties_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=object_properties_validation.ObjectPropertiesValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py index 50f17f89b1f..e50043e4a79 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi index 91417b42766..0d1aac1aed5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/__init__.py index 814d02a73b4..10524ddf2dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import object_type_matches_objects -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=object_type_matches_objects.ObjectTypeMatchesObjects, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py index ed12ce85b4b..6ec805e1a0d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi index 4859475d033..3ed16f86073 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/__init__.py index 92e5a1a2b7d..6b7d21e495c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import oneof_complex_types -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=oneof_complex_types.OneofComplexTypes, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py index f4a4f9b2a7b..913b82e5afb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi index 4ab41398c11..78645c1df18 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/__init__.py index 273a40c2105..f022450ad0c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import oneof -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=oneof.Oneof, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py index c86eebaed5e..b51e89040ff 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi index b09be0f94da..7ea6f9a84d3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/__init__.py index f293ca33448..211aaded878 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import oneof_with_base_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=oneof_with_base_schema.OneofWithBaseSchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py index e47a888bcf8..39d4b7e12bd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi index d4bfcb09adc..145980a3758 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/__init__.py index e329bb470f2..900f5b0b2cb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import oneof_with_empty_schema -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=oneof_with_empty_schema.OneofWithEmptySchema, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py index 6562fcbb683..c91d07043d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi index dbc9902e19e..3e7f66c31a5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/__init__.py index 8900552dd2f..15c38f2c298 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import oneof_with_required -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=oneof_with_required.OneofWithRequired, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py index 5cfdb330b4c..8f932d6e641 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi index 8d165251132..e30a8ea20d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/__init__.py index d9270cc15d8..e0cd6c62630 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import pattern_is_not_anchored -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=pattern_is_not_anchored.PatternIsNotAnchored, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py index b8ad27d06e1..1d78b5138be 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi index aa0681bb118..cc443f568af 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/__init__.py index 5eff7e88a0f..757903865a0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import pattern_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=pattern_validation.PatternValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py index 63d16a59164..57f25545823 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi index c9b87eee0fd..029b65ad24f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/__init__.py index 8095aabfbb5..6f5577b4570 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import properties_with_escaped_characters -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=properties_with_escaped_characters.PropertiesWithEscapedCharacters, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py index a45cd8f600f..00a452d91f4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi index e91ed98bb50..76ec1dae231 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/__init__.py index f34f528cfcc..7dbfff68023 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py index c610642f293..0993a06f770 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi index 50152a6b5dd..5412e5d47c5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/__init__.py index d7e84d8a61d..a28a65a7fa1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ref_in_additionalproperties -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ref_in_additionalproperties.RefInAdditionalproperties, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py index 28881b075ee..6e843c40c5b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi index bbfb0b585b0..bb9a0902ca5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/__init__.py index 96837ca5fde..15654946025 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ref_in_allof -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ref_in_allof.RefInAllof, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py index 1e54a29488d..ead957d3b79 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi index d83599f15d5..775fa28f96b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/__init__.py index 566f8b6f5cd..3779320a7f2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ref_in_anyof -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ref_in_anyof.RefInAnyof, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py index d1d7334ecdd..d4f2ebe055a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi index 7329c9497f0..99d21bc8c8b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/__init__.py index 9fdc7b4125c..99b41dc0d65 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ref_in_items -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ref_in_items.RefInItems, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py index 052efdec3aa..3e5657016dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi index 44018b5f838..b1daa768c5f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/__init__.py index 30f6ca0847d..33a973debaf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ref_in_not -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ref_in_not.RefInNot, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py index eb968c0cd67..568b2b0f888 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi index c06c735f93c..fad2565f801 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/__init__.py index 3104d4a2f13..b86ea61a91d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ref_in_oneof -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ref_in_oneof.RefInOneof, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py index 3af11d32e3f..04643c4fbb4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi index d05885ebf4f..c421d37e375 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/__init__.py index 3df30df223a..d09e394446c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import ref_in_property -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=ref_in_property.RefInProperty, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py index bd6e41b857f..6ee46ed00f6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi index 1dfaf893b90..e6706b3a4b6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/__init__.py index 4d0706f5ddc..6715ea0fdc3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import required_default_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=required_default_validation.RequiredDefaultValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py index 67c185903ff..38425470a09 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi index a8a722d0fd7..ae8358a3440 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/__init__.py index 338eff12553..70eef43f3fd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import required_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=required_validation.RequiredValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py index 0f856dc2498..65b7b054064 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi index b04964e92dc..4105412d179 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/__init__.py index 971e2e05a64..8ec63e969ff 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import required_with_empty_array -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=required_with_empty_array.RequiredWithEmptyArray, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py index 4651ff9c5f6..0ac25b19c67 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi index 95e5636c0e5..81c86eb249c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/__init__.py index 38606c390bf..a06dad1be6e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import required_with_escaped_characters -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=required_with_escaped_characters.RequiredWithEscapedCharacters, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py index 13345671657..595b87fcd65 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi index c563ff3b693..a23c2a49820 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/__init__.py index 6c69cf2cb49..8a284c3060c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import simple_enum_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=simple_enum_validation.SimpleEnumValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py index 70128ada77e..d2e4bfe25ad 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi index 91d76e4b3b8..e94075f6eb1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/__init__.py index 4362d7acdfd..ff3fe62366e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import string_type_matches_strings -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=string_type_matches_strings.StringTypeMatchesStrings, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py index 43da9dbb6d3..89d3fd1a36f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi index e51d6b12a04..645977914c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/__init__.py index 29b7702d87f..273ce23209d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import the_default_keyword_does_not_do_anything_if_the_property_is_missing -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=the_default_keyword_does_not_do_anything_if_the_property_is_missing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py index e06c7e6eeb1..31a7e3c72a4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi index 4b293049c1b..15a6ebf8537 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/__init__.py index 7701e5d99ff..a2d54ae62de 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import uniqueitems_false_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=uniqueitems_false_validation.UniqueitemsFalseValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py index 769def81ce8..e955862522e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi index b20c85d8aa1..24f00e847c6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/__init__.py index 47865712506..c36cc6d002c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import uniqueitems_validation -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=uniqueitems_validation.UniqueitemsValidation, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py index 4ba9662f3c8..c88ab4223d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi index f3911d4a39d..f46be38365d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/__init__.py index 9fc9999e3ee..205e33b96e2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import uri_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=uri_format.UriFormat, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py index d60870215d2..59be165b6f1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi index 4ce8a6a283d..8396b45cc14 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/__init__.py index d58bc3cfa68..ca17679d12f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import uri_reference_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=uri_reference_format.UriReferenceFormat, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py index 51e6034545b..061ee340585 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi index 3504e478aeb..431c0a8e4f1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/__init__.py index 22b6824e7db..efb2c728d18 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/request_body/__init__.py @@ -10,11 +10,10 @@ from unit_test_api.components.schema import uri_template_format -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=uri_template_format.UriTemplateFormat, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/response_for_200/__init__.py index 2bc1e877079..2c6719d0e2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py index ea1040a296f..79b46b736d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/response_for_200/__init__.py index 9944ecb1769..bcfd0d12ef7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py index 95ddafff27d..8a440c4c548 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/response_for_200/__init__.py index 1be3fad78b9..824944bdc63 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( additionalproperties_are_allowed_by_default.AdditionalpropertiesAreAllowedByDefault, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py index 9ed002fc731..7f64230cb2f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/response_for_200/__init__.py index 6889889f9eb..d44454e9024 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( additionalproperties_can_exist_by_itself.AdditionalpropertiesCanExistByItself, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py index db2c05f8d5e..a39b3dbce8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/response_for_200/__init__.py index 52cc0bc740c..f7d476c3ced 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( additionalproperties_should_not_look_in_applicators.AdditionalpropertiesShouldNotLookInApplicators, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py index dfaacbf762a..d86d6772c7f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/response_for_200/__init__.py index 66de0bb760f..ff0397a4aad 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( allof_combined_with_anyof_oneof.AllofCombinedWithAnyofOneof, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py index b7739a5fa72..00fd4730d6c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/response_for_200/__init__.py index 717490ea1c2..52efaee75d7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( allof.Allof, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py index dbbe0896ba9..72f4d29f73c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/response_for_200/__init__.py index e6528563c98..85581756623 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( allof_simple_types.AllofSimpleTypes, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py index 83557443563..862837e6554 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py index 2b9eb3264ed..ab69119694d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( allof_with_base_schema.AllofWithBaseSchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py index 3f69c27ed24..69ddd6070b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py index 805b62d09cd..5077bbb4d73 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( allof_with_one_empty_schema.AllofWithOneEmptySchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py index 774aa8b477e..bea523ae029 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py index 39425fdc82b..9e331525a9f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( allof_with_the_first_empty_schema.AllofWithTheFirstEmptySchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py index c3525c2506f..b68e2fd4721 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py index 236b0f54894..31fd913cba3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( allof_with_the_last_empty_schema.AllofWithTheLastEmptySchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py index 935980d76a6..03daeeb9f53 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/response_for_200/__init__.py index 4a954e93bdd..41601d243c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( allof_with_two_empty_schemas.AllofWithTwoEmptySchemas, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py index e7864564ef6..5555bc17746 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/response_for_200/__init__.py index 451f5a35eb9..e6ad923ad6d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( anyof_complex_types.AnyofComplexTypes, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py index aca20d679c2..64d0cf2fe4f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/response_for_200/__init__.py index fcb2861f8be..b0028e25f2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( anyof.Anyof, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py index 1aa79848664..b0e0d40547f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py index 534761c9767..6e5339e062d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( anyof_with_base_schema.AnyofWithBaseSchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py index dd9406b5200..1ff66855da0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py index 199b28e6dd2..d8169fdab20 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( anyof_with_one_empty_schema.AnyofWithOneEmptySchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py index eda200cb650..ea9ce102795 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/response_for_200/__init__.py index 918b52162a0..9025022ee41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( array_type_matches_arrays.ArrayTypeMatchesArrays, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py index 9e31d26779b..f1ddd2a13bf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/response_for_200/__init__.py index fa26b9175a6..8628fee8c59 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( boolean_type_matches_booleans.BooleanTypeMatchesBooleans, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py index a0d833e203d..03f39f26f8f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/response_for_200/__init__.py index 9420780852d..e0768f12fa3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( by_int.ByInt, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py index 3d91c091310..19aaf45bba4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/response_for_200/__init__.py index e2afa30425d..38a25e107fb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( by_number.ByNumber, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py index 73413342eda..7fb782be547 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/response_for_200/__init__.py index 5127ce40d75..7098def0954 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( by_small_number.BySmallNumber, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py index 4ed750d32e8..4a3fc15c2d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/response_for_200/__init__.py index e8e7e74af16..10e960901ea 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( date_time_format.DateTimeFormat, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py index 1b4e998af09..7b9cee8bf49 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/response_for_200/__init__.py index e3b41121796..41f61431504 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( email_format.EmailFormat, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py index b8bafd6a7e4..5fd11ae4e10 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/response_for_200/__init__.py index 7eee3cb409e..72bbf1a679a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( enum_with0_does_not_match_false.EnumWith0DoesNotMatchFalse, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py index ac29db61674..2cc01965bcc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/response_for_200/__init__.py index 0f420d5c8f5..d7bfefd0ee6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( enum_with1_does_not_match_true.EnumWith1DoesNotMatchTrue, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py index ef87e248328..393d057badf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py index 74203fe0906..644da696785 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( enum_with_escaped_characters.EnumWithEscapedCharacters, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py index afea47cbd2c..45800391c06 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/response_for_200/__init__.py index 8e9747ebb08..e23f0c8164c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( enum_with_false_does_not_match0.EnumWithFalseDoesNotMatch0, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py index aa4fd8b2105..45dad557855 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/response_for_200/__init__.py index 6d0899983a1..872ecd6cac3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( enum_with_true_does_not_match1.EnumWithTrueDoesNotMatch1, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py index 62a31066ee8..b2aa67d60ae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/response_for_200/__init__.py index 784cbe72fea..3beb5335e36 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( enums_in_properties.EnumsInProperties, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py index f8b49f1712c..3a389aa4f98 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/response_for_200/__init__.py index 3370ff8a016..496b0a2dc9b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( forbidden_property.ForbiddenProperty, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py index b8aaacf2548..b5fe89d0130 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/response_for_200/__init__.py index 254d67701dd..c19b8c99fa9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( hostname_format.HostnameFormat, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py index da8d488b011..51169875bf5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/response_for_200/__init__.py index 4b7ca68afaf..c101870f55a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( integer_type_matches_integers.IntegerTypeMatchesIntegers, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py index 877c84994e8..cdb7da82b99 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/response_for_200/__init__.py index 86500ba70f4..2a358e3749e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( invalid_instance_should_not_raise_error_when_float_division_inf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py index 8ef06b23c70..d88aa3f1ade 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/response_for_200/__init__.py index 0d63e0936e3..66ac14999db 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( invalid_string_value_for_default.InvalidStringValueForDefault, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py index 801f01de960..a06dee664fa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/response_for_200/__init__.py index d03496b294f..31b74876a20 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ipv4_format.Ipv4Format, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py index 5eb6b69f34a..03b1c2f3ef8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/response_for_200/__init__.py index 1e61c305696..6b36a6ac7c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ipv6_format.Ipv6Format, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py index 548606811b2..7e4ab929fc3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/response_for_200/__init__.py index 7c80b126f73..cefbee96515 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( json_pointer_format.JsonPointerFormat, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py index 7c187c7ccda..d8910ec991c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/response_for_200/__init__.py index 0bdfa951db4..220832e8aca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( maximum_validation.MaximumValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py index 6f0202ace8a..d18d59477a9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/response_for_200/__init__.py index 0e1059ead57..7be6ad08f41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( maximum_validation_with_unsigned_integer.MaximumValidationWithUnsignedInteger, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py index e3b9a522780..1870b5053f8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/response_for_200/__init__.py index 657ac4b49e9..f6e715fdbc6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( maxitems_validation.MaxitemsValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py index 2f1d813bb25..23d197760bc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/response_for_200/__init__.py index 935af505719..684dab8a1f2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( maxlength_validation.MaxlengthValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py index 05f4067a8f1..9a768386bee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/response_for_200/__init__.py index 63d1fe7961c..ade5081e18f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( maxproperties0_means_the_object_is_empty.Maxproperties0MeansTheObjectIsEmpty, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py index 676d48bbd9e..a149968c0ae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/response_for_200/__init__.py index 456cfff7b49..92a54307d58 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( maxproperties_validation.MaxpropertiesValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py index f91604455f6..fda1d956aca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/response_for_200/__init__.py index 9fe68d601ec..1cbdbd4870d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( minimum_validation.MinimumValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py index 2957d2caf12..6521b344ed5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/response_for_200/__init__.py index 9948b3b9011..a22d9bbc9b3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( minimum_validation_with_signed_integer.MinimumValidationWithSignedInteger, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py index e43f177b0e1..e2bbbb2a979 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/response_for_200/__init__.py index 63d238ec9b2..383a7edb219 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( minitems_validation.MinitemsValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py index 4001bcce9f7..d3df1d2ee34 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/response_for_200/__init__.py index 9ccc0cdd711..ac7130150dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( minlength_validation.MinlengthValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py index c36459928d0..ee1ffdc4e98 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/response_for_200/__init__.py index b9e6f4e148e..9d6c661d39f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( minproperties_validation.MinpropertiesValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py index 9d56dbb0752..6fcc50e4d58 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py index c6e79f6c5d6..1f32355f8d2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( nested_allof_to_check_validation_semantics.NestedAllofToCheckValidationSemantics, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py index fc16458b7d3..a51fc9606f4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py index 14c69a04962..ee1c5c500e3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( nested_anyof_to_check_validation_semantics.NestedAnyofToCheckValidationSemantics, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py index 3dc86365188..cfd6e03a2de 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/response_for_200/__init__.py index 29ae40c8045..32649e87938 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( nested_items.NestedItems, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py index 43d9143c2d6..06bf8a74bff 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py index 96a7364e551..19719dddbad 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( nested_oneof_to_check_validation_semantics.NestedOneofToCheckValidationSemantics, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py index 11b72ea4641..fb1eab65c86 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/response_for_200/__init__.py index a67b7977c44..7a7f72cd6d7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( not_more_complex_schema.NotMoreComplexSchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py index caa34e87fd6..cfffc962969 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/response_for_200/__init__.py index 7aafec83cf4..366bf377aff 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( _not._Not, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py index 559a8f8c4e1..d3213a6451a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/response_for_200/__init__.py index d7a12586b0b..17e4ecf48c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( nul_characters_in_strings.NulCharactersInStrings, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py index 10a26df5161..d451f22df05 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/response_for_200/__init__.py index 3497fc055c9..aeeb80943e3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( null_type_matches_only_the_null_object.NullTypeMatchesOnlyTheNullObject, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py index f2e0e9eae6e..af9e2a99465 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/response_for_200/__init__.py index 4c657f831ec..7b631bd9df6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( number_type_matches_numbers.NumberTypeMatchesNumbers, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py index 83b52d802cd..000d117b5fa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/response_for_200/__init__.py index 1de3f6a2534..975a8bce9dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( object_properties_validation.ObjectPropertiesValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py index e5d32027227..5ce33d5d9bc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/response_for_200/__init__.py index 4e15cf878b6..3e345238006 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( object_type_matches_objects.ObjectTypeMatchesObjects, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py index 43c9d1757d1..14c5e59faf4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/response_for_200/__init__.py index 6e75e13af79..5f16a96b2c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( oneof_complex_types.OneofComplexTypes, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py index 40d299e098b..b577074ab50 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/response_for_200/__init__.py index 44d74e4a73e..d5cab78850b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( oneof.Oneof, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py index e04de8de04d..176a957c35d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py index 87ef87583ad..a1c3fb22c39 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( oneof_with_base_schema.OneofWithBaseSchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py index d92e2a38d3f..cf36226a551 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py index cdbfc70fc1a..e8459ea19dc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( oneof_with_empty_schema.OneofWithEmptySchema, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py index 1b382af1858..803493409f1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/response_for_200/__init__.py index 55528a1791c..f7b0a8dce5a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( oneof_with_required.OneofWithRequired, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py index 6dcb580b13d..6f341544c0d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/response_for_200/__init__.py index d8528a726a0..19495782b7c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( pattern_is_not_anchored.PatternIsNotAnchored, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py index 69462c6098c..a8b9833d122 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/response_for_200/__init__.py index 987a616bd9c..7a8c32fc7fc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( pattern_validation.PatternValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py index 8c2e2beb7b8..8b3056ee283 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py index 50dfff60d72..e84f6a64885 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( properties_with_escaped_characters.PropertiesWithEscapedCharacters, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py index 9d9d4bc026e..79f7df66362 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/response_for_200/__init__.py index c361a201385..8204a72d3d1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py index 3544d465765..b2381f9192b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/response_for_200/__init__.py index d3b475b14dc..1d2dec5cb30 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ref_in_additionalproperties.RefInAdditionalproperties, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py index 5978eed02b2..e91a4a33f95 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/response_for_200/__init__.py index 752cdbf1a2a..56815fcb0ed 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ref_in_allof.RefInAllof, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py index dfb3a27e073..fb330332da5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/response_for_200/__init__.py index cc6d7ea8d23..70361fc6943 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ref_in_anyof.RefInAnyof, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py index 23d7e5dc39a..c9a139dcd56 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/response_for_200/__init__.py index ef02cb81eec..7b5069cb26a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ref_in_items.RefInItems, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py index cba482429ee..f26f1366b3b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/response_for_200/__init__.py index 5bb90c7e789..10eaaf7b48b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ref_in_not.RefInNot, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py index 3bd082a089c..0db7f691baa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/response_for_200/__init__.py index e5b928617c9..4553c6752d7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ref_in_oneof.RefInOneof, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py index b6d42f32bc7..3d70d7d112f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/response_for_200/__init__.py index 8e9f7c4940b..557ac69dcee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ref_in_property.RefInProperty, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py index 440d2b24133..102e546b8a4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/response_for_200/__init__.py index 32a613e3c4e..fd889427565 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( required_default_validation.RequiredDefaultValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py index 98a45cb35a0..7741589e7ee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/response_for_200/__init__.py index 8add03f8106..c458a7e9a19 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( required_validation.RequiredValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py index d4ce0777736..f67274b1f22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/response_for_200/__init__.py index e05bf86787e..faa86768b0f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( required_with_empty_array.RequiredWithEmptyArray, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py index 5ccf211cd08..653e7c00941 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py index 2cd179f06f8..626739c5417 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( required_with_escaped_characters.RequiredWithEscapedCharacters, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py index 7bdb6447ac8..073e9fffd76 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/response_for_200/__init__.py index c9ff77be2fb..e5bac443c86 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( simple_enum_validation.SimpleEnumValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py index 81cc845c82c..66b6f72ed72 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/response_for_200/__init__.py index 9a30bdc93dc..a9b9560e61f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( string_type_matches_strings.StringTypeMatchesStrings, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py index c3b807c3df6..3b83496d51b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/response_for_200/__init__.py index 9a7fefb8ff3..a2cd53ad428 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( the_default_keyword_does_not_do_anything_if_the_property_is_missing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py index 3a953a9590a..854432e9edc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/response_for_200/__init__.py index bdb8a91aec9..975e6c550d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( uniqueitems_false_validation.UniqueitemsFalseValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py index ad5873d561d..d0dda6c701c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/response_for_200/__init__.py index e0161da9205..078de0d13c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( uniqueitems_validation.UniqueitemsValidation, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py index c1e299fcde8..dc565aff091 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/response_for_200/__init__.py index aee5b940422..f37cd9e3706 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( uri_format.UriFormat, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py index 7749f1d1809..c1d6469cf54 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/response_for_200/__init__.py index 8931c3e4b00..df8f875dcbe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( uri_reference_format.UriReferenceFormat, ), - }, -) + } diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py index fc23cb73e68..9cccfad769c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/response_for_200/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/response_for_200/__init__.py index cde18ec4150..65a5971abf7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/response_for_200/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( uri_template_format.UriTemplateFormat, ), - }, -) + } diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py index a8fc2dcfc56..26d22adefb9 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py @@ -118,10 +118,6 @@ def __next__(self): class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - @staticmethod def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): """ @@ -283,13 +279,8 @@ def _ref6570_expansion( class StyleFormSerializer(ParameterSerializerBase): @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - def _serialize_form( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, @@ -298,7 +289,7 @@ def _serialize_form( ) -> str: if prefix_separator_iterator is None: prefix_separator_iterator = PrefixSeparatorIterator('', '&') - return self._ref6570_expansion( + return cls._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, @@ -309,15 +300,16 @@ def _serialize_form( class StyleSimpleSerializer(ParameterSerializerBase): + @classmethod def _serialize_simple( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, percent_encode: bool ) -> str: prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( + return cls._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, @@ -325,8 +317,9 @@ def _serialize_simple( prefix_separator_iterator=prefix_separator_iterator ) + @classmethod def _deserialize_simple( - self, + cls, in_data: str, name: str, explode: bool, @@ -365,144 +358,88 @@ class ParameterBase(JSONDetector): schema: typing.Optional[typing.Type[Schema]] content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } _json_encoder = JSONEncoder() - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + @classmethod def _serialize_json( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], eliminate_whitespace: bool = False ) -> str: if eliminate_whitespace: - return json.dumps(in_data, separators=self._json_encoder.compact_separators) + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) return json.dumps(in_data) class PathParameter(ParameterBase, StyleSimpleSerializer): name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - self.name = name - super().__init__( - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def __serialize_label( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_matrix( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_simple( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], ) -> typing.Dict[str, str]: - value = self._serialize_simple( + value = cls._serialize_simple( in_data=in_data, - name=self.name, - explode=self.explode, + name=cls.name, + explode=cls.explode, percent_encode=True ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ simple -> path path: @@ -512,115 +449,103 @@ def serialize( matrix -> path returns path_params """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class QueryParameter(ParameterBase, StyleFormSerializer): name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - self.name = name - super().__init__( - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def __serialize_space_delimited( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_pipe_delimited( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_form( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( in_data, - name=self.name, - explode=self.explode, + name=cls.name, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if self.style is ParameterStyle.FORM: + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: + elif cls.style is ParameterStyle.SPACE_DELIMITED: return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: + elif cls.style is ParameterStyle.PIPE_DELIMITED: return PrefixSeparatorIterator('', '|') + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ form -> query query: @@ -634,111 +559,83 @@ def serialize( deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 returns fields """ - if self.style: + if cls.style: # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - for content_type, schema in self.content.items(): + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data, eliminate_whitespace=True) - return self._to_dict( - self.name, - next(prefix_separator_iterator) + self.name + '=' + quote(value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + quote(value) ) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class CookieParameter(ParameterBase, StyleFormSerializer): name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - self.name = name - super().__init__( - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ form -> cookie returns fields: tuple """ - if self.style: + if cls.style: """ TODO add escaping of comma, space, equals or turn encoding on """ - value = self._serialize_form( + value = cls._serialize_form( cast_in_data, - explode=self.explode, - name=self.name, + explode=cls.explode, + name=cls.name, percent_encode=False, prefix_separator_iterator=PrefixSeparatorIterator('', '&') ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None @staticmethod def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: @@ -749,49 +646,51 @@ def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHead headers.extend(data) return headers + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], name: str ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ simple -> header headers: PoolManager needs a mapping, tuple is close returns headers: dict """ - if self.style: - value = self._serialize_simple(cast_in_data, name, self.explode, False) - return self.__to_headers(((name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self.__to_headers(((name, value),)) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + @classmethod def deserialize( - self, + cls, in_data: str, name: str ) -> Schema: - if self.schema: + if cls.schema: """ simple -> header headers: PoolManager needs a mapping, tuple is close returns headers: dict """ - if self.style: - extracted_data = self._deserialize_simple(in_data, name, self.explode, False) + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) return schema.from_openapi_data_oapg(extracted_data) - # self.content will be length one - for content_type, schema in self.content.items(): - if self._content_type_is_json(content_type): + # cls.content will be length one + for content_type, schema in cls.content.items(): + if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) return schema.from_openapi_data_oapg(cast_in_data) raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) @@ -799,38 +698,16 @@ def deserialize( class HeaderParameter(HeaderParameterWithoutName): name: str - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if name in self.__disallowed_header_names: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.name = name - super().__init__( - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> HTTPHeaderDict: return super().serialize( in_data, - self.name + cls.name ) @@ -943,20 +820,8 @@ def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict] class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): __filename_content_disposition_pattern = re.compile('filename="(.+?)"') response_cls: typing.Type[T] - content: typing.Optional[typing.Dict[str, MediaType]] - headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] - - def __init__( - self, - response_cls: typing.Type[T], - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None @staticmethod def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: @@ -985,8 +850,9 @@ def __file_name_from_content_disposition(cls, content_disposition: typing.Option return None return match.group(1) + @classmethod def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse + cls, response: urllib3.HTTPResponse ) -> typing.Union[bytes, io.BufferedReader]: """ urllib3 use cases: @@ -996,8 +862,8 @@ def __deserialize_application_octet_stream( """ if response.supports_chunked_reads(): file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) ) if file_name is None: @@ -1033,14 +899,15 @@ def __deserialize_multipart_form_data( for part in msg.get_payload() } - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> T: + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: Configuration) -> T: content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() deserialized_headers = unset - if self.headers is not None: - self._verify_typed_dict_inputs_oapg(self.response_cls.headers, response.headers) + if cls.headers is not None: + cls._verify_typed_dict_inputs_oapg(cls.response_cls.headers, response.headers) deserialized_headers = {} for header_name, header_param in self.headers.items(): header_value = response.getheader(header_name) @@ -1049,27 +916,27 @@ def deserialize(self, response: urllib3.HTTPResponse, configuration: Configurati header_value = header_param.deserialize(header_value, header_name) deserialized_headers[header_name] = header_value - if self.content is not None: - if content_type not in self.content: + if cls.content is not None: + if content_type not in cls.content: raise ApiValueError( f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" ) - body_schema = self.content[content_type].schema + body_schema = cls.content[content_type].schema if body_schema is None: # some specs do not define response content media type schemas - return self.response_cls( + return cls.response_cls( response=response, headers=deserialized_headers, body=unset ) - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) + body_data = cls.__deserialize_application_octet_stream(response) elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) + body_data = cls.__deserialize_multipart_form_data(response) content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) @@ -1078,7 +945,7 @@ def deserialize(self, response: urllib3.HTTPResponse, configuration: Configurati elif streamed: response.release_conn() - return self.response_cls( + return cls.response_cls( response=response, headers=deserialized_headers, body=deserialized_body @@ -1436,22 +1303,15 @@ class RequestBody(StyleFormSerializer, JSONDetector): content: content_type to MediaType Schema info """ __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - + @classmethod def __serialize_json( - self, + cls, in_data: typing.Any ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) + in_data = cls.__json_encoder.default(in_data) json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( "utf-8" ) @@ -1469,13 +1329,15 @@ def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: raise ValueError('Unable to serialize type BoolClass to text/plain') return dict(body=str(in_data)) - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) + @classmethod + def __multipart_json_item(cls, key: str, value: Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) request_field = RequestField(name=key, data=json.dumps(json_value)) request_field.make_multipart(content_type='application/json') return request_field - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: + @classmethod + def __multipart_form_item(cls, key: str, value: Schema) -> RequestField: if isinstance(value, str): request_field = RequestField(name=key, data=str(value)) request_field.make_multipart(content_type='text/plain') @@ -1487,11 +1349,12 @@ def __multipart_form_item(self, key: str, value: Schema) -> RequestField: request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) value.close() else: - request_field = self.__multipart_json_item(key=key, value=value) + request_field = cls.__multipart_json_item(key=key, value=value) return request_field + @classmethod def __serialize_multipart_form_data( - self, in_data: Schema + cls, in_data: Schema ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: if not isinstance(in_data, frozendict.frozendict): raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') @@ -1514,19 +1377,20 @@ def __serialize_multipart_form_data( if value: # values use explode = True, so the code makes a RequestField for each item with name=key for item in value: - request_field = self.__multipart_form_item(key=key, value=item) + request_field = cls.__multipart_form_item(key=key, value=item) fields.append(request_field) else: # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) + request_field = cls.__multipart_json_item(key=key, value=value) fields.append(request_field) else: - request_field = self.__multipart_form_item(key=key, value=value) + request_field = cls.__multipart_form_item(key=key, value=value) fields.append(request_field) return dict(fields=tuple(fields)) - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: + @staticmethod + def __serialize_application_octet_stream(in_data: BinarySchema) -> typing.Dict[str, bytes]: if isinstance(in_data, bytes): return dict(body=in_data) # FileIO type @@ -1534,8 +1398,9 @@ def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing. in_data.close() return result + @classmethod def __serialize_application_x_www_form_data( - self, in_data: typing.Any + cls, in_data: typing.Any ) -> SerializedRequestBody: """ POST submission of form data in body @@ -1543,12 +1408,13 @@ def __serialize_application_x_www_form_data( if not isinstance(in_data, frozendict.frozendict): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) + @classmethod def serialize( - self, in_data: typing.Any, content_type: str + cls, in_data: typing.Any, content_type: str ) -> SerializedRequestBody: """ If a str is returned then the result will be assigned to data when making the request @@ -1559,7 +1425,7 @@ def serialize( - body for application/json - encode_multipart and fields for multipart/form-data """ - media_type = self.content[content_type] + media_type = cls.content[content_type] if isinstance(in_data, media_type.schema): cast_in_data = in_data elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: @@ -1568,14 +1434,14 @@ def serialize( cast_in_data = media_type.schema(in_data) # TODO check for and use encoding if it exists # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) + return cls.__serialize_text_plain(cast_in_data) elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) + return cls.__serialize_multipart_form_data(cast_in_data) elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) + return cls.__serialize_application_x_www_form_data(cast_in_data) elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) + return cls.__serialize_application_octet_stream(cast_in_data) raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py index 193e23b080f..128992791aa 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) @@ -112,7 +112,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi index 43f7e54d1c1..607258bf28a 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi @@ -100,7 +100,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/request_body/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/request_body/__init__.py index 397f35586be..bbe758ab8aa 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/request_body/__init__.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/request_body/__init__.py @@ -10,10 +10,9 @@ from this_package.components.schema import operator -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=operator.Operator, ), - }, -) + } diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/response_for_200/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/response_for_200/__init__.py index 9d567bce12a..ff1dfe1915d 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/response_for_200/__init__.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/response_for_200/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 7a914d8673c..305b549ab8a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -118,10 +118,6 @@ def __next__(self): class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - @staticmethod def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): """ @@ -283,13 +279,8 @@ def _ref6570_expansion( class StyleFormSerializer(ParameterSerializerBase): @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - def _serialize_form( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, @@ -298,7 +289,7 @@ def _serialize_form( ) -> str: if prefix_separator_iterator is None: prefix_separator_iterator = PrefixSeparatorIterator('', '&') - return self._ref6570_expansion( + return cls._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, @@ -309,15 +300,16 @@ def _serialize_form( class StyleSimpleSerializer(ParameterSerializerBase): + @classmethod def _serialize_simple( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], name: str, explode: bool, percent_encode: bool ) -> str: prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( + return cls._ref6570_expansion( variable_name=name, in_data=in_data, explode=explode, @@ -325,8 +317,9 @@ def _serialize_simple( prefix_separator_iterator=prefix_separator_iterator ) + @classmethod def _deserialize_simple( - self, + cls, in_data: str, name: str, explode: bool, @@ -365,144 +358,88 @@ class ParameterBase(JSONDetector): schema: typing.Optional[typing.Type[Schema]] content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } _json_encoder = JSONEncoder() - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content + def __init_subclass__(cls, **kwargs): + if cls.explode is None: + if cls.style is ParameterStyle.FORM: + cls.explode = True + else: + cls.explode = False + @classmethod def _serialize_json( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], eliminate_whitespace: bool = False ) -> str: if eliminate_whitespace: - return json.dumps(in_data, separators=self._json_encoder.compact_separators) + return json.dumps(in_data, separators=cls._json_encoder.compact_separators) return json.dumps(in_data) class PathParameter(ParameterBase, StyleSimpleSerializer): name: str + required: bool = False + in_type: ParameterInType = ParameterInType.PATH + style: ParameterStyle = ParameterStyle.SIMPLE + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - self.name = name - super().__init__( - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def __serialize_label( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_matrix( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list] ) -> typing.Dict[str, str]: prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_simple( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], ) -> typing.Dict[str, str]: - value = self._serialize_simple( + value = cls._serialize_simple( in_data=in_data, - name=self.name, - explode=self.explode, + name=cls.name, + explode=cls.explode, percent_encode=True ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ simple -> path path: @@ -512,115 +449,103 @@ def serialize( matrix -> path returns path_params """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): + if cls.style: + if cls.style is ParameterStyle.SIMPLE: + return cls.__serialize_simple(cast_in_data) + elif cls.style is ParameterStyle.LABEL: + return cls.__serialize_label(cast_in_data) + elif cls.style is ParameterStyle.MATRIX: + return cls.__serialize_matrix(cast_in_data) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class QueryParameter(ParameterBase, StyleFormSerializer): name: str + required: bool = False + in_type: ParameterInType = ParameterInType.QUERY + style: ParameterStyle = ParameterStyle.FORM + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - self.name = name - super().__init__( - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def __serialize_space_delimited( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_pipe_delimited( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._ref6570_expansion( + variable_name=cls.name, in_data=in_data, - explode=self.explode, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) + @classmethod def __serialize_form( - self, + cls, in_data: typing.Union[None, int, float, str, bool, dict, list], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] ) -> typing.Dict[str, str]: if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( + prefix_separator_iterator = cls.get_prefix_separator_iterator() + value = cls._serialize_form( in_data, - name=self.name, - explode=self.explode, + name=cls.name, + explode=cls.explode, percent_encode=True, prefix_separator_iterator=prefix_separator_iterator ) - return self._to_dict(self.name, value) + return cls._to_dict(cls.name, value) - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if self.style is ParameterStyle.FORM: + @classmethod + def get_prefix_separator_iterator(cls) -> typing.Optional[PrefixSeparatorIterator]: + if cls.style is ParameterStyle.FORM: return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: + elif cls.style is ParameterStyle.SPACE_DELIMITED: return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: + elif cls.style is ParameterStyle.PIPE_DELIMITED: return PrefixSeparatorIterator('', '|') + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ form -> query query: @@ -634,111 +559,83 @@ def serialize( deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 returns fields """ - if self.style: + if cls.style: # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one + if cls.style is ParameterStyle.FORM: + return cls.__serialize_form(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.SPACE_DELIMITED: + return cls.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif cls.style is ParameterStyle.PIPE_DELIMITED: + return cls.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # cls.content will be length one if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - for content_type, schema in self.content.items(): + prefix_separator_iterator = cls.get_prefix_separator_iterator() + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data, eliminate_whitespace=True) - return self._to_dict( - self.name, - next(prefix_separator_iterator) + self.name + '=' + quote(value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data, eliminate_whitespace=True) + return cls._to_dict( + cls.name, + next(prefix_separator_iterator) + cls.name + '=' + quote(value) ) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class CookieParameter(ParameterBase, StyleFormSerializer): name: str + required: bool = False + style: ParameterStyle = ParameterStyle.FORM + in_type: ParameterInType = ParameterInType.COOKIE + explode: typing.Optional[bool] = None + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - self.name = name - super().__init__( - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ form -> cookie returns fields: tuple """ - if self.style: + if cls.style: """ TODO add escaping of comma, space, equals or turn encoding on """ - value = self._serialize_form( + value = cls._serialize_form( cast_in_data, - explode=self.explode, - name=self.name, + explode=cls.explode, + name=cls.name, percent_encode=False, prefix_separator_iterator=PrefixSeparatorIterator('', '&') ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): + return cls._to_dict(cls.name, value) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls._to_dict(cls.name, value) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) class HeaderParameterWithoutName(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) + required: bool = False + style: ParameterStyle = ParameterStyle.SIMPLE + in_type: ParameterInType = ParameterInType.HEADER + explode: bool = False + allow_reserved: typing.Optional[bool] = None + schema: typing.Optional[typing.Type[Schema]] = None + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None @staticmethod def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: @@ -749,49 +646,51 @@ def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHead headers.extend(data) return headers + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], name: str ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) + if cls.schema: + cast_in_data = cls.schema(in_data) + cast_in_data = cls._json_encoder.default(cast_in_data) """ simple -> header headers: PoolManager needs a mapping, tuple is close returns headers: dict """ - if self.style: - value = self._serialize_simple(cast_in_data, name, self.explode, False) - return self.__to_headers(((name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): + if cls.style: + value = cls._serialize_simple(cast_in_data, name, cls.explode, False) + return cls.__to_headers(((name, value),)) + # cls.content will be length one + for content_type, schema in cls.content.items(): cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if self._content_type_is_json(content_type): - value = self._serialize_json(cast_in_data) - return self.__to_headers(((name, value),)) + cast_in_data = cls._json_encoder.default(cast_in_data) + if cls._content_type_is_json(content_type): + value = cls._serialize_json(cast_in_data) + return cls.__to_headers(((name, value),)) raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + @classmethod def deserialize( - self, + cls, in_data: str, name: str ) -> Schema: - if self.schema: + if cls.schema: """ simple -> header headers: PoolManager needs a mapping, tuple is close returns headers: dict """ - if self.style: - extracted_data = self._deserialize_simple(in_data, name, self.explode, False) + if cls.style: + extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) return schema.from_openapi_data_oapg(extracted_data) - # self.content will be length one - for content_type, schema in self.content.items(): - if self._content_type_is_json(content_type): + # cls.content will be length one + for content_type, schema in cls.content.items(): + if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) return schema.from_openapi_data_oapg(cast_in_data) raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) @@ -799,38 +698,16 @@ def deserialize( class HeaderParameter(HeaderParameterWithoutName): name: str - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if name in self.__disallowed_header_names: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.name = name - super().__init__( - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) + @classmethod def serialize( - self, + cls, in_data: typing.Union[ Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] ) -> HTTPHeaderDict: return super().serialize( in_data, - self.name + cls.name ) @@ -943,20 +820,8 @@ def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict] class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): __filename_content_disposition_pattern = re.compile('filename="(.+?)"') response_cls: typing.Type[T] - content: typing.Optional[typing.Dict[str, MediaType]] - headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] - - def __init__( - self, - response_cls: typing.Type[T], - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls + content: typing.Optional[typing.Dict[str, MediaType]] = None + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None @staticmethod def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: @@ -985,8 +850,9 @@ def __file_name_from_content_disposition(cls, content_disposition: typing.Option return None return match.group(1) + @classmethod def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse + cls, response: urllib3.HTTPResponse ) -> typing.Union[bytes, io.BufferedReader]: """ urllib3 use cases: @@ -996,8 +862,8 @@ def __deserialize_application_octet_stream( """ if response.supports_chunked_reads(): file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) + cls.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or cls.__file_name_from_response_url(response.geturl()) ) if file_name is None: @@ -1033,14 +899,15 @@ def __deserialize_multipart_form_data( for part in msg.get_payload() } - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> T: + @classmethod + def deserialize(cls, response: urllib3.HTTPResponse, configuration: Configuration) -> T: content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() deserialized_headers = unset - if self.headers is not None: - self._verify_typed_dict_inputs_oapg(self.response_cls.headers, response.headers) + if cls.headers is not None: + cls._verify_typed_dict_inputs_oapg(cls.response_cls.headers, response.headers) deserialized_headers = {} for header_name, header_param in self.headers.items(): header_value = response.getheader(header_name) @@ -1049,27 +916,27 @@ def deserialize(self, response: urllib3.HTTPResponse, configuration: Configurati header_value = header_param.deserialize(header_value, header_name) deserialized_headers[header_name] = header_value - if self.content is not None: - if content_type not in self.content: + if cls.content is not None: + if content_type not in cls.content: raise ApiValueError( f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" + f"when only {str(set(cls.content))} are defined for status_code={str(response.status)}" ) - body_schema = self.content[content_type].schema + body_schema = cls.content[content_type].schema if body_schema is None: # some specs do not define response content media type schemas - return self.response_cls( + return cls.response_cls( response=response, headers=deserialized_headers, body=unset ) - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) + if cls._content_type_is_json(content_type): + body_data = cls.__deserialize_json(response) elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) + body_data = cls.__deserialize_application_octet_stream(response) elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) + body_data = cls.__deserialize_multipart_form_data(response) content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) @@ -1078,7 +945,7 @@ def deserialize(self, response: urllib3.HTTPResponse, configuration: Configurati elif streamed: response.release_conn() - return self.response_cls( + return cls.response_cls( response=response, headers=deserialized_headers, body=deserialized_body @@ -1445,22 +1312,15 @@ class RequestBody(StyleFormSerializer, JSONDetector): content: content_type to MediaType Schema info """ __json_encoder = JSONEncoder() + content: typing.Dict[str, MediaType] + required: bool = False - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - + @classmethod def __serialize_json( - self, + cls, in_data: typing.Any ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) + in_data = cls.__json_encoder.default(in_data) json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( "utf-8" ) @@ -1478,13 +1338,15 @@ def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: raise ValueError('Unable to serialize type BoolClass to text/plain') return dict(body=str(in_data)) - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) + @classmethod + def __multipart_json_item(cls, key: str, value: Schema) -> RequestField: + json_value = cls.__json_encoder.default(value) request_field = RequestField(name=key, data=json.dumps(json_value)) request_field.make_multipart(content_type='application/json') return request_field - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: + @classmethod + def __multipart_form_item(cls, key: str, value: Schema) -> RequestField: if isinstance(value, str): request_field = RequestField(name=key, data=str(value)) request_field.make_multipart(content_type='text/plain') @@ -1496,11 +1358,12 @@ def __multipart_form_item(self, key: str, value: Schema) -> RequestField: request_field = RequestField.from_tuples(key, (os.path.basename(value.name), value.read())) value.close() else: - request_field = self.__multipart_json_item(key=key, value=value) + request_field = cls.__multipart_json_item(key=key, value=value) return request_field + @classmethod def __serialize_multipart_form_data( - self, in_data: Schema + cls, in_data: Schema ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: if not isinstance(in_data, frozendict.frozendict): raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') @@ -1523,19 +1386,20 @@ def __serialize_multipart_form_data( if value: # values use explode = True, so the code makes a RequestField for each item with name=key for item in value: - request_field = self.__multipart_form_item(key=key, value=item) + request_field = cls.__multipart_form_item(key=key, value=item) fields.append(request_field) else: # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) + request_field = cls.__multipart_json_item(key=key, value=value) fields.append(request_field) else: - request_field = self.__multipart_form_item(key=key, value=value) + request_field = cls.__multipart_form_item(key=key, value=value) fields.append(request_field) return dict(fields=tuple(fields)) - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: + @staticmethod + def __serialize_application_octet_stream(in_data: BinarySchema) -> typing.Dict[str, bytes]: if isinstance(in_data, bytes): return dict(body=in_data) # FileIO type @@ -1543,8 +1407,9 @@ def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing. in_data.close() return result + @classmethod def __serialize_application_x_www_form_data( - self, in_data: typing.Any + cls, in_data: typing.Any ) -> SerializedRequestBody: """ POST submission of form data in body @@ -1552,12 +1417,13 @@ def __serialize_application_x_www_form_data( if not isinstance(in_data, frozendict.frozendict): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) + cast_in_data = cls.__json_encoder.default(in_data) + value = cls._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) + @classmethod def serialize( - self, in_data: typing.Any, content_type: str + cls, in_data: typing.Any, content_type: str ) -> SerializedRequestBody: """ If a str is returned then the result will be assigned to data when making the request @@ -1568,7 +1434,7 @@ def serialize( - body for application/json - encode_multipart and fields for multipart/form-data """ - media_type = self.content[content_type] + media_type = cls.content[content_type] if isinstance(in_data, media_type.schema): cast_in_data = in_data elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: @@ -1577,14 +1443,14 @@ def serialize( cast_in_data = media_type.schema(in_data) # TODO check for and use encoding if it exists # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) + if cls._content_type_is_json(content_type): + return cls.__serialize_json(cast_in_data) elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) + return cls.__serialize_text_plain(cast_in_data) elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) + return cls.__serialize_multipart_form_data(cast_in_data) elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) + return cls.__serialize_application_x_www_form_data(cast_in_data) elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) + return cls.__serialize_application_octet_stream(cast_in_data) raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_int32_json_content_type_header/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_int32_json_content_type_header/__init__.py index 704f1e8a48b..e7fb35ab998 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_int32_json_content_type_header/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_int32_json_content_type_header/__init__.py @@ -14,10 +14,9 @@ from . import application_json -parameter_oapg = api_client.HeaderParameterWithoutName( - style=api_client.ParameterStyle.SIMPLE, - content={ +class Int32JsonContentTypeHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + content = { "application/json": application_json.ApplicationJson, - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_number_header/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_number_header/__init__.py index a1a0e19df09..66485effa05 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_number_header/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_number_header/__init__.py @@ -14,7 +14,6 @@ from . import schema -parameter_oapg = api_client.HeaderParameterWithoutName( - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class NumberHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_ref_content_schema_header/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_ref_content_schema_header/__init__.py index 164f0402b54..3dca5674f58 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_ref_content_schema_header/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_ref_content_schema_header/__init__.py @@ -15,10 +15,9 @@ from petstore_api.components.schema import string_with_validation -parameter_oapg = api_client.HeaderParameterWithoutName( - style=api_client.ParameterStyle.SIMPLE, - content={ +class RefContentSchemaHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + content = { "application/json": string_with_validation.StringWithValidation, - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_ref_schema_header/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_ref_schema_header/__init__.py index d28663ec552..3b41b6b98fc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_ref_schema_header/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_ref_schema_header/__init__.py @@ -15,8 +15,7 @@ from petstore_api.components.schema import string_with_validation -parameter_oapg = api_client.HeaderParameterWithoutName( - style=api_client.ParameterStyle.SIMPLE, - schema=string_with_validation.StringWithValidation, - required=True, -) +class RefSchemaHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = string_with_validation.StringWithValidation + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_string_header/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_string_header/__init__.py index 52e3b49cf97..a567bcf9c0e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_string_header/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/headers/header_string_header/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameterWithoutName( - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class StringHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/__init__.py index dbeacfb2f9f..d1b2c2732f8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_component_ref_schema_string_with_validation/__init__.py @@ -15,10 +15,9 @@ from petstore_api.components.schema import string_with_validation -parameter_oapg = api_client.PathParameter( - name="CRSstringWithValidation", - content={ +class ComponentRefSchemaStringWithValidation(api_client.PathParameter): + name = "CRSstringWithValidation" + content = { "application/json": string_with_validation.StringWithValidation, - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_path_user_name/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_path_user_name/__init__.py index 8494006efe0..9354ac549d1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_path_user_name/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_path_user_name/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="username", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class PathUserName(api_client.PathParameter): + name = "username" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/__init__.py index 1385a468650..0923b3d1b78 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/parameters/parameter_ref_schema_string_with_validation/__init__.py @@ -15,9 +15,8 @@ from petstore_api.components.schema import string_with_validation -parameter_oapg = api_client.PathParameter( - name="RSstringWithValidation", - style=api_client.ParameterStyle.SIMPLE, - schema=string_with_validation.StringWithValidation, - required=True, -) +class RefSchemaStringWithValidation(api_client.PathParameter): + name = "RSstringWithValidation" + style = api_client.ParameterStyle.SIMPLE + schema = string_with_validation.StringWithValidation + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_client/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_client/__init__.py index 1421035f050..7a8db5695ae 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_client/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_client/__init__.py @@ -10,11 +10,10 @@ from petstore_api.components.schema import client -parameter_oapg = api_client.RequestBody( - content={ +class Client(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=client.Client, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_pet/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_pet/__init__.py index b9f4fc712f7..dba16a95566 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_pet/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_pet/__init__.py @@ -10,14 +10,13 @@ from petstore_api.components.schema import pet -parameter_oapg = api_client.RequestBody( - content={ +class Pet(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=pet.Pet, ), 'application/xml': api_client.MediaType( schema=pet.Pet, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_user_array/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_user_array/__init__.py index d04c9541363..0a12fcfc6f0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_user_array/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/request_bodies/request_body_user_array/__init__.py @@ -9,11 +9,10 @@ from petstore_api import api_client, exceptions from . import application_json -parameter_oapg = api_client.RequestBody( - content={ +class UserArray(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=application_json.ApplicationJson, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_description_only/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_description_only/__init__.py index 20bbd06e4c5..9b0166e7eae 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_description_only/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_description_only/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class SuccessDescriptionOnly(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_inline_content_and_header/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_inline_content_and_header/__init__.py index c9f3f15361b..8d70685b183 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_inline_content_and_header/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_inline_content_and_header/__init__.py @@ -35,7 +35,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - header_some_header.parameter_oapg, + header_some_header.SomeHeader, ] @dataclasses.dataclass @@ -47,12 +47,11 @@ class ApiResponse(api_client.ApiResponse): headers: Header.Params -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class SuccessInlineContentAndHeader(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( application_json.ApplicationJson, ), - }, + } headers=Header.parameters -) diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_inline_content_and_header/header_some_header/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_inline_content_and_header/header_some_header/__init__.py index a1a0e19df09..4e238501f44 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_inline_content_and_header/header_some_header/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_inline_content_and_header/header_some_header/__init__.py @@ -14,7 +14,6 @@ from . import schema -parameter_oapg = api_client.HeaderParameterWithoutName( - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class SomeHeader(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_with_json_api_response/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_with_json_api_response/__init__.py index 06babb69397..abd500fc875 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_with_json_api_response/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/components/responses/response_success_with_json_api_response/__init__.py @@ -44,11 +44,11 @@ class Params(RequiredParams, OptionalParams): parameters = [ - header_ref_schema_header.parameter_oapg, - header_int32_json_content_type_header.parameter_oapg, - header_ref_content_schema_header.parameter_oapg, - header_string_header.parameter_oapg, - header_number_header.parameter_oapg, + header_ref_schema_header.RefSchemaHeader, + header_int32_json_content_type_header.Int32JsonContentTypeHeader, + header_ref_content_schema_header.RefContentSchemaHeader, + header_string_header.StringHeader, + header_number_header.NumberHeader, ] @dataclasses.dataclass @@ -60,12 +60,11 @@ class ApiResponse(api_client.ApiResponse): headers: Header.Params -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class SuccessWithJsonApiResponse(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( api_response.ApiResponse, ), - }, + } headers=Header.parameters -) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py index bcf6d5c1a31..23e3a8eb244 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -126,7 +126,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Client.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi index 79da81e5025..80ffabab49a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi @@ -114,7 +114,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Client.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/response_for_200/__init__.py index eee9db9c103..49ddc156cd7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( client.Client, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.py index e2f7d0b9cd2..e1541285b82 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.py @@ -59,10 +59,10 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, - parameter_2.parameter_oapg, - parameter_3.parameter_oapg, - parameter_5.parameter_oapg, + parameter_0._0, + parameter_2._2, + parameter_3._3, + parameter_5._5, ] class RequestHeaderParameters: @@ -86,8 +86,8 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_1.parameter_oapg, - parameter_4.parameter_oapg, + parameter_1._1, + parameter_4._4, ] _auth = [ 'bearer_test', @@ -97,11 +97,11 @@ class Params(RequiredParams, OptionalParams): __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.pyi index fb7a53381c3..1d28e515b43 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.pyi @@ -58,10 +58,10 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, - parameter_2.parameter_oapg, - parameter_3.parameter_oapg, - parameter_5.parameter_oapg, + parameter_0._0, + parameter_2._2, + parameter_3._3, + parameter_5._5, ] class RequestHeaderParameters: @@ -85,8 +85,8 @@ class RequestHeaderParameters: parameters = [ - parameter_1.parameter_oapg, - parameter_4.parameter_oapg, + parameter_1._1, + parameter_4._4, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_0/__init__.py index 1dd7ccac244..5a357988dca 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_0/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="required_string_group", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _0(api_client.QueryParameter): + name = "required_string_group" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_1/__init__.py index dd7468bca59..f7dd1643923 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_1/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_1/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="required_boolean_group", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _1(api_client.HeaderParameter): + name = "required_boolean_group" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_2/__init__.py index 248b57f45d3..84a89ab2b1e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_2/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_2/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="required_int64_group", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _2(api_client.QueryParameter): + name = "required_int64_group" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_3/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_3/__init__.py index 1628af67739..1f6763aa54a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_3/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_3/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="string_group", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _3(api_client.QueryParameter): + name = "string_group" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_4/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_4/__init__.py index 236d77e25ea..e9f7463bc71 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_4/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_4/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="boolean_group", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class _4(api_client.HeaderParameter): + name = "boolean_group" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_5/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_5/__init__.py index a32c48a82db..a1a41411adb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_5/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/parameter_5/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="int64_group", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _5(api_client.QueryParameter): + name = "int64_group" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py index 73d0f88725b..b60b4ef774d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py @@ -61,10 +61,10 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_2.parameter_oapg, - parameter_3.parameter_oapg, - parameter_4.parameter_oapg, - parameter_5.parameter_oapg, + parameter_2._2, + parameter_3._3, + parameter_4._4, + parameter_5._5, ] class RequestHeaderParameters: @@ -88,20 +88,20 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, + parameter_0._0, + parameter_1._1, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, + '404': response_for_404._404, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '404': response_for_404.response, + '200': response_for_200.SuccessDescriptionOnly, + '404': response_for_404._404, }) _all_accept_content_types = ( 'application/json', @@ -216,7 +216,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi index 60ac2cd56d1..81e46cb75b4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi @@ -60,10 +60,10 @@ class RequestQueryParameters: parameters = [ - parameter_2.parameter_oapg, - parameter_3.parameter_oapg, - parameter_4.parameter_oapg, - parameter_5.parameter_oapg, + parameter_2._2, + parameter_3._3, + parameter_4._4, + parameter_5._5, ] class RequestHeaderParameters: @@ -87,8 +87,8 @@ class RequestHeaderParameters: parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, + parameter_0._0, + parameter_1._1, ]_all_accept_content_types = ( 'application/json', ) @@ -202,7 +202,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_0/__init__.py index cee1e2df688..0d77d01e2bf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_0/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="enum_header_string_array", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class _0(api_client.HeaderParameter): + name = "enum_header_string_array" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_1/__init__.py index 5f6abe21740..9341e4e4a1b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_1/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_1/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="enum_header_string", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class _1(api_client.HeaderParameter): + name = "enum_header_string" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_2/__init__.py index 19d4c043680..4f89910211a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_2/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_2/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="enum_query_string_array", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _2(api_client.QueryParameter): + name = "enum_query_string_array" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_3/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_3/__init__.py index bf41a04f149..4422ae6f62d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_3/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_3/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="enum_query_string", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _3(api_client.QueryParameter): + name = "enum_query_string" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_4/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_4/__init__.py index 9cca842f283..e9471d433c8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_4/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_4/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="enum_query_integer", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _4(api_client.QueryParameter): + name = "enum_query_integer" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_5/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_5/__init__.py index c981cd1d7dc..ca1644dd439 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_5/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/parameter_5/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="enum_query_double", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _5(api_client.QueryParameter): + name = "enum_query_double" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/request_body/__init__.py index 9addfd31c59..0361ec3b0c2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import application_x_www_form_urlencoded -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/x-www-form-urlencoded': api_client.MediaType( schema=application_x_www_form_urlencoded.ApplicationXWwwFormUrlencoded, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/response_for_404/__init__.py index c84e3d66403..50e94a32109 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/response_for_404/__init__.py @@ -23,11 +23,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( application_json.ApplicationJson, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py index 9029bf2592c..470ac7b6674 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -126,7 +126,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Client.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi index 7162eb4ff00..de2978f1230 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi @@ -114,7 +114,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Client.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/response_for_200/__init__.py index eee9db9c103..49ddc156cd7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( client.Client, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py index 4b4779b0eb5..0aee5213ddc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py @@ -39,13 +39,13 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, + '404': response_for_404._404, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '404': response_for_404.response, + '200': response_for_200.SuccessDescriptionOnly, + '404': response_for_404._404, }) @@ -120,7 +120,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi index b8b569f2945..5639fd329b9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/request_body/__init__.py index 9addfd31c59..0361ec3b0c2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import application_x_www_form_urlencoded -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/x-www-form-urlencoded': api_client.MediaType( schema=application_x_www_form_urlencoded.ApplicationXWwwFormUrlencoded, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/response_for_404/__init__.py index 20bbd06e4c5..e399fbcc707 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/response_for_404/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py index e4ec78f72ac..db61ce4e54b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -124,7 +124,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi index 87b70e7a1b4..6f9c8894b4b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi @@ -112,7 +112,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/__init__.py index 325aa624467..4c86bb19d33 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import additional_properties_with_array_of_enums -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/response_for_200/__init__.py index d00e6d7fb49..3a16cb928f8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py index fde9981ef5a..919014f7455 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) @@ -114,7 +114,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi index f166ede6efe..3885fbbf2d6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi @@ -102,7 +102,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/request_body/__init__.py index a43a7dbd010..6e7b1c0382d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/request_body/__init__.py @@ -10,11 +10,10 @@ from petstore_api.components.schema import file_schema_test_class -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=file_schema_test_class.FileSchemaTestClass, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py index c4db75cc2ca..11a75aecb9b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py @@ -52,17 +52,17 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) @@ -155,7 +155,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi index ee1490b3071..98cd161e342 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi @@ -51,7 +51,7 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] class BaseApi(api_client.Api): @@ -143,7 +143,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/parameter_0/__init__.py index c49aaef4fb2..8870bc98fe5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/parameter_0/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="query", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _0(api_client.QueryParameter): + name = "query" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/request_body/__init__.py index a73209a15d0..dd0144ecf1e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/request_body/__init__.py @@ -10,11 +10,10 @@ from petstore_api.components.schema import user -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=user.User, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.py index 07148196f99..056f825d7c7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.py @@ -54,19 +54,19 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, - parameter_2.parameter_oapg, + parameter_0._0, + parameter_1._1, + parameter_2._2, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.pyi index 8567d086647..73b8399e43f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.pyi @@ -53,9 +53,9 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, - parameter_2.parameter_oapg, + parameter_0._0, + parameter_1._1, + parameter_2._2, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_0/__init__.py index 221fafb6841..e559255f127 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_0/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="someVar", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _0(api_client.QueryParameter): + name = "someVar" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_1/__init__.py index 2834a253493..494dd6f8200 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_1/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_1/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="SomeVar", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _1(api_client.QueryParameter): + name = "SomeVar" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_2/__init__.py index 16d90eb80f9..49c13abc1e6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_2/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/parameter_2/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="some_var", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _2(api_client.QueryParameter): + name = "some_var" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py index 6623f963c92..b47a4c063ab 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py @@ -38,11 +38,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -130,7 +130,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Client.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi index 78fbd29d96f..301596b50b0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi @@ -114,7 +114,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Client.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/response_for_200/__init__.py index eee9db9c103..49ddc156cd7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( client.Client, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py index d37b7b33028..af94a40900e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py @@ -51,18 +51,18 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] -default_response = response_for_default.response +default_response = response_for_default.Default __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.pyi index 42ed0f24aa5..0ab8a1df761 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.pyi @@ -50,7 +50,7 @@ class RequestPathParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/parameter_0/__init__.py index 2f7204740e4..16b4b42edaa 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="id", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _0(api_client.PathParameter): + name = "id" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/response_for_default/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/response_for_default/__init__.py index 20bbd06e4c5..a9d06e3d016 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/response_for_default/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/response_for_default/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class Default(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.py index 563a0b5cf18..389ba7b5410 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/response_for_200/__init__.py index 2b555ec2c4e..c6680424248 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( health_check_result.HealthCheckResult, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py index eac522cbb84..015f78d62a4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) @@ -115,7 +115,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi index bad7f8f3deb..af6dee9a21b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi @@ -103,7 +103,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/request_body/__init__.py index d04c9541363..80194486c5c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/request_body/__init__.py @@ -9,11 +9,10 @@ from petstore_api import api_client, exceptions from . import application_json -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=application_json.ApplicationJson, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/__init__.py index 8fbda4a752f..646aa187011 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/__init__.py @@ -54,18 +54,18 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, + parameter_0._0, + parameter_1._1, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -183,7 +183,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/__init__.pyi index ae73e3bbb0e..7c029283c81 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/__init__.pyi @@ -53,8 +53,8 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, + parameter_0._0, + parameter_1._1, ]_all_accept_content_types = ( 'application/json', 'multipart/form-data', @@ -171,7 +171,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/parameter_0/__init__.py index f205bd52266..f7f8129be73 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="compositionAtRoot", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _0(api_client.QueryParameter): + name = "compositionAtRoot" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/parameter_1/__init__.py index dcf477a3c0b..c20b0593309 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/parameter_1/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/parameter_1/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="compositionInProperty", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _1(api_client.QueryParameter): + name = "compositionInProperty" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/request_body/__init__.py index bd5ec8a9064..85977b6e709 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/request_body/__init__.py @@ -10,13 +10,12 @@ from . import application_json from . import multipart_form_data -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=application_json.ApplicationJson, ), 'multipart/form-data': api_client.MediaType( schema=multipart_form_data.MultipartFormData, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/response_for_200/__init__.py index aff90cce386..3654fa41e3a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition/post/response_for_200/__init__.py @@ -25,14 +25,13 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( application_json.ApplicationJson, ), 'multipart/form-data': api_client.MediaType( multipart_form_data.MultipartFormData, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py index 6a5b3312ac4..fc6b5deeede 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) @@ -113,7 +113,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi index b1190c22912..44ea3aff42e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi @@ -101,7 +101,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/request_body/__init__.py index 9addfd31c59..0361ec3b0c2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import application_x_www_form_urlencoded -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/x-www-form-urlencoded': api_client.MediaType( schema=application_x_www_form_urlencoded.ApplicationXWwwFormUrlencoded, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py index f506e6bfc99..ed5d94d6ec3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) @@ -113,7 +113,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi index fc1d0e8b231..d9dd34c7483 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi @@ -101,7 +101,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/request_body/__init__.py index 62d7c7921df..eb73179c230 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import json_patch_request -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json-patch+json': api_client.MediaType( schema=json_patch_request.JSONPatchRequest, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py index 8c34096e750..686c84d57b9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json; charset=utf-8', @@ -124,7 +124,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi index 3012a4c5383..ddedf30a697 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi @@ -112,7 +112,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/request_body/__init__.py index 4bdbc15190a..dede420b188 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import application_json_charsetutf8 -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json; charset=utf-8': api_client.MediaType( schema=application_json_charsetutf8.ApplicationJsonCharsetutf8, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/response_for_200/__init__.py index 8403361beed..3375951cfbf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/response_for_200/__init__.py @@ -23,11 +23,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json; charset=utf-8': api_client.MediaType( application_json_charsetutf8.ApplicationJsonCharsetutf8, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.py index ae3a6fda71f..7cf95ef501a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.py @@ -50,17 +50,17 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.pyi index 8c8294f0f59..21bd8194e82 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.pyi @@ -49,7 +49,7 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/parameter_0/__init__.py index df991a73483..130d7ebb389 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="mapBean", - style=api_client.ParameterStyle.DEEP_OBJECT, - schema=schema.Schema, - explode=True, -) +class _0(api_client.QueryParameter): + name = "mapBean" + style=api_client.ParameterStyle.DEEP_OBJECT + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.py index b8efccb37be..4490ab11ee8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.py @@ -74,11 +74,11 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, - parameter_2.parameter_oapg, - parameter_3.parameter_oapg, - parameter_4.parameter_oapg, + parameter_0._0, + parameter_1._1, + parameter_2._2, + parameter_3._3, + parameter_4._4, ] class RequestHeaderParameters: @@ -104,10 +104,10 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_5.parameter_oapg, - parameter_6.parameter_oapg, - parameter_7.parameter_oapg, - parameter_8.parameter_oapg, + parameter_5._5, + parameter_6._6, + parameter_7._7, + parameter_8._8, ] class RequestPathParameters: @@ -134,11 +134,11 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_9.parameter_oapg, - parameter_10.parameter_oapg, - parameter_11.parameter_oapg, - parameter_12.parameter_oapg, - parameter_13.parameter_oapg, + parameter_9._9, + parameter_10._10, + parameter_11._11, + parameter_12._12, + parameter_13._13, ] class RequestCookieParameters: @@ -165,21 +165,21 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_14.parameter_oapg, - parameter_15.parameter_oapg, - parameter_16.parameter_oapg, - parameter_17.parameter_oapg, - parameter_18.parameter_oapg, + parameter_14._14, + parameter_15._15, + parameter_16._16, + parameter_17._17, + parameter_18._18, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -317,7 +317,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.pyi index c9b2bd0be57..5547417dedc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/__init__.pyi @@ -73,11 +73,11 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, - parameter_2.parameter_oapg, - parameter_3.parameter_oapg, - parameter_4.parameter_oapg, + parameter_0._0, + parameter_1._1, + parameter_2._2, + parameter_3._3, + parameter_4._4, ] class RequestHeaderParameters: @@ -103,10 +103,10 @@ class RequestHeaderParameters: parameters = [ - parameter_5.parameter_oapg, - parameter_6.parameter_oapg, - parameter_7.parameter_oapg, - parameter_8.parameter_oapg, + parameter_5._5, + parameter_6._6, + parameter_7._7, + parameter_8._8, ] class RequestPathParameters: @@ -133,11 +133,11 @@ class RequestPathParameters: parameters = [ - parameter_9.parameter_oapg, - parameter_10.parameter_oapg, - parameter_11.parameter_oapg, - parameter_12.parameter_oapg, - parameter_13.parameter_oapg, + parameter_9._9, + parameter_10._10, + parameter_11._11, + parameter_12._12, + parameter_13._13, ] class RequestCookieParameters: @@ -164,11 +164,11 @@ class RequestCookieParameters: parameters = [ - parameter_14.parameter_oapg, - parameter_15.parameter_oapg, - parameter_16.parameter_oapg, - parameter_17.parameter_oapg, - parameter_18.parameter_oapg, + parameter_14._14, + parameter_15._15, + parameter_16._16, + parameter_17._17, + parameter_18._18, ]_all_accept_content_types = ( 'application/json', ) @@ -305,7 +305,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_0/__init__.py index 12b8c866eba..3f7cc6ae792 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="1", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _0(api_client.QueryParameter): + name = "1" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_1/__init__.py index 14df284365b..c754419112f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_1/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_1/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="aB", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _1(api_client.QueryParameter): + name = "aB" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_10/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_10/__init__.py index c892be11839..e26dac7b607 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_10/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_10/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="aB", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _10(api_client.PathParameter): + name = "aB" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_11/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_11/__init__.py index 8d56231426a..ea7688f6f1f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_11/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_11/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="Ab", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _11(api_client.PathParameter): + name = "Ab" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_12/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_12/__init__.py index 0760e485949..42f1db2bf4e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_12/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_12/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="self", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _12(api_client.PathParameter): + name = "self" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_13/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_13/__init__.py index d737ed955c0..91277127bfc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_13/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_13/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="A-B", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _13(api_client.PathParameter): + name = "A-B" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_14/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_14/__init__.py index 6970d09f62e..2214bc62136 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_14/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_14/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.CookieParameter( - name="1", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _14(api_client.CookieParameter): + name = "1" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_15/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_15/__init__.py index 1b3eda127b7..2ccba39a680 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_15/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_15/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.CookieParameter( - name="aB", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _15(api_client.CookieParameter): + name = "aB" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_16/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_16/__init__.py index ffff0d55c20..ce68511dc17 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_16/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_16/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.CookieParameter( - name="Ab", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _16(api_client.CookieParameter): + name = "Ab" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_17/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_17/__init__.py index 0474f862779..154ed71b251 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_17/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_17/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.CookieParameter( - name="self", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _17(api_client.CookieParameter): + name = "self" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_18/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_18/__init__.py index 2f6b96fbad4..9685931c250 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_18/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_18/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.CookieParameter( - name="A-B", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _18(api_client.CookieParameter): + name = "A-B" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_2/__init__.py index 145f8e5e090..483283c8536 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_2/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_2/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="Ab", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _2(api_client.QueryParameter): + name = "Ab" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_3/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_3/__init__.py index 0d12c57f999..7340bfa51a4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_3/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_3/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="self", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _3(api_client.QueryParameter): + name = "self" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_4/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_4/__init__.py index 449f58b1cbd..a27df0a0327 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_4/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_4/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="A-B", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - explode=True, -) +class _4(api_client.QueryParameter): + name = "A-B" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_5/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_5/__init__.py index 72202c9e7d4..d9a3ace5c2c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_5/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_5/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="1", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class _5(api_client.HeaderParameter): + name = "1" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_6/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_6/__init__.py index 42072c83df6..4c4dce3b0e5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_6/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_6/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="aB", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class _6(api_client.HeaderParameter): + name = "aB" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_7/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_7/__init__.py index 609cd4e3701..8eaf5fda5e5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_7/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_7/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="self", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class _7(api_client.HeaderParameter): + name = "self" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_8/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_8/__init__.py index 1e2d6b24217..9b5c2c375c1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_8/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_8/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="A-B", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class _8(api_client.HeaderParameter): + name = "A-B" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_9/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_9/__init__.py index 3d4b6efe88c..15d994c1b2e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_9/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/parameter_9/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="1", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _9(api_client.PathParameter): + name = "1" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/__init__.py index 8975b84a9b0..c1bec842a59 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import application_json -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=application_json.ApplicationJson, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/response_for_200/__init__.py index c84e3d66403..2b6be265674 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/response_for_200/__init__.py @@ -23,11 +23,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( application_json.ApplicationJson, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py index 5b076fbc791..28f2fb6f573 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py @@ -52,7 +52,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] _auth = [ 'petstore_auth', @@ -62,11 +62,11 @@ class Params(RequiredParams, OptionalParams): __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -169,7 +169,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi index af2a68dfd39..65862bef5cb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi @@ -51,7 +51,7 @@ class RequestPathParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ]_all_accept_content_types = ( 'application/json', ) @@ -153,7 +153,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameter_0/__init__.py index 8906f9f32b6..6a34450d9b1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _0(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/__init__.py index cd0ad43a93c..f9a380add29 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import multipart_form_data -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'multipart/form-data': api_client.MediaType( schema=multipart_form_data.MultipartFormData, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/response_for_200/__init__.py index 242aad4c5e1..594fc0e82e1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( api_response.ApiResponse, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py index 2b458581d8d..8b2b6eda429 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py @@ -51,17 +51,17 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.pyi index 54e88583509..16f7f6c71aa 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.pyi @@ -50,7 +50,7 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ]_all_accept_content_types = ( 'application/json', ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/parameter_0/__init__.py index dc580f1facf..0604f664ce1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/parameter_0/__init__.py @@ -14,10 +14,9 @@ from . import application_json -parameter_oapg = api_client.QueryParameter( - name="someParam", - content={ +class _0(api_client.QueryParameter): + name = "someParam" + content = { "application/json": application_json.ApplicationJson, - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/response_for_200/__init__.py index c84e3d66403..2b6be265674 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/response_for_200/__init__.py @@ -23,11 +23,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( application_json.ApplicationJson, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py index 0523a7eecd0..9af6ea0bd83 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py @@ -50,17 +50,17 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.pyi index 1d310ad11c1..e8d6d296a38 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.pyi @@ -49,7 +49,7 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/parameter_0/__init__.py index 1a3bb139d5d..c04deb3ca38 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/parameter_0/__init__.py @@ -15,9 +15,8 @@ from petstore_api.components.schema import foo -parameter_oapg = api_client.QueryParameter( - name="mapBean", - style=api_client.ParameterStyle.DEEP_OBJECT, - schema=foo.Foo, - explode=True, -) +class _0(api_client.QueryParameter): + name = "mapBean" + style=api_client.ParameterStyle.DEEP_OBJECT + schema = foo.Foo + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py index ac2b3a47437..4ee23568103 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -124,7 +124,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi index fea5d98513a..9d1561e8700 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi @@ -112,7 +112,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/request_body/__init__.py index 2c4ceb74dd3..1da24f47f4a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import array_of_enums -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=array_of_enums.ArrayOfEnums, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/response_for_200/__init__.py index 53d3409d674..d8f659b8f9e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( array_of_enums.ArrayOfEnums, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py index 4a8b55e7128..fec0a715554 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -123,7 +123,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi index 14b911d8393..dd5030f1cc4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi @@ -111,7 +111,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/request_body/__init__.py index 40b3456b6a0..10b9d95361c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import animal_farm -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=animal_farm.AnimalFarm, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/response_for_200/__init__.py index 7a59be2be7e..18d9e5a003c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( animal_farm.AnimalFarm, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py index 2351bfe3dc0..3937e6cbc8f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -123,7 +123,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi index 3c3b0ef03d6..29d6cc46a11 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi @@ -111,7 +111,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/request_body/__init__.py index c3b7485a405..a61d77bf88d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import boolean -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=boolean.Boolean, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/response_for_200/__init__.py index 8a754978829..2470b5d0855 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( boolean.Boolean, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py index 5490392f100..91830b17779 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -123,7 +123,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi index 6a7bbac2475..589b692b6f1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi @@ -111,7 +111,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/__init__.py index 75f8f295e09..c76b991458d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import composed_one_of_different_types -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=composed_one_of_different_types.ComposedOneOfDifferentTypes, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/response_for_200/__init__.py index e1276ffa7e9..87b516941f2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( composed_one_of_different_types.ComposedOneOfDifferentTypes, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py index 80206ad52c1..0cf0745a3f9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -123,7 +123,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi index bbc93e5f05f..e3845877b98 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi @@ -111,7 +111,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/request_body/__init__.py index dc04af61fb9..5e28cc91f99 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import string_enum -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=string_enum.StringEnum, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/response_for_200/__init__.py index 0ee457cf2ae..eca7985f13a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( string_enum.StringEnum, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py index fb82d359bfb..eba120f62bd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -125,7 +125,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi index 98dd47f95f3..90b3b6d6832 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi @@ -113,7 +113,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/request_body/__init__.py index ac43b318177..20dadd71bab 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/request_body/__init__.py @@ -10,11 +10,10 @@ from petstore_api.components.schema import mammal -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=mammal.Mammal, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/response_for_200/__init__.py index 04307c17c26..61403c1d88a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( mammal.Mammal, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py index 65850bdd1eb..33e1a900446 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -123,7 +123,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi index 422baf12372..a226103e327 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi @@ -111,7 +111,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/request_body/__init__.py index 06f2c5fb994..43be70b998f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import number_with_validations -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=number_with_validations.NumberWithValidations, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/response_for_200/__init__.py index 02fc4821ba1..df926a5ca82 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( number_with_validations.NumberWithValidations, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py index 136ed7d1f43..c7dbc0b3921 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -123,7 +123,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi index 3e88d15c8ec..2be3f4267de 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi @@ -111,7 +111,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/__init__.py index 30b2f542e31..b0e4f41af61 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import object_model_with_ref_props -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=object_model_with_ref_props.ObjectModelWithRefProps, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/response_for_200/__init__.py index 6d84dfc2ddb..df179dfc255 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( object_model_with_ref_props.ObjectModelWithRefProps, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py index 0d857b60dcf..7b48df503a0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -123,7 +123,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi index 59495b7c136..559e2e9f3ad 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi @@ -111,7 +111,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/request_body/__init__.py index 9eb93524788..7bfb5860b77 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/request_body/__init__.py @@ -10,10 +10,9 @@ from petstore_api.components.schema import string -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=string.String, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/response_for_200/__init__.py index e55840d4cfa..ec8d8ecbbdd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( string.String, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.py index cb6e7c327f4..7f88fe79fdf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.py @@ -33,11 +33,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/response_for_200/__init__.py index bc33544a8da..d8d80a796c9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/response_for_200/__init__.py @@ -23,12 +23,11 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( ), 'application/xml': api_client.MediaType( ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.py index 89e9013c78c..9abb87e77cf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.py @@ -60,22 +60,22 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, - parameter_2.parameter_oapg, - parameter_3.parameter_oapg, - parameter_4.parameter_oapg, - parameter_5.parameter_oapg, + parameter_0._0, + parameter_1._1, + parameter_2._2, + parameter_3._3, + parameter_4._4, + parameter_5._5, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessDescriptionOnly, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.pyi index aefaa183104..8ee943d7754 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.pyi @@ -59,12 +59,12 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, - parameter_2.parameter_oapg, - parameter_3.parameter_oapg, - parameter_4.parameter_oapg, - parameter_5.parameter_oapg, + parameter_0._0, + parameter_1._1, + parameter_2._2, + parameter_3._3, + parameter_4._4, + parameter_5._5, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_0/__init__.py index 24e91d34639..8715299ef54 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_0/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="pipe", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _0(api_client.QueryParameter): + name = "pipe" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_1/__init__.py index 7033440c5be..d89b0207a61 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_1/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_1/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="ioutil", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, -) +class _1(api_client.QueryParameter): + name = "ioutil" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_2/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_2/__init__.py index 86ed8a17e9e..26953ead8e5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_2/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_2/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="http", - style=api_client.ParameterStyle.SPACE_DELIMITED, - schema=schema.Schema, - required=True, -) +class _2(api_client.QueryParameter): + name = "http" + style = api_client.ParameterStyle.SPACE_DELIMITED + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_3/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_3/__init__.py index fd47f6287ea..f809805bed9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_3/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_3/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="url", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, -) +class _3(api_client.QueryParameter): + name = "url" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_4/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_4/__init__.py index d142bd4db74..8e33414193e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_4/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_4/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="context", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _4(api_client.QueryParameter): + name = "context" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_5/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_5/__init__.py index f412aff000a..437df21b44d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_5/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/parameter_5/__init__.py @@ -15,10 +15,9 @@ from petstore_api.components.schema import string_with_validation -parameter_oapg = api_client.QueryParameter( - name="refParam", - style=api_client.ParameterStyle.FORM, - schema=string_with_validation.StringWithValidation, - required=True, - explode=True, -) +class _5(api_client.QueryParameter): + name = "refParam" + style = api_client.ParameterStyle.FORM + schema = string_with_validation.StringWithValidation + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py index 2f4d84a2c1b..7723884718a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/octet-stream', @@ -126,7 +126,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi index af63a465beb..b4b2843da06 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi @@ -114,7 +114,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/request_body/__init__.py index 45050070331..6458d4c3a5a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/request_body/__init__.py @@ -9,11 +9,10 @@ from petstore_api import api_client, exceptions from . import application_octet_stream -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/octet-stream': api_client.MediaType( schema=application_octet_stream.ApplicationOctetStream, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/response_for_200/__init__.py index f5b8529487e..e7f10f5b38d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/response_for_200/__init__.py @@ -23,11 +23,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/octet-stream': api_client.MediaType( application_octet_stream.ApplicationOctetStream, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py index 13516db695b..1b7c1277a53 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -124,7 +124,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi index 9e09444df48..852d9255fe6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi @@ -112,7 +112,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/request_body/__init__.py index cd0ad43a93c..f9a380add29 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import multipart_form_data -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'multipart/form-data': api_client.MediaType( schema=multipart_form_data.MultipartFormData, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/response_for_200/__init__.py index 242aad4c5e1..594fc0e82e1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( api_response.ApiResponse, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py index e50431aa90b..6f1401f28d4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py @@ -34,11 +34,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200._200, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200._200, }) _all_accept_content_types = ( 'application/json', @@ -124,7 +124,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi index d0ce966d99d..cace6d4a0ce 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi @@ -112,7 +112,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/request_body/__init__.py index cd0ad43a93c..f9a380add29 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import multipart_form_data -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'multipart/form-data': api_client.MediaType( schema=multipart_form_data.MultipartFormData, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/response_for_200/__init__.py index 242aad4c5e1..594fc0e82e1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/response_for_200/__init__.py @@ -24,11 +24,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( api_response.ApiResponse, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.py index 4d7c98f0c49..1ba7ba853b3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.py @@ -30,7 +30,7 @@ -default_response = response_for_default.response +default_response = response_for_default.Default _all_accept_content_types = ( 'application/json', ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/response_for_default/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/response_for_default/__init__.py index c84e3d66403..df72fa79e02 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/response_for_default/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/response_for_default/__init__.py @@ -23,11 +23,10 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class Default(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/json': api_client.MediaType( application_json.ApplicationJson, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py index 078c07f4ae6..ceda0e0c9b2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py @@ -51,13 +51,13 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '405': api_client.OpenApiResponse[response_for_405.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, + '405': response_for_405._405, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '405': response_for_405.response, + '200': response_for_200.SuccessDescriptionOnly, + '405': response_for_405._405, }) @@ -152,7 +152,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Pet.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi index 7cdbc1be60f..0011e71b7e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi @@ -122,7 +122,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Pet.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/response_for_405/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/response_for_405/__init__.py index 20bbd06e4c5..2263083f0c9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/response_for_405/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/response_for_405/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _405(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py index f07c24b5af3..1677e125e92 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py @@ -52,15 +52,15 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], - '405': api_client.OpenApiResponse[response_for_405.ApiResponse], + '400': response_for_400._400, + '404': response_for_404._404, + '405': response_for_405._405, } ) _status_code_to_response = __StatusCodeToResponse({ - '400': response_for_400.response, - '404': response_for_404.response, - '405': response_for_405.response, + '400': response_for_400._400, + '404': response_for_404._404, + '405': response_for_405._405, }) @@ -145,7 +145,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Pet.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi index 535a86fdd89..797cd55975a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi @@ -113,7 +113,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.Pet.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_404/__init__.py index 20bbd06e4c5..e399fbcc707 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_404/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_405/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_405/__init__.py index 20bbd06e4c5..2263083f0c9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_405/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/response_for_405/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _405(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.py index 353809d8143..4f19f9048bd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.py @@ -52,7 +52,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] _auth = [ 'http_signature_test', @@ -63,13 +63,13 @@ class Params(RequiredParams, OptionalParams): __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '200': response_for_200._200, + '400': response_for_400._400, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '400': response_for_400.response, + '200': response_for_200._200, + '400': response_for_400._400, }) _all_accept_content_types = ( 'application/xml', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.pyi index c53731524e4..d5753ce7d18 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.pyi @@ -51,7 +51,7 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ]_all_accept_content_types = ( 'application/xml', 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/parameter_0/__init__.py index 1553b8869cc..2e85b2e03eb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="status", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, -) +class _0(api_client.QueryParameter): + name = "status" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/response_for_200/__init__.py index 11240e4b684..8a0b1f0fe36 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/response_for_200/__init__.py @@ -25,14 +25,13 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/xml': api_client.MediaType( application_xml.ApplicationXml, ), 'application/json': api_client.MediaType( application_json.ApplicationJson, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.py index cc31c8d3d84..05b9eb1ee0b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.py @@ -52,7 +52,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] _auth = [ 'http_signature_test', @@ -63,13 +63,13 @@ class Params(RequiredParams, OptionalParams): __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '200': response_for_200._200, + '400': response_for_400._400, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '400': response_for_400.response, + '200': response_for_200._200, + '400': response_for_400._400, }) _all_accept_content_types = ( 'application/xml', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.pyi index 48e5cc555c9..ce29c420cc0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.pyi @@ -51,7 +51,7 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ]_all_accept_content_types = ( 'application/xml', 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/parameter_0/__init__.py index bd4051cf7f2..50d2ed2cdbd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="tags", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, -) +class _0(api_client.QueryParameter): + name = "tags" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/response_for_200/__init__.py index 11240e4b684..8a0b1f0fe36 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/response_for_200/__init__.py @@ -25,14 +25,13 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/xml': api_client.MediaType( application_xml.ApplicationXml, ), 'application/json': api_client.MediaType( application_json.ApplicationJson, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.py index 112b5b9d969..7107608a106 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.py @@ -52,7 +52,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] class RequestPathParameters: @@ -75,7 +75,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_1.parameter_oapg, + parameter_1._1, ] _auth = [ 'petstore_auth', @@ -85,11 +85,11 @@ class Params(RequiredParams, OptionalParams): __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '400': response_for_400._400, } ) _status_code_to_response = __StatusCodeToResponse({ - '400': response_for_400.response, + '400': response_for_400._400, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.pyi index ea1f1bea3a7..243ea532c2e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.pyi @@ -51,7 +51,7 @@ class RequestHeaderParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] class RequestPathParameters: @@ -74,7 +74,7 @@ class RequestPathParameters: parameters = [ - parameter_1.parameter_oapg, + parameter_1._1, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/parameter_0/__init__.py index 7c279aaa710..1261d17c220 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/parameter_0/__init__.py @@ -14,8 +14,7 @@ from . import schema -parameter_oapg = api_client.HeaderParameter( - name="api_key", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class _0(api_client.HeaderParameter): + name = "api_key" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/parameter_1/__init__.py index 8906f9f32b6..8a93a05a0d2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/parameter_1/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/parameter_1/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _1(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.py index 00d9695453d..2def7b4a079 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.py @@ -53,7 +53,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] _auth = [ 'api_key', @@ -63,15 +63,15 @@ class Params(RequiredParams, OptionalParams): __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '200': response_for_200._200, + '400': response_for_400._400, + '404': response_for_404._404, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '400': response_for_400.response, - '404': response_for_404.response, + '200': response_for_200._200, + '400': response_for_400._400, + '404': response_for_404._404, }) _all_accept_content_types = ( 'application/xml', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.pyi index c69049cc438..8f1fcc8dce5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.pyi @@ -52,7 +52,7 @@ class RequestPathParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ]_all_accept_content_types = ( 'application/xml', 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/parameter_0/__init__.py index 8906f9f32b6..6a34450d9b1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _0(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_200/__init__.py index 5c68793090c..ed16fbb5200 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_200/__init__.py @@ -25,14 +25,13 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/xml': api_client.MediaType( pet.Pet, ), 'application/json': api_client.MediaType( pet.Pet, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_404/__init__.py index 20bbd06e4c5..e399fbcc707 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/response_for_404/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py index 0cb0317ee20..824a3d169e0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py @@ -52,7 +52,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] _auth = [ 'petstore_auth', @@ -62,11 +62,11 @@ class Params(RequiredParams, OptionalParams): __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '405': api_client.OpenApiResponse[response_for_405.ApiResponse], + '405': response_for_405._405, } ) _status_code_to_response = __StatusCodeToResponse({ - '405': response_for_405.response, + '405': response_for_405._405, }) @@ -151,7 +151,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi index f713be64dc8..3b849f1e205 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi @@ -51,7 +51,7 @@ class RequestPathParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] class BaseApi(api_client.Api): @@ -135,7 +135,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/parameter_0/__init__.py index 8906f9f32b6..6a34450d9b1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _0(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/request_body/__init__.py index 9addfd31c59..0361ec3b0c2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import application_x_www_form_urlencoded -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/x-www-form-urlencoded': api_client.MediaType( schema=application_x_www_form_urlencoded.ApplicationXWwwFormUrlencoded, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/response_for_405/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/response_for_405/__init__.py index 20bbd06e4c5..2263083f0c9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/response_for_405/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/response_for_405/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _405(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py index 37ccb186c18..c5303d1bbdb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py @@ -52,7 +52,7 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] _auth = [ 'petstore_auth', @@ -62,11 +62,11 @@ class Params(RequiredParams, OptionalParams): __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessWithJsonApiResponse, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessWithJsonApiResponse, }) _all_accept_content_types = ( 'application/json', @@ -169,7 +169,7 @@ class instances _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi index 3537e6d33fa..d2d7c6d729c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi @@ -51,7 +51,7 @@ class RequestPathParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ]_all_accept_content_types = ( 'application/json', ) @@ -153,7 +153,7 @@ class BaseApi(api_client.Api): _fields = None _body = None if body is not schemas.unset: - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/parameter_0/__init__.py index 8906f9f32b6..6a34450d9b1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="petId", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _0(api_client.PathParameter): + name = "petId" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/request_body/__init__.py index cd0ad43a93c..f9a380add29 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/request_body/__init__.py @@ -9,10 +9,9 @@ from petstore_api import api_client, exceptions from . import multipart_form_data -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'multipart/form-data': api_client.MediaType( schema=multipart_form_data.MultipartFormData, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.py index ad0f2823525..98f89483cc1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.py @@ -37,11 +37,11 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '200': response_for_200.SuccessInlineContentAndHeader, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, + '200': response_for_200.SuccessInlineContentAndHeader, }) _all_accept_content_types = ( 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py index 8c6f9722386..111ee886000 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py @@ -35,13 +35,13 @@ __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '200': response_for_200._200, + '400': response_for_400._400, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '400': response_for_400.response, + '200': response_for_200._200, + '400': response_for_400._400, }) _all_accept_content_types = ( 'application/xml', @@ -130,7 +130,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi index 17fd76e4906..85b6a1feaea 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi @@ -116,7 +116,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/request_body/__init__.py index 9d83e5435f4..991f44c2ef4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/request_body/__init__.py @@ -10,11 +10,10 @@ from petstore_api.components.schema import order -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=order.Order, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/response_for_200/__init__.py index 467661597fc..a3b9783db96 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/response_for_200/__init__.py @@ -25,14 +25,13 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/xml': api_client.MediaType( order.Order, ), 'application/json': api_client.MediaType( order.Order, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.py index 0986059c816..7dac542d6e0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.py @@ -51,19 +51,19 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '400': response_for_400._400, + '404': response_for_404._404, } ) _status_code_to_response = __StatusCodeToResponse({ - '400': response_for_400.response, - '404': response_for_404.response, + '400': response_for_400._400, + '404': response_for_404._404, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.pyi index 3c11c3480be..ab8f2b7f9f8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.pyi @@ -50,7 +50,7 @@ class RequestPathParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/parameter_0/__init__.py index 19795d42822..fd5e0497a25 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="order_id", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _0(api_client.PathParameter): + name = "order_id" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/response_for_404/__init__.py index 20bbd06e4c5..e399fbcc707 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/response_for_404/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.py index bd56dea3783..70ae4f68432 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.py @@ -53,21 +53,21 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '200': response_for_200._200, + '400': response_for_400._400, + '404': response_for_404._404, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '400': response_for_400.response, - '404': response_for_404.response, + '200': response_for_200._200, + '400': response_for_400._400, + '404': response_for_404._404, }) _all_accept_content_types = ( 'application/xml', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.pyi index ff38ad12ba3..ac8a79bbe2d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.pyi @@ -52,7 +52,7 @@ class RequestPathParameters: parameters = [ - parameter_0.parameter_oapg, + parameter_0._0, ]_all_accept_content_types = ( 'application/xml', 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/parameter_0/__init__.py index 19795d42822..fd5e0497a25 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/parameter_0/__init__.py @@ -14,9 +14,8 @@ from . import schema -parameter_oapg = api_client.PathParameter( - name="order_id", - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, - required=True, -) +class _0(api_client.PathParameter): + name = "order_id" + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_200/__init__.py index 467661597fc..a3b9783db96 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_200/__init__.py @@ -25,14 +25,13 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/xml': api_client.MediaType( order.Order, ), 'application/json': api_client.MediaType( order.Order, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_404/__init__.py index 20bbd06e4c5..e399fbcc707 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/response_for_404/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py index 5d87e5b7e88..691d382df82 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py @@ -31,7 +31,7 @@ -default_response = response_for_default.response +default_response = response_for_default.Default class BaseApi(api_client.Api): @@ -107,7 +107,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi index f3333a7a88c..5e1495c8336 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi @@ -103,7 +103,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/request_body/__init__.py index a73209a15d0..dd0144ecf1e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/request_body/__init__.py @@ -10,11 +10,10 @@ from petstore_api.components.schema import user -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=user.User, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/response_for_default/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/response_for_default/__init__.py index 20bbd06e4c5..a9d06e3d016 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/response_for_default/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/response_for_default/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class Default(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py index 3a43ced6eba..317e49a6bbb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py @@ -31,7 +31,7 @@ -default_response = response_for_default.response +default_response = response_for_default.Default class BaseApi(api_client.Api): @@ -107,7 +107,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.UserArray.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi index 9165f550c36..10c683efc99 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi @@ -103,7 +103,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.UserArray.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/response_for_default/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/response_for_default/__init__.py index 20bbd06e4c5..a9d06e3d016 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/response_for_default/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/response_for_default/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class Default(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py index 2aac643d699..f88c0011771 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py @@ -31,7 +31,7 @@ -default_response = response_for_default.response +default_response = response_for_default.Default class BaseApi(api_client.Api): @@ -107,7 +107,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.UserArray.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi index 7303ca9e26e..50766e5a9c6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi @@ -103,7 +103,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.UserArray.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/response_for_default/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/response_for_default/__init__.py index 20bbd06e4c5..a9d06e3d016 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/response_for_default/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/response_for_default/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class Default(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.py index cbc164cffa8..ca0e4cae42a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.py @@ -54,20 +54,20 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, + parameter_0._0, + parameter_1._1, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '200': response_for_200._200, + '400': response_for_400._400, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '400': response_for_400.response, + '200': response_for_200._200, + '400': response_for_400._400, }) _all_accept_content_types = ( 'application/xml', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.pyi index c11456d559d..47eb1d1a254 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.pyi @@ -53,8 +53,8 @@ class RequestQueryParameters: parameters = [ - parameter_0.parameter_oapg, - parameter_1.parameter_oapg, + parameter_0._0, + parameter_1._1, ]_all_accept_content_types = ( 'application/xml', 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/parameter_0/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/parameter_0/__init__.py index 08877af910f..7135a5e998f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/parameter_0/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/parameter_0/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="username", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _0(api_client.QueryParameter): + name = "username" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/parameter_1/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/parameter_1/__init__.py index 5666bc9ce3c..73964ed1498 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/parameter_1/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/parameter_1/__init__.py @@ -14,10 +14,9 @@ from . import schema -parameter_oapg = api_client.QueryParameter( - name="password", - style=api_client.ParameterStyle.FORM, - schema=schema.Schema, - required=True, - explode=True, -) +class _1(api_client.QueryParameter): + name = "password" + style = api_client.ParameterStyle.FORM + schema = schema.Schema + required = True + explode = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/__init__.py index e3e5fc94b5b..89c1c75bd3a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/__init__.py @@ -48,13 +48,13 @@ class Params(RequiredParams, OptionalParams): parameters = [ - header_ref_schema_header.parameter_oapg, - header_x_rate_limit.parameter_oapg, - header_int32_json_content_type_header.parameter_oapg, - header_x_expires_after.parameter_oapg, - header_ref_content_schema_header.parameter_oapg, - header_string_header.parameter_oapg, - header_number_header.parameter_oapg, + header_ref_schema_header.RefSchemaHeader, + header_x_rate_limit.XRateLimit, + header_int32_json_content_type_header.Int32JsonContentTypeHeader, + header_x_expires_after.XExpiresAfter, + header_ref_content_schema_header.RefContentSchemaHeader, + header_string_header.StringHeader, + header_number_header.NumberHeader, ] @dataclasses.dataclass @@ -67,15 +67,14 @@ class ApiResponse(api_client.ApiResponse): headers: Header.Params -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/xml': api_client.MediaType( application_xml.ApplicationXml, ), 'application/json': api_client.MediaType( application_json.ApplicationJson, ), - }, + } headers=Header.parameters -) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/header_x_expires_after/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/header_x_expires_after/__init__.py index a1a0e19df09..67c93ea45e7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/header_x_expires_after/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/header_x_expires_after/__init__.py @@ -14,7 +14,6 @@ from . import schema -parameter_oapg = api_client.HeaderParameterWithoutName( - style=api_client.ParameterStyle.SIMPLE, - schema=schema.Schema, -) +class XExpiresAfter(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + schema = schema.Schema diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/header_x_rate_limit/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/header_x_rate_limit/__init__.py index 704f1e8a48b..d185c6a2e0f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/header_x_rate_limit/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_200/header_x_rate_limit/__init__.py @@ -14,10 +14,9 @@ from . import application_json -parameter_oapg = api_client.HeaderParameterWithoutName( - style=api_client.ParameterStyle.SIMPLE, - content={ +class XRateLimit(api_client.HeaderParameterWithoutName): + style = api_client.ParameterStyle.SIMPLE + content = { "application/json": application_json.ApplicationJson, - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.py index 0eb5a693c9a..d297e4d56b0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.py @@ -29,7 +29,7 @@ -default_response = response_for_default.response +default_response = response_for_default.SuccessDescriptionOnly class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.py index 2c32655cb97..ad97ab0b1e3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.py @@ -51,19 +51,19 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_path_user_name.parameter_oapg, + parameter_path_user_name.PathUserName, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '200': response_for_200.SuccessDescriptionOnly, + '404': response_for_404._404, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '404': response_for_404.response, + '200': response_for_200.SuccessDescriptionOnly, + '404': response_for_404._404, }) diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.pyi index 67689eec9a0..07a28640688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.pyi @@ -50,7 +50,7 @@ class RequestPathParameters: parameters = [ - parameter_path_user_name.parameter_oapg, + parameter_path_user_name.PathUserName, ] class BaseApi(api_client.Api): diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/response_for_404/__init__.py index 20bbd06e4c5..e399fbcc707 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/response_for_404/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.py index dca0a6df58d..56fbba853fd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.py @@ -53,21 +53,21 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_path_user_name.parameter_oapg, + parameter_path_user_name.PathUserName, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '200': api_client.OpenApiResponse[response_for_200.ApiResponse], - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '200': response_for_200._200, + '400': response_for_400._400, + '404': response_for_404._404, } ) _status_code_to_response = __StatusCodeToResponse({ - '200': response_for_200.response, - '400': response_for_400.response, - '404': response_for_404.response, + '200': response_for_200._200, + '400': response_for_400._400, + '404': response_for_404._404, }) _all_accept_content_types = ( 'application/xml', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.pyi index f901946565c..411704b5e8a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.pyi @@ -52,7 +52,7 @@ class RequestPathParameters: parameters = [ - parameter_path_user_name.parameter_oapg, + parameter_path_user_name.PathUserName, ]_all_accept_content_types = ( 'application/xml', 'application/json', diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_200/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_200/__init__.py index e574e297576..51aa3ed966c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_200/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_200/__init__.py @@ -25,14 +25,13 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, - content={ +class _200(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse + content = { 'application/xml': api_client.MediaType( user.User, ), 'application/json': api_client.MediaType( user.User, ), - }, -) + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_404/__init__.py index 20bbd06e4c5..e399fbcc707 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/response_for_404/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py index 9d1e68c3432..ef3e1c4a1e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py @@ -53,19 +53,19 @@ class Params(RequiredParams, OptionalParams): parameters = [ - parameter_path_user_name.parameter_oapg, + parameter_path_user_name.PathUserName, ] __StatusCodeToResponse = typing_extensions.TypedDict( '__StatusCodeToResponse', { - '400': api_client.OpenApiResponse[response_for_400.ApiResponse], - '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '400': response_for_400._400, + '404': response_for_404._404, } ) _status_code_to_response = __StatusCodeToResponse({ - '400': response_for_400.response, - '404': response_for_404.response, + '400': response_for_400._400, + '404': response_for_404._404, }) @@ -152,7 +152,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi index 1245b6428d7..9e87b287178 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi @@ -52,7 +52,7 @@ class RequestPathParameters: parameters = [ - parameter_path_user_name.parameter_oapg, + parameter_path_user_name.PathUserName, ] class BaseApi(api_client.Api): @@ -138,7 +138,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body.parameter_oapg.serialize(body, content_type) + serialized_data = request_body.RequestBody.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/request_body/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/request_body/__init__.py index a73209a15d0..dd0144ecf1e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/request_body/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/request_body/__init__.py @@ -10,11 +10,10 @@ from petstore_api.components.schema import user -parameter_oapg = api_client.RequestBody( - content={ +class RequestBody(api_client.RequestBody): + content = { 'application/json': api_client.MediaType( schema=user.User, ), - }, - required=True, -) + } + required = True diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/response_for_400/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/response_for_400/__init__.py index 20bbd06e4c5..bd0d4cf9688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/response_for_400/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/response_for_400/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _400(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/response_for_404/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/response_for_404/__init__.py index 20bbd06e4c5..e399fbcc707 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/response_for_404/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/response_for_404/__init__.py @@ -20,6 +20,5 @@ class ApiResponse(api_client.ApiResponse): headers: schemas.Unset = schemas.unset -response = api_client.OpenApiResponse( - response_cls=ApiResponse, -) +class _404(api_client.OpenApiResponse[ApiResponse]): + response_cls = ApiResponse diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py index 61055ffb524..b07531d28b9 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py @@ -54,18 +54,18 @@ class ApiResponse(api_client.ApiResponse): body: shape.Shape headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=shape.Shape), - }, - ) + } + data = { 'shapeType': 'Triangle', 'triangleType': 'EquilateralTriangle', } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, equilateral_triangle.EquilateralTriangle)) self.assertEqual(body['shapeType'], 'Triangle') @@ -83,7 +83,7 @@ class ApiResponse(api_client.ApiResponse): r"\['ComplexQuadrilateral', 'SimpleQuadrilateral'\] are allowed at \('args\[0\]', 'quadrilateralType'\)" ) with self.assertRaisesRegex(petstore_api.ApiValueError, err_msg): - _response_for_200.deserialize(response, self.configuration) + ResponseFor200.deserialize(response, self.configuration) def test_deserialize_animal(self): """ @@ -98,19 +98,19 @@ class ApiResponse(api_client.ApiResponse): body: animal.Animal headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=animal.Animal), - }, - ) + } + data = { 'className': 'Dog', 'color': 'white', 'breed': 'Jack Russel Terrier' } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, dog.Dog)) self.assertEqual(body['className'], 'Dog') @@ -168,12 +168,12 @@ class ApiResponse(api_client.ApiResponse): body: mammal.Mammal headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=mammal.Mammal), - }, - ) + } + has_baleen = True has_teeth = False class_name = 'whale' @@ -183,7 +183,7 @@ class ApiResponse(api_client.ApiResponse): 'className': class_name } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, whale.Whale)) self.assertEqual(bool(body['hasBaleen']), has_baleen) @@ -198,7 +198,7 @@ class ApiResponse(api_client.ApiResponse): 'className': class_name } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, zebra.Zebra)) self.assertEqual(body['type'], zebra_type) @@ -214,17 +214,17 @@ class ApiResponse(api_client.ApiResponse): body: banana.Banana headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=banana.Banana), - }, - ) + } + data = { 'lengthCm': 3.1415 } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, banana.Banana)) self.assertTrue(isinstance(body.lengthCm, Decimal)) @@ -239,7 +239,7 @@ class ApiResponse(api_client.ApiResponse): 'lengthCm': 3 } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, banana.Banana)) self.assertTrue(isinstance(body.lengthCm, Decimal)) @@ -256,15 +256,15 @@ class ApiResponse(api_client.ApiResponse): body: fruit_req.FruitReq headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=fruit_req.FruitReq), - }, - ) + } + data = None response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) self.assertTrue(isinstance(deserialized.body, fruit_req.FruitReq)) self.assertTrue(isinstance(deserialized.body, NoneClass)) @@ -296,13 +296,13 @@ class ApiResponse(api_client.ApiResponse): body: dog.Dog headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=dog.Dog), - }, - ) - deserialized = _response_for_200.deserialize(response, self.configuration) + } + + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, dog.Dog)) self.assertEqual(body['className'], 'Dog') @@ -329,13 +329,13 @@ class ApiResponse(api_client.ApiResponse): body: mammal.Mammal headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=mammal.Mammal), - }, - ) - deserialized = _response_for_200.deserialize(response, self.configuration) + } + + deserialized = ResponseFor200.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, zebra.Zebra)) self.assertEqual(body['className'], 'zebra') @@ -349,12 +349,12 @@ class ApiResponse(api_client.ApiResponse): body: banana_req.BananaReq headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=banana_req.BananaReq), - }, - ) + } + with self.assertRaises( petstore_api.exceptions.ApiValueError ): @@ -366,7 +366,7 @@ class ApiResponse(api_client.ApiResponse): 'unknown-group': 'abc', } response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) + ResponseFor200.deserialize(response, self.configuration) def test_deserialize_with_additional_properties_and_reference(self): """ @@ -379,12 +379,12 @@ class ApiResponse(api_client.ApiResponse): body: drawing.Drawing headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=drawing.Drawing), - }, - ) + } + data = { 'mainShape': { 'shapeType': 'Triangle', @@ -406,7 +406,7 @@ class ApiResponse(api_client.ApiResponse): } } response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) + ResponseFor200.deserialize(response, self.configuration) def test_deserialize_NumberWithValidations(self): from petstore_api.components.schema.number_with_validations import NumberWithValidations @@ -415,17 +415,17 @@ def test_deserialize_NumberWithValidations(self): # make sure that an exception is thrown on an invalid type value with self.assertRaises(petstore_api.ApiTypeError): response = self.__response('test str') - response_for_200.response.deserialize(response, self.configuration) + response_for_200._200.deserialize(response, self.configuration) # make sure that an exception is thrown on an invalid value with self.assertRaises(petstore_api.ApiValueError): response = self.__response(21.0) - response_for_200.response.deserialize(response, self.configuration) + response_for_200._200.deserialize(response, self.configuration) # valid value works number_val = 11.0 response = self.__response(number_val) - response = response_for_200.response.deserialize(response, self.configuration) + response = response_for_200._200.deserialize(response, self.configuration) self.assertTrue(isinstance(response.body, NumberWithValidations)) self.assertEqual(response.body, number_val) @@ -435,7 +435,7 @@ def test_array_of_enums(self): from petstore_api.components.schema import string_enum data = ["placed", None] response = self.__response(data) - deserialized = response_for_200.response.deserialize(response, self.configuration) + deserialized = response_for_200._200.deserialize(response, self.configuration) assert isinstance(deserialized.body, ArrayOfEnums) expected_results = ArrayOfEnums([string_enum.StringEnum(v) for v in data]) assert expected_results == deserialized.body @@ -455,14 +455,14 @@ class ApiResponse(api_client.ApiResponse): body: format_test.FormatTest headers: schemas.Unset - _response_for_200 = api_client.OpenApiResponse( - response_cls=ApiResponse, + class ResponseFor200(api_client.OpenApiResponse): + response_cls=ApiResponse content={ self.json_content_type: api_client.MediaType(schema=format_test.FormatTest), - }, - ) + } + response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) + deserialized = ResponseFor200.deserialize(response, self.configuration) self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) with self.assertRaisesRegex( @@ -478,7 +478,7 @@ class ApiResponse(api_client.ApiResponse): 'float': 62.4, } response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) + ResponseFor200.deserialize(response, self.configuration) # Disable JSON schema validation. No error should be raised during deserialization. configuration = petstore_api.Configuration() @@ -493,7 +493,7 @@ class ApiResponse(api_client.ApiResponse): 'float': 62.4, } response = self.__response(data) - deserialized = _response_for_200.deserialize(response, configuration) + deserialized = ResponseFor200.deserialize(response, configuration) self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) # Disable JSON schema validation but for a different keyword. @@ -514,4 +514,4 @@ class ApiResponse(api_client.ApiResponse): 'float': 62.4, } response = self.__response(data) - _response_for_200.deserialize(response, configuration) + ResponseFor200.deserialize(response, configuration) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py b/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py index 75ece111b8c..6de9a2de7e6 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py @@ -17,85 +17,12 @@ class TestParameter(unittest.TestCase): - in_type_to_parameter_cls = { - api_client.ParameterInType.PATH: api_client.PathParameter, - api_client.ParameterInType.QUERY: api_client.QueryParameter, - api_client.ParameterInType.COOKIE: api_client.CookieParameter, - api_client.ParameterInType.HEADER: api_client.HeaderParameter, - } - invalid_inputs = ( True, False ) - def test_throws_exception_when_schema_and_content_omitted(self): - with self.assertRaises(ValueError): - api_client.QueryParameter( - name='' - ) - - def test_throws_exception_when_schema_and_content_input(self): - with self.assertRaises(ValueError): - schema = schemas.StrSchema - api_client.QueryParameter( - name='', - schema=schema, - content={'application/json': schema} - ) - - def test_succeeds_when_schema_or_content_input(self): - schema = schemas.StrSchema - api_client.QueryParameter( - name='', - schema=schema, - ) - api_client.QueryParameter( - name='', - content={'application/json': schema} - ) - - def test_succeeds_and_fails_for_style_and_in_type_combos(self): - style_to_in_type = { - api_client.ParameterStyle.MATRIX: {api_client.ParameterInType.PATH}, - api_client.ParameterStyle.LABEL: {api_client.ParameterInType.PATH}, - api_client.ParameterStyle.FORM: {api_client.ParameterInType.QUERY, api_client.ParameterInType.COOKIE}, - api_client.ParameterStyle.SIMPLE: {api_client.ParameterInType.PATH, api_client.ParameterInType.HEADER}, - api_client.ParameterStyle.SPACE_DELIMITED: {api_client.ParameterInType.QUERY}, - api_client.ParameterStyle.PIPE_DELIMITED: {api_client.ParameterInType.QUERY}, - api_client.ParameterStyle.DEEP_OBJECT: {api_client.ParameterInType.QUERY}, - } - schema = schemas.StrSchema - for style in style_to_in_type: - valid_in_types = style_to_in_type[style] - for valid_in_type in valid_in_types: - parameter_cls = self.in_type_to_parameter_cls[valid_in_type] - parameter_cls( - name='', - style=style, - schema=schema, - ) - invalid_in_types = {in_t for in_t in api_client.ParameterInType if in_t not in valid_in_types} - for invalid_in_type in invalid_in_types: - parameter_cls = self.in_type_to_parameter_cls[invalid_in_type] - with self.assertRaises(ValueError): - parameter_cls( - name='', - style=style, - schema=schema, - ) - - def test_throws_exception_when_invalid_name_input(self): - disallowed_names = {'Accept', 'Content-Type', 'Authorization'} - for disallowed_name in disallowed_names: - with self.assertRaises(ValueError): - api_client.HeaderParameter( - name=disallowed_name, - schema=schemas.StrSchema, - ) - def test_query_style_form_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -149,28 +76,27 @@ def test_query_style_form_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.FORM, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.FORM + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.FORM, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.FORM + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_cookie_style_form_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -224,28 +150,27 @@ def test_cookie_style_form_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.CookieParameter( - name=name, - style=api_client.ParameterStyle.FORM, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.CookieParameter): + name='color' + style=api_client.ParameterStyle.FORM + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.CookieParameter( - name=name, - style=api_client.ParameterStyle.FORM, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.CookieParameter): + name='color' + style=api_client.ParameterStyle.FORM + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_simple_in_path_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -299,28 +224,27 @@ def test_style_simple_in_path_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.SIMPLE, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.SIMPLE + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.SIMPLE, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.SIMPLE + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_simple_in_header_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -374,28 +298,27 @@ def test_style_simple_in_header_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.HeaderParameter( - name=name, - style=api_client.ParameterStyle.SIMPLE, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.HeaderParameter): + name='color' + style=api_client.ParameterStyle.SIMPLE + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.HeaderParameter( - name=name, - style=api_client.ParameterStyle.SIMPLE, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.HeaderParameter): + name='color' + style=api_client.ParameterStyle.SIMPLE + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_label_in_path_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -449,28 +372,27 @@ def test_style_label_in_path_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.LABEL, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.LABEL + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.LABEL, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.LABEL + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_matrix_in_path_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -524,28 +446,27 @@ def test_style_matrix_in_path_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.MATRIX, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.MATRIX + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.PathParameter( - name=name, - style=api_client.ParameterStyle.MATRIX, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.PathParameter): + name='color' + style=api_client.ParameterStyle.MATRIX + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_space_delimited_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -589,28 +510,27 @@ def test_style_space_delimited_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.SPACE_DELIMITED, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.SPACE_DELIMITED + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.SPACE_DELIMITED, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.SPACE_DELIMITED + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_style_pipe_delimited_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -654,28 +574,27 @@ def test_style_pipe_delimited_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.PIPE_DELIMITED, - schema=schemas.AnyTypeSchema, - explode=test_case.explode, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.PIPE_DELIMITED + schema=schemas.AnyTypeSchema + explode=test_case.explode + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - for explode in (True, False): - parameter = api_client.QueryParameter( - name=name, - style=api_client.ParameterStyle.PIPE_DELIMITED, - schema=schemas.AnyTypeSchema, - explode=explode, - ) - parameter.serialize(invalid_input) + for explode_value in (True, False): + class Parameter(api_client.QueryParameter): + name='color' + style=api_client.ParameterStyle.PIPE_DELIMITED + schema=schemas.AnyTypeSchema + explode=explode_value + + Parameter.serialize(invalid_input) def test_path_params_no_style(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -719,23 +638,22 @@ def test_path_params_no_style(self): ), ) for test_case in test_cases: - parameter = api_client.PathParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.PathParameter): + name='color' + schema=schemas.AnyTypeSchema + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - parameter = api_client.PathParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - parameter.serialize(invalid_input) + class Parameter(api_client.PathParameter): + name='color' + schema=schemas.AnyTypeSchema + + Parameter.serialize(invalid_input) def test_header_params_no_style(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -779,23 +697,22 @@ def test_header_params_no_style(self): ), ) for test_case in test_cases: - parameter = api_client.HeaderParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.HeaderParameter): + name='color' + schema=schemas.AnyTypeSchema + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - parameter = api_client.HeaderParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - parameter.serialize(invalid_input) + class Parameter(api_client.HeaderParameter): + name='color' + schema=schemas.AnyTypeSchema + + Parameter.serialize(invalid_input) def test_query_params_no_style(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -839,23 +756,22 @@ def test_query_params_no_style(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.QueryParameter): + name='color' + schema=schemas.AnyTypeSchema + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - parameter = api_client.QueryParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - parameter.serialize(invalid_input) + class Parameter(api_client.QueryParameter): + name='color' + schema=schemas.AnyTypeSchema + + Parameter.serialize(invalid_input) def test_cookie_params_no_style(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -899,39 +815,22 @@ def test_cookie_params_no_style(self): ), ) for test_case in test_cases: - parameter = api_client.CookieParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - serialization = parameter.serialize(test_case.payload) + class Parameter(api_client.CookieParameter): + name='color' + schema=schemas.AnyTypeSchema + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) with self.assertRaises(exceptions.ApiValueError): for invalid_input in self.invalid_inputs: - parameter = api_client.CookieParameter( - name=name, - schema=schemas.AnyTypeSchema, - ) - parameter.serialize(invalid_input) + class Parameter(api_client.CookieParameter): + name='color' + schema=schemas.AnyTypeSchema - def test_checks_content_lengths(self): - with self.assertRaises(ValueError): - api_client.QueryParameter( - name='', content={} - ) - with self.assertRaises(ValueError): - api_client.QueryParameter( - name='', - content={'application/json': schemas.AnyTypeSchema, 'text/plain': schemas.AnyTypeSchema} - ) - # valid length works - api_client.QueryParameter( - name='', - content={'application/json': schemas.AnyTypeSchema} - ) + Parameter.serialize(invalid_input) def test_header_content_json_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -983,15 +882,14 @@ def test_header_content_json_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.HeaderParameter( - name=name, + class Parameter(api_client.HeaderParameter): + name='color' content={'application/json': schemas.AnyTypeSchema} - ) - serialization = parameter.serialize(test_case.payload) + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) def test_query_content_json_serialization(self): - name = 'color' test_cases = ( ParamTestCase( None, @@ -1043,20 +941,20 @@ def test_query_content_json_serialization(self): ), ) for test_case in test_cases: - parameter = api_client.QueryParameter( - name=name, + class Parameter(api_client.QueryParameter): + name='color' content={'application/json': schemas.AnyTypeSchema} - ) - serialization = parameter.serialize(test_case.payload) + + serialization = Parameter.serialize(test_case.payload) self.assertEqual(serialization, test_case.expected_serialization) def test_throws_error_for_unimplemented_serialization(self): with self.assertRaises(NotImplementedError): - parameter = api_client.HeaderParameter( - name='color', + class Parameter(api_client.HeaderParameter): + name='color' content={'text/plain': schemas.AnyTypeSchema} - ) - parameter.serialize(None) + + Parameter.serialize(None) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py b/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py index 14339c2e230..c92cd372eb0 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py @@ -19,13 +19,6 @@ class TestParameter(unittest.TestCase): - - def test_throws_exception_when_content_is_invalid_size(self): - with self.assertRaises(ValueError): - api_client.RequestBody( - content={} - ) - def test_content_json_serialization(self): payloads = [ None, @@ -42,10 +35,12 @@ def test_content_json_serialization(self): dict(R=100, G=200, B=150), ] for payload in payloads: - request_body = api_client.RequestBody( - content={'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema)} - ) - serialization = request_body.serialize(payload, 'application/json') + class RequestBody(api_client.RequestBody): + content = { + 'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema) + } + + serialization = RequestBody.serialize(payload, 'application/json') self.assertEqual( serialization, dict(body=json.dumps(payload, separators=(",", ":"), ensure_ascii=False).encode('utf-8')) @@ -62,10 +57,10 @@ def test_content_multipart_form_data_serialization(self): some_dict={}, some_bytes=b'abc' ) - request_body = api_client.RequestBody( + class RequestBody(api_client.RequestBody): content={'multipart/form-data': api_client.MediaType(schema=schemas.AnyTypeSchema)} - ) - serialization = request_body.serialize(payload, 'multipart/form-data') + + serialization = RequestBody.serialize(payload, 'multipart/form-data') self.assertEqual( serialization, dict( @@ -123,21 +118,21 @@ def test_content_multipart_form_data_serialization(self): ) def test_throws_error_for_nonexistant_content_type(self): - request_body = api_client.RequestBody( + class RequestBody(api_client.RequestBody): content={'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema)} - ) + with self.assertRaises(KeyError): - request_body.serialize(None, 'abc/def') + RequestBody.serialize(None, 'abc/def') def test_throws_error_for_not_implemented_content_type(self): - request_body = api_client.RequestBody( + class RequestBody(api_client.RequestBody): content={ 'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema), 'text/css': api_client.MediaType(schema=schemas.AnyTypeSchema) } - ) + with self.assertRaises(NotImplementedError): - request_body.serialize(None, 'text/css') + RequestBody.serialize(None, 'text/css') def test_application_x_www_form_urlencoded_serialization(self): payload = dict( @@ -149,16 +144,16 @@ def test_application_x_www_form_urlencoded_serialization(self): some_dict={}, ) content_type = 'application/x-www-form-urlencoded' - request_body = api_client.RequestBody( + class RequestBody(api_client.RequestBody): content={content_type: api_client.MediaType(schema=schemas.AnyTypeSchema)} - ) - serialization = request_body.serialize(payload, content_type) + + serialization = RequestBody.serialize(payload, content_type) self.assertEqual( serialization, dict(body='some_str=hi%20there&some_int=1&some_float=3.14') ) - serialization = request_body.serialize({}, content_type) + serialization = RequestBody.serialize({}, content_type) self.assertEqual( serialization, dict(body='') @@ -172,7 +167,7 @@ def test_application_x_www_form_urlencoded_serialization(self): ] for invalid_payload in invalid_payloads: with self.assertRaises(exceptions.ApiValueError): - request_body.serialize(invalid_payload, content_type) + RequestBody.serialize(invalid_payload, content_type) if __name__ == '__main__':