forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/4.1.x' into sync_41x_50x
This commit is contained in:
@@ -45,8 +45,10 @@ ApiClient <- R6::R6Class(
|
||||
apiKeys = NULL,
|
||||
# Access token
|
||||
accessToken = NULL,
|
||||
# Time Out (seconds)
|
||||
timeout = NULL,
|
||||
# constructor
|
||||
initialize = function(basePath=NULL, userAgent=NULL, defaultHeaders=NULL, username=NULL, password=NULL, apiKeys=NULL, accessToken=NULL){
|
||||
initialize = function(basePath=NULL, userAgent=NULL, defaultHeaders=NULL, username=NULL, password=NULL, apiKeys=NULL, accessToken=NULL, timeout=NULL){
|
||||
if (!is.null(basePath)) {
|
||||
self$basePath <- basePath
|
||||
}
|
||||
@@ -76,25 +78,76 @@ ApiClient <- R6::R6Class(
|
||||
if (!is.null(userAgent)) {
|
||||
self$`userAgent` <- userAgent
|
||||
}
|
||||
|
||||
if (!is.null(timeout)) {
|
||||
self$timeout <- timeout
|
||||
}
|
||||
},
|
||||
CallApi = function(url, method, queryParams, headerParams, body, ...){
|
||||
headers <- httr::add_headers(c(headerParams, self$defaultHeaders))
|
||||
|
||||
httpTimeout <- NULL
|
||||
if (!is.null(self$timeout)) {
|
||||
httpTimeout <- httr::timeout(self$timeout)
|
||||
}
|
||||
|
||||
if (method == "GET") {
|
||||
httr::GET(url, queryParams, headers, ...)
|
||||
httr::GET(url, query = queryParams, headers, httpTimeout, httr::user_agent(self$`userAgent`), ...)
|
||||
} else if (method == "POST") {
|
||||
httr::POST(url, query = queryParams, headers, body = body, httr::content_type("application/json"), ...)
|
||||
httr::POST(url, query = queryParams, headers, body = body, httr::content_type("application/json"), httpTimeout, httr::user_agent(self$`userAgent`), ...)
|
||||
} else if (method == "PUT") {
|
||||
httr::PUT(url, query = queryParams, headers, body = body, httr::content_type("application/json"), ...)
|
||||
httr::PUT(url, query = queryParams, headers, body = body, httr::content_type("application/json"), httpTimeout, httpTimeout, httr::user_agent(self$`userAgent`), ...)
|
||||
} else if (method == "PATCH") {
|
||||
httr::PATCH(url, query = queryParams, headers, body = body, httr::content_type("application/json"), ...)
|
||||
httr::PATCH(url, query = queryParams, headers, body = body, httr::content_type("application/json"), httpTimeout, httpTimeout, httr::user_agent(self$`userAgent`), ...)
|
||||
} else if (method == "HEAD") {
|
||||
httr::HEAD(url, query = queryParams, headers, ...)
|
||||
httr::HEAD(url, query = queryParams, headers, httpTimeout, httpTimeout, httr::user_agent(self$`userAgent`), ...)
|
||||
} else if (method == "DELETE") {
|
||||
httr::DELETE(url, query = queryParams, headers, ...)
|
||||
httr::DELETE(url, query = queryParams, headers, httpTimeout, httpTimeout, httr::user_agent(self$`userAgent`), ...)
|
||||
} else {
|
||||
stop("http method must be `GET`, `HEAD`, `OPTIONS`, `POST`, `PATCH`, `PUT` or `DELETE`.")
|
||||
}
|
||||
},
|
||||
|
||||
deserialize = function(resp, returnType, pkgEnv) {
|
||||
respObj <- jsonlite::fromJSON(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
self$deserializeObj(respObj, returnType, pkgEnv)
|
||||
},
|
||||
|
||||
deserializeObj = function(obj, returnType, pkgEnv) {
|
||||
returnObj <- NULL
|
||||
primitiveTypes <- c("character", "numeric", "integer", "logical", "complex")
|
||||
|
||||
if (startsWith(returnType, "map(")) {
|
||||
innerReturnType <- regmatches(returnType, regexec(pattern = "map\\((.*)\\)", returnType))[[1]][2]
|
||||
returnObj <- lapply(names(obj), function(name) {
|
||||
self$deserializeObj(obj[[name]], innerReturnType, pkgEnv)
|
||||
})
|
||||
names(returnObj) <- names(obj)
|
||||
} else if (startsWith(returnType, "array[")) {
|
||||
innerReturnType <- regmatches(returnType, regexec(pattern = "array\\[(.*)\\]", returnType))[[1]][2]
|
||||
if (c(innerReturnType) %in% primitiveTypes) {
|
||||
returnObj <- vector("list", length = length(obj))
|
||||
if (length(obj) > 0) {
|
||||
for (row in 1:length(obj)) {
|
||||
returnObj[[row]] <- self$deserializeObj(obj[row], innerReturnType, pkgEnv)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
returnObj <- vector("list", length = nrow(obj))
|
||||
if (nrow(obj) > 0) {
|
||||
for (row in 1:nrow(obj)) {
|
||||
returnObj[[row]] <- self$deserializeObj(obj[row, , drop = FALSE], innerReturnType, pkgEnv)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (exists(returnType, pkgEnv) && !(c(returnType) %in% primitiveTypes)) {
|
||||
returnType <- get(returnType, envir = as.environment(pkgEnv))
|
||||
returnObj <- returnType$new()
|
||||
returnObj$fromJSON(jsonlite::toJSON(obj, digits = NA))
|
||||
} else {
|
||||
returnObj <- obj
|
||||
}
|
||||
returnObj
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -54,16 +54,24 @@ Category <- R6::R6Class(
|
||||
}
|
||||
},
|
||||
toJSONString = function() {
|
||||
sprintf(
|
||||
'{
|
||||
"id":
|
||||
%d,
|
||||
"name":
|
||||
"%s"
|
||||
}',
|
||||
self$`id`,
|
||||
jsoncontent <- c(
|
||||
if (!is.null(self$`id`)) {
|
||||
sprintf(
|
||||
'"id":
|
||||
%d
|
||||
',
|
||||
self$`id`
|
||||
)},
|
||||
if (!is.null(self$`name`)) {
|
||||
sprintf(
|
||||
'"name":
|
||||
"%s"
|
||||
',
|
||||
self$`name`
|
||||
)}
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
paste('{', jsoncontent, '}', sep = "")
|
||||
},
|
||||
fromJSONString = function(CategoryJson) {
|
||||
CategoryObject <- jsonlite::fromJSON(CategoryJson)
|
||||
|
||||
@@ -67,19 +67,31 @@ ModelApiResponse <- R6::R6Class(
|
||||
}
|
||||
},
|
||||
toJSONString = function() {
|
||||
sprintf(
|
||||
'{
|
||||
"code":
|
||||
%d,
|
||||
"type":
|
||||
"%s",
|
||||
"message":
|
||||
"%s"
|
||||
}',
|
||||
self$`code`,
|
||||
self$`type`,
|
||||
jsoncontent <- c(
|
||||
if (!is.null(self$`code`)) {
|
||||
sprintf(
|
||||
'"code":
|
||||
%d
|
||||
',
|
||||
self$`code`
|
||||
)},
|
||||
if (!is.null(self$`type`)) {
|
||||
sprintf(
|
||||
'"type":
|
||||
"%s"
|
||||
',
|
||||
self$`type`
|
||||
)},
|
||||
if (!is.null(self$`message`)) {
|
||||
sprintf(
|
||||
'"message":
|
||||
"%s"
|
||||
',
|
||||
self$`message`
|
||||
)}
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
paste('{', jsoncontent, '}', sep = "")
|
||||
},
|
||||
fromJSONString = function(ModelApiResponseJson) {
|
||||
ModelApiResponseObject <- jsonlite::fromJSON(ModelApiResponseJson)
|
||||
|
||||
@@ -105,28 +105,52 @@ Order <- R6::R6Class(
|
||||
}
|
||||
},
|
||||
toJSONString = function() {
|
||||
sprintf(
|
||||
'{
|
||||
"id":
|
||||
%d,
|
||||
"petId":
|
||||
%d,
|
||||
"quantity":
|
||||
%d,
|
||||
"shipDate":
|
||||
"%s",
|
||||
"status":
|
||||
"%s",
|
||||
"complete":
|
||||
"%s"
|
||||
}',
|
||||
self$`id`,
|
||||
self$`petId`,
|
||||
self$`quantity`,
|
||||
self$`shipDate`,
|
||||
self$`status`,
|
||||
jsoncontent <- c(
|
||||
if (!is.null(self$`id`)) {
|
||||
sprintf(
|
||||
'"id":
|
||||
%d
|
||||
',
|
||||
self$`id`
|
||||
)},
|
||||
if (!is.null(self$`petId`)) {
|
||||
sprintf(
|
||||
'"petId":
|
||||
%d
|
||||
',
|
||||
self$`petId`
|
||||
)},
|
||||
if (!is.null(self$`quantity`)) {
|
||||
sprintf(
|
||||
'"quantity":
|
||||
%d
|
||||
',
|
||||
self$`quantity`
|
||||
)},
|
||||
if (!is.null(self$`shipDate`)) {
|
||||
sprintf(
|
||||
'"shipDate":
|
||||
"%s"
|
||||
',
|
||||
self$`shipDate`
|
||||
)},
|
||||
if (!is.null(self$`status`)) {
|
||||
sprintf(
|
||||
'"status":
|
||||
"%s"
|
||||
',
|
||||
self$`status`
|
||||
)},
|
||||
if (!is.null(self$`complete`)) {
|
||||
sprintf(
|
||||
'"complete":
|
||||
"%s"
|
||||
',
|
||||
self$`complete`
|
||||
)}
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
paste('{', jsoncontent, '}', sep = "")
|
||||
},
|
||||
fromJSONString = function(OrderJson) {
|
||||
OrderObject <- jsonlite::fromJSON(OrderJson)
|
||||
|
||||
@@ -93,63 +93,77 @@ Pet <- R6::R6Class(
|
||||
}
|
||||
if (!is.null(PetObject$`category`)) {
|
||||
categoryObject <- Category$new()
|
||||
categoryObject$fromJSON(jsonlite::toJSON(PetObject$category, auto_unbox = TRUE))
|
||||
categoryObject$fromJSON(jsonlite::toJSON(PetObject$category, auto_unbox = TRUE, digits = NA))
|
||||
self$`category` <- categoryObject
|
||||
}
|
||||
if (!is.null(PetObject$`name`)) {
|
||||
self$`name` <- PetObject$`name`
|
||||
}
|
||||
if (!is.null(PetObject$`photoUrls`)) {
|
||||
self$`photoUrls` <- PetObject$`photoUrls`
|
||||
self$`photoUrls` <- ApiClient$new()$deserializeObj(PetObject$`photoUrls`, "array[character]", "package:petstore")
|
||||
}
|
||||
if (!is.null(PetObject$`tags`)) {
|
||||
self$`tags` <- sapply(PetObject$`tags`, function(x) {
|
||||
tagsObject <- Tag$new()
|
||||
tagsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
|
||||
tagsObject
|
||||
})
|
||||
self$`tags` <- ApiClient$new()$deserializeObj(PetObject$`tags`, "array[Tag]", "package:petstore")
|
||||
}
|
||||
if (!is.null(PetObject$`status`)) {
|
||||
self$`status` <- PetObject$`status`
|
||||
}
|
||||
},
|
||||
toJSONString = function() {
|
||||
sprintf(
|
||||
'{
|
||||
"id":
|
||||
%d,
|
||||
"category":
|
||||
%s,
|
||||
"name":
|
||||
"%s",
|
||||
"photoUrls":
|
||||
[%s],
|
||||
"tags":
|
||||
[%s],
|
||||
"status":
|
||||
"%s"
|
||||
}',
|
||||
self$`id`,
|
||||
jsonlite::toJSON(self$`category`$toJSON(), auto_unbox=TRUE),
|
||||
self$`name`,
|
||||
paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse=","),
|
||||
paste(unlist(lapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE))), collapse=","),
|
||||
jsoncontent <- c(
|
||||
if (!is.null(self$`id`)) {
|
||||
sprintf(
|
||||
'"id":
|
||||
%d
|
||||
',
|
||||
self$`id`
|
||||
)},
|
||||
if (!is.null(self$`category`)) {
|
||||
sprintf(
|
||||
'"category":
|
||||
%s
|
||||
',
|
||||
jsonlite::toJSON(self$`category`$toJSON(), auto_unbox=TRUE, digits = NA)
|
||||
)},
|
||||
if (!is.null(self$`name`)) {
|
||||
sprintf(
|
||||
'"name":
|
||||
"%s"
|
||||
',
|
||||
self$`name`
|
||||
)},
|
||||
if (!is.null(self$`photoUrls`)) {
|
||||
sprintf(
|
||||
'"photoUrls":
|
||||
[%s]
|
||||
',
|
||||
paste(unlist(lapply(self$`photoUrls`, function(x) paste0('"', x, '"'))), collapse=",")
|
||||
)},
|
||||
if (!is.null(self$`tags`)) {
|
||||
sprintf(
|
||||
'"tags":
|
||||
[%s]
|
||||
',
|
||||
paste(unlist(lapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA))), collapse=",")
|
||||
)},
|
||||
if (!is.null(self$`status`)) {
|
||||
sprintf(
|
||||
'"status":
|
||||
"%s"
|
||||
',
|
||||
self$`status`
|
||||
)}
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
paste('{', jsoncontent, '}', sep = "")
|
||||
},
|
||||
fromJSONString = function(PetJson) {
|
||||
PetObject <- jsonlite::fromJSON(PetJson)
|
||||
self$`id` <- PetObject$`id`
|
||||
self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(PetObject$category, auto_unbox = TRUE))
|
||||
self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(PetObject$category, auto_unbox = TRUE, digits = NA))
|
||||
self$`name` <- PetObject$`name`
|
||||
self$`photoUrls` <- lapply(PetObject$`photoUrls`, function (x) x)
|
||||
data.frame <- PetObject$`tags`
|
||||
self$`tags` <- vector("list", length = nrow(data.frame))
|
||||
for (row in 1:nrow(data.frame)) {
|
||||
tags.node <- Tag$new()
|
||||
tags.node$fromJSON(jsonlite::toJSON(data.frame[row,,drop = TRUE], auto_unbox = TRUE))
|
||||
self$`tags`[[row]] <- tags.node
|
||||
}
|
||||
self$`photoUrls` <- ApiClient$new()$deserializeObj(PetObject$`photoUrls`, "array[character]","package:petstore")
|
||||
self$`tags` <- ApiClient$new()$deserializeObj(PetObject$`tags`, "array[Tag]","package:petstore")
|
||||
self$`status` <- PetObject$`status`
|
||||
self
|
||||
}
|
||||
|
||||
@@ -57,6 +57,18 @@ PetApi <- R6::R6Class(
|
||||
}
|
||||
},
|
||||
AddPet = function(body, ...){
|
||||
apiResponse <- self$AddPetWithHttpInfo(body, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
AddPetWithHttpInfo = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -83,15 +95,26 @@ PetApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
DeletePet = function(pet.id, api.key=NULL, ...){
|
||||
apiResponse <- self$DeletePetWithHttpInfo(pet.id, api.key, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
DeletePetWithHttpInfo = function(pet.id, api.key=NULL, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -118,15 +141,26 @@ PetApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
FindPetsByStatus = function(status, ...){
|
||||
apiResponse <- self$FindPetsByStatusWithHttpInfo(status, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
FindPetsByStatusWithHttpInfo = function(status, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -149,15 +183,27 @@ PetApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
Pet$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "array[Pet]", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
FindPetsByTags = function(tags, ...){
|
||||
apiResponse <- self$FindPetsByTagsWithHttpInfo(tags, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
FindPetsByTagsWithHttpInfo = function(tags, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -180,15 +226,27 @@ PetApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
Pet$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "array[Pet]", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
GetPetById = function(pet.id, ...){
|
||||
apiResponse <- self$GetPetByIdWithHttpInfo(pet.id, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
GetPetByIdWithHttpInfo = function(pet.id, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -215,15 +273,27 @@ PetApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
Pet$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "Pet", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
UpdatePet = function(body, ...){
|
||||
apiResponse <- self$UpdatePetWithHttpInfo(body, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
UpdatePetWithHttpInfo = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -250,15 +320,26 @@ PetApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
UpdatePetWithForm = function(pet.id, name=NULL, status=NULL, ...){
|
||||
apiResponse <- self$UpdatePetWithFormWithHttpInfo(pet.id, name, status, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
UpdatePetWithFormWithHttpInfo = function(pet.id, name=NULL, status=NULL, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -288,15 +369,26 @@ PetApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
UploadFile = function(pet.id, additional.metadata=NULL, file=NULL, ...){
|
||||
apiResponse <- self$UploadFileWithHttpInfo(pet.id, additional.metadata, file, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
UploadFileWithHttpInfo = function(pet.id, additional.metadata=NULL, file=NULL, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -326,13 +418,13 @@ PetApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
ModelApiResponse$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "ModelApiResponse", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -45,6 +45,18 @@ StoreApi <- R6::R6Class(
|
||||
}
|
||||
},
|
||||
DeleteOrder = function(order.id, ...){
|
||||
apiResponse <- self$DeleteOrderWithHttpInfo(order.id, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
DeleteOrderWithHttpInfo = function(order.id, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -67,15 +79,26 @@ StoreApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
GetInventory = function(...){
|
||||
apiResponse <- self$GetInventoryWithHttpInfo(...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
GetInventoryWithHttpInfo = function(...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -94,15 +117,27 @@ StoreApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
integer$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "map(integer)", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
GetOrderById = function(order.id, ...){
|
||||
apiResponse <- self$GetOrderByIdWithHttpInfo(order.id, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
GetOrderByIdWithHttpInfo = function(order.id, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -125,15 +160,27 @@ StoreApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
Order$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "Order", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
PlaceOrder = function(body, ...){
|
||||
apiResponse <- self$PlaceOrderWithHttpInfo(body, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
PlaceOrderWithHttpInfo = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -158,13 +205,13 @@ StoreApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
Order$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "Order", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -54,16 +54,24 @@ Tag <- R6::R6Class(
|
||||
}
|
||||
},
|
||||
toJSONString = function() {
|
||||
sprintf(
|
||||
'{
|
||||
"id":
|
||||
%d,
|
||||
"name":
|
||||
"%s"
|
||||
}',
|
||||
self$`id`,
|
||||
jsoncontent <- c(
|
||||
if (!is.null(self$`id`)) {
|
||||
sprintf(
|
||||
'"id":
|
||||
%d
|
||||
',
|
||||
self$`id`
|
||||
)},
|
||||
if (!is.null(self$`name`)) {
|
||||
sprintf(
|
||||
'"name":
|
||||
"%s"
|
||||
',
|
||||
self$`name`
|
||||
)}
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
paste('{', jsoncontent, '}', sep = "")
|
||||
},
|
||||
fromJSONString = function(TagJson) {
|
||||
TagObject <- jsonlite::fromJSON(TagJson)
|
||||
|
||||
@@ -132,34 +132,66 @@ User <- R6::R6Class(
|
||||
}
|
||||
},
|
||||
toJSONString = function() {
|
||||
sprintf(
|
||||
'{
|
||||
"id":
|
||||
%d,
|
||||
"username":
|
||||
"%s",
|
||||
"firstName":
|
||||
"%s",
|
||||
"lastName":
|
||||
"%s",
|
||||
"email":
|
||||
"%s",
|
||||
"password":
|
||||
"%s",
|
||||
"phone":
|
||||
"%s",
|
||||
"userStatus":
|
||||
%d
|
||||
}',
|
||||
self$`id`,
|
||||
self$`username`,
|
||||
self$`firstName`,
|
||||
self$`lastName`,
|
||||
self$`email`,
|
||||
self$`password`,
|
||||
self$`phone`,
|
||||
jsoncontent <- c(
|
||||
if (!is.null(self$`id`)) {
|
||||
sprintf(
|
||||
'"id":
|
||||
%d
|
||||
',
|
||||
self$`id`
|
||||
)},
|
||||
if (!is.null(self$`username`)) {
|
||||
sprintf(
|
||||
'"username":
|
||||
"%s"
|
||||
',
|
||||
self$`username`
|
||||
)},
|
||||
if (!is.null(self$`firstName`)) {
|
||||
sprintf(
|
||||
'"firstName":
|
||||
"%s"
|
||||
',
|
||||
self$`firstName`
|
||||
)},
|
||||
if (!is.null(self$`lastName`)) {
|
||||
sprintf(
|
||||
'"lastName":
|
||||
"%s"
|
||||
',
|
||||
self$`lastName`
|
||||
)},
|
||||
if (!is.null(self$`email`)) {
|
||||
sprintf(
|
||||
'"email":
|
||||
"%s"
|
||||
',
|
||||
self$`email`
|
||||
)},
|
||||
if (!is.null(self$`password`)) {
|
||||
sprintf(
|
||||
'"password":
|
||||
"%s"
|
||||
',
|
||||
self$`password`
|
||||
)},
|
||||
if (!is.null(self$`phone`)) {
|
||||
sprintf(
|
||||
'"phone":
|
||||
"%s"
|
||||
',
|
||||
self$`phone`
|
||||
)},
|
||||
if (!is.null(self$`userStatus`)) {
|
||||
sprintf(
|
||||
'"userStatus":
|
||||
%d
|
||||
',
|
||||
self$`userStatus`
|
||||
)}
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
paste('{', jsoncontent, '}', sep = "")
|
||||
},
|
||||
fromJSONString = function(UserJson) {
|
||||
UserObject <- jsonlite::fromJSON(UserJson)
|
||||
|
||||
@@ -57,6 +57,18 @@ UserApi <- R6::R6Class(
|
||||
}
|
||||
},
|
||||
CreateUser = function(body, ...){
|
||||
apiResponse <- self$CreateUserWithHttpInfo(body, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
CreateUserWithHttpInfo = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -81,15 +93,26 @@ UserApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
CreateUsersWithArrayInput = function(body, ...){
|
||||
apiResponse <- self$CreateUsersWithArrayInputWithHttpInfo(body, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
CreateUsersWithArrayInputWithHttpInfo = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -99,7 +122,8 @@ UserApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
body.items = paste(unlist(lapply(body, function(param){param$toJSONString()})), collapse = ",")
|
||||
body <- paste0('[', body.items, ']')
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
@@ -114,15 +138,26 @@ UserApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
CreateUsersWithListInput = function(body, ...){
|
||||
apiResponse <- self$CreateUsersWithListInputWithHttpInfo(body, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
CreateUsersWithListInputWithHttpInfo = function(body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -132,7 +167,8 @@ UserApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
if (!missing(`body`)) {
|
||||
body <- `body`$toJSONString()
|
||||
body.items = paste(unlist(lapply(body, function(param){param$toJSONString()})), collapse = ",")
|
||||
body <- paste0('[', body.items, ']')
|
||||
} else {
|
||||
body <- NULL
|
||||
}
|
||||
@@ -147,15 +183,26 @@ UserApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
DeleteUser = function(username, ...){
|
||||
apiResponse <- self$DeleteUserWithHttpInfo(username, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
DeleteUserWithHttpInfo = function(username, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -178,15 +225,26 @@ UserApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
GetUserByName = function(username, ...){
|
||||
apiResponse <- self$GetUserByNameWithHttpInfo(username, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
GetUserByNameWithHttpInfo = function(username, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -209,15 +267,27 @@ UserApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
User$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "User", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
LoginUser = function(username, password, ...){
|
||||
apiResponse <- self$LoginUserWithHttpInfo(username, password, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
LoginUserWithHttpInfo = function(username, password, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -244,15 +314,27 @@ UserApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
character$new()$fromJSONString(httr::content(resp, "text", encoding = "UTF-8"))
|
||||
deserializedRespObj <- self$apiClient$deserialize(resp, "character", "package:petstore")
|
||||
ApiResponse$new(deserializedRespObj, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
LogoutUser = function(...){
|
||||
apiResponse <- self$LogoutUserWithHttpInfo(...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
LogoutUserWithHttpInfo = function(...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -267,15 +349,26 @@ UserApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
},
|
||||
UpdateUser = function(username, body, ...){
|
||||
apiResponse <- self$UpdateUserWithHttpInfo(username, body, ...)
|
||||
resp <- apiResponse$response
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
apiResponse$content
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
apiResponse
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
apiResponse
|
||||
}
|
||||
},
|
||||
|
||||
UpdateUserWithHttpInfo = function(username, body, ...){
|
||||
args <- list(...)
|
||||
queryParams <- list()
|
||||
headerParams <- c()
|
||||
@@ -308,13 +401,12 @@ UserApi <- R6::R6Class(
|
||||
...)
|
||||
|
||||
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
|
||||
# void response, no need to return anything
|
||||
ApiResponse$new(NULL, resp)
|
||||
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
|
||||
ApiResponse$new("API client error", resp)
|
||||
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
|
||||
ApiResponse$new("API server error", resp)
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -6,8 +6,8 @@ Name | Type | Description | Notes
|
||||
**id** | **integer** | | [optional]
|
||||
**category** | [**Category**](Category.md) | | [optional]
|
||||
**name** | **character** | |
|
||||
**photoUrls** | **character** | |
|
||||
**tags** | [**Tag**](Tag.md) | | [optional]
|
||||
**photoUrls** | **array[character]** | |
|
||||
**tags** | [**array[Tag]**](Tag.md) | | [optional]
|
||||
**status** | **character** | pet status in the store | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ void (empty response body)
|
||||
|
||||
|
||||
# **FindPetsByStatus**
|
||||
> Pet FindPetsByStatus(status)
|
||||
> array[Pet] FindPetsByStatus(status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
@@ -105,7 +105,7 @@ Multiple status values can be provided with comma separated strings
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.status <- list("status_example") # character | Status values that need to be considered for filter
|
||||
var.status <- list("status_example") # array[character] | Status values that need to be considered for filter
|
||||
|
||||
#Finds Pets by status
|
||||
api.instance <- PetApi$new()
|
||||
@@ -119,11 +119,11 @@ dput(result)
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**character**](character.md)| Status values that need to be considered for filter |
|
||||
**status** | [**array[character]**](character.md)| Status values that need to be considered for filter |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
[**array[Pet]**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -137,7 +137,7 @@ Name | Type | Description | Notes
|
||||
|
||||
|
||||
# **FindPetsByTags**
|
||||
> Pet FindPetsByTags(tags)
|
||||
> array[Pet] FindPetsByTags(tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
@@ -147,7 +147,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.tags <- list("inner_example") # character | Tags to filter by
|
||||
var.tags <- list("inner_example") # array[character] | Tags to filter by
|
||||
|
||||
#Finds Pets by tags
|
||||
api.instance <- PetApi$new()
|
||||
@@ -161,11 +161,11 @@ dput(result)
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**character**](character.md)| Tags to filter by |
|
||||
**tags** | [**array[character]**](character.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
[**array[Pet]**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ No authorization required
|
||||
|
||||
|
||||
# **GetInventory**
|
||||
> integer GetInventory()
|
||||
> map(integer) GetInventory()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
@@ -74,7 +74,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**integer**
|
||||
**map(integer)**
|
||||
|
||||
### Authorization
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ Creates list of users with given input array
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.body <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # User | List of user object
|
||||
var.body <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||
|
||||
#Creates list of users with given input array
|
||||
api.instance <- UserApi$new()
|
||||
@@ -73,7 +73,7 @@ api.instance$CreateUsersWithArrayInput(var.body)
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](array.md)| List of user object |
|
||||
**body** | [**array[User]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -99,7 +99,7 @@ Creates list of users with given input array
|
||||
```R
|
||||
library(petstore)
|
||||
|
||||
var.body <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # User | List of user object
|
||||
var.body <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object
|
||||
|
||||
#Creates list of users with given input array
|
||||
api.instance <- UserApi$new()
|
||||
@@ -110,7 +110,7 @@ api.instance$CreateUsersWithListInput(var.body)
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](array.md)| List of user object |
|
||||
**body** | [**array[User]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
4.0.1-SNAPSHOT
|
||||
4.0.2-SNAPSHOT
|
||||
@@ -76,4 +76,6 @@ private:
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIApiResponse)
|
||||
|
||||
#endif // OAIApiResponse_H
|
||||
|
||||
@@ -68,4 +68,6 @@ private:
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAICategory)
|
||||
|
||||
#endif // OAICategory_H
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <QString>
|
||||
#include <QJsonValue>
|
||||
#include <QMetaType>
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
@@ -61,4 +62,6 @@ private :
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIEnum)
|
||||
|
||||
#endif // OAI_ENUM_H
|
||||
|
||||
@@ -54,18 +54,29 @@ OAIHttpRequestWorker::OAIHttpRequestWorker(QObject *parent)
|
||||
: QObject(parent), manager(nullptr)
|
||||
{
|
||||
qsrand(QDateTime::currentDateTime().toTime_t());
|
||||
|
||||
timeout = 0;
|
||||
timer = new QTimer();
|
||||
manager = new QNetworkAccessManager(this);
|
||||
connect(manager, &QNetworkAccessManager::finished, this, &OAIHttpRequestWorker::on_manager_finished);
|
||||
}
|
||||
|
||||
OAIHttpRequestWorker::~OAIHttpRequestWorker() {
|
||||
if(timer != nullptr){
|
||||
if(timer->isActive()){
|
||||
timer->stop();
|
||||
}
|
||||
timer->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
QMap<QByteArray, QByteArray> OAIHttpRequestWorker::getResponseHeaders() const {
|
||||
return headers;
|
||||
}
|
||||
|
||||
void OAIHttpRequestWorker::setTimeOut(int tout){
|
||||
timeout = tout;
|
||||
}
|
||||
|
||||
QString OAIHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) {
|
||||
// result structure follows RFC 5987
|
||||
bool need_utf_encoding = false;
|
||||
@@ -117,7 +128,7 @@ QString OAIHttpRequestWorker::http_attribute_encode(QString attribute_name, QStr
|
||||
void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) {
|
||||
|
||||
// reset variables
|
||||
|
||||
QNetworkReply* reply = nullptr;
|
||||
QByteArray request_content = "";
|
||||
response = "";
|
||||
error_type = QNetworkReply::NoError;
|
||||
@@ -285,19 +296,19 @@ void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) {
|
||||
}
|
||||
|
||||
if (input->http_method == "GET") {
|
||||
manager->get(request);
|
||||
reply = manager->get(request);
|
||||
}
|
||||
else if (input->http_method == "POST") {
|
||||
manager->post(request, request_content);
|
||||
reply = manager->post(request, request_content);
|
||||
}
|
||||
else if (input->http_method == "PUT") {
|
||||
manager->put(request, request_content);
|
||||
reply = manager->put(request, request_content);
|
||||
}
|
||||
else if (input->http_method == "HEAD") {
|
||||
manager->head(request);
|
||||
reply = manager->head(request);
|
||||
}
|
||||
else if (input->http_method == "DELETE") {
|
||||
manager->deleteResource(request);
|
||||
reply = manager->deleteResource(request);
|
||||
}
|
||||
else {
|
||||
#if (QT_VERSION >= 0x050800)
|
||||
@@ -307,11 +318,16 @@ void OAIHttpRequestWorker::execute(OAIHttpRequestInput *input) {
|
||||
buffer->setData(request_content);
|
||||
buffer->open(QIODevice::ReadOnly);
|
||||
|
||||
QNetworkReply* reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer);
|
||||
reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer);
|
||||
buffer->setParent(reply);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(timeout > 0){
|
||||
timer->setSingleShot(true);
|
||||
timer->setInterval(timeout);
|
||||
connect(timer, &QTimer::timeout, this, [=](){ on_manager_timeout(reply); });
|
||||
timer->start();
|
||||
}
|
||||
}
|
||||
|
||||
void OAIHttpRequestWorker::on_manager_finished(QNetworkReply *reply) {
|
||||
@@ -327,6 +343,16 @@ void OAIHttpRequestWorker::on_manager_finished(QNetworkReply *reply) {
|
||||
|
||||
emit on_execution_finished(this);
|
||||
}
|
||||
void OAIHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) {
|
||||
error_type = QNetworkReply::TimeoutError;
|
||||
response = "";
|
||||
error_str = "Timed out waiting for response";
|
||||
disconnect(manager, nullptr, nullptr, nullptr);
|
||||
reply->abort();
|
||||
reply->deleteLater();
|
||||
|
||||
emit on_execution_finished(this);
|
||||
}
|
||||
QSslConfiguration* OAIHttpRequestWorker::sslDefaultConfiguration;
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QTimer>
|
||||
#include <QMap>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
@@ -69,7 +70,7 @@ public:
|
||||
QByteArray response;
|
||||
QNetworkReply::NetworkError error_type;
|
||||
QString error_str;
|
||||
|
||||
QTimer *timer;
|
||||
explicit OAIHttpRequestWorker(QObject *parent = nullptr);
|
||||
virtual ~OAIHttpRequestWorker();
|
||||
|
||||
@@ -77,16 +78,17 @@ public:
|
||||
QString http_attribute_encode(QString attribute_name, QString input);
|
||||
void execute(OAIHttpRequestInput *input);
|
||||
static QSslConfiguration* sslDefaultConfiguration;
|
||||
|
||||
void setTimeOut(int tout);
|
||||
signals:
|
||||
void on_execution_finished(OAIHttpRequestWorker *worker);
|
||||
|
||||
private:
|
||||
QNetworkAccessManager *manager;
|
||||
QMap<QByteArray, QByteArray> headers;
|
||||
int timeout;
|
||||
void on_manager_timeout(QNetworkReply *reply);
|
||||
private slots:
|
||||
void on_manager_finished(QNetworkReply *reply);
|
||||
|
||||
void on_manager_finished(QNetworkReply *reply);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QMetaType>
|
||||
|
||||
namespace OpenAPI {
|
||||
|
||||
@@ -63,4 +64,6 @@ private :
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIObject)
|
||||
|
||||
#endif // OAI_OBJECT_H
|
||||
|
||||
@@ -101,4 +101,6 @@ private:
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIOrder)
|
||||
|
||||
#endif // OAIOrder_H
|
||||
|
||||
@@ -103,4 +103,6 @@ private:
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIPet)
|
||||
|
||||
#endif // OAIPet_H
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
namespace OpenAPI {
|
||||
|
||||
OAIPetApi::OAIPetApi() : basePath("/v2"),
|
||||
host("petstore.swagger.io") {
|
||||
host("petstore.swagger.io"),
|
||||
timeout(0){
|
||||
|
||||
}
|
||||
|
||||
@@ -27,9 +28,10 @@ OAIPetApi::~OAIPetApi() {
|
||||
|
||||
}
|
||||
|
||||
OAIPetApi::OAIPetApi(const QString& host, const QString& basePath) {
|
||||
OAIPetApi::OAIPetApi(const QString& host, const QString& basePath, const int tout) {
|
||||
this->host = host;
|
||||
this->basePath = basePath;
|
||||
this->timeout = tout;
|
||||
}
|
||||
|
||||
void OAIPetApi::setBasePath(const QString& basePath){
|
||||
@@ -40,6 +42,10 @@ void OAIPetApi::setHost(const QString& host){
|
||||
this->host = host;
|
||||
}
|
||||
|
||||
void OAIPetApi::setApiTimeOutMs(const int tout){
|
||||
timeout = tout;
|
||||
}
|
||||
|
||||
void OAIPetApi::addHeaders(const QString& key, const QString& value){
|
||||
defaultHeaders.insert(key, value);
|
||||
}
|
||||
@@ -51,6 +57,7 @@ OAIPetApi::addPet(const OAIPet& body) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet");
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
@@ -102,6 +109,7 @@ OAIPetApi::deletePet(const qint64& pet_id, const QString& api_key) {
|
||||
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
if (api_key != nullptr) {
|
||||
@@ -189,6 +197,7 @@ OAIPetApi::findPetsByStatus(const QList<QString>& status) {
|
||||
}
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
@@ -283,6 +292,7 @@ OAIPetApi::findPetsByTags(const QList<QString>& tags) {
|
||||
}
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
@@ -340,6 +350,7 @@ OAIPetApi::getPetById(const qint64& pet_id) {
|
||||
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
@@ -385,6 +396,7 @@ OAIPetApi::updatePet(const OAIPet& body) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet");
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "PUT");
|
||||
|
||||
|
||||
@@ -436,6 +448,7 @@ OAIPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QS
|
||||
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
if (name != nullptr) {
|
||||
input.add_var("name", name);
|
||||
@@ -489,6 +502,7 @@ OAIPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata,
|
||||
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
if (additional_metadata != nullptr) {
|
||||
input.add_var("additionalMetadata", additional_metadata);
|
||||
|
||||
@@ -29,11 +29,12 @@ class OAIPetApi: public QObject {
|
||||
|
||||
public:
|
||||
OAIPetApi();
|
||||
OAIPetApi(const QString& host, const QString& basePath);
|
||||
OAIPetApi(const QString& host, const QString& basePath, const int toutMs = 0);
|
||||
~OAIPetApi();
|
||||
|
||||
void setBasePath(const QString& basePath);
|
||||
void setHost(const QString& host);
|
||||
void setApiTimeOutMs(const int tout);
|
||||
void addHeaders(const QString& key, const QString& value);
|
||||
|
||||
void addPet(const OAIPet& body);
|
||||
@@ -48,6 +49,7 @@ public:
|
||||
private:
|
||||
QString basePath;
|
||||
QString host;
|
||||
int timeout;
|
||||
QMap<QString, QString> defaultHeaders;
|
||||
void addPetCallback (OAIHttpRequestWorker * worker);
|
||||
void deletePetCallback (OAIHttpRequestWorker * worker);
|
||||
@@ -77,23 +79,23 @@ signals:
|
||||
void updatePetWithFormSignalFull(OAIHttpRequestWorker* worker);
|
||||
void uploadFileSignalFull(OAIHttpRequestWorker* worker, OAIApiResponse summary);
|
||||
|
||||
void addPetSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void deletePetSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void findPetsByStatusSignalE(QList<OAIPet> summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void findPetsByTagsSignalE(QList<OAIPet> summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void getPetByIdSignalE(OAIPet summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void updatePetSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void uploadFileSignalE(OAIApiResponse summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void addPetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void deletePetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void findPetsByStatusSignalE(QList<OAIPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void findPetsByTagsSignalE(QList<OAIPet> summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void getPetByIdSignalE(OAIPet summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void updatePetSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void uploadFileSignalE(OAIApiResponse summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
|
||||
void addPetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void deletePetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void findPetsByStatusSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void findPetsByTagsSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void getPetByIdSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void updatePetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void updatePetWithFormSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void uploadFileSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void addPetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void deletePetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void findPetsByStatusSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void findPetsByTagsSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void getPetByIdSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void updatePetSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void updatePetWithFormSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void uploadFileSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
namespace OpenAPI {
|
||||
|
||||
OAIStoreApi::OAIStoreApi() : basePath("/v2"),
|
||||
host("petstore.swagger.io") {
|
||||
host("petstore.swagger.io"),
|
||||
timeout(0){
|
||||
|
||||
}
|
||||
|
||||
@@ -27,9 +28,10 @@ OAIStoreApi::~OAIStoreApi() {
|
||||
|
||||
}
|
||||
|
||||
OAIStoreApi::OAIStoreApi(const QString& host, const QString& basePath) {
|
||||
OAIStoreApi::OAIStoreApi(const QString& host, const QString& basePath, const int tout) {
|
||||
this->host = host;
|
||||
this->basePath = basePath;
|
||||
this->timeout = tout;
|
||||
}
|
||||
|
||||
void OAIStoreApi::setBasePath(const QString& basePath){
|
||||
@@ -40,6 +42,10 @@ void OAIStoreApi::setHost(const QString& host){
|
||||
this->host = host;
|
||||
}
|
||||
|
||||
void OAIStoreApi::setApiTimeOutMs(const int tout){
|
||||
timeout = tout;
|
||||
}
|
||||
|
||||
void OAIStoreApi::addHeaders(const QString& key, const QString& value){
|
||||
defaultHeaders.insert(key, value);
|
||||
}
|
||||
@@ -54,6 +60,7 @@ OAIStoreApi::deleteOrder(const QString& order_id) {
|
||||
fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(order_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
@@ -98,6 +105,7 @@ OAIStoreApi::getInventory() {
|
||||
fullPath.append(this->host).append(this->basePath).append("/store/inventory");
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
@@ -155,6 +163,7 @@ OAIStoreApi::getOrderById(const qint64& order_id) {
|
||||
fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(order_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
@@ -200,6 +209,7 @@ OAIStoreApi::placeOrder(const OAIOrder& body) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/store/order");
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,12 @@ class OAIStoreApi: public QObject {
|
||||
|
||||
public:
|
||||
OAIStoreApi();
|
||||
OAIStoreApi(const QString& host, const QString& basePath);
|
||||
OAIStoreApi(const QString& host, const QString& basePath, const int toutMs = 0);
|
||||
~OAIStoreApi();
|
||||
|
||||
void setBasePath(const QString& basePath);
|
||||
void setHost(const QString& host);
|
||||
void setApiTimeOutMs(const int tout);
|
||||
void addHeaders(const QString& key, const QString& value);
|
||||
|
||||
void deleteOrder(const QString& order_id);
|
||||
@@ -43,6 +44,7 @@ public:
|
||||
private:
|
||||
QString basePath;
|
||||
QString host;
|
||||
int timeout;
|
||||
QMap<QString, QString> defaultHeaders;
|
||||
void deleteOrderCallback (OAIHttpRequestWorker * worker);
|
||||
void getInventoryCallback (OAIHttpRequestWorker * worker);
|
||||
@@ -60,15 +62,15 @@ signals:
|
||||
void getOrderByIdSignalFull(OAIHttpRequestWorker* worker, OAIOrder summary);
|
||||
void placeOrderSignalFull(OAIHttpRequestWorker* worker, OAIOrder summary);
|
||||
|
||||
void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void getInventorySignalE(QMap<QString, qint32> summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void getOrderByIdSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void placeOrderSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void getInventorySignalE(QMap<QString, qint32> summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void getOrderByIdSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void placeOrderSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
|
||||
void deleteOrderSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void getInventorySignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void getOrderByIdSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void placeOrderSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void deleteOrderSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void getInventorySignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void getOrderByIdSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void placeOrderSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -68,4 +68,6 @@ private:
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAITag)
|
||||
|
||||
#endif // OAITag_H
|
||||
|
||||
@@ -116,4 +116,6 @@ private:
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(OpenAPI::OAIUser)
|
||||
|
||||
#endif // OAIUser_H
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
namespace OpenAPI {
|
||||
|
||||
OAIUserApi::OAIUserApi() : basePath("/v2"),
|
||||
host("petstore.swagger.io") {
|
||||
host("petstore.swagger.io"),
|
||||
timeout(0){
|
||||
|
||||
}
|
||||
|
||||
@@ -27,9 +28,10 @@ OAIUserApi::~OAIUserApi() {
|
||||
|
||||
}
|
||||
|
||||
OAIUserApi::OAIUserApi(const QString& host, const QString& basePath) {
|
||||
OAIUserApi::OAIUserApi(const QString& host, const QString& basePath, const int tout) {
|
||||
this->host = host;
|
||||
this->basePath = basePath;
|
||||
this->timeout = tout;
|
||||
}
|
||||
|
||||
void OAIUserApi::setBasePath(const QString& basePath){
|
||||
@@ -40,6 +42,10 @@ void OAIUserApi::setHost(const QString& host){
|
||||
this->host = host;
|
||||
}
|
||||
|
||||
void OAIUserApi::setApiTimeOutMs(const int tout){
|
||||
timeout = tout;
|
||||
}
|
||||
|
||||
void OAIUserApi::addHeaders(const QString& key, const QString& value){
|
||||
defaultHeaders.insert(key, value);
|
||||
}
|
||||
@@ -51,6 +57,7 @@ OAIUserApi::createUser(const OAIUser& body) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/user");
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
@@ -99,6 +106,7 @@ OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& body) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/createWithArray");
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
@@ -148,6 +156,7 @@ OAIUserApi::createUsersWithListInput(const QList<OAIUser>& body) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/createWithList");
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
@@ -200,6 +209,7 @@ OAIUserApi::deleteUser(const QString& username) {
|
||||
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
@@ -247,6 +257,7 @@ OAIUserApi::getUserByName(const QString& username) {
|
||||
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
@@ -308,6 +319,7 @@ OAIUserApi::loginUser(const QString& username, const QString& password) {
|
||||
.append(QUrl::toPercentEncoding(::OpenAPI::toStringValue(password)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
@@ -354,6 +366,7 @@ OAIUserApi::logoutUser() {
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/logout");
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
@@ -401,6 +414,7 @@ OAIUserApi::updateUser(const QString& username, const OAIUser& body) {
|
||||
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
worker->setTimeOut(timeout);
|
||||
OAIHttpRequestInput input(fullPath, "PUT");
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,12 @@ class OAIUserApi: public QObject {
|
||||
|
||||
public:
|
||||
OAIUserApi();
|
||||
OAIUserApi(const QString& host, const QString& basePath);
|
||||
OAIUserApi(const QString& host, const QString& basePath, const int toutMs = 0);
|
||||
~OAIUserApi();
|
||||
|
||||
void setBasePath(const QString& basePath);
|
||||
void setHost(const QString& host);
|
||||
void setApiTimeOutMs(const int tout);
|
||||
void addHeaders(const QString& key, const QString& value);
|
||||
|
||||
void createUser(const OAIUser& body);
|
||||
@@ -47,6 +48,7 @@ public:
|
||||
private:
|
||||
QString basePath;
|
||||
QString host;
|
||||
int timeout;
|
||||
QMap<QString, QString> defaultHeaders;
|
||||
void createUserCallback (OAIHttpRequestWorker * worker);
|
||||
void createUsersWithArrayInputCallback (OAIHttpRequestWorker * worker);
|
||||
@@ -76,23 +78,23 @@ signals:
|
||||
void logoutUserSignalFull(OAIHttpRequestWorker* worker);
|
||||
void updateUserSignalFull(OAIHttpRequestWorker* worker);
|
||||
|
||||
void createUserSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void deleteUserSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void getUserByNameSignalE(OAIUser summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void loginUserSignalE(QString summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void logoutUserSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void updateUserSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void createUserSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void deleteUserSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void getUserByNameSignalE(OAIUser summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void loginUserSignalE(QString summary, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void logoutUserSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void updateUserSignalE(QNetworkReply::NetworkError error_type, QString error_str);
|
||||
|
||||
void createUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void createUsersWithArrayInputSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void createUsersWithListInputSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void deleteUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void getUserByNameSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void loginUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void logoutUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void updateUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void createUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void createUsersWithArrayInputSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void createUsersWithListInputSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void deleteUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void getUserByNameSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void loginUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void logoutUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
void updateUserSignalEFull(OAIHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,54 +1,37 @@
|
||||
#
|
||||
# OpenAPI Petstore
|
||||
# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#
|
||||
# OpenAPI spec version: 1.0.0
|
||||
#
|
||||
# https://openapi-generator.tech
|
||||
#
|
||||
# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
cmake_minimum_required (VERSION 3.2)
|
||||
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
#PROJECT's NAME
|
||||
project(CppRestOpenAPIClient)
|
||||
project(cpprest-petstore)
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
|
||||
# THE LOCATION OF OUTPUT BINARIES
|
||||
set(CMAKE_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/lib)
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_DIR})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -Wno-unused-variable")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++14 -Wall -Wno-unused-variable")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg -g3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -g3")
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
set(CMAKE_PREFIX_PATH /usr/lib/x86_64-linux-gnu/cmake)
|
||||
find_package(cpprestsdk REQUIRED)
|
||||
find_package(Boost REQUIRED)
|
||||
add_subdirectory(client)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
file(GLOB SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
|
||||
)
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/client
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/client/model
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/client/api
|
||||
)
|
||||
|
||||
# BUILD TYPE
|
||||
message("A ${CMAKE_BUILD_TYPE} build configuration is detected")
|
||||
link_directories(
|
||||
${Boost_LIBRARY_DIRS}
|
||||
)
|
||||
add_executable(${PROJECT_NAME} ${SRCS})
|
||||
add_dependencies(${PROJECT_NAME} CppRestOpenAPIClient )
|
||||
target_link_libraries(${PROJECT_NAME} CppRestOpenAPIClient cpprest pthread boost_system crypto)
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Update require components as necessary
|
||||
#find_package(Boost 1.45.0 REQUIRED COMPONENTS ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
|
||||
|
||||
# build and set path to cpp rest sdk
|
||||
set(CPPREST_ROOT ${PROJECT_SOURCE_DIR}/3rdParty/cpprest)
|
||||
set(CPPREST_INCLUDE_DIR ${CPPREST_ROOT}/include)
|
||||
set(CPPREST_LIBRARY_DIR ${CPPREST_ROOT}/lib)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR} api model ${CPPREST_INCLUDE_DIR})
|
||||
|
||||
|
||||
# If using vcpkg, set include directories. Also comment out CPPREST section above since vcpkg will handle it.
|
||||
# To install required vcpkg packages execute:
|
||||
# > vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows
|
||||
# set(VCPKG_ROOT "C:\\vcpkg\\installed\\x64-windows")
|
||||
# set(VCPKG_INCLUDE_DIR ${VCPKG_ROOT}/include)
|
||||
# set(VCPKG_LIBRARY_DIR ${VCPKG_ROOT}/lib)
|
||||
# include_directories(${PROJECT_SOURCE_DIR} api model ${VCPKG_INCLUDE_DIR})
|
||||
|
||||
#SUPPORTING FILES
|
||||
set(SUPPORTING_FILES "ApiClient" "ApiConfiguration" "ApiException" "HttpContent" "IHttpBody" "JsonBody" "ModelBase" "MultipartFormData" "Object")
|
||||
#SOURCE FILES
|
||||
file(GLOB SOURCE_FILES "api/*" "model/*")
|
||||
|
||||
add_library(${PROJECT_NAME} ${SUPPORTING_FILES} ${SOURCE_FILES})
|
||||
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
||||
|
||||
92
samples/client/petstore/cpp-restsdk/PetApiTests.cpp
Normal file
92
samples/client/petstore/cpp-restsdk/PetApiTests.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
#include "PetApiTests.h"
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <functional>
|
||||
|
||||
OAIPetApiTests::OAIPetApiTests(std::string host, std::string basePath){
|
||||
apiconfiguration = std::make_shared<ApiConfiguration>();
|
||||
apiconfiguration->setBaseUrl(host + basePath);
|
||||
apiconfiguration->setUserAgent(U("OpenAPI Client"));
|
||||
apiclient = std::make_shared<ApiClient>(apiconfiguration);
|
||||
api = std::make_shared<PetApi>(apiclient);
|
||||
}
|
||||
|
||||
OAIPetApiTests::~OAIPetApiTests() {
|
||||
|
||||
}
|
||||
|
||||
void OAIPetApiTests::runTests(){
|
||||
testAddPet();
|
||||
testFindPetsByStatus();
|
||||
testGetPetById();
|
||||
}
|
||||
|
||||
void OAIPetApiTests::testAddPet(){
|
||||
auto req = std::make_shared<Pet>();
|
||||
req->setId(12345);
|
||||
req->setName("cpprest-pet");
|
||||
req->setStatus(U("123"));
|
||||
|
||||
std::function<void()> responseCallback = []()
|
||||
{
|
||||
std::cout << "added pet successfully" << std::endl;
|
||||
};
|
||||
|
||||
auto reqTask = api->addPet(req).then(responseCallback);
|
||||
try{
|
||||
reqTask.wait();
|
||||
}
|
||||
catch(const ApiException& ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
catch(const std::exception &ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
void OAIPetApiTests::testFindPetsByStatus(){
|
||||
auto req = std::vector<utility::string_t>();
|
||||
req.push_back(U("123"));
|
||||
auto reqTask = api->findPetsByStatus(req)
|
||||
.then([=](std::vector<std::shared_ptr<Pet>> pets)
|
||||
{
|
||||
std::cout << "found pet successfully" << std::endl;
|
||||
});
|
||||
try{
|
||||
reqTask.wait();
|
||||
}
|
||||
catch(const ApiException& ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
catch(const std::exception &ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
void OAIPetApiTests::testGetPetById(){
|
||||
int req = 12345;
|
||||
auto responseCallback = std::bind(&OAIPetApiTests::getPetByIdCallback, this, std::placeholders::_1);
|
||||
|
||||
auto reqTask = api->getPetById(req).then(responseCallback);
|
||||
|
||||
try{
|
||||
reqTask.wait();
|
||||
}
|
||||
catch(const ApiException& ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
catch(const std::exception &ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
void OAIPetApiTests::getPetByIdCallback(std::shared_ptr<Pet> pet){
|
||||
std::cout << "found pet by id successfully" << std::endl;
|
||||
}
|
||||
34
samples/client/petstore/cpp-restsdk/PetApiTests.h
Normal file
34
samples/client/petstore/cpp-restsdk/PetApiTests.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef OAI_PETAPI_TESTS_H
|
||||
#define OAI_PETAPI_TESTS_H
|
||||
|
||||
#include <memory>
|
||||
#include "client/ApiClient.h"
|
||||
#include "client/ApiConfiguration.h"
|
||||
#include "client/api/PetApi.h"
|
||||
#include "client/model/Pet.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace org::openapitools::client::api;
|
||||
|
||||
class OAIPetApiTests
|
||||
{
|
||||
public:
|
||||
explicit OAIPetApiTests(std::string host = U("http://petstore.swagger.io"), std::string basePath = U("/v2"));
|
||||
|
||||
virtual ~OAIPetApiTests();
|
||||
public:
|
||||
void runTests();
|
||||
private:
|
||||
void testAddPet();
|
||||
void testFindPetsByStatus();
|
||||
void testGetPetById();
|
||||
|
||||
void getPetByIdCallback(std::shared_ptr<Pet> pet);
|
||||
|
||||
std::shared_ptr<ApiConfiguration> apiconfiguration;
|
||||
std::shared_ptr<ApiClient> apiclient;
|
||||
std::shared_ptr<PetApi> api;
|
||||
};
|
||||
|
||||
#endif // OAI_PETAPI_TESTS_H
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
54
samples/client/petstore/cpp-restsdk/client/CMakeLists.txt
Normal file
54
samples/client/petstore/cpp-restsdk/client/CMakeLists.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
#
|
||||
# OpenAPI Petstore
|
||||
# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#
|
||||
# The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
# https://openapi-generator.tech
|
||||
#
|
||||
# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
#PROJECT's NAME
|
||||
project(CppRestOpenAPIClient)
|
||||
|
||||
|
||||
# THE LOCATION OF OUTPUT BINARIES
|
||||
set(CMAKE_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/lib)
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_DIR})
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
# BUILD TYPE
|
||||
message("A ${CMAKE_BUILD_TYPE} build configuration is detected")
|
||||
|
||||
# Update require components as necessary
|
||||
#find_package(Boost 1.45.0 REQUIRED COMPONENTS ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
|
||||
|
||||
# build and set path to cpp rest sdk
|
||||
set(CPPREST_ROOT ${PROJECT_SOURCE_DIR}/3rdParty/cpprest)
|
||||
set(CPPREST_INCLUDE_DIR ${CPPREST_ROOT}/include)
|
||||
set(CPPREST_LIBRARY_DIR ${CPPREST_ROOT}/lib)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR} api model ${CPPREST_INCLUDE_DIR})
|
||||
|
||||
|
||||
# If using vcpkg, set include directories. Also comment out CPPREST section above since vcpkg will handle it.
|
||||
# To install required vcpkg packages execute:
|
||||
# > vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows
|
||||
# set(VCPKG_ROOT "C:\\vcpkg\\installed\\x64-windows")
|
||||
# set(VCPKG_INCLUDE_DIR ${VCPKG_ROOT}/include)
|
||||
# set(VCPKG_LIBRARY_DIR ${VCPKG_ROOT}/lib)
|
||||
# include_directories(${PROJECT_SOURCE_DIR} api model ${VCPKG_INCLUDE_DIR})
|
||||
|
||||
#SUPPORTING FILES
|
||||
set(SUPPORTING_FILES "ApiClient" "ApiConfiguration" "ApiException" "HttpContent" "IHttpBody" "JsonBody" "ModelBase" "MultipartFormData" "Object")
|
||||
#SOURCE FILES
|
||||
file(GLOB SOURCE_FILES "api/*" "model/*")
|
||||
|
||||
add_library(${PROJECT_NAME} ${SUPPORTING_FILES} ${SOURCE_FILES})
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
6
samples/client/petstore/cpp-restsdk/main.cpp
Normal file
6
samples/client/petstore/cpp-restsdk/main.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "PetApiTests.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
auto petTest = std::make_shared<OAIPetApiTests>();
|
||||
petTest->runTests();
|
||||
}
|
||||
@@ -48,7 +48,7 @@ using Org.OpenAPITools.Model;
|
||||
## Getting Started
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -58,10 +58,11 @@ namespace Example
|
||||
{
|
||||
public class Example
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
|
||||
var apiInstance = new AnotherFakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new AnotherFakeApi(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -70,9 +71,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.Call123TestSpecialTags(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ To test special tags and operation ID starting with number
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -27,9 +27,10 @@ namespace Example
|
||||
{
|
||||
public class Call123TestSpecialTagsExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new AnotherFakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new AnotherFakeApi(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -38,9 +39,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.Call123TestSpecialTags(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,5 +69,10 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ this route creates an XmlItem
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -39,9 +39,10 @@ namespace Example
|
||||
{
|
||||
public class CreateXmlItemExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var xmlItem = new XmlItem(); // XmlItem | XmlItem Body
|
||||
|
||||
try
|
||||
@@ -49,9 +50,11 @@ namespace Example
|
||||
// creates an XmlItem
|
||||
apiInstance.CreateXmlItem(xmlItem);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,6 +80,11 @@ No authorization required
|
||||
- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="fakeouterbooleanserialize"></a>
|
||||
@@ -89,7 +97,7 @@ Test serialization of outer boolean types
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -99,9 +107,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterBooleanSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = true; // bool? | Input boolean as post body (optional)
|
||||
|
||||
try
|
||||
@@ -109,9 +118,11 @@ namespace Example
|
||||
bool result = apiInstance.FakeOuterBooleanSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,6 +148,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output boolean | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="fakeoutercompositeserialize"></a>
|
||||
@@ -149,7 +165,7 @@ Test serialization of object with outer number type
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -159,9 +175,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterCompositeSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
|
||||
|
||||
try
|
||||
@@ -169,9 +186,11 @@ namespace Example
|
||||
OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,6 +216,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output composite | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="fakeouternumberserialize"></a>
|
||||
@@ -209,7 +233,7 @@ Test serialization of outer number types
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -219,9 +243,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterNumberSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = 8.14; // decimal? | Input number as post body (optional)
|
||||
|
||||
try
|
||||
@@ -229,9 +254,11 @@ namespace Example
|
||||
decimal result = apiInstance.FakeOuterNumberSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,6 +284,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output number | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="fakeouterstringserialize"></a>
|
||||
@@ -269,7 +301,7 @@ Test serialization of outer string types
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -279,9 +311,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterStringSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = body_example; // string | Input string as post body (optional)
|
||||
|
||||
try
|
||||
@@ -289,9 +322,11 @@ namespace Example
|
||||
string result = apiInstance.FakeOuterStringSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,6 +352,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output string | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testbodywithfileschema"></a>
|
||||
@@ -329,7 +369,7 @@ For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -339,18 +379,21 @@ namespace Example
|
||||
{
|
||||
public class TestBodyWithFileSchemaExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.TestBodyWithFileSchema(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,6 +419,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testbodywithqueryparams"></a>
|
||||
@@ -386,7 +434,7 @@ No authorization required
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -396,9 +444,10 @@ namespace Example
|
||||
{
|
||||
public class TestBodyWithQueryParamsExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var query = query_example; // string |
|
||||
var body = new User(); // User |
|
||||
|
||||
@@ -406,9 +455,11 @@ namespace Example
|
||||
{
|
||||
apiInstance.TestBodyWithQueryParams(query, body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,6 +486,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testclientmodel"></a>
|
||||
@@ -447,7 +503,7 @@ To test \"client\" model
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -457,9 +513,10 @@ namespace Example
|
||||
{
|
||||
public class TestClientModelExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -468,9 +525,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.TestClientModel(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -496,6 +555,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testendpointparameters"></a>
|
||||
@@ -508,7 +572,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -518,13 +582,14 @@ namespace Example
|
||||
{
|
||||
public class TestEndpointParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure HTTP basic authorization: http_basic_test
|
||||
Configuration.Default.Username = "YOUR_USERNAME";
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";
|
||||
|
||||
var apiInstance = new FakeApi();
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var number = 8.14; // decimal | None
|
||||
var _double = 1.2D; // double | None
|
||||
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
|
||||
@@ -545,9 +610,11 @@ namespace Example
|
||||
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -586,6 +653,12 @@ void (empty response body)
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testenumparameters"></a>
|
||||
@@ -598,7 +671,7 @@ To test enum parameters
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -608,9 +681,10 @@ namespace Example
|
||||
{
|
||||
public class TestEnumParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var enumHeaderStringArray = enumHeaderStringArray_example; // List<string> | Header parameter enum test (string array) (optional)
|
||||
var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg)
|
||||
var enumQueryStringArray = enumQueryStringArray_example; // List<string> | Query parameter enum test (string array) (optional)
|
||||
@@ -625,9 +699,11 @@ namespace Example
|
||||
// To test enum parameters
|
||||
apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -660,6 +736,12 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid request | - |
|
||||
| **404** | Not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testgroupparameters"></a>
|
||||
@@ -672,7 +754,7 @@ Fake endpoint to test group parameters (optional)
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -682,9 +764,10 @@ namespace Example
|
||||
{
|
||||
public class TestGroupParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var requiredStringGroup = 56; // int | Required String in group parameters
|
||||
var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
|
||||
var requiredInt64Group = 789; // long | Required Integer in group parameters
|
||||
@@ -697,9 +780,11 @@ namespace Example
|
||||
// Fake endpoint to test group parameters (optional)
|
||||
apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -730,6 +815,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Someting wrong | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testinlineadditionalproperties"></a>
|
||||
@@ -740,7 +830,7 @@ test inline additionalProperties
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -750,9 +840,10 @@ namespace Example
|
||||
{
|
||||
public class TestInlineAdditionalPropertiesExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var param = new Dictionary<string, string>(); // Dictionary<string, string> | request body
|
||||
|
||||
try
|
||||
@@ -760,9 +851,11 @@ namespace Example
|
||||
// test inline additionalProperties
|
||||
apiInstance.TestInlineAdditionalProperties(param);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -788,6 +881,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testjsonformdata"></a>
|
||||
@@ -798,7 +896,7 @@ test json serialization of form data
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -808,9 +906,10 @@ namespace Example
|
||||
{
|
||||
public class TestJsonFormDataExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var param = param_example; // string | field1
|
||||
var param2 = param2_example; // string | field2
|
||||
|
||||
@@ -819,9 +918,11 @@ namespace Example
|
||||
// test json serialization of form data
|
||||
apiInstance.TestJsonFormData(param, param2);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -848,5 +949,10 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ To test class name in snake case
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -27,14 +27,15 @@ namespace Example
|
||||
{
|
||||
public class TestClassnameExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure API key authorization: api_key_query
|
||||
Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer");
|
||||
|
||||
var apiInstance = new FakeClassnameTags123Api();
|
||||
var apiInstance = new FakeClassnameTags123Api(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -43,9 +44,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.TestClassname(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,5 +74,10 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -33,12 +33,13 @@ namespace Example
|
||||
{
|
||||
public class AddPetExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try
|
||||
@@ -46,9 +47,11 @@ namespace Example
|
||||
// Add a new pet to the store
|
||||
apiInstance.AddPet(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,6 +77,12 @@ void (empty response body)
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="deletepet"></a>
|
||||
@@ -84,7 +93,7 @@ Deletes a pet
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -94,12 +103,13 @@ namespace Example
|
||||
{
|
||||
public class DeletePetExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | Pet id to delete
|
||||
var apiKey = apiKey_example; // string | (optional)
|
||||
|
||||
@@ -108,9 +118,11 @@ namespace Example
|
||||
// Deletes a pet
|
||||
apiInstance.DeletePet(petId, apiKey);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,11 +149,17 @@ void (empty response body)
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid pet value | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="findpetsbystatus"></a>
|
||||
# **FindPetsByStatus**
|
||||
> List<Pet> FindPetsByStatus (List<string> status)
|
||||
> List<Pet> FindPetsByStatus (List<string> status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
@@ -149,7 +167,7 @@ Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -159,23 +177,26 @@ namespace Example
|
||||
{
|
||||
public class FindPetsByStatusExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var status = status_example; // List<string> | Status values that need to be considered for filter
|
||||
|
||||
try
|
||||
{
|
||||
// Finds Pets by status
|
||||
List<Pet> result = apiInstance.FindPetsByStatus(status);
|
||||
List<Pet> result = apiInstance.FindPetsByStatus(status);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,7 +211,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -201,11 +222,17 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid status value | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="findpetsbytags"></a>
|
||||
# **FindPetsByTags**
|
||||
> List<Pet> FindPetsByTags (List<string> tags)
|
||||
> List<Pet> FindPetsByTags (List<string> tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
@@ -213,7 +240,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -223,23 +250,26 @@ namespace Example
|
||||
{
|
||||
public class FindPetsByTagsExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var tags = new List<string>(); // List<string> | Tags to filter by
|
||||
|
||||
try
|
||||
{
|
||||
// Finds Pets by tags
|
||||
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +284,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -265,6 +295,12 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid tag value | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getpetbyid"></a>
|
||||
@@ -277,7 +313,7 @@ Returns a single pet
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -287,14 +323,15 @@ namespace Example
|
||||
{
|
||||
public class GetPetByIdExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure API key authorization: api_key
|
||||
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | ID of pet to return
|
||||
|
||||
try
|
||||
@@ -303,9 +340,11 @@ namespace Example
|
||||
Pet result = apiInstance.GetPetById(petId);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,6 +370,13 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="updatepet"></a>
|
||||
@@ -341,7 +387,7 @@ Update an existing pet
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -351,12 +397,13 @@ namespace Example
|
||||
{
|
||||
public class UpdatePetExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try
|
||||
@@ -364,9 +411,11 @@ namespace Example
|
||||
// Update an existing pet
|
||||
apiInstance.UpdatePet(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,6 +441,14 @@ void (empty response body)
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
| **405** | Validation exception | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="updatepetwithform"></a>
|
||||
@@ -402,7 +459,7 @@ Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -412,12 +469,13 @@ namespace Example
|
||||
{
|
||||
public class UpdatePetWithFormExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | ID of pet that needs to be updated
|
||||
var name = name_example; // string | Updated name of the pet (optional)
|
||||
var status = status_example; // string | Updated status of the pet (optional)
|
||||
@@ -427,9 +485,11 @@ namespace Example
|
||||
// Updates a pet in the store with form data
|
||||
apiInstance.UpdatePetWithForm(petId, name, status);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -457,6 +517,11 @@ void (empty response body)
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="uploadfile"></a>
|
||||
@@ -467,7 +532,7 @@ uploads an image
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -477,12 +542,13 @@ namespace Example
|
||||
{
|
||||
public class UploadFileExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | ID of pet to update
|
||||
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
|
||||
var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional)
|
||||
@@ -493,9 +559,11 @@ namespace Example
|
||||
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -523,6 +591,11 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="uploadfilewithrequiredfile"></a>
|
||||
@@ -533,7 +606,7 @@ uploads an image (required)
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -543,12 +616,13 @@ namespace Example
|
||||
{
|
||||
public class UploadFileWithRequiredFileExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | ID of pet to update
|
||||
var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload
|
||||
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
|
||||
@@ -559,9 +633,11 @@ namespace Example
|
||||
ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -589,5 +665,10 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -30,9 +30,10 @@ namespace Example
|
||||
{
|
||||
public class DeleteOrderExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new StoreApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new StoreApi(Configuration.Default);
|
||||
var orderId = orderId_example; // string | ID of the order that needs to be deleted
|
||||
|
||||
try
|
||||
@@ -40,9 +41,11 @@ namespace Example
|
||||
// Delete purchase order by ID
|
||||
apiInstance.DeleteOrder(orderId);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,11 +71,17 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getinventory"></a>
|
||||
# **GetInventory**
|
||||
> Dictionary<string, int> GetInventory ()
|
||||
> Dictionary<string, int> GetInventory ()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
@@ -80,7 +89,7 @@ Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -90,24 +99,27 @@ namespace Example
|
||||
{
|
||||
public class GetInventoryExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure API key authorization: api_key
|
||||
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
|
||||
|
||||
var apiInstance = new StoreApi();
|
||||
var apiInstance = new StoreApi(Configuration.Default);
|
||||
|
||||
try
|
||||
{
|
||||
// Returns pet inventories by status
|
||||
Dictionary<string, int> result = apiInstance.GetInventory();
|
||||
Dictionary<string, int> result = apiInstance.GetInventory();
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,6 +142,11 @@ This endpoint does not need any parameter.
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getorderbyid"></a>
|
||||
@@ -142,7 +159,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -152,9 +169,10 @@ namespace Example
|
||||
{
|
||||
public class GetOrderByIdExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new StoreApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new StoreApi(Configuration.Default);
|
||||
var orderId = 789; // long | ID of pet that needs to be fetched
|
||||
|
||||
try
|
||||
@@ -163,9 +181,11 @@ namespace Example
|
||||
Order result = apiInstance.GetOrderById(orderId);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,6 +211,13 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="placeorder"></a>
|
||||
@@ -201,7 +228,7 @@ Place an order for a pet
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -211,9 +238,10 @@ namespace Example
|
||||
{
|
||||
public class PlaceOrderExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new StoreApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new StoreApi(Configuration.Default);
|
||||
var body = new Order(); // Order | order placed for purchasing the pet
|
||||
|
||||
try
|
||||
@@ -222,9 +250,11 @@ namespace Example
|
||||
Order result = apiInstance.PlaceOrder(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,5 +280,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid Order | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -34,9 +34,10 @@ namespace Example
|
||||
{
|
||||
public class CreateUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var body = new User(); // User | Created user object
|
||||
|
||||
try
|
||||
@@ -44,9 +45,11 @@ namespace Example
|
||||
// Create user
|
||||
apiInstance.CreateUser(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,6 +75,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="createuserswitharrayinput"></a>
|
||||
@@ -82,7 +90,7 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -92,9 +100,10 @@ namespace Example
|
||||
{
|
||||
public class CreateUsersWithArrayInputExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var body = new List<User>(); // List<User> | List of user object
|
||||
|
||||
try
|
||||
@@ -102,9 +111,11 @@ namespace Example
|
||||
// Creates list of users with given input array
|
||||
apiInstance.CreateUsersWithArrayInput(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +126,7 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](List.md)| List of user object |
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -130,6 +141,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="createuserswithlistinput"></a>
|
||||
@@ -140,7 +156,7 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -150,9 +166,10 @@ namespace Example
|
||||
{
|
||||
public class CreateUsersWithListInputExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var body = new List<User>(); // List<User> | List of user object
|
||||
|
||||
try
|
||||
@@ -160,9 +177,11 @@ namespace Example
|
||||
// Creates list of users with given input array
|
||||
apiInstance.CreateUsersWithListInput(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +192,7 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](List.md)| List of user object |
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -188,6 +207,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="deleteuser"></a>
|
||||
@@ -200,7 +224,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -210,9 +234,10 @@ namespace Example
|
||||
{
|
||||
public class DeleteUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var username = username_example; // string | The name that needs to be deleted
|
||||
|
||||
try
|
||||
@@ -220,9 +245,11 @@ namespace Example
|
||||
// Delete user
|
||||
apiInstance.DeleteUser(username);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,6 +275,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getuserbyname"></a>
|
||||
@@ -258,7 +291,7 @@ Get user by user name
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -268,9 +301,10 @@ namespace Example
|
||||
{
|
||||
public class GetUserByNameExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
try
|
||||
@@ -279,9 +313,11 @@ namespace Example
|
||||
User result = apiInstance.GetUserByName(username);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,6 +343,13 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="loginuser"></a>
|
||||
@@ -317,7 +360,7 @@ Logs user into the system
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -327,9 +370,10 @@ namespace Example
|
||||
{
|
||||
public class LoginUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var username = username_example; // string | The user name for login
|
||||
var password = password_example; // string | The password for login in clear text
|
||||
|
||||
@@ -339,9 +383,11 @@ namespace Example
|
||||
string result = apiInstance.LoginUser(username, password);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,6 +414,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
|
||||
| **400** | Invalid username/password supplied | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="logoutuser"></a>
|
||||
@@ -378,7 +430,7 @@ Logs out current logged in user session
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -388,18 +440,21 @@ namespace Example
|
||||
{
|
||||
public class LogoutUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
|
||||
try
|
||||
{
|
||||
// Logs out current logged in user session
|
||||
apiInstance.LogoutUser();
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,6 +477,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="updateuser"></a>
|
||||
@@ -434,7 +494,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -444,9 +504,10 @@ namespace Example
|
||||
{
|
||||
public class UpdateUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var username = username_example; // string | name that need to be deleted
|
||||
var body = new User(); // User | Updated user object
|
||||
|
||||
@@ -455,9 +516,11 @@ namespace Example
|
||||
// Updated user
|
||||
apiInstance.UpdateUser(username, body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -484,5 +547,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid user supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-p
|
||||
## Getting Started
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -70,10 +70,11 @@ namespace Example
|
||||
{
|
||||
public class Example
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
|
||||
var apiInstance = new AnotherFakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new AnotherFakeApi(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -82,9 +83,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.Call123TestSpecialTags(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ To test special tags and operation ID starting with number
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -27,9 +27,10 @@ namespace Example
|
||||
{
|
||||
public class Call123TestSpecialTagsExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new AnotherFakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new AnotherFakeApi(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -38,9 +39,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.Call123TestSpecialTags(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,5 +69,10 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ this route creates an XmlItem
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -39,9 +39,10 @@ namespace Example
|
||||
{
|
||||
public class CreateXmlItemExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var xmlItem = new XmlItem(); // XmlItem | XmlItem Body
|
||||
|
||||
try
|
||||
@@ -49,9 +50,11 @@ namespace Example
|
||||
// creates an XmlItem
|
||||
apiInstance.CreateXmlItem(xmlItem);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,6 +80,11 @@ No authorization required
|
||||
- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="fakeouterbooleanserialize"></a>
|
||||
@@ -89,7 +97,7 @@ Test serialization of outer boolean types
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -99,9 +107,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterBooleanSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = true; // bool? | Input boolean as post body (optional)
|
||||
|
||||
try
|
||||
@@ -109,9 +118,11 @@ namespace Example
|
||||
bool result = apiInstance.FakeOuterBooleanSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,6 +148,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output boolean | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="fakeoutercompositeserialize"></a>
|
||||
@@ -149,7 +165,7 @@ Test serialization of object with outer number type
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -159,9 +175,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterCompositeSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
|
||||
|
||||
try
|
||||
@@ -169,9 +186,11 @@ namespace Example
|
||||
OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,6 +216,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output composite | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="fakeouternumberserialize"></a>
|
||||
@@ -209,7 +233,7 @@ Test serialization of outer number types
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -219,9 +243,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterNumberSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = 8.14; // decimal? | Input number as post body (optional)
|
||||
|
||||
try
|
||||
@@ -229,9 +254,11 @@ namespace Example
|
||||
decimal result = apiInstance.FakeOuterNumberSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,6 +284,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output number | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="fakeouterstringserialize"></a>
|
||||
@@ -269,7 +301,7 @@ Test serialization of outer string types
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -279,9 +311,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterStringSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = body_example; // string | Input string as post body (optional)
|
||||
|
||||
try
|
||||
@@ -289,9 +322,11 @@ namespace Example
|
||||
string result = apiInstance.FakeOuterStringSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,6 +352,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output string | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testbodywithfileschema"></a>
|
||||
@@ -329,7 +369,7 @@ For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -339,18 +379,21 @@ namespace Example
|
||||
{
|
||||
public class TestBodyWithFileSchemaExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.TestBodyWithFileSchema(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,6 +419,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testbodywithqueryparams"></a>
|
||||
@@ -386,7 +434,7 @@ No authorization required
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -396,9 +444,10 @@ namespace Example
|
||||
{
|
||||
public class TestBodyWithQueryParamsExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var query = query_example; // string |
|
||||
var body = new User(); // User |
|
||||
|
||||
@@ -406,9 +455,11 @@ namespace Example
|
||||
{
|
||||
apiInstance.TestBodyWithQueryParams(query, body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,6 +486,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testclientmodel"></a>
|
||||
@@ -447,7 +503,7 @@ To test \"client\" model
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -457,9 +513,10 @@ namespace Example
|
||||
{
|
||||
public class TestClientModelExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -468,9 +525,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.TestClientModel(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -496,6 +555,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testendpointparameters"></a>
|
||||
@@ -508,7 +572,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -518,13 +582,14 @@ namespace Example
|
||||
{
|
||||
public class TestEndpointParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure HTTP basic authorization: http_basic_test
|
||||
Configuration.Default.Username = "YOUR_USERNAME";
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";
|
||||
|
||||
var apiInstance = new FakeApi();
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var number = 8.14; // decimal | None
|
||||
var _double = 1.2D; // double | None
|
||||
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
|
||||
@@ -545,9 +610,11 @@ namespace Example
|
||||
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -586,6 +653,12 @@ void (empty response body)
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testenumparameters"></a>
|
||||
@@ -598,7 +671,7 @@ To test enum parameters
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -608,9 +681,10 @@ namespace Example
|
||||
{
|
||||
public class TestEnumParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var enumHeaderStringArray = enumHeaderStringArray_example; // List<string> | Header parameter enum test (string array) (optional)
|
||||
var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg)
|
||||
var enumQueryStringArray = enumQueryStringArray_example; // List<string> | Query parameter enum test (string array) (optional)
|
||||
@@ -625,9 +699,11 @@ namespace Example
|
||||
// To test enum parameters
|
||||
apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -660,6 +736,12 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid request | - |
|
||||
| **404** | Not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testgroupparameters"></a>
|
||||
@@ -672,7 +754,7 @@ Fake endpoint to test group parameters (optional)
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -682,9 +764,10 @@ namespace Example
|
||||
{
|
||||
public class TestGroupParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var requiredStringGroup = 56; // int | Required String in group parameters
|
||||
var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
|
||||
var requiredInt64Group = 789; // long | Required Integer in group parameters
|
||||
@@ -697,9 +780,11 @@ namespace Example
|
||||
// Fake endpoint to test group parameters (optional)
|
||||
apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -730,6 +815,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Someting wrong | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testinlineadditionalproperties"></a>
|
||||
@@ -740,7 +830,7 @@ test inline additionalProperties
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -750,9 +840,10 @@ namespace Example
|
||||
{
|
||||
public class TestInlineAdditionalPropertiesExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var param = new Dictionary<string, string>(); // Dictionary<string, string> | request body
|
||||
|
||||
try
|
||||
@@ -760,9 +851,11 @@ namespace Example
|
||||
// test inline additionalProperties
|
||||
apiInstance.TestInlineAdditionalProperties(param);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -788,6 +881,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="testjsonformdata"></a>
|
||||
@@ -798,7 +896,7 @@ test json serialization of form data
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -808,9 +906,10 @@ namespace Example
|
||||
{
|
||||
public class TestJsonFormDataExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var param = param_example; // string | field1
|
||||
var param2 = param2_example; // string | field2
|
||||
|
||||
@@ -819,9 +918,11 @@ namespace Example
|
||||
// test json serialization of form data
|
||||
apiInstance.TestJsonFormData(param, param2);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -848,5 +949,10 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ To test class name in snake case
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -27,14 +27,15 @@ namespace Example
|
||||
{
|
||||
public class TestClassnameExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure API key authorization: api_key_query
|
||||
Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer");
|
||||
|
||||
var apiInstance = new FakeClassnameTags123Api();
|
||||
var apiInstance = new FakeClassnameTags123Api(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -43,9 +44,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.TestClassname(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,5 +74,10 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -33,12 +33,13 @@ namespace Example
|
||||
{
|
||||
public class AddPetExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try
|
||||
@@ -46,9 +47,11 @@ namespace Example
|
||||
// Add a new pet to the store
|
||||
apiInstance.AddPet(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,6 +77,12 @@ void (empty response body)
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="deletepet"></a>
|
||||
@@ -84,7 +93,7 @@ Deletes a pet
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -94,12 +103,13 @@ namespace Example
|
||||
{
|
||||
public class DeletePetExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | Pet id to delete
|
||||
var apiKey = apiKey_example; // string | (optional)
|
||||
|
||||
@@ -108,9 +118,11 @@ namespace Example
|
||||
// Deletes a pet
|
||||
apiInstance.DeletePet(petId, apiKey);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,11 +149,17 @@ void (empty response body)
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid pet value | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="findpetsbystatus"></a>
|
||||
# **FindPetsByStatus**
|
||||
> List<Pet> FindPetsByStatus (List<string> status)
|
||||
> List<Pet> FindPetsByStatus (List<string> status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
@@ -149,7 +167,7 @@ Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -159,23 +177,26 @@ namespace Example
|
||||
{
|
||||
public class FindPetsByStatusExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var status = status_example; // List<string> | Status values that need to be considered for filter
|
||||
|
||||
try
|
||||
{
|
||||
// Finds Pets by status
|
||||
List<Pet> result = apiInstance.FindPetsByStatus(status);
|
||||
List<Pet> result = apiInstance.FindPetsByStatus(status);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,7 +211,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -201,11 +222,17 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid status value | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="findpetsbytags"></a>
|
||||
# **FindPetsByTags**
|
||||
> List<Pet> FindPetsByTags (List<string> tags)
|
||||
> List<Pet> FindPetsByTags (List<string> tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
@@ -213,7 +240,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -223,23 +250,26 @@ namespace Example
|
||||
{
|
||||
public class FindPetsByTagsExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var tags = new List<string>(); // List<string> | Tags to filter by
|
||||
|
||||
try
|
||||
{
|
||||
// Finds Pets by tags
|
||||
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +284,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -265,6 +295,12 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid tag value | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getpetbyid"></a>
|
||||
@@ -277,7 +313,7 @@ Returns a single pet
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -287,14 +323,15 @@ namespace Example
|
||||
{
|
||||
public class GetPetByIdExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure API key authorization: api_key
|
||||
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | ID of pet to return
|
||||
|
||||
try
|
||||
@@ -303,9 +340,11 @@ namespace Example
|
||||
Pet result = apiInstance.GetPetById(petId);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,6 +370,13 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="updatepet"></a>
|
||||
@@ -341,7 +387,7 @@ Update an existing pet
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -351,12 +397,13 @@ namespace Example
|
||||
{
|
||||
public class UpdatePetExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try
|
||||
@@ -364,9 +411,11 @@ namespace Example
|
||||
// Update an existing pet
|
||||
apiInstance.UpdatePet(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,6 +441,14 @@ void (empty response body)
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
| **405** | Validation exception | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="updatepetwithform"></a>
|
||||
@@ -402,7 +459,7 @@ Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -412,12 +469,13 @@ namespace Example
|
||||
{
|
||||
public class UpdatePetWithFormExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | ID of pet that needs to be updated
|
||||
var name = name_example; // string | Updated name of the pet (optional)
|
||||
var status = status_example; // string | Updated status of the pet (optional)
|
||||
@@ -427,9 +485,11 @@ namespace Example
|
||||
// Updates a pet in the store with form data
|
||||
apiInstance.UpdatePetWithForm(petId, name, status);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -457,6 +517,11 @@ void (empty response body)
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="uploadfile"></a>
|
||||
@@ -467,7 +532,7 @@ uploads an image
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -477,12 +542,13 @@ namespace Example
|
||||
{
|
||||
public class UploadFileExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | ID of pet to update
|
||||
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
|
||||
var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional)
|
||||
@@ -493,9 +559,11 @@ namespace Example
|
||||
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -523,6 +591,11 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="uploadfilewithrequiredfile"></a>
|
||||
@@ -533,7 +606,7 @@ uploads an image (required)
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -543,12 +616,13 @@ namespace Example
|
||||
{
|
||||
public class UploadFileWithRequiredFileExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
var apiInstance = new PetApi();
|
||||
var apiInstance = new PetApi(Configuration.Default);
|
||||
var petId = 789; // long | ID of pet to update
|
||||
var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload
|
||||
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
|
||||
@@ -559,9 +633,11 @@ namespace Example
|
||||
ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -589,5 +665,10 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -30,9 +30,10 @@ namespace Example
|
||||
{
|
||||
public class DeleteOrderExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new StoreApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new StoreApi(Configuration.Default);
|
||||
var orderId = orderId_example; // string | ID of the order that needs to be deleted
|
||||
|
||||
try
|
||||
@@ -40,9 +41,11 @@ namespace Example
|
||||
// Delete purchase order by ID
|
||||
apiInstance.DeleteOrder(orderId);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,11 +71,17 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getinventory"></a>
|
||||
# **GetInventory**
|
||||
> Dictionary<string, int> GetInventory ()
|
||||
> Dictionary<string, int> GetInventory ()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
@@ -80,7 +89,7 @@ Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -90,24 +99,27 @@ namespace Example
|
||||
{
|
||||
public class GetInventoryExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure API key authorization: api_key
|
||||
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
|
||||
|
||||
var apiInstance = new StoreApi();
|
||||
var apiInstance = new StoreApi(Configuration.Default);
|
||||
|
||||
try
|
||||
{
|
||||
// Returns pet inventories by status
|
||||
Dictionary<string, int> result = apiInstance.GetInventory();
|
||||
Dictionary<string, int> result = apiInstance.GetInventory();
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,6 +142,11 @@ This endpoint does not need any parameter.
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getorderbyid"></a>
|
||||
@@ -142,7 +159,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -152,9 +169,10 @@ namespace Example
|
||||
{
|
||||
public class GetOrderByIdExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new StoreApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new StoreApi(Configuration.Default);
|
||||
var orderId = 789; // long | ID of pet that needs to be fetched
|
||||
|
||||
try
|
||||
@@ -163,9 +181,11 @@ namespace Example
|
||||
Order result = apiInstance.GetOrderById(orderId);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,6 +211,13 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="placeorder"></a>
|
||||
@@ -201,7 +228,7 @@ Place an order for a pet
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -211,9 +238,10 @@ namespace Example
|
||||
{
|
||||
public class PlaceOrderExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new StoreApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new StoreApi(Configuration.Default);
|
||||
var body = new Order(); // Order | order placed for purchasing the pet
|
||||
|
||||
try
|
||||
@@ -222,9 +250,11 @@ namespace Example
|
||||
Order result = apiInstance.PlaceOrder(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,5 +280,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid Order | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -34,9 +34,10 @@ namespace Example
|
||||
{
|
||||
public class CreateUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var body = new User(); // User | Created user object
|
||||
|
||||
try
|
||||
@@ -44,9 +45,11 @@ namespace Example
|
||||
// Create user
|
||||
apiInstance.CreateUser(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,6 +75,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="createuserswitharrayinput"></a>
|
||||
@@ -82,7 +90,7 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -92,9 +100,10 @@ namespace Example
|
||||
{
|
||||
public class CreateUsersWithArrayInputExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var body = new List<User>(); // List<User> | List of user object
|
||||
|
||||
try
|
||||
@@ -102,9 +111,11 @@ namespace Example
|
||||
// Creates list of users with given input array
|
||||
apiInstance.CreateUsersWithArrayInput(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +126,7 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](List.md)| List of user object |
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -130,6 +141,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="createuserswithlistinput"></a>
|
||||
@@ -140,7 +156,7 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -150,9 +166,10 @@ namespace Example
|
||||
{
|
||||
public class CreateUsersWithListInputExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var body = new List<User>(); // List<User> | List of user object
|
||||
|
||||
try
|
||||
@@ -160,9 +177,11 @@ namespace Example
|
||||
// Creates list of users with given input array
|
||||
apiInstance.CreateUsersWithListInput(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +192,7 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](List.md)| List of user object |
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -188,6 +207,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="deleteuser"></a>
|
||||
@@ -200,7 +224,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -210,9 +234,10 @@ namespace Example
|
||||
{
|
||||
public class DeleteUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var username = username_example; // string | The name that needs to be deleted
|
||||
|
||||
try
|
||||
@@ -220,9 +245,11 @@ namespace Example
|
||||
// Delete user
|
||||
apiInstance.DeleteUser(username);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,6 +275,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getuserbyname"></a>
|
||||
@@ -258,7 +291,7 @@ Get user by user name
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -268,9 +301,10 @@ namespace Example
|
||||
{
|
||||
public class GetUserByNameExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
try
|
||||
@@ -279,9 +313,11 @@ namespace Example
|
||||
User result = apiInstance.GetUserByName(username);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,6 +343,13 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="loginuser"></a>
|
||||
@@ -317,7 +360,7 @@ Logs user into the system
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -327,9 +370,10 @@ namespace Example
|
||||
{
|
||||
public class LoginUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var username = username_example; // string | The user name for login
|
||||
var password = password_example; // string | The password for login in clear text
|
||||
|
||||
@@ -339,9 +383,11 @@ namespace Example
|
||||
string result = apiInstance.LoginUser(username, password);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,6 +414,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
|
||||
| **400** | Invalid username/password supplied | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="logoutuser"></a>
|
||||
@@ -378,7 +430,7 @@ Logs out current logged in user session
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -388,18 +440,21 @@ namespace Example
|
||||
{
|
||||
public class LogoutUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
|
||||
try
|
||||
{
|
||||
// Logs out current logged in user session
|
||||
apiInstance.LogoutUser();
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,6 +477,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="updateuser"></a>
|
||||
@@ -434,7 +494,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -444,9 +504,10 @@ namespace Example
|
||||
{
|
||||
public class UpdateUserExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new UserApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new UserApi(Configuration.Default);
|
||||
var username = username_example; // string | name that need to be deleted
|
||||
var body = new User(); // User | Updated user object
|
||||
|
||||
@@ -455,9 +516,11 @@ namespace Example
|
||||
// Updated user
|
||||
apiInstance.UpdateUser(username, body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -484,5 +547,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid user supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-p
|
||||
## Getting Started
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
|
||||
@@ -10,8 +10,8 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
|
||||
|
||||
if not exist ".\bin" mkdir bin
|
||||
|
||||
copy packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll
|
||||
copy packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
|
||||
copy packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll
|
||||
copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
|
||||
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\Org.OpenAPITools.dll /recurse:src\Org.OpenAPITools\*.cs /doc:bin\Org.OpenAPITools.xml
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ ${nuget_cmd} install src/Org.OpenAPITools/packages.config -o packages;
|
||||
|
||||
echo "[INFO] Copy DLLs to the 'bin' folder"
|
||||
mkdir -p bin;
|
||||
cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
cp packages/Newtonsoft.Json.12.0.1/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
|
||||
cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
|
||||
cp packages/JsonSubTypes.1.2.0/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll
|
||||
cp packages/JsonSubTypes.1.5.2/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll
|
||||
|
||||
echo "[INFO] Run 'mcs' to build bin/Org.OpenAPITools.dll"
|
||||
mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\
|
||||
|
||||
@@ -19,6 +19,7 @@ To test special tags and operation ID starting with number
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -71,6 +72,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
|
||||
@@ -31,6 +31,7 @@ this route creates an XmlItem
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -82,6 +83,11 @@ No authorization required
|
||||
- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -99,6 +105,7 @@ Test serialization of outer boolean types
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -150,6 +157,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output boolean | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -167,6 +179,7 @@ Test serialization of object with outer number type
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -218,6 +231,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output composite | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -235,6 +253,7 @@ Test serialization of outer number types
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -286,6 +305,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output number | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -303,6 +327,7 @@ Test serialization of outer string types
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -354,6 +379,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output string | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -371,6 +401,7 @@ For this test, the body for this request much reference a schema named `File`.
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -421,6 +452,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -436,6 +472,7 @@ No authorization required
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -488,6 +525,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -505,6 +547,7 @@ To test \"client\" model
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -557,6 +600,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -574,6 +622,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -655,6 +704,12 @@ void (empty response body)
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -672,6 +727,7 @@ To test enum parameters
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -737,6 +793,12 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid request | - |
|
||||
| **404** | Not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -754,6 +816,7 @@ Fake endpoint to test group parameters (optional)
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -815,6 +878,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Someting wrong | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -830,6 +898,7 @@ test inline additionalProperties
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -881,6 +950,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -896,6 +970,7 @@ test json serialization of form data
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -949,6 +1024,11 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
|
||||
@@ -19,6 +19,7 @@ To test class name in snake case
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -76,6 +77,11 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
|
||||
@@ -25,6 +25,7 @@ Add a new pet to the store
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -79,6 +80,12 @@ void (empty response body)
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -94,6 +101,7 @@ Deletes a pet
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -150,6 +158,12 @@ void (empty response body)
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid pet value | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -158,7 +172,7 @@ void (empty response body)
|
||||
|
||||
## FindPetsByStatus
|
||||
|
||||
> List<Pet> FindPetsByStatus (List<string> status)
|
||||
> List<Pet> FindPetsByStatus (List<string> status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
@@ -167,6 +181,7 @@ Multiple status values can be provided with comma separated strings
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -188,7 +203,7 @@ namespace Example
|
||||
try
|
||||
{
|
||||
// Finds Pets by status
|
||||
List<Pet> result = apiInstance.FindPetsByStatus(status);
|
||||
List<Pet> result = apiInstance.FindPetsByStatus(status);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (ApiException e)
|
||||
@@ -211,7 +226,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -222,6 +237,12 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid status value | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -230,7 +251,7 @@ Name | Type | Description | Notes
|
||||
|
||||
## FindPetsByTags
|
||||
|
||||
> List<Pet> FindPetsByTags (List<string> tags)
|
||||
> List<Pet> FindPetsByTags (List<string> tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
@@ -239,6 +260,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -260,7 +282,7 @@ namespace Example
|
||||
try
|
||||
{
|
||||
// Finds Pets by tags
|
||||
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (ApiException e)
|
||||
@@ -283,7 +305,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -294,6 +316,12 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid tag value | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -311,6 +339,7 @@ Returns a single pet
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -368,6 +397,13 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -383,6 +419,7 @@ Update an existing pet
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -437,6 +474,14 @@ void (empty response body)
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
| **405** | Validation exception | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -452,6 +497,7 @@ Updates a pet in the store with form data
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -510,6 +556,11 @@ void (empty response body)
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -525,6 +576,7 @@ uploads an image
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -584,6 +636,11 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -599,6 +656,7 @@ uploads an image (required)
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -658,6 +716,11 @@ Name | Type | Description | Notes
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
|
||||
@@ -22,6 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -73,6 +74,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -81,7 +88,7 @@ No authorization required
|
||||
|
||||
## GetInventory
|
||||
|
||||
> Dictionary<string, int?> GetInventory ()
|
||||
> Dictionary<string, int?> GetInventory ()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
@@ -90,6 +97,7 @@ Returns a map of status codes to quantities
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -112,7 +120,7 @@ namespace Example
|
||||
try
|
||||
{
|
||||
// Returns pet inventories by status
|
||||
Dictionary<string, int?> result = apiInstance.GetInventory();
|
||||
Dictionary<string, int?> result = apiInstance.GetInventory();
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (ApiException e)
|
||||
@@ -143,6 +151,11 @@ This endpoint does not need any parameter.
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -160,6 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -212,6 +226,13 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -227,6 +248,7 @@ Place an order for a pet
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -279,6 +301,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid Order | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
|
||||
@@ -26,6 +26,7 @@ This can only be done by the logged in user.
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -77,6 +78,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -92,6 +98,7 @@ Creates list of users with given input array
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -128,7 +135,7 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](List.md)| List of user object |
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -143,6 +150,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -158,6 +170,7 @@ Creates list of users with given input array
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -194,7 +207,7 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](List.md)| List of user object |
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -209,6 +222,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -226,6 +244,7 @@ This can only be done by the logged in user.
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -277,6 +296,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -292,6 +317,7 @@ Get user by user name
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -344,6 +370,13 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -359,6 +392,7 @@ Logs user into the system
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -413,6 +447,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
|
||||
| **400** | Invalid username/password supplied | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -428,6 +468,7 @@ Logs out current logged in user session
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -475,6 +516,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -492,6 +538,7 @@ This can only be done by the logged in user.
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -545,6 +592,12 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid user supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
|
||||
@@ -14,9 +14,9 @@ wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
|
||||
mozroots --import --sync
|
||||
mono nuget.exe install src/Org.OpenAPITools.Test/packages.config -o packages
|
||||
|
||||
echo "[INFO] Install NUnit runners via NuGet"
|
||||
mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages
|
||||
echo "[INFO] Install NUnit Console 3.x runners via NuGet"
|
||||
mono nuget.exe install NUnit.ConsoleRunner -Version 3.10.0 -OutputDirectory packages
|
||||
|
||||
echo "[INFO] Build the solution and run the unit test"
|
||||
xbuild Org.OpenAPITools.sln && \
|
||||
mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/Org.OpenAPITools.Test/bin/Debug/Org.OpenAPITools.Test.dll
|
||||
mono ./packages/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe src/Org.OpenAPITools.Test/bin/Debug/Org.OpenAPITools.Test.dll
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace Org.OpenAPITools.Test
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class AnotherFakeApiTests
|
||||
{
|
||||
private AnotherFakeApi instance;
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace Org.OpenAPITools.Test
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class FakeApiTests
|
||||
{
|
||||
private FakeApi instance;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user