martin-mfg 9afea50cab
use map/array model class only if it is generated (#17612)
* fix

* tests

* generate samples

* refactor
2024-01-29 21:35:21 +08:00

980 lines
37 KiB
JavaScript

/**
* 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 Client from '../model/Client';
import EnumClass from '../model/EnumClass';
import FileSchemaTestClass from '../model/FileSchemaTestClass';
import HealthCheckStatus from '../model/HealthCheckStatus';
import OuterComposite from '../model/OuterComposite';
import OuterObjectWithEnumProperty from '../model/OuterObjectWithEnumProperty';
import Pet from '../model/Pet';
import TestInlineFreeformAdditionalPropertiesRequest from '../model/TestInlineFreeformAdditionalPropertiesRequest';
import User from '../model/User';
/**
* Fake service.
* @module api/FakeApi
* @version 1.0.0
*/
export default class FakeApi {
/**
* Constructs a new FakeApi.
* @alias module:api/FakeApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
/**
* Callback function to receive the result of the fakeHealthGet operation.
* @callback module:api/FakeApi~fakeHealthGetCallback
* @param {String} error Error message, if any.
* @param {module:model/HealthCheckStatus} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Health check endpoint
* @param {module:api/FakeApi~fakeHealthGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/HealthCheckStatus}
*/
fakeHealthGet(callback) {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = HealthCheckStatus;
return this.apiClient.callApi(
'/fake/health', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the fakeHttpSignatureTest operation.
* @callback module:api/FakeApi~fakeHttpSignatureTestCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* test http signature authentication
* @param {module:model/Pet} pet Pet object that needs to be added to the store
* @param {Object} opts Optional parameters
* @param {String} [queryOne] query parameter
* @param {String} [header1] header parameter
* @param {module:api/FakeApi~fakeHttpSignatureTestCallback} callback The callback function, accepting three arguments: error, data, response
*/
fakeHttpSignatureTest(pet, opts, callback) {
opts = opts || {};
let postBody = pet;
// verify the required parameter 'pet' is set
if (pet === undefined || pet === null) {
throw new Error("Missing the required parameter 'pet' when calling fakeHttpSignatureTest");
}
let pathParams = {
};
let queryParams = {
'query_1': opts['queryOne']
};
let headerParams = {
'header_1': opts['header1']
};
let formParams = {
};
let authNames = ['http_signature_test'];
let contentTypes = ['application/json', 'application/xml'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/http-signature-test', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the fakeOuterBooleanSerialize operation.
* @callback module:api/FakeApi~fakeOuterBooleanSerializeCallback
* @param {String} error Error message, if any.
* @param {Boolean} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Test serialization of outer boolean types
* @param {Object} opts Optional parameters
* @param {Boolean} [body] Input boolean as post body
* @param {module:api/FakeApi~fakeOuterBooleanSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Boolean}
*/
fakeOuterBooleanSerialize(opts, callback) {
opts = opts || {};
let postBody = opts['body'];
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['*/*'];
let returnType = 'Boolean';
return this.apiClient.callApi(
'/fake/outer/boolean', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the fakeOuterCompositeSerialize operation.
* @callback module:api/FakeApi~fakeOuterCompositeSerializeCallback
* @param {String} error Error message, if any.
* @param {module:model/OuterComposite} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Test serialization of object with outer number type
* @param {Object} opts Optional parameters
* @param {module:model/OuterComposite} [outerComposite] Input composite as post body
* @param {module:api/FakeApi~fakeOuterCompositeSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterComposite}
*/
fakeOuterCompositeSerialize(opts, callback) {
opts = opts || {};
let postBody = opts['outerComposite'];
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['*/*'];
let returnType = OuterComposite;
return this.apiClient.callApi(
'/fake/outer/composite', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the fakeOuterNumberSerialize operation.
* @callback module:api/FakeApi~fakeOuterNumberSerializeCallback
* @param {String} error Error message, if any.
* @param {Number} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Test serialization of outer number types
* @param {Object} opts Optional parameters
* @param {Number} [body] Input number as post body
* @param {module:api/FakeApi~fakeOuterNumberSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Number}
*/
fakeOuterNumberSerialize(opts, callback) {
opts = opts || {};
let postBody = opts['body'];
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['*/*'];
let returnType = 'Number';
return this.apiClient.callApi(
'/fake/outer/number', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the fakeOuterStringSerialize operation.
* @callback module:api/FakeApi~fakeOuterStringSerializeCallback
* @param {String} error Error message, if any.
* @param {String} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Test serialization of outer string types
* @param {Object} opts Optional parameters
* @param {String} [body] Input string as post body
* @param {module:api/FakeApi~fakeOuterStringSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link String}
*/
fakeOuterStringSerialize(opts, callback) {
opts = opts || {};
let postBody = opts['body'];
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['*/*'];
let returnType = 'String';
return this.apiClient.callApi(
'/fake/outer/string', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* 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 testAdditionalPropertiesReference operation.
* @callback module:api/FakeApi~testAdditionalPropertiesReferenceCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* test referenced additionalProperties
*
* @param {Object.<String, {String: Object}>} requestBody request body
* @param {module:api/FakeApi~testAdditionalPropertiesReferenceCallback} callback The callback function, accepting three arguments: error, data, response
*/
testAdditionalPropertiesReference(requestBody, callback) {
let postBody = requestBody;
// verify the required parameter 'requestBody' is set
if (requestBody === undefined || requestBody === null) {
throw new Error("Missing the required parameter 'requestBody' when calling testAdditionalPropertiesReference");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/additionalProperties-reference', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testBodyWithBinary operation.
* @callback module:api/FakeApi~testBodyWithBinaryCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* For this test, the body has to be a binary file.
* @param {File} body image to upload
* @param {module:api/FakeApi~testBodyWithBinaryCallback} callback The callback function, accepting three arguments: error, data, response
*/
testBodyWithBinary(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testBodyWithBinary");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['image/png'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/body-with-binary', 'PUT',
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
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* For this test, the body for this request must reference a schema named `File`.
* @param {module:model/FileSchemaTestClass} fileSchemaTestClass
* @param {module:api/FakeApi~testBodyWithFileSchemaCallback} callback The callback function, accepting three arguments: error, data, response
*/
testBodyWithFileSchema(fileSchemaTestClass, callback) {
let postBody = fileSchemaTestClass;
// verify the required parameter 'fileSchemaTestClass' is set
if (fileSchemaTestClass === undefined || fileSchemaTestClass === null) {
throw new Error("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/body-with-file-schema', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testBodyWithQueryParams operation.
* @callback module:api/FakeApi~testBodyWithQueryParamsCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* @param {String} query
* @param {module:model/User} user
* @param {module:api/FakeApi~testBodyWithQueryParamsCallback} callback The callback function, accepting three arguments: error, data, response
*/
testBodyWithQueryParams(query, user, callback) {
let postBody = user;
// verify the required parameter 'query' is set
if (query === undefined || query === null) {
throw new Error("Missing the required parameter 'query' when calling testBodyWithQueryParams");
}
// verify the required parameter 'user' is set
if (user === undefined || user === null) {
throw new Error("Missing the required parameter 'user' when calling testBodyWithQueryParams");
}
let pathParams = {
};
let queryParams = {
'query': query
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/body-with-query-params', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testClientModel operation.
* @callback module:api/FakeApi~testClientModelCallback
* @param {String} error Error message, if any.
* @param {module:model/Client} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* To test \"client\" model
* To test \"client\" model
* @param {module:model/Client} client client model
* @param {module:api/FakeApi~testClientModelCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Client}
*/
testClientModel(client, callback) {
let postBody = client;
// verify the required parameter 'client' is set
if (client === undefined || client === null) {
throw new Error("Missing the required parameter 'client' when calling testClientModel");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = Client;
return this.apiClient.callApi(
'/fake', 'PATCH',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testEndpointParameters operation.
* @callback module:api/FakeApi~testEndpointParametersCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* @param {Number} number None
* @param {Number} _double None
* @param {String} patternWithoutDelimiter None
* @param {Blob} _byte None
* @param {Object} opts Optional parameters
* @param {Number} [integer] None
* @param {Number} [int32] None
* @param {Number} [int64] None
* @param {Number} [_float] None
* @param {String} [string] None
* @param {File} [binary] None
* @param {Date} [date] None
* @param {Date} [dateTime] None
* @param {String} [password] None
* @param {String} [callback] None
* @param {module:api/FakeApi~testEndpointParametersCallback} callback The callback function, accepting three arguments: error, data, response
*/
testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, opts, callback) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'number' is set
if (number === undefined || number === null) {
throw new Error("Missing the required parameter 'number' when calling testEndpointParameters");
}
// verify the required parameter '_double' is set
if (_double === undefined || _double === null) {
throw new Error("Missing the required parameter '_double' when calling testEndpointParameters");
}
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) {
throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
}
// verify the required parameter '_byte' is set
if (_byte === undefined || _byte === null) {
throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
'integer': opts['integer'],
'int32': opts['int32'],
'int64': opts['int64'],
'number': number,
'float': opts['_float'],
'double': _double,
'string': opts['string'],
'pattern_without_delimiter': patternWithoutDelimiter,
'byte': _byte,
'binary': opts['binary'],
'date': opts['date'],
'dateTime': opts['dateTime'],
'password': opts['password'],
'callback': opts['callback']
};
let authNames = ['http_basic_test'];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testEnumParameters operation.
* @callback module:api/FakeApi~testEnumParametersCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* To test enum parameters
* To test enum parameters
* @param {Object} opts Optional parameters
* @param {Array.<module:model/String>} [enumHeaderStringArray] Header parameter enum test (string array)
* @param {module:model/String} [enumHeaderString = '-efg')] Header parameter enum test (string)
* @param {Array.<module:model/String>} [enumQueryStringArray] Query parameter enum test (string array)
* @param {module:model/String} [enumQueryString = '-efg')] Query parameter enum test (string)
* @param {module:model/Number} [enumQueryInteger] Query parameter enum test (double)
* @param {module:model/Number} [enumQueryDouble] Query parameter enum test (double)
* @param {Array.<module:model/EnumClass>} [enumQueryModelArray]
* @param {Array.<module:model/String>} [enumFormStringArray = '$')] Form parameter enum test (string array)
* @param {module:model/String} [enumFormString = '-efg')] Form parameter enum test (string)
* @param {module:api/FakeApi~testEnumParametersCallback} callback The callback function, accepting three arguments: error, data, response
*/
testEnumParameters(opts, callback) {
opts = opts || {};
let postBody = null;
let pathParams = {
};
let queryParams = {
'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'multi'),
'enum_query_string': opts['enumQueryString'],
'enum_query_integer': opts['enumQueryInteger'],
'enum_query_double': opts['enumQueryDouble'],
'enum_query_model_array': this.apiClient.buildCollectionParam(opts['enumQueryModelArray'], 'multi')
};
let headerParams = {
'enum_header_string_array': opts['enumHeaderStringArray'],
'enum_header_string': opts['enumHeaderString']
};
let formParams = {
'enum_form_string_array': this.apiClient.buildCollectionParam(opts['enumFormStringArray'], 'csv'),
'enum_form_string': opts['enumFormString']
};
let authNames = [];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testGroupParameters operation.
* @callback module:api/FakeApi~testGroupParametersCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Fake endpoint to test group parameters (optional)
* Fake endpoint to test group parameters (optional)
* @param {Number} requiredStringGroup Required String in group parameters
* @param {Boolean} requiredBooleanGroup Required Boolean in group parameters
* @param {Number} requiredInt64Group Required Integer in group parameters
* @param {Object} opts Optional parameters
* @param {Number} [stringGroup] String in group parameters
* @param {Boolean} [booleanGroup] Boolean in group parameters
* @param {Number} [int64Group] Integer in group parameters
* @param {module:api/FakeApi~testGroupParametersCallback} callback The callback function, accepting three arguments: error, data, response
*/
testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts, callback) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'requiredStringGroup' is set
if (requiredStringGroup === undefined || requiredStringGroup === null) {
throw new Error("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters");
}
// verify the required parameter 'requiredBooleanGroup' is set
if (requiredBooleanGroup === undefined || requiredBooleanGroup === null) {
throw new Error("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");
}
// verify the required parameter 'requiredInt64Group' is set
if (requiredInt64Group === undefined || requiredInt64Group === null) {
throw new Error("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
}
let pathParams = {
};
let queryParams = {
'required_string_group': requiredStringGroup,
'required_int64_group': requiredInt64Group,
'string_group': opts['stringGroup'],
'int64_group': opts['int64Group']
};
let headerParams = {
'required_boolean_group': requiredBooleanGroup,
'boolean_group': opts['booleanGroup']
};
let formParams = {
};
let authNames = ['bearer_test'];
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testInlineAdditionalProperties operation.
* @callback module:api/FakeApi~testInlineAdditionalPropertiesCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* test inline additionalProperties
*
* @param {Object.<String, {String: String}>} requestBody request body
* @param {module:api/FakeApi~testInlineAdditionalPropertiesCallback} callback The callback function, accepting three arguments: error, data, response
*/
testInlineAdditionalProperties(requestBody, callback) {
let postBody = requestBody;
// verify the required parameter 'requestBody' is set
if (requestBody === undefined || requestBody === null) {
throw new Error("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/inline-additionalProperties', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testInlineFreeformAdditionalProperties operation.
* @callback module:api/FakeApi~testInlineFreeformAdditionalPropertiesCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* test inline free-form additionalProperties
*
* @param {module:model/TestInlineFreeformAdditionalPropertiesRequest} testInlineFreeformAdditionalPropertiesRequest request body
* @param {module:api/FakeApi~testInlineFreeformAdditionalPropertiesCallback} callback The callback function, accepting three arguments: error, data, response
*/
testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, callback) {
let postBody = testInlineFreeformAdditionalPropertiesRequest;
// verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set
if (testInlineFreeformAdditionalPropertiesRequest === undefined || testInlineFreeformAdditionalPropertiesRequest === null) {
throw new Error("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/inline-freeform-additionalProperties', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testJsonFormData operation.
* @callback module:api/FakeApi~testJsonFormDataCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* test json serialization of form data
*
* @param {String} param field1
* @param {String} param2 field2
* @param {module:api/FakeApi~testJsonFormDataCallback} callback The callback function, accepting three arguments: error, data, response
*/
testJsonFormData(param, param2, callback) {
let postBody = null;
// verify the required parameter 'param' is set
if (param === undefined || param === null) {
throw new Error("Missing the required parameter 'param' when calling testJsonFormData");
}
// verify the required parameter 'param2' is set
if (param2 === undefined || param2 === null) {
throw new Error("Missing the required parameter 'param2' when calling testJsonFormData");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
'param': param,
'param2': param2
};
let authNames = [];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/jsonFormData', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testQueryParameterCollectionFormat operation.
* @callback module:api/FakeApi~testQueryParameterCollectionFormatCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* To test the collection format in query parameters
* @param {Array.<String>} pipe
* @param {Array.<String>} ioutil
* @param {Array.<String>} http
* @param {Array.<String>} url
* @param {Array.<String>} context
* @param {String} allowEmpty
* @param {Object} opts Optional parameters
* @param {Object.<String, {String: String}>} [language]
* @param {module:api/FakeApi~testQueryParameterCollectionFormatCallback} callback The callback function, accepting three arguments: error, data, response
*/
testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts, callback) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'pipe' is set
if (pipe === undefined || pipe === null) {
throw new Error("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat");
}
// verify the required parameter 'ioutil' is set
if (ioutil === undefined || ioutil === null) {
throw new Error("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat");
}
// verify the required parameter 'http' is set
if (http === undefined || http === null) {
throw new Error("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat");
}
// verify the required parameter 'url' is set
if (url === undefined || url === null) {
throw new Error("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat");
}
// verify the required parameter 'context' is set
if (context === undefined || context === null) {
throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat");
}
// verify the required parameter 'allowEmpty' is set
if (allowEmpty === undefined || allowEmpty === null) {
throw new Error("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat");
}
let pathParams = {
};
let queryParams = {
'pipe': this.apiClient.buildCollectionParam(pipe, 'pipes'),
'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'),
'http': this.apiClient.buildCollectionParam(http, 'ssv'),
'url': this.apiClient.buildCollectionParam(url, 'csv'),
'context': this.apiClient.buildCollectionParam(context, 'multi'),
'language': opts['language'],
'allowEmpty': allowEmpty
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/test-query-parameters', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the testStringMapReference operation.
* @callback module:api/FakeApi~testStringMapReferenceCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* test referenced string map
*
* @param {Object.<String, {String: String}>} requestBody request body
* @param {module:api/FakeApi~testStringMapReferenceCallback} callback The callback function, accepting three arguments: error, data, response
*/
testStringMapReference(requestBody, callback) {
let postBody = requestBody;
// verify the required parameter 'requestBody' is set
if (requestBody === undefined || requestBody === null) {
throw new Error("Missing the required parameter 'requestBody' when calling testStringMapReference");
}
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/stringMap-reference', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
}