[go][client] Fix example value for non string enums (#8900)

* [go][client] Fix example value for non string enums

* regenerated samples
This commit is contained in:
Jiri Kuncar
2021-03-08 11:11:50 +01:00
committed by GitHub
parent 101da6e434
commit 8cb4741248
432 changed files with 30350 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ import Client from '../model/Client';
import FileSchemaTestClass from '../model/FileSchemaTestClass';
import HealthCheckResult from '../model/HealthCheckResult';
import OuterComposite from '../model/OuterComposite';
import OuterObjectWithEnumProperty from '../model/OuterObjectWithEnumProperty';
import Pet from '../model/Pet';
import User from '../model/User';
@@ -277,6 +278,47 @@ export default class FakeApi {
);
}
/**
* Callback function to receive the result of the fakePropertyEnumIntegerSerialize operation.
* @callback module:api/FakeApi~fakePropertyEnumIntegerSerializeCallback
* @param {String} error Error message, if any.
* @param {module:model/OuterObjectWithEnumProperty} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Test serialization of enum (int) properties with examples
* @param {module:model/OuterObjectWithEnumProperty} outerObjectWithEnumProperty Input enum (int) as post body
* @param {module:api/FakeApi~fakePropertyEnumIntegerSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterObjectWithEnumProperty}
*/
fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, callback) {
let postBody = outerObjectWithEnumProperty;
// verify the required parameter 'outerObjectWithEnumProperty' is set
if (outerObjectWithEnumProperty === undefined || outerObjectWithEnumProperty === null) {
throw new Error("Missing the required parameter 'outerObjectWithEnumProperty' when calling fakePropertyEnumIntegerSerialize");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['*/*'];
let returnType = OuterObjectWithEnumProperty;
return this.apiClient.callApi(
'/fake/property/enum-int', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testBodyWithFileSchema operation.
* @callback module:api/FakeApi~testBodyWithFileSchemaCallback

View File

@@ -50,6 +50,7 @@ import OuterEnum from './model/OuterEnum';
import OuterEnumDefaultValue from './model/OuterEnumDefaultValue';
import OuterEnumInteger from './model/OuterEnumInteger';
import OuterEnumIntegerDefaultValue from './model/OuterEnumIntegerDefaultValue';
import OuterObjectWithEnumProperty from './model/OuterObjectWithEnumProperty';
import Pet from './model/Pet';
import ReadOnlyFirst from './model/ReadOnlyFirst';
import Return from './model/Return';
@@ -325,6 +326,12 @@ export {
*/
OuterEnumIntegerDefaultValue,
/**
* The OuterObjectWithEnumProperty model constructor.
* @property {module:model/OuterObjectWithEnumProperty}
*/
OuterObjectWithEnumProperty,
/**
* The Pet model constructor.
* @property {module:model/Pet}

View File

@@ -0,0 +1,74 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import OuterEnumInteger from './OuterEnumInteger';
/**
* The OuterObjectWithEnumProperty model module.
* @module model/OuterObjectWithEnumProperty
* @version 1.0.0
*/
class OuterObjectWithEnumProperty {
/**
* Constructs a new <code>OuterObjectWithEnumProperty</code>.
* @alias module:model/OuterObjectWithEnumProperty
* @param value {module:model/OuterEnumInteger}
*/
constructor(value) {
OuterObjectWithEnumProperty.initialize(this, value);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, value) {
obj['value'] = value;
}
/**
* Constructs a <code>OuterObjectWithEnumProperty</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/OuterObjectWithEnumProperty} obj Optional instance to populate.
* @return {module:model/OuterObjectWithEnumProperty} The populated <code>OuterObjectWithEnumProperty</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new OuterObjectWithEnumProperty();
if (data.hasOwnProperty('value')) {
obj['value'] = OuterEnumInteger.constructFromObject(data['value']);
}
}
return obj;
}
}
/**
* @member {module:model/OuterEnumInteger} value
*/
OuterObjectWithEnumProperty.prototype['value'] = undefined;
export default OuterObjectWithEnumProperty;