Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export type {{{enumName}}} = {{#allowableValues}}{{#values}}"{{{.}}}"{{^-last}}
* {{classname}} - fetch parameter creator{{#description}}
* {{&description}}{{/description}}
*/
export const {{classname}}FetchParamCreactor = {
export const {{classname}}FetchParamCreator = {
{{#operation}}
/** {{#summary}}
* {{summary}}{{/summary}}{{#notes}}
Expand Down Expand Up @@ -136,7 +136,7 @@ export const {{classname}}Fp = {
* @param {{paramName}} {{description}}{{/allParams}}
*/
{{nickname}}({{#hasParams}}params: { {{#allParams}}"{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}}; {{/allParams}} }, {{/hasParams}}options?: any): (fetch: FetchAPI, basePath?: string) => Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}> {
const fetchArgs = {{classname}}FetchParamCreactor.{{nickname}}({{#hasParams}}params, {{/hasParams}}options);
const fetchArgs = {{classname}}FetchParamCreator.{{nickname}}({{#hasParams}}params, {{/hasParams}}options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand Down
46 changes: 23 additions & 23 deletions samples/client/petstore/typescript-fetch/builds/default/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export interface User {
/**
* PetApi - fetch parameter creator
*/
export const PetApiFetchParamCreactor = {
export const PetApiFetchParamCreator = {
/**
* Add a new pet to the store
*
Expand Down Expand Up @@ -305,7 +305,7 @@ export const PetApiFp = {
* @param body Pet object that needs to be added to the store
*/
addPet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = PetApiFetchParamCreactor.addPet(params, options);
const fetchArgs = PetApiFetchParamCreator.addPet(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -323,7 +323,7 @@ export const PetApiFp = {
* @param apiKey
*/
deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = PetApiFetchParamCreactor.deletePet(params, options);
const fetchArgs = PetApiFetchParamCreator.deletePet(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -340,7 +340,7 @@ export const PetApiFp = {
* @param status Status values that need to be considered for filter
*/
findPetsByStatus(params: { "status"?: Array<string>; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<Array<Pet>> {
const fetchArgs = PetApiFetchParamCreactor.findPetsByStatus(params, options);
const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -357,7 +357,7 @@ export const PetApiFp = {
* @param tags Tags to filter by
*/
findPetsByTags(params: { "tags"?: Array<string>; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<Array<Pet>> {
const fetchArgs = PetApiFetchParamCreactor.findPetsByTags(params, options);
const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -374,7 +374,7 @@ export const PetApiFp = {
* @param petId ID of pet that needs to be fetched
*/
getPetById(params: { "petId": number; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<Pet> {
const fetchArgs = PetApiFetchParamCreactor.getPetById(params, options);
const fetchArgs = PetApiFetchParamCreator.getPetById(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -391,7 +391,7 @@ export const PetApiFp = {
* @param body Pet object that needs to be added to the store
*/
updatePet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = PetApiFetchParamCreactor.updatePet(params, options);
const fetchArgs = PetApiFetchParamCreator.updatePet(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -410,7 +410,7 @@ export const PetApiFp = {
* @param status Updated status of the pet
*/
updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = PetApiFetchParamCreactor.updatePetWithForm(params, options);
const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -429,7 +429,7 @@ export const PetApiFp = {
* @param file file to upload
*/
uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = PetApiFetchParamCreactor.uploadFile(params, options);
const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand Down Expand Up @@ -598,7 +598,7 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) {
/**
* StoreApi - fetch parameter creator
*/
export const StoreApiFetchParamCreactor = {
export const StoreApiFetchParamCreator = {
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
Expand Down Expand Up @@ -700,7 +700,7 @@ export const StoreApiFp = {
* @param orderId ID of the order that needs to be deleted
*/
deleteOrder(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = StoreApiFetchParamCreactor.deleteOrder(params, options);
const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -716,7 +716,7 @@ export const StoreApiFp = {
* Returns a map of status codes to quantities
*/
getInventory(options?: any): (fetch: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> {
const fetchArgs = StoreApiFetchParamCreactor.getInventory(options);
const fetchArgs = StoreApiFetchParamCreator.getInventory(options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -733,7 +733,7 @@ export const StoreApiFp = {
* @param orderId ID of pet that needs to be fetched
*/
getOrderById(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<Order> {
const fetchArgs = StoreApiFetchParamCreactor.getOrderById(params, options);
const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -750,7 +750,7 @@ export const StoreApiFp = {
* @param body order placed for purchasing the pet
*/
placeOrder(params: { "body"?: Order; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<Order> {
const fetchArgs = StoreApiFetchParamCreactor.placeOrder(params, options);
const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand Down Expand Up @@ -843,7 +843,7 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) {
/**
* UserApi - fetch parameter creator
*/
export const UserApiFetchParamCreactor = {
export const UserApiFetchParamCreator = {
/**
* Create user
* This can only be done by the logged in user.
Expand Down Expand Up @@ -1044,7 +1044,7 @@ export const UserApiFp = {
* @param body Created user object
*/
createUser(params: { "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = UserApiFetchParamCreactor.createUser(params, options);
const fetchArgs = UserApiFetchParamCreator.createUser(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -1061,7 +1061,7 @@ export const UserApiFp = {
* @param body List of user object
*/
createUsersWithArrayInput(params: { "body"?: Array<User>; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = UserApiFetchParamCreactor.createUsersWithArrayInput(params, options);
const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -1078,7 +1078,7 @@ export const UserApiFp = {
* @param body List of user object
*/
createUsersWithListInput(params: { "body"?: Array<User>; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = UserApiFetchParamCreactor.createUsersWithListInput(params, options);
const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -1095,7 +1095,7 @@ export const UserApiFp = {
* @param username The name that needs to be deleted
*/
deleteUser(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = UserApiFetchParamCreactor.deleteUser(params, options);
const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -1112,7 +1112,7 @@ export const UserApiFp = {
* @param username The name that needs to be fetched. Use user1 for testing.
*/
getUserByName(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<User> {
const fetchArgs = UserApiFetchParamCreactor.getUserByName(params, options);
const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -1130,7 +1130,7 @@ export const UserApiFp = {
* @param password The password for login in clear text
*/
loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<string> {
const fetchArgs = UserApiFetchParamCreactor.loginUser(params, options);
const fetchArgs = UserApiFetchParamCreator.loginUser(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -1146,7 +1146,7 @@ export const UserApiFp = {
*
*/
logoutUser(options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = UserApiFetchParamCreactor.logoutUser(options);
const fetchArgs = UserApiFetchParamCreator.logoutUser(options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand All @@ -1164,7 +1164,7 @@ export const UserApiFp = {
* @param body Updated user object
*/
updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise<any> {
const fetchArgs = UserApiFetchParamCreactor.updateUser(params, options);
const fetchArgs = UserApiFetchParamCreator.updateUser(params, options);
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
Expand Down
Loading