forked from loafle/openapi-generator-original
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen into apiclient_update
# Conflicts: # modules/swagger-codegen/src/main/resources/go/api.mustache
This commit is contained in:
commit
87f9ff189a
@ -26,6 +26,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/go -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l go -o samples/client/petstore/go"
|
ags="$@ generate -t modules/swagger-codegen/src/main/resources/go -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l go -o samples/client/petstore/go/go-petstore"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
@ -9,7 +9,7 @@ public class CodegenParameter {
|
|||||||
public Boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
|
public Boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
|
||||||
isCookieParam, isBodyParam, hasMore, isContainer,
|
isCookieParam, isBodyParam, hasMore, isContainer,
|
||||||
secondaryParam, isCollectionFormatMulti, isPrimitiveType;
|
secondaryParam, isCollectionFormatMulti, isPrimitiveType;
|
||||||
public String baseName, paramName, dataType, datatypeWithEnum, collectionFormat, description, baseType, defaultValue;
|
public String baseName, paramName, dataType, datatypeWithEnum, collectionFormat, description, unescapedDescription, baseType, defaultValue;
|
||||||
public String example; // example value (x-example)
|
public String example; // example value (x-example)
|
||||||
public String jsonSchema;
|
public String jsonSchema;
|
||||||
public Boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime;
|
public Boolean isString, isInteger, isLong, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime;
|
||||||
|
@ -1706,6 +1706,7 @@ public class DefaultCodegen {
|
|||||||
CodegenParameter p = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER);
|
CodegenParameter p = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER);
|
||||||
p.baseName = param.getName();
|
p.baseName = param.getName();
|
||||||
p.description = escapeText(param.getDescription());
|
p.description = escapeText(param.getDescription());
|
||||||
|
p.unescapedDescription = param.getDescription();
|
||||||
if (param.getRequired()) {
|
if (param.getRequired()) {
|
||||||
p.required = param.getRequired();
|
p.required = param.getRequired();
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import io.swagger.codegen.SupportingFile;
|
|||||||
import io.swagger.codegen.CodegenProperty;
|
import io.swagger.codegen.CodegenProperty;
|
||||||
import io.swagger.codegen.CodegenModel;
|
import io.swagger.codegen.CodegenModel;
|
||||||
import io.swagger.codegen.CodegenOperation;
|
import io.swagger.codegen.CodegenOperation;
|
||||||
|
import io.swagger.codegen.CodegenParameter;
|
||||||
import io.swagger.models.properties.*;
|
import io.swagger.models.properties.*;
|
||||||
import io.swagger.codegen.CliOption;
|
import io.swagger.codegen.CliOption;
|
||||||
import io.swagger.models.Model;
|
import io.swagger.models.Model;
|
||||||
@ -45,6 +46,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
protected String packageCopyright = "No Copyright";
|
protected String packageCopyright = "No Copyright";
|
||||||
protected String clientPackage = "IO.Swagger.Client";
|
protected String clientPackage = "IO.Swagger.Client";
|
||||||
protected String localVariablePrefix = "";
|
protected String localVariablePrefix = "";
|
||||||
|
protected String apiDocPath = "docs/";
|
||||||
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
protected String targetFramework = NET45;
|
protected String targetFramework = NET45;
|
||||||
protected String targetFrameworkNuget = "net45";
|
protected String targetFrameworkNuget = "net45";
|
||||||
@ -62,6 +65,9 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
modelTestTemplateFiles.put("model_test.mustache", ".cs");
|
modelTestTemplateFiles.put("model_test.mustache", ".cs");
|
||||||
apiTestTemplateFiles.put("api_test.mustache", ".cs");
|
apiTestTemplateFiles.put("api_test.mustache", ".cs");
|
||||||
|
|
||||||
|
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||||
|
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||||
|
|
||||||
// C# client default
|
// C# client default
|
||||||
setSourceFolder("src" + File.separator + "main" + File.separator + "csharp");
|
setSourceFolder("src" + File.separator + "main" + File.separator + "csharp");
|
||||||
|
|
||||||
@ -219,17 +225,19 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("compile.mustache", "", "compile.bat"));
|
supportingFiles.add(new SupportingFile("compile.mustache", "", "compile.bat"));
|
||||||
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
|
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
|
||||||
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor" + java.io.File.separator, "packages.config"));
|
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor" + java.io.File.separator, "packages.config"));
|
||||||
supportingFiles.add(new SupportingFile("README.md", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
|
|
||||||
|
|
||||||
if (optionalAssemblyInfoFlag) {
|
if (optionalAssemblyInfoFlag) {
|
||||||
supportingFiles.add(new SupportingFile("AssemblyInfo.mustache", packageFolder + File.separator + "Properties", "AssemblyInfo.cs"));
|
supportingFiles.add(new SupportingFile("AssemblyInfo.mustache", packageFolder + File.separator + "Properties", "AssemblyInfo.cs"));
|
||||||
}
|
}
|
||||||
if (optionalProjectFileFlag) {
|
if (optionalProjectFileFlag) {
|
||||||
supportingFiles.add(new SupportingFile("Project.mustache", packageFolder, clientPackage + ".csproj"));
|
supportingFiles.add(new SupportingFile("Project.mustache", packageFolder, clientPackage + ".csproj"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
additionalProperties.put("apiDocPath", apiDocPath);
|
||||||
|
additionalProperties.put("modelDocPath", modelDocPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -467,4 +475,20 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
public void setSupportsUWP(Boolean supportsUWP){
|
public void setSupportsUWP(Boolean supportsUWP){
|
||||||
this.supportsUWP = supportsUWP;
|
this.supportsUWP = supportsUWP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelDocFilename(String name) {
|
||||||
|
return toModelFilename(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
protected String packageName = "swagger";
|
protected String packageName = "swagger";
|
||||||
protected String packageVersion = "1.0.0";
|
protected String packageVersion = "1.0.0";
|
||||||
|
protected String apiDocPath = "docs/";
|
||||||
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.CLIENT;
|
return CodegenType.CLIENT;
|
||||||
@ -37,6 +39,10 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
outputFolder = "generated-code/go";
|
outputFolder = "generated-code/go";
|
||||||
modelTemplateFiles.put("model.mustache", ".go");
|
modelTemplateFiles.put("model.mustache", ".go");
|
||||||
apiTemplateFiles.put("api.mustache", ".go");
|
apiTemplateFiles.put("api.mustache", ".go");
|
||||||
|
|
||||||
|
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||||
|
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||||
|
|
||||||
templateDir = "go";
|
templateDir = "go";
|
||||||
|
|
||||||
setReservedWordsLowerCase(
|
setReservedWordsLowerCase(
|
||||||
@ -127,14 +133,18 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
|
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
|
||||||
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
|
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
|
||||||
|
|
||||||
|
additionalProperties.put("apiDocPath", apiDocPath);
|
||||||
|
additionalProperties.put("modelDocPath", modelDocPath);
|
||||||
|
|
||||||
modelPackage = packageName;
|
modelPackage = packageName;
|
||||||
apiPackage = packageName;
|
apiPackage = packageName;
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||||
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
|
||||||
supportingFiles.add(new SupportingFile("configuration.mustache", packageName, "configuration.go"));
|
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go"));
|
||||||
supportingFiles.add(new SupportingFile("api_client.mustache", packageName, "api_client.go"));
|
supportingFiles.add(new SupportingFile("api_client.mustache", "", "api_client.go"));
|
||||||
|
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -158,11 +168,11 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apiFileFolder() {
|
public String apiFileFolder() {
|
||||||
return outputFolder + File.separator + packageName;
|
return outputFolder + File.separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String modelFileFolder() {
|
public String modelFileFolder() {
|
||||||
return outputFolder + File.separator + packageName;
|
return outputFolder + File.separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -263,6 +273,26 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apiDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String modelDocFileFolder() {
|
||||||
|
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toModelDocFilename(String name) {
|
||||||
|
return toModelName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toApiDocFilename(String name) {
|
||||||
|
return toApiName(name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTypeDeclaration(Property p) {
|
public String getTypeDeclaration(Property p) {
|
||||||
if(p instanceof ArrayProperty) {
|
if(p instanceof ArrayProperty) {
|
||||||
|
@ -32,18 +32,6 @@ public class SpringMVCServerCodegen extends JavaClientCodegen {
|
|||||||
additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
|
additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
|
||||||
additionalProperties.put(CONFIG_PACKAGE, configPackage);
|
additionalProperties.put(CONFIG_PACKAGE, configPackage);
|
||||||
|
|
||||||
languageSpecificPrimitives = new HashSet<String>(
|
|
||||||
Arrays.asList(
|
|
||||||
"byte[]",
|
|
||||||
"String",
|
|
||||||
"boolean",
|
|
||||||
"Boolean",
|
|
||||||
"Double",
|
|
||||||
"Integer",
|
|
||||||
"Long",
|
|
||||||
"Float")
|
|
||||||
);
|
|
||||||
|
|
||||||
cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code"));
|
cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code"));
|
||||||
|
|
||||||
supportedLibraries.clear();
|
supportedLibraries.clear();
|
||||||
|
@ -29,8 +29,8 @@ import java.util.List;
|
|||||||
import static org.springframework.http.MediaType.*;
|
import static org.springframework.http.MediaType.*;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "/{{baseName}}", produces = {APPLICATION_JSON_VALUE})
|
@RequestMapping(value = "/{{{baseName}}}", produces = {APPLICATION_JSON_VALUE})
|
||||||
@Api(value = "/{{baseName}}", description = "the {{baseName}} API")
|
@Api(value = "/{{{baseName}}}", description = "the {{{baseName}}} API")
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
public class {{classname}} {
|
public class {{classname}} {
|
||||||
@ -44,8 +44,8 @@ public class {{classname}} {
|
|||||||
{{/hasMore}}{{/authMethods}}
|
{{/hasMore}}{{/authMethods}}
|
||||||
}{{/hasAuthMethods}})
|
}{{/hasAuthMethods}})
|
||||||
@io.swagger.annotations.ApiResponses(value = { {{#responses}}
|
@io.swagger.annotations.ApiResponses(value = { {{#responses}}
|
||||||
@io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}"){{#hasMore}},{{/hasMore}}{{/responses}} })
|
@io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class){{#hasMore}},{{/hasMore}}{{/responses}} })
|
||||||
@RequestMapping(value = "{{path}}",
|
@RequestMapping(value = "{{{path}}}",
|
||||||
{{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
|
{{#hasProduces}}produces = { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}
|
||||||
{{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
|
{{#hasConsumes}}consumes = { {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}
|
||||||
method = RequestMethod.{{httpMethod}})
|
method = RequestMethod.{{httpMethod}})
|
||||||
|
@ -129,7 +129,7 @@ Class | Method | HTTP request | Description
|
|||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
{{#isOAuth}}- **Type**: OAuth
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
- **Flow**: {{flow}}
|
- **Flow**: {{flow}}
|
||||||
- **Authorizatoin URL**: {{authorizationUrl}}
|
- **Authorization URL**: {{authorizationUrl}}
|
||||||
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
{{#scopes}} - {{scope}}: {{description}}
|
{{#scopes}} - {{scope}}: {{description}}
|
||||||
{{/scopes}}
|
{{/scopes}}
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
## Frameworks supported
|
|
||||||
- .NET 4.0 or later
|
|
||||||
- Windows Phone 7.1 (Mango)
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
|
|
||||||
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
|
|
||||||
|
|
||||||
The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
|
|
||||||
```
|
|
||||||
Install-Package RestSharp
|
|
||||||
Install-Package Newtonsoft.Json
|
|
||||||
```
|
|
||||||
|
|
||||||
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
Run the following command to generate the DLL
|
|
||||||
- [Mac/Linux] compile-mono.sh
|
|
||||||
- [Windows] compile.bat
|
|
||||||
|
|
||||||
Then include the DLL (under the `bin` folder) in the C# project
|
|
@ -0,0 +1,147 @@
|
|||||||
|
# {{packageName}} - the C# library for the {{appName}}
|
||||||
|
|
||||||
|
{{#appDescription}}
|
||||||
|
{{{appDescription}}}
|
||||||
|
{{/appDescription}}
|
||||||
|
|
||||||
|
This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API version: {{appVersion}}
|
||||||
|
- SDK version: {{packageVersion}}
|
||||||
|
- Build date: {{generatedDate}}
|
||||||
|
- Build package: {{generatorClass}}
|
||||||
|
{{#infoUrl}}
|
||||||
|
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||||
|
{{/infoUrl}}
|
||||||
|
|
||||||
|
## Frameworks supported
|
||||||
|
{{^supportUWP}}
|
||||||
|
- .NET 4.0 or later
|
||||||
|
- Windows Phone 7.1 (Mango)
|
||||||
|
{{/supportUWP}}
|
||||||
|
{{#supportUWP}}
|
||||||
|
- UWP
|
||||||
|
{{/supportUWP}}
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
|
||||||
|
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
|
||||||
|
|
||||||
|
The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
|
||||||
|
```
|
||||||
|
Install-Package RestSharp
|
||||||
|
Install-Package Newtonsoft.Json
|
||||||
|
```
|
||||||
|
|
||||||
|
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Run the following command to generate the DLL
|
||||||
|
- [Mac/Linux] `/bin/sh compile-mono.sh`
|
||||||
|
- [Windows] `compile.bat`
|
||||||
|
|
||||||
|
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
|
||||||
|
```csharp
|
||||||
|
using {{packageName}}.Api;
|
||||||
|
using {{packageName}}.Client;
|
||||||
|
{{#modelPackage}}
|
||||||
|
using {{{.}}};
|
||||||
|
{{/modelPackage}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using {{packageName}}.Api;
|
||||||
|
using {{packageName}}.Client;
|
||||||
|
{{#modelPackage}}
|
||||||
|
using {{{.}}};
|
||||||
|
{{/modelPackage}}
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class {{operationId}}Example
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
|
Configuration.Default.Username = 'YOUR_USERNAME';
|
||||||
|
Configuration.Default.Password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: {{{name}}}
|
||||||
|
Configuration.Default.ApiKey.Add('{{{keyParamName}}}', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
var apiInstance = new {{classname}}();
|
||||||
|
{{#allParams}}
|
||||||
|
{{#isPrimitiveType}}
|
||||||
|
var {{paramName}} = {{example}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{^isPrimitiveType}}
|
||||||
|
var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
{{#summary}}
|
||||||
|
// {{{.}}}
|
||||||
|
{{/summary}}
|
||||||
|
{{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||||
|
Debug.WriteLine(result);{{/returnType}}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *{{basePath}}*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
|
||||||
|
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
{{#modelPackage}}
|
||||||
|
{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
|
||||||
|
{{/model}}{{/models}}
|
||||||
|
{{/modelPackage}}
|
||||||
|
{{^modelPackage}}
|
||||||
|
No model defined in this package
|
||||||
|
{{/modelPackage}}
|
||||||
|
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
{{^authMethods}} All endpoints do not require authorization.
|
||||||
|
{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
|
||||||
|
{{#authMethods}}### {{name}}
|
||||||
|
|
||||||
|
{{#isApiKey}}- **Type**: API key
|
||||||
|
- **API key parameter name**: {{keyParamName}}
|
||||||
|
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
|
||||||
|
{{/isApiKey}}
|
||||||
|
{{#isBasic}}- **Type**: HTTP basic authentication
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
|
- **Flow**: {{flow}}
|
||||||
|
- **Authorization URL**: {{authorizationUrl}}
|
||||||
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
|
{{#scopes}} - {{scope}}: {{description}}
|
||||||
|
{{/scopes}}
|
||||||
|
{{/isOAuth}}
|
||||||
|
|
||||||
|
{{/authMethods}}
|
@ -0,0 +1,96 @@
|
|||||||
|
# {{packageName}}.Api.{{classname}}{{#description}}
|
||||||
|
{{description}}{{/description}}
|
||||||
|
|
||||||
|
All URIs are relative to *{{basePath}}*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
# **{{{operationId}}}**
|
||||||
|
> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||||
|
|
||||||
|
{{{summary}}}{{#notes}}
|
||||||
|
|
||||||
|
{{{notes}}}{{/notes}}
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using {{packageName}}.Api;
|
||||||
|
using {{packageName}}.Client;
|
||||||
|
using {{packageName}}.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class {{operationId}}Example
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||||
|
// Configure HTTP basic authorization: {{{name}}}
|
||||||
|
Configuration.Default.Username = 'YOUR_USERNAME';
|
||||||
|
Configuration.Default.Password = 'YOUR_PASSWORD';{{/isBasic}}{{#isApiKey}}
|
||||||
|
// Configure API key authorization: {{{name}}}
|
||||||
|
Configuration.Default.ApiKey.Add('{{{keyParamName}}}', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('{{{keyParamName}}}', 'BEARER');{{/isApiKey}}{{#isOAuth}}
|
||||||
|
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';{{/isOAuth}}{{/authMethods}}
|
||||||
|
{{/hasAuthMethods}}
|
||||||
|
|
||||||
|
var apiInstance = new {{classname}}();
|
||||||
|
{{#allParams}}
|
||||||
|
{{#isPrimitiveType}}
|
||||||
|
var {{paramName}} = {{example}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{^isPrimitiveType}}
|
||||||
|
var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
{{#summary}}
|
||||||
|
// {{{.}}}
|
||||||
|
{{/summary}}
|
||||||
|
{{#returnType}}{{returnType}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||||
|
Debug.WriteLine(result);{{/returnType}}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||||
|
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||||
|
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,14 @@
|
|||||||
|
{{#models}}
|
||||||
|
{{#model}}
|
||||||
|
# {{{packageName}}}.Model.{{{classname}}}
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
|
||||||
|
{{/vars}}
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
{{/model}}
|
||||||
|
{{/models}}
|
@ -1,8 +1,19 @@
|
|||||||
# Go API client for {{packageName}}
|
# Go API client for {{packageName}}
|
||||||
|
|
||||||
|
{{#appDescription}}
|
||||||
|
{{{appDescription}}}
|
||||||
|
{{/appDescription}}
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
|
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
|
||||||
|
|
||||||
|
- API version: {{appVersion}}
|
||||||
|
- Package version: {{packageVersion}}
|
||||||
|
- Build date: {{generatedDate}}
|
||||||
|
- Build package: {{generatorClass}}
|
||||||
|
{{#infoUrl}}
|
||||||
|
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||||
|
{{/infoUrl}}
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Put the package under your project folder and add the following in import:
|
Put the package under your project folder and add the following in import:
|
||||||
@ -10,3 +21,43 @@ Put the package under your project folder and add the following in import:
|
|||||||
"./{{packageName}}"
|
"./{{packageName}}"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *{{basePath}}*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
|
||||||
|
{{/model}}{{/models}}
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
{{^authMethods}} All endpoints do not require authorization.
|
||||||
|
{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
|
||||||
|
{{#authMethods}}## {{{name}}}
|
||||||
|
|
||||||
|
{{#isApiKey}}- **Type**: API key
|
||||||
|
- **API key parameter name**: {{{keyParamName}}}
|
||||||
|
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
|
||||||
|
{{/isApiKey}}
|
||||||
|
{{#isBasic}}- **Type**: HTTP basic authentication
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
|
- **Flow**: {{{flow}}}
|
||||||
|
- **Authorizatoin URL**: {{{authorizationUrl}}}
|
||||||
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
|
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
||||||
|
{{/scopes}}
|
||||||
|
{{/isOAuth}}
|
||||||
|
|
||||||
|
{{/authMethods}}
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||||
|
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||||
|
@ -38,12 +38,22 @@ func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
|||||||
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||||
*/
|
*/
|
||||||
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
||||||
|
|
||||||
var httpMethod = {{httpMethod}}
|
var httpMethod = {{httpMethod}}
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
path := c.Configuration.BasePath + "{{basePathWithoutHost}}{{path}}"
|
path := c.Configuration.BasePath + "{{basePathWithoutHost}}{{path}}"
|
||||||
{{#pathParams}} path = strings.Replace(path, "{" + "{{baseName}}" + "}", fmt.Sprintf("%v", {{paramName}}), -1)
|
{{#pathParams}} path = strings.Replace(path, "{" + "{{baseName}}" + "}", fmt.Sprintf("%v", {{paramName}}), -1)
|
||||||
{{/pathParams}}
|
{{/pathParams}}
|
||||||
|
|
||||||
|
{{#allParams}}
|
||||||
|
{{#required}}
|
||||||
|
// verify the required parameter '{{paramName}}' is set
|
||||||
|
if &{{paramName}} == nil {
|
||||||
|
return {{#returnType}}*new({{{returnType}}}), {{/returnType}}errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}")
|
||||||
|
}
|
||||||
|
{{/required}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
||||||
|
|
||||||
{{#authMethods}}// authentication ({{name}}) required
|
{{#authMethods}}// authentication ({{name}}) required
|
||||||
|
@ -0,0 +1,169 @@
|
|||||||
|
package {{packageName}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
{{#imports}} "{{import}}"
|
||||||
|
{{/imports}}
|
||||||
|
)
|
||||||
|
|
||||||
|
type {{classname}} struct {
|
||||||
|
Configuration Configuration
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{classname}}() *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
return &{{classname}} {
|
||||||
|
Configuration: *configuration,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
configuration.BasePath = basePath
|
||||||
|
|
||||||
|
return &{{classname}} {
|
||||||
|
Configuration: *configuration,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#operation}}
|
||||||
|
/**
|
||||||
|
* {{summary}}
|
||||||
|
* {{notes}}
|
||||||
|
{{#allParams}} * @param {{paramName}} {{description}}
|
||||||
|
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||||
|
*/
|
||||||
|
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
||||||
|
<<<<<<< HEAD
|
||||||
|
var httpMethod = {{httpMethod}}
|
||||||
|
// create path and map variables
|
||||||
|
path := c.Configuration.BasePath + "{{basePathWithoutHost}}{{path}}"
|
||||||
|
{{#pathParams}} path = strings.Replace(path, "{" + "{{baseName}}" + "}", fmt.Sprintf("%v", {{paramName}}), -1)
|
||||||
|
{{/pathParams}}
|
||||||
|
|
||||||
|
=======
|
||||||
|
{{#allParams}}
|
||||||
|
{{#required}}
|
||||||
|
// verify the required parameter '{{paramName}}' is set
|
||||||
|
if &{{paramName}} == nil {
|
||||||
|
return {{#returnType}}*new({{{returnType}}}), {{/returnType}}errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}")
|
||||||
|
}
|
||||||
|
{{/required}}
|
||||||
|
{{/allParams}}
|
||||||
|
>>>>>>> c375f2fed5138125228c6e881df7acf3a8ada17d
|
||||||
|
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
{{#authMethods}}// authentication ({{name}}) required
|
||||||
|
{{#isApiKey}}{{#isKeyInHeader}}
|
||||||
|
// set key with prefix in header
|
||||||
|
_sling.Set("{{keyParamName}}", a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))
|
||||||
|
{{/isKeyInHeader}}{{#isKeyInQuery}}
|
||||||
|
// set key with prefix in querystring
|
||||||
|
{{#hasKeyParamName}} type KeyQueryParams struct {
|
||||||
|
{{keyParamName}} string `url:"{{keyParamName}},omitempty"`
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&KeyQueryParams{ {{keyParamName}}: a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}") })
|
||||||
|
{{/hasKeyParamName}}
|
||||||
|
{{/isKeyInQuery}}{{/isApiKey}}
|
||||||
|
{{#isBasic}}
|
||||||
|
// http basic authentication required
|
||||||
|
if a.Configuration.Username != "" || a.Configuration.Password != ""{
|
||||||
|
_sling.Set("Authorization", "Basic " + a.Configuration.GetBasicAuthEncodedString())
|
||||||
|
}
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}
|
||||||
|
// oauth required
|
||||||
|
if a.Configuration.AccessToken != ""{
|
||||||
|
_sling.Set("Authorization", "Bearer " + a.Configuration.AccessToken)
|
||||||
|
}
|
||||||
|
{{/isOAuth}}
|
||||||
|
{{/authMethods}}
|
||||||
|
|
||||||
|
|
||||||
|
// add default headers if any
|
||||||
|
for key := range a.Configuration.DefaultHeader {
|
||||||
|
_sling = _sling.Set(key, a.Configuration.DefaultHeader[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#hasQueryParams}} type QueryParams struct {
|
||||||
|
{{#queryParams}}{{vendorExtensions.x-exportParamName}} {{dataType}} `url:"{{baseName}},omitempty"`
|
||||||
|
{{/queryParams}}
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&QueryParams{ {{#queryParams}}{{vendorExtensions.x-exportParamName}}: {{paramName}}{{#hasMore}},{{/hasMore}}{{/queryParams}} })
|
||||||
|
{{/hasQueryParams}}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string {
|
||||||
|
{{#consumes}}
|
||||||
|
"{{mediaType}}",
|
||||||
|
{{/consumes}}
|
||||||
|
}
|
||||||
|
//set Content-Type header
|
||||||
|
localVarHttpContentType := a.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
_sling = _sling.Set("Content-Type", localVarHttpContentType)
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string {
|
||||||
|
{{#produces}}
|
||||||
|
"{{mediaType}}",
|
||||||
|
{{/produces}}
|
||||||
|
}
|
||||||
|
//set Accept header
|
||||||
|
localVarHttpHeaderAccept := a.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
_sling = _sling.Set("Accept", localVarHttpHeaderAccept)
|
||||||
|
}
|
||||||
|
{{#hasHeaderParams}}{{#headerParams}} // header params "{{baseName}}"
|
||||||
|
_sling = _sling.Set("{{baseName}}", {{paramName}})
|
||||||
|
{{/headerParams}}{{/hasHeaderParams}}
|
||||||
|
{{#hasFormParams}} type FormParams struct {
|
||||||
|
{{#formParams}} {{vendorExtensions.x-exportParamName}} {{dataType}} `url:"{{baseName}},omitempty"`
|
||||||
|
{{/formParams}}
|
||||||
|
}
|
||||||
|
_sling = _sling.BodyForm(&FormParams{ {{#formParams}}{{vendorExtensions.x-exportParamName}}: {{paramName}}{{#hasMore}},{{/hasMore}}{{/formParams}} })
|
||||||
|
{{/hasFormParams}}
|
||||||
|
{{#hasBodyParam}}{{#bodyParams}}// body params
|
||||||
|
_sling = _sling.BodyJSON({{paramName}})
|
||||||
|
{{/bodyParams}}{{/hasBodyParam}}
|
||||||
|
{{#returnType}} var successPayload = new({{returnType}}){{/returnType}}
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive({{#returnType}}successPayload{{/returnType}}{{^returnType}}nil{{/returnType}}, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {{#returnType}}*successPayload, {{/returnType}}err
|
||||||
|
}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,160 @@
|
|||||||
|
package {{packageName}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"github.com/dghubble/sling"
|
||||||
|
{{#imports}} "{{import}}"
|
||||||
|
{{/imports}}
|
||||||
|
)
|
||||||
|
|
||||||
|
type {{classname}} struct {
|
||||||
|
Configuration Configuration
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{classname}}() *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
return &{{classname}} {
|
||||||
|
Configuration: *configuration,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
configuration.BasePath = basePath
|
||||||
|
|
||||||
|
return &{{classname}} {
|
||||||
|
Configuration: *configuration,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#operation}}
|
||||||
|
/**
|
||||||
|
* {{summary}}
|
||||||
|
* {{notes}}
|
||||||
|
{{#allParams}} * @param {{paramName}} {{description}}
|
||||||
|
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||||
|
*/
|
||||||
|
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
||||||
|
|
||||||
|
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
{{#authMethods}}// authentication ({{name}}) required
|
||||||
|
{{#isApiKey}}{{#isKeyInHeader}}
|
||||||
|
// set key with prefix in header
|
||||||
|
_sling.Set("{{keyParamName}}", a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))
|
||||||
|
{{/isKeyInHeader}}{{#isKeyInQuery}}
|
||||||
|
// set key with prefix in querystring
|
||||||
|
{{#hasKeyParamName}} type KeyQueryParams struct {
|
||||||
|
{{keyParamName}} string `url:"{{keyParamName}},omitempty"`
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&KeyQueryParams{ {{keyParamName}}: a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}") })
|
||||||
|
{{/hasKeyParamName}}
|
||||||
|
{{/isKeyInQuery}}{{/isApiKey}}
|
||||||
|
{{#isBasic}}
|
||||||
|
// http basic authentication required
|
||||||
|
if a.Configuration.Username != "" || a.Configuration.Password != ""{
|
||||||
|
_sling.Set("Authorization", "Basic " + a.Configuration.GetBasicAuthEncodedString())
|
||||||
|
}
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}
|
||||||
|
// oauth required
|
||||||
|
if a.Configuration.AccessToken != ""{
|
||||||
|
_sling.Set("Authorization", "Bearer " + a.Configuration.AccessToken)
|
||||||
|
}
|
||||||
|
{{/isOAuth}}
|
||||||
|
{{/authMethods}}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "{{basePathWithoutHost}}{{path}}"
|
||||||
|
{{#pathParams}} path = strings.Replace(path, "{" + "{{baseName}}" + "}", fmt.Sprintf("%v", {{paramName}}), -1)
|
||||||
|
{{/pathParams}}
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// add default headers if any
|
||||||
|
for key := range a.Configuration.DefaultHeader {
|
||||||
|
_sling = _sling.Set(key, a.Configuration.DefaultHeader[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#hasQueryParams}} type QueryParams struct {
|
||||||
|
{{#queryParams}}{{vendorExtensions.x-exportParamName}} {{dataType}} `url:"{{baseName}},omitempty"`
|
||||||
|
{{/queryParams}}
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&QueryParams{ {{#queryParams}}{{vendorExtensions.x-exportParamName}}: {{paramName}}{{#hasMore}},{{/hasMore}}{{/queryParams}} })
|
||||||
|
{{/hasQueryParams}}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string {
|
||||||
|
{{#consumes}}
|
||||||
|
"{{mediaType}}",
|
||||||
|
{{/consumes}}
|
||||||
|
}
|
||||||
|
//set Content-Type header
|
||||||
|
localVarHttpContentType := a.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
_sling = _sling.Set("Content-Type", localVarHttpContentType)
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string {
|
||||||
|
{{#produces}}
|
||||||
|
"{{mediaType}}",
|
||||||
|
{{/produces}}
|
||||||
|
}
|
||||||
|
//set Accept header
|
||||||
|
localVarHttpHeaderAccept := a.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
_sling = _sling.Set("Accept", localVarHttpHeaderAccept)
|
||||||
|
}
|
||||||
|
{{#hasHeaderParams}}{{#headerParams}} // header params "{{baseName}}"
|
||||||
|
_sling = _sling.Set("{{baseName}}", {{paramName}})
|
||||||
|
{{/headerParams}}{{/hasHeaderParams}}
|
||||||
|
{{#hasFormParams}} type FormParams struct {
|
||||||
|
{{#formParams}} {{vendorExtensions.x-exportParamName}} {{dataType}} `url:"{{baseName}},omitempty"`
|
||||||
|
{{/formParams}}
|
||||||
|
}
|
||||||
|
_sling = _sling.BodyForm(&FormParams{ {{#formParams}}{{vendorExtensions.x-exportParamName}}: {{paramName}}{{#hasMore}},{{/hasMore}}{{/formParams}} })
|
||||||
|
{{/hasFormParams}}
|
||||||
|
{{#hasBodyParam}}{{#bodyParams}}// body params
|
||||||
|
_sling = _sling.BodyJSON({{paramName}})
|
||||||
|
{{/bodyParams}}{{/hasBodyParam}}
|
||||||
|
{{#returnType}} var successPayload = new({{returnType}}){{/returnType}}
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive({{#returnType}}successPayload{{/returnType}}{{^returnType}}nil{{/returnType}}, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {{#returnType}}*successPayload, {{/returnType}}err
|
||||||
|
}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,158 @@
|
|||||||
|
package {{packageName}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
{{#imports}} "{{import}}"
|
||||||
|
{{/imports}}
|
||||||
|
)
|
||||||
|
|
||||||
|
type {{classname}} struct {
|
||||||
|
Configuration Configuration
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{classname}}() *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
return &{{classname}} {
|
||||||
|
Configuration: *configuration,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
configuration.BasePath = basePath
|
||||||
|
|
||||||
|
return &{{classname}} {
|
||||||
|
Configuration: *configuration,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#operation}}
|
||||||
|
/**
|
||||||
|
* {{summary}}
|
||||||
|
* {{notes}}
|
||||||
|
{{#allParams}} * @param {{paramName}} {{description}}
|
||||||
|
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||||
|
*/
|
||||||
|
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
||||||
|
var httpMethod = {{httpMethod}}
|
||||||
|
// create path and map variables
|
||||||
|
path := c.Configuration.BasePath + "{{basePathWithoutHost}}{{path}}"
|
||||||
|
{{#pathParams}} path = strings.Replace(path, "{" + "{{baseName}}" + "}", fmt.Sprintf("%v", {{paramName}}), -1)
|
||||||
|
{{/pathParams}}
|
||||||
|
|
||||||
|
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
{{#authMethods}}// authentication ({{name}}) required
|
||||||
|
{{#isApiKey}}{{#isKeyInHeader}}
|
||||||
|
// set key with prefix in header
|
||||||
|
_sling.Set("{{keyParamName}}", a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))
|
||||||
|
{{/isKeyInHeader}}{{#isKeyInQuery}}
|
||||||
|
// set key with prefix in querystring
|
||||||
|
{{#hasKeyParamName}} type KeyQueryParams struct {
|
||||||
|
{{keyParamName}} string `url:"{{keyParamName}},omitempty"`
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&KeyQueryParams{ {{keyParamName}}: a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}") })
|
||||||
|
{{/hasKeyParamName}}
|
||||||
|
{{/isKeyInQuery}}{{/isApiKey}}
|
||||||
|
{{#isBasic}}
|
||||||
|
// http basic authentication required
|
||||||
|
if a.Configuration.Username != "" || a.Configuration.Password != ""{
|
||||||
|
_sling.Set("Authorization", "Basic " + a.Configuration.GetBasicAuthEncodedString())
|
||||||
|
}
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}
|
||||||
|
// oauth required
|
||||||
|
if a.Configuration.AccessToken != ""{
|
||||||
|
_sling.Set("Authorization", "Bearer " + a.Configuration.AccessToken)
|
||||||
|
}
|
||||||
|
{{/isOAuth}}
|
||||||
|
{{/authMethods}}
|
||||||
|
|
||||||
|
|
||||||
|
// add default headers if any
|
||||||
|
for key := range a.Configuration.DefaultHeader {
|
||||||
|
_sling = _sling.Set(key, a.Configuration.DefaultHeader[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#hasQueryParams}} type QueryParams struct {
|
||||||
|
{{#queryParams}}{{vendorExtensions.x-exportParamName}} {{dataType}} `url:"{{baseName}},omitempty"`
|
||||||
|
{{/queryParams}}
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&QueryParams{ {{#queryParams}}{{vendorExtensions.x-exportParamName}}: {{paramName}}{{#hasMore}},{{/hasMore}}{{/queryParams}} })
|
||||||
|
{{/hasQueryParams}}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string {
|
||||||
|
{{#consumes}}
|
||||||
|
"{{mediaType}}",
|
||||||
|
{{/consumes}}
|
||||||
|
}
|
||||||
|
//set Content-Type header
|
||||||
|
localVarHttpContentType := a.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
_sling = _sling.Set("Content-Type", localVarHttpContentType)
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string {
|
||||||
|
{{#produces}}
|
||||||
|
"{{mediaType}}",
|
||||||
|
{{/produces}}
|
||||||
|
}
|
||||||
|
//set Accept header
|
||||||
|
localVarHttpHeaderAccept := a.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
_sling = _sling.Set("Accept", localVarHttpHeaderAccept)
|
||||||
|
}
|
||||||
|
{{#hasHeaderParams}}{{#headerParams}} // header params "{{baseName}}"
|
||||||
|
_sling = _sling.Set("{{baseName}}", {{paramName}})
|
||||||
|
{{/headerParams}}{{/hasHeaderParams}}
|
||||||
|
{{#hasFormParams}} type FormParams struct {
|
||||||
|
{{#formParams}} {{vendorExtensions.x-exportParamName}} {{dataType}} `url:"{{baseName}},omitempty"`
|
||||||
|
{{/formParams}}
|
||||||
|
}
|
||||||
|
_sling = _sling.BodyForm(&FormParams{ {{#formParams}}{{vendorExtensions.x-exportParamName}}: {{paramName}}{{#hasMore}},{{/hasMore}}{{/formParams}} })
|
||||||
|
{{/hasFormParams}}
|
||||||
|
{{#hasBodyParam}}{{#bodyParams}}// body params
|
||||||
|
_sling = _sling.BodyJSON({{paramName}})
|
||||||
|
{{/bodyParams}}{{/hasBodyParam}}
|
||||||
|
{{#returnType}} var successPayload = new({{returnType}}){{/returnType}}
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive({{#returnType}}successPayload{{/returnType}}{{^returnType}}nil{{/returnType}}, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {{#returnType}}*successPayload, {{/returnType}}err
|
||||||
|
}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,167 @@
|
|||||||
|
package {{packageName}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
"fmt"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"github.com/dghubble/sling"
|
||||||
|
{{#imports}} "{{import}}"
|
||||||
|
{{/imports}}
|
||||||
|
)
|
||||||
|
|
||||||
|
type {{classname}} struct {
|
||||||
|
Configuration Configuration
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{classname}}() *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
return &{{classname}} {
|
||||||
|
Configuration: *configuration,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
||||||
|
configuration := NewConfiguration()
|
||||||
|
configuration.BasePath = basePath
|
||||||
|
|
||||||
|
return &{{classname}} {
|
||||||
|
Configuration: *configuration,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#operation}}
|
||||||
|
/**
|
||||||
|
* {{summary}}
|
||||||
|
* {{notes}}
|
||||||
|
{{#allParams}} * @param {{paramName}} {{description}}
|
||||||
|
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||||
|
*/
|
||||||
|
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
||||||
|
{{#allParams}}
|
||||||
|
{{#required}}
|
||||||
|
// verify the required parameter '{{paramName}}' is set
|
||||||
|
if &{{paramName}} == nil {
|
||||||
|
return {{#returnType}}*new({{{returnType}}}), {{/returnType}}errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}")
|
||||||
|
}
|
||||||
|
{{/required}}
|
||||||
|
{{/allParams}}
|
||||||
|
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
{{#authMethods}}// authentication ({{name}}) required
|
||||||
|
{{#isApiKey}}{{#isKeyInHeader}}
|
||||||
|
// set key with prefix in header
|
||||||
|
_sling.Set("{{keyParamName}}", a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))
|
||||||
|
{{/isKeyInHeader}}{{#isKeyInQuery}}
|
||||||
|
// set key with prefix in querystring
|
||||||
|
{{#hasKeyParamName}} type KeyQueryParams struct {
|
||||||
|
{{keyParamName}} string `url:"{{keyParamName}},omitempty"`
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&KeyQueryParams{ {{keyParamName}}: a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}") })
|
||||||
|
{{/hasKeyParamName}}
|
||||||
|
{{/isKeyInQuery}}{{/isApiKey}}
|
||||||
|
{{#isBasic}}
|
||||||
|
// http basic authentication required
|
||||||
|
if a.Configuration.Username != "" || a.Configuration.Password != ""{
|
||||||
|
_sling.Set("Authorization", "Basic " + a.Configuration.GetBasicAuthEncodedString())
|
||||||
|
}
|
||||||
|
{{/isBasic}}
|
||||||
|
{{#isOAuth}}
|
||||||
|
// oauth required
|
||||||
|
if a.Configuration.AccessToken != ""{
|
||||||
|
_sling.Set("Authorization", "Bearer " + a.Configuration.AccessToken)
|
||||||
|
}
|
||||||
|
{{/isOAuth}}
|
||||||
|
{{/authMethods}}
|
||||||
|
|
||||||
|
// create path and map variables
|
||||||
|
path := "{{basePathWithoutHost}}{{path}}"
|
||||||
|
{{#pathParams}} path = strings.Replace(path, "{" + "{{baseName}}" + "}", fmt.Sprintf("%v", {{paramName}}), -1)
|
||||||
|
{{/pathParams}}
|
||||||
|
|
||||||
|
_sling = _sling.Path(path)
|
||||||
|
|
||||||
|
// add default headers if any
|
||||||
|
for key := range a.Configuration.DefaultHeader {
|
||||||
|
_sling = _sling.Set(key, a.Configuration.DefaultHeader[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
{{#hasQueryParams}} type QueryParams struct {
|
||||||
|
{{#queryParams}}{{vendorExtensions.x-exportParamName}} {{dataType}} `url:"{{baseName}},omitempty"`
|
||||||
|
{{/queryParams}}
|
||||||
|
}
|
||||||
|
_sling = _sling.QueryStruct(&QueryParams{ {{#queryParams}}{{vendorExtensions.x-exportParamName}}: {{paramName}}{{#hasMore}},{{/hasMore}}{{/queryParams}} })
|
||||||
|
{{/hasQueryParams}}
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHttpContentTypes := []string {
|
||||||
|
{{#consumes}}
|
||||||
|
"{{mediaType}}",
|
||||||
|
{{/consumes}}
|
||||||
|
}
|
||||||
|
//set Content-Type header
|
||||||
|
localVarHttpContentType := a.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes)
|
||||||
|
if localVarHttpContentType != "" {
|
||||||
|
_sling = _sling.Set("Content-Type", localVarHttpContentType)
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHttpHeaderAccepts := []string {
|
||||||
|
{{#produces}}
|
||||||
|
"{{mediaType}}",
|
||||||
|
{{/produces}}
|
||||||
|
}
|
||||||
|
//set Accept header
|
||||||
|
localVarHttpHeaderAccept := a.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
|
||||||
|
if localVarHttpHeaderAccept != "" {
|
||||||
|
_sling = _sling.Set("Accept", localVarHttpHeaderAccept)
|
||||||
|
}
|
||||||
|
{{#hasHeaderParams}}{{#headerParams}} // header params "{{baseName}}"
|
||||||
|
_sling = _sling.Set("{{baseName}}", {{paramName}})
|
||||||
|
{{/headerParams}}{{/hasHeaderParams}}
|
||||||
|
{{#hasFormParams}} type FormParams struct {
|
||||||
|
{{#formParams}} {{vendorExtensions.x-exportParamName}} {{dataType}} `url:"{{baseName}},omitempty"`
|
||||||
|
{{/formParams}}
|
||||||
|
}
|
||||||
|
_sling = _sling.BodyForm(&FormParams{ {{#formParams}}{{vendorExtensions.x-exportParamName}}: {{paramName}}{{#hasMore}},{{/hasMore}}{{/formParams}} })
|
||||||
|
{{/hasFormParams}}
|
||||||
|
{{#hasBodyParam}}{{#bodyParams}}// body params
|
||||||
|
_sling = _sling.BodyJSON({{paramName}})
|
||||||
|
{{/bodyParams}}{{/hasBodyParam}}
|
||||||
|
{{#returnType}} var successPayload = new({{returnType}}){{/returnType}}
|
||||||
|
|
||||||
|
// We use this map (below) so that any arbitrary error JSON can be handled.
|
||||||
|
// FIXME: This is in the absence of this Go generator honoring the non-2xx
|
||||||
|
// response (error) models, which needs to be implemented at some point.
|
||||||
|
var failurePayload map[string]interface{}
|
||||||
|
|
||||||
|
httpResponse, err := _sling.Receive({{#returnType}}successPayload{{/returnType}}{{^returnType}}nil{{/returnType}}, &failurePayload)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
// err == nil only means that there wasn't a sub-application-layer error (e.g. no network error)
|
||||||
|
if failurePayload != nil {
|
||||||
|
// If the failurePayload is present, there likely was some kind of non-2xx status
|
||||||
|
// returned (and a JSON payload error present)
|
||||||
|
var str []byte
|
||||||
|
str, err = json.Marshal(failurePayload)
|
||||||
|
if err == nil { // For safety, check for an error marshalling... probably superfluous
|
||||||
|
// This will return the JSON error body as a string
|
||||||
|
err = errors.New(string(str))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// So, there was no network-type error, and nothing in the failure payload,
|
||||||
|
// but we should still check the status code
|
||||||
|
if httpResponse == nil {
|
||||||
|
// This should never happen...
|
||||||
|
err = errors.New("No HTTP Response received.")
|
||||||
|
} else if code := httpResponse.StatusCode; 200 > code || code > 299 {
|
||||||
|
err = errors.New("HTTP Error: " + string(httpResponse.StatusCode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {{#returnType}}*successPayload, {{/returnType}}err
|
||||||
|
}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,44 @@
|
|||||||
|
# {{invokerPackage}}\{{classname}}{{#description}}
|
||||||
|
{{description}}{{/description}}
|
||||||
|
|
||||||
|
All URIs are relative to *{{basePath}}*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||||
|
{{/operation}}{{/operations}}
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
# **{{{operationId}}}**
|
||||||
|
> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||||
|
|
||||||
|
{{{summary}}}{{#notes}}
|
||||||
|
|
||||||
|
{{{notes}}}{{/notes}}
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||||
|
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||||
|
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
@ -0,0 +1,11 @@
|
|||||||
|
{{#models}}{{#model}}# {{classname}}
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
|
||||||
|
{{/vars}}
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
{{/model}}{{/models}}
|
75
modules/swagger-codegen/src/main/resources/go/pom.mustache
Normal file
75
modules/swagger-codegen/src/main/resources/go/pom.mustache
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<project>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>com.wordnik</groupId>
|
||||||
|
<artifactId>Go{{packageName}}</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>{{packageVersion}}</version>
|
||||||
|
<name>Go{{packageName}}</name>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>go-get-testify</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>get</argument>
|
||||||
|
<argument>github.com/stretchr/testify/assert</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>go-get-sling</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>get</argument>
|
||||||
|
<argument>github.com/dghubble/sling</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>go-test</id>
|
||||||
|
<phase>integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>test</argument>
|
||||||
|
<argument>-v</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -135,7 +135,7 @@ Class | Method | HTTP request | Description
|
|||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
{{#isOAuth}}- **Type**: OAuth
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
- **Flow**: {{{flow}}}
|
- **Flow**: {{{flow}}}
|
||||||
- **Authorizatoin URL**: {{{authorizationUrl}}}
|
- **Authorization URL**: {{{authorizationUrl}}}
|
||||||
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
||||||
{{/scopes}}
|
{{/scopes}}
|
||||||
|
@ -303,7 +303,7 @@ Class | Method | HTTP request | Description
|
|||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
{{#isOAuth}}- **Type**: OAuth
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
- **Flow**: {{{flow}}}
|
- **Flow**: {{{flow}}}
|
||||||
- **Authorizatoin URL**: {{{authorizationUrl}}}
|
- **Authorization URL**: {{{authorizationUrl}}}
|
||||||
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
||||||
{{/scopes}}
|
{{/scopes}}
|
||||||
|
@ -116,7 +116,7 @@ Class | Method | HTTP request | Description
|
|||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
{{#isOAuth}}- **Type**: OAuth
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
- **Flow**: {{{flow}}}
|
- **Flow**: {{{flow}}}
|
||||||
- **Authorizatoin URL**: {{{authorizationUrl}}}
|
- **Authorization URL**: {{{authorizationUrl}}}
|
||||||
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
||||||
{{/scopes}}
|
{{/scopes}}
|
||||||
|
@ -108,7 +108,7 @@ Class | Method | HTTP request | Description
|
|||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
{{#isOAuth}}- **Type**: OAuth
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
- **Flow**: {{{flow}}}
|
- **Flow**: {{{flow}}}
|
||||||
- **Authorizatoin URL**: {{{authorizationUrl}}}
|
- **Authorization URL**: {{{authorizationUrl}}}
|
||||||
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
{{#scopes}} - **{{{scope}}}**: {{{description}}}
|
||||||
{{/scopes}}
|
{{/scopes}}
|
||||||
|
@ -119,7 +119,7 @@ Class | Method | HTTP request | Description
|
|||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
{{#isOAuth}}- **Type**: OAuth
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
- **Flow**: {{flow}}
|
- **Flow**: {{flow}}
|
||||||
- **Authorizatoin URL**: {{authorizationUrl}}
|
- **Authorization URL**: {{authorizationUrl}}
|
||||||
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||||
{{#scopes}} - {{scope}}: {{description}}
|
{{#scopes}} - {{scope}}: {{description}}
|
||||||
{{/scopes}}
|
{{/scopes}}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
# IO.Swagger - the C# library for the Swagger Petstore
|
||||||
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
|
||||||
|
|
||||||
|
This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version: 1.0.0
|
||||||
|
- Build date: 2016-04-17T23:54:21.676+08:00
|
||||||
|
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||||
|
|
||||||
## Frameworks supported
|
## Frameworks supported
|
||||||
- .NET 4.0 or later
|
- .NET 4.0 or later
|
||||||
- Windows Phone 7.1 (Mango)
|
- Windows Phone 7.1 (Mango)
|
||||||
@ -16,7 +26,112 @@ NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploa
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Run the following command to generate the DLL
|
Run the following command to generate the DLL
|
||||||
- [Mac/Linux] compile-mono.sh
|
- [Mac/Linux] `/bin/sh compile-mono.sh`
|
||||||
- [Windows] compile.bat
|
- [Windows] `compile.bat`
|
||||||
|
|
||||||
|
Then include the DLL (under the `bin` folder) in the C# project, and import the packages:
|
||||||
|
```csharp
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class Example
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add a new pet to the store
|
||||||
|
apiInstance.AddPet(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
|
||||||
|
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
|
||||||
|
*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
|
||||||
|
*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [IO.Swagger.Model.Animal](docs/Animal.md)
|
||||||
|
- [IO.Swagger.Model.ApiResponse](docs/ApiResponse.md)
|
||||||
|
- [IO.Swagger.Model.Cat](docs/Cat.md)
|
||||||
|
- [IO.Swagger.Model.Category](docs/Category.md)
|
||||||
|
- [IO.Swagger.Model.Dog](docs/Dog.md)
|
||||||
|
- [IO.Swagger.Model.FormatTest](docs/FormatTest.md)
|
||||||
|
- [IO.Swagger.Model.Model200Response](docs/Model200Response.md)
|
||||||
|
- [IO.Swagger.Model.ModelReturn](docs/ModelReturn.md)
|
||||||
|
- [IO.Swagger.Model.Name](docs/Name.md)
|
||||||
|
- [IO.Swagger.Model.Order](docs/Order.md)
|
||||||
|
- [IO.Swagger.Model.Pet](docs/Pet.md)
|
||||||
|
- [IO.Swagger.Model.SpecialModelName](docs/SpecialModelName.md)
|
||||||
|
- [IO.Swagger.Model.Tag](docs/Tag.md)
|
||||||
|
- [IO.Swagger.Model.User](docs/User.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
### petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- write:pets: modify pets in your account
|
||||||
|
- read:pets: read your pets
|
||||||
|
|
||||||
Then include the DLL (under the `bin` folder) in the C# project
|
|
||||||
|
@ -0,0 +1,184 @@
|
|||||||
|
- the C# library for the Swagger Petstore
|
||||||
|
|
||||||
|
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||||
|
|
||||||
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version:
|
||||||
|
- Build date: 2016-04-14T06:55:47.468-04:00
|
||||||
|
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||||
|
|
||||||
|
## Frameworks supported
|
||||||
|
- .NET 4.0 or later
|
||||||
|
- Windows Phone 7.1 (Mango)
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
|
||||||
|
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
|
||||||
|
|
||||||
|
The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
|
||||||
|
```
|
||||||
|
Install-Package RestSharp
|
||||||
|
Install-Package Newtonsoft.Json
|
||||||
|
```
|
||||||
|
|
||||||
|
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Run the following command to generate the DLL
|
||||||
|
- [Mac/Linux] compile-mono.sh
|
||||||
|
- [Windows] compile.bat
|
||||||
|
|
||||||
|
Then include the DLL (under the `bin` folder) in the C# project
|
||||||
|
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Module;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class Example
|
||||||
|
{
|
||||||
|
public void main(){
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
// Configure API key authorization: test_api_client_id
|
||||||
|
Configuration.Default.ApiKey.Add('x-test_api_client_id', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('x-test_api_client_id', 'BEARER');
|
||||||
|
// Configure API key authorization: test_api_client_secret
|
||||||
|
Configuration.Default.ApiKey.Add('x-test_api_client_secret', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('x-test_api_client_secret', 'BEARER');
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
Configuration.Default.ApiKey.Add('api_key', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('api_key', 'BEARER');
|
||||||
|
// Configure HTTP basic authorization: test_http_basic
|
||||||
|
Configuration.Default.Username = 'YOUR_USERNAME';
|
||||||
|
Configuration.Default.Password = 'YOUR_PASSWORD';
|
||||||
|
// Configure API key authorization: test_api_key_query
|
||||||
|
Configuration.Default.ApiKey.Add('test_api_key_query', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('test_api_key_query', 'BEARER');
|
||||||
|
// Configure API key authorization: test_api_key_header
|
||||||
|
Configuration.Default.ApiKey.Add('test_api_key_header', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('test_api_key_header', 'BEARER');
|
||||||
|
|
||||||
|
var apiInstance = new ();
|
||||||
|
|
||||||
|
try {
|
||||||
|
apiInstance.();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Debug.Print("Exception when calling .: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*::PetApi* | [**AddPet**](docs/PetApi.md#AddPet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*::PetApi* | [**AddPetUsingByteArray**](docs/PetApi.md#AddPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
*::PetApi* | [**DeletePet**](docs/PetApi.md#DeletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*::PetApi* | [**FindPetsByStatus**](docs/PetApi.md#FindPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*::PetApi* | [**FindPetsByTags**](docs/PetApi.md#FindPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*::PetApi* | [**GetPetById**](docs/PetApi.md#GetPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*::PetApi* | [**GetPetByIdInObject**](docs/PetApi.md#GetPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
*::PetApi* | [**PetPetIdtestingByteArraytrueGet**](docs/PetApi.md#PetPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
*::PetApi* | [**UpdatePet**](docs/PetApi.md#UpdatePet) | **PUT** /pet | Update an existing pet
|
||||||
|
*::PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#UpdatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*::PetApi* | [**UploadFile**](docs/PetApi.md#UploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*::StoreApi* | [**DeleteOrder**](docs/StoreApi.md#DeleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*::StoreApi* | [**FindOrdersByStatus**](docs/StoreApi.md#FindOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
|
||||||
|
*::StoreApi* | [**GetInventory**](docs/StoreApi.md#GetInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*::StoreApi* | [**GetInventoryInObject**](docs/StoreApi.md#GetInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
*::StoreApi* | [**GetOrderById**](docs/StoreApi.md#GetOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*::StoreApi* | [**PlaceOrder**](docs/StoreApi.md#PlaceOrder) | **POST** /store/order | Place an order for a pet
|
||||||
|
*::UserApi* | [**CreateUser**](docs/UserApi.md#CreateUser) | **POST** /user | Create user
|
||||||
|
*::UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#CreateUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*::UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#CreateUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
*::UserApi* | [**DeleteUser**](docs/UserApi.md#DeleteUser) | **DELETE** /user/{username} | Delete user
|
||||||
|
*::UserApi* | [**GetUserByName**](docs/UserApi.md#GetUserByName) | **GET** /user/{username} | Get user by user name
|
||||||
|
*::UserApi* | [**LoginUser**](docs/UserApi.md#LoginUser) | **GET** /user/login | Logs user into the system
|
||||||
|
*::UserApi* | [**LogoutUser**](docs/UserApi.md#LogoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
*::UserApi* | [**UpdateUser**](docs/UserApi.md#UpdateUser) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [::Animal](docs/Animal.md)
|
||||||
|
- [::Cat](docs/Cat.md)
|
||||||
|
- [::Category](docs/Category.md)
|
||||||
|
- [::Dog](docs/Dog.md)
|
||||||
|
- [::FormatTest](docs/FormatTest.md)
|
||||||
|
- [::InlineResponse200](docs/InlineResponse200.md)
|
||||||
|
- [::Model200Response](docs/Model200Response.md)
|
||||||
|
- [::ModelReturn](docs/ModelReturn.md)
|
||||||
|
- [::Name](docs/Name.md)
|
||||||
|
- [::Order](docs/Order.md)
|
||||||
|
- [::Pet](docs/Pet.md)
|
||||||
|
- [::SpecialModelName](docs/SpecialModelName.md)
|
||||||
|
- [::Tag](docs/Tag.md)
|
||||||
|
- [::User](docs/User.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
|
||||||
|
### petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- write:pets: modify pets in your account
|
||||||
|
- read:pets: read your pets
|
||||||
|
|
||||||
|
### test_api_client_id
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: x-test_api_client_id
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
### test_api_client_secret
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: x-test_api_client_secret
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
### test_http_basic
|
||||||
|
|
||||||
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
|
### test_api_key_query
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: test_api_key_query
|
||||||
|
- **Location**: URL query string
|
||||||
|
|
||||||
|
### test_api_key_header
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: test_api_key_header
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# IO.Swagger.Model.Animal
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ClassName** | **string** | |
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# IO.Swagger.Model.ApiResponse
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Code** | **int?** | | [optional]
|
||||||
|
**Type** | **string** | | [optional]
|
||||||
|
**Message** | **string** | | [optional]
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# IO.Swagger.Model.Cat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ClassName** | **string** | |
|
||||||
|
**Declawed** | **bool?** | | [optional]
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# IO.Swagger.Model.Category
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional]
|
||||||
|
**Name** | **string** | | [optional]
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# IO.Swagger.Model.Dog
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ClassName** | **string** | |
|
||||||
|
**Breed** | **string** | | [optional]
|
||||||
|
|
@ -0,0 +1,19 @@
|
|||||||
|
# IO.Swagger.Model.FormatTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Integer** | **int?** | | [optional]
|
||||||
|
**Int32** | **int?** | | [optional]
|
||||||
|
**Int64** | **long?** | | [optional]
|
||||||
|
**Number** | **double?** | |
|
||||||
|
**_Float** | **float?** | | [optional]
|
||||||
|
**_Double** | **double?** | | [optional]
|
||||||
|
**_String** | **string** | | [optional]
|
||||||
|
**_Byte** | **byte[]** | | [optional]
|
||||||
|
**Binary** | **byte[]** | | [optional]
|
||||||
|
**Date** | **DateTime?** | | [optional]
|
||||||
|
**DateTime** | **DateTime?** | | [optional]
|
||||||
|
**Password** | **string** | | [optional]
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
# InlineResponse200
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**PhotoUrls** | **List<string>** | | [optional]
|
||||||
|
**Name** | **string** | | [optional]
|
||||||
|
**Id** | **long?** | |
|
||||||
|
**Category** | **Object** | | [optional]
|
||||||
|
**Tags** | [**List<Tag>**](Tag.md) | | [optional]
|
||||||
|
**Status** | **string** | pet status in the store | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# IO.Swagger.Model.Model200Response
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Name** | **int?** | | [optional]
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# IO.Swagger.Model.ModelReturn
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_Return** | **int?** | | [optional]
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# IO.Swagger.Model.Name
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_Name** | **int?** | |
|
||||||
|
**SnakeCase** | **int?** | | [optional]
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
# IO.Swagger.Model.Order
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional]
|
||||||
|
**PetId** | **long?** | | [optional]
|
||||||
|
**Quantity** | **int?** | | [optional]
|
||||||
|
**ShipDate** | **DateTime?** | | [optional]
|
||||||
|
**Status** | **string** | Order Status | [optional]
|
||||||
|
**Complete** | **bool?** | | [optional] [default to false]
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
# IO.Swagger.Model.Pet
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional]
|
||||||
|
**Category** | [**Category**](Category.md) | | [optional]
|
||||||
|
**Name** | **string** | |
|
||||||
|
**PhotoUrls** | **List<string>** | |
|
||||||
|
**Tags** | [**List<Tag>**](Tag.md) | | [optional]
|
||||||
|
**Status** | **string** | pet status in the store | [optional]
|
||||||
|
|
@ -0,0 +1,520 @@
|
|||||||
|
# IO.Swagger.Api.PetApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||||
|
[**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
[**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
[**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
[**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||||
|
[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
# **AddPet**
|
||||||
|
> void AddPet (Pet body)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class AddPetExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add a new pet to the store
|
||||||
|
apiInstance.AddPet(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **DeletePet**
|
||||||
|
> void DeletePet (long? petId, string apiKey = null)
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeletePetExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var petId = 789; // long? | Pet id to delete
|
||||||
|
var apiKey = apiKey_example; // string | (optional)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Deletes a pet
|
||||||
|
apiInstance.DeletePet(petId, apiKey);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long?**| Pet id to delete |
|
||||||
|
**apiKey** | **string**| | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **FindPetsByStatus**
|
||||||
|
> List<Pet> FindPetsByStatus (List<string> status)
|
||||||
|
|
||||||
|
Finds Pets by status
|
||||||
|
|
||||||
|
Multiple status values can be provided with comma separated strings
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class FindPetsByStatusExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var status = new List<string>(); // List<string> | Status values that need to be considered for filter
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Finds Pets by status
|
||||||
|
List<Pet> result = apiInstance.FindPetsByStatus(status);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | [**List<string>**](string.md)| Status values that need to be considered for filter |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **FindPetsByTags**
|
||||||
|
> List<Pet> FindPetsByTags (List<string> tags)
|
||||||
|
|
||||||
|
Finds Pets by tags
|
||||||
|
|
||||||
|
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class FindPetsByTagsExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var tags = new List<string>(); // List<string> | Tags to filter by
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Finds Pets by tags
|
||||||
|
List<Pet> result = apiInstance.FindPetsByTags(tags);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**tags** | [**List<string>**](string.md)| Tags to filter by |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<Pet>**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **GetPetById**
|
||||||
|
> Pet GetPetById (long? petId)
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
|
||||||
|
Returns a single pet
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetPetByIdExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
Configuration.Default.ApiKey.Add('api_key', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('api_key', 'BEARER');
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var petId = 789; // long? | ID of pet to return
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Find pet by ID
|
||||||
|
Pet result = apiInstance.GetPetById(petId);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long?**| ID of pet to return |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **UpdatePet**
|
||||||
|
> void UpdatePet (Pet body)
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdatePetExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Update an existing pet
|
||||||
|
apiInstance.UpdatePet(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **UpdatePetWithForm**
|
||||||
|
> void UpdatePetWithForm (long? petId, string name = null, string status = null)
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdatePetWithFormExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
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)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Updates a pet in the store with form data
|
||||||
|
apiInstance.UpdatePetWithForm(petId, name, status);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long?**| ID of pet that needs to be updated |
|
||||||
|
**name** | **string**| Updated name of the pet | [optional]
|
||||||
|
**status** | **string**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **UploadFile**
|
||||||
|
> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null)
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UploadFileExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Configuration.Default.AccessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
var apiInstance = new PetApi();
|
||||||
|
var petId = 789; // long? | ID of pet to update
|
||||||
|
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
|
||||||
|
var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional)
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// uploads an image
|
||||||
|
ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **long?**| ID of pet to update |
|
||||||
|
**additionalMetadata** | **string**| Additional data to pass to server | [optional]
|
||||||
|
**file** | **System.IO.Stream**| file to upload | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ApiResponse**](ApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
# IO.Swagger.Model.SpecialModelName
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**SpecialPropertyName** | **long?** | | [optional]
|
||||||
|
|
@ -0,0 +1,248 @@
|
|||||||
|
# IO.Swagger.Api.StoreApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
# **DeleteOrder**
|
||||||
|
> void DeleteOrder (string orderId)
|
||||||
|
|
||||||
|
Delete purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeleteOrderExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi();
|
||||||
|
var orderId = orderId_example; // string | ID of the order that needs to be deleted
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Delete purchase order by ID
|
||||||
|
apiInstance.DeleteOrder(orderId);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**orderId** | **string**| ID of the order that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **GetInventory**
|
||||||
|
> Dictionary<string, int?> GetInventory ()
|
||||||
|
|
||||||
|
Returns pet inventories by status
|
||||||
|
|
||||||
|
Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetInventoryExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
Configuration.Default.ApiKey.Add('api_key', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Configuration.Default.ApiKeyPrefix.Add('api_key', 'BEARER');
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Returns pet inventories by status
|
||||||
|
Dictionary<string, int?> result = apiInstance.GetInventory();
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Dictionary<string, int?>**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
# **GetOrderById**
|
||||||
|
> Order GetOrderById (long? orderId)
|
||||||
|
|
||||||
|
Find purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetOrderByIdExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi();
|
||||||
|
var orderId = 789; // long? | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Find purchase order by ID
|
||||||
|
Order result = apiInstance.GetOrderById(orderId);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**orderId** | **long?**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **PlaceOrder**
|
||||||
|
> Order PlaceOrder (Order body)
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class PlaceOrderExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new StoreApi();
|
||||||
|
var body = new Order(); // Order | order placed for purchasing the pet
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Place an order for a pet
|
||||||
|
Order result = apiInstance.PlaceOrder(body);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# IO.Swagger.Model.Tag
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional]
|
||||||
|
**Name** | **string** | | [optional]
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
# IO.Swagger.Model.User
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **long?** | | [optional]
|
||||||
|
**Username** | **string** | | [optional]
|
||||||
|
**FirstName** | **string** | | [optional]
|
||||||
|
**LastName** | **string** | | [optional]
|
||||||
|
**Email** | **string** | | [optional]
|
||||||
|
**Password** | **string** | | [optional]
|
||||||
|
**Phone** | **string** | | [optional]
|
||||||
|
**UserStatus** | **int?** | User Status | [optional]
|
||||||
|
|
@ -0,0 +1,482 @@
|
|||||||
|
# IO.Swagger.Api.UserApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user
|
||||||
|
[**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
[**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
[**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
|
||||||
|
[**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
|
||||||
|
[**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
|
||||||
|
[**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
[**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
# **CreateUser**
|
||||||
|
> void CreateUser (User body)
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var body = new User(); // User | Created user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Create user
|
||||||
|
apiInstance.CreateUser(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**User**](User.md)| Created user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **CreateUsersWithArrayInput**
|
||||||
|
> void CreateUsersWithArrayInput (List<User> body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUsersWithArrayInputExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var body = new List<User>(); // List<User> | List of user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Creates list of users with given input array
|
||||||
|
apiInstance.CreateUsersWithArrayInput(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **CreateUsersWithListInput**
|
||||||
|
> void CreateUsersWithListInput (List<User> body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class CreateUsersWithListInputExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var body = new List<User>(); // List<User> | List of user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Creates list of users with given input array
|
||||||
|
apiInstance.CreateUsersWithListInput(body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**List<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **DeleteUser**
|
||||||
|
> void DeleteUser (string username)
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class DeleteUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var username = username_example; // string | The name that needs to be deleted
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Delete user
|
||||||
|
apiInstance.DeleteUser(username);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The name that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **GetUserByName**
|
||||||
|
> User GetUserByName (string username)
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class GetUserByNameExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Get user by user name
|
||||||
|
User result = apiInstance.GetUserByName(username);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The name that needs to be fetched. Use user1 for testing. |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**User**](User.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **LoginUser**
|
||||||
|
> string LoginUser (string username, string password)
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class LoginUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var username = username_example; // string | The user name for login
|
||||||
|
var password = password_example; // string | The password for login in clear text
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Logs user into the system
|
||||||
|
string result = apiInstance.LoginUser(username, password);
|
||||||
|
Debug.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The user name for login |
|
||||||
|
**password** | **string**| The password for login in clear text |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**string**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **LogoutUser**
|
||||||
|
> void LogoutUser ()
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class LogoutUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Logs out current logged in user session
|
||||||
|
apiInstance.LogoutUser();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
# **UpdateUser**
|
||||||
|
> void UpdateUser (string username, User body)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```csharp
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using IO.Swagger.Api;
|
||||||
|
using IO.Swagger.Client;
|
||||||
|
using IO.Swagger.Model;
|
||||||
|
|
||||||
|
namespace Example
|
||||||
|
{
|
||||||
|
public class UpdateUserExample
|
||||||
|
{
|
||||||
|
public void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
var apiInstance = new UserApi();
|
||||||
|
var username = username_example; // string | name that need to be deleted
|
||||||
|
var body = new User(); // User | Updated user object
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Updated user
|
||||||
|
apiInstance.UpdateUser(username, body);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| name that need to be deleted |
|
||||||
|
**body** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
@ -1,8 +1,14 @@
|
|||||||
# Go API client for swagger
|
# Go API client for swagger
|
||||||
|
|
||||||
|
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
|
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version: 1.0.0
|
||||||
|
- Build date: 2016-04-16T15:44:50.329-07:00
|
||||||
|
- Build package: class io.swagger.codegen.languages.GoClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Put the package under your project folder and add the following in import:
|
Put the package under your project folder and add the following in import:
|
||||||
@ -10,3 +16,64 @@ Put the package under your project folder and add the following in import:
|
|||||||
"./swagger"
|
"./swagger"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user
|
||||||
|
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /user/{username} | Delete user
|
||||||
|
*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **Get** /user/{username} | Get user by user name
|
||||||
|
*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Put** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [ApiResponse](docs/ApiResponse.md)
|
||||||
|
- [Category](docs/Category.md)
|
||||||
|
- [Order](docs/Order.md)
|
||||||
|
- [Pet](docs/Pet.md)
|
||||||
|
- [Tag](docs/Tag.md)
|
||||||
|
- [User](docs/User.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
|
## petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- **write:pets**: modify pets in your account
|
||||||
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
## api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
apiteam@swagger.io
|
||||||
|
|
||||||
|
24
samples/client/petstore/go/go-petstore/.gitignore
vendored
Normal file
24
samples/client/petstore/go/go-petstore/.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Folders
|
||||||
|
_obj
|
||||||
|
_test
|
||||||
|
|
||||||
|
# Architecture specific extensions/prefixes
|
||||||
|
*.[568vq]
|
||||||
|
[568vq].out
|
||||||
|
|
||||||
|
*.cgo1.go
|
||||||
|
*.cgo2.c
|
||||||
|
_cgo_defun.c
|
||||||
|
_cgo_gotypes.go
|
||||||
|
_cgo_export.*
|
||||||
|
|
||||||
|
_testmain.go
|
||||||
|
|
||||||
|
*.exe
|
||||||
|
*.test
|
||||||
|
*.prof
|
79
samples/client/petstore/go/go-petstore/README.md
Normal file
79
samples/client/petstore/go/go-petstore/README.md
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# Go API client for swagger
|
||||||
|
|
||||||
|
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version: 1.0.0
|
||||||
|
- Build date: 2016-04-17T16:17:52.285+08:00
|
||||||
|
- Build package: class io.swagger.codegen.languages.GoClientCodegen
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Put the package under your project folder and add the following in import:
|
||||||
|
```
|
||||||
|
"./swagger"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user
|
||||||
|
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /user/{username} | Delete user
|
||||||
|
*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **Get** /user/{username} | Get user by user name
|
||||||
|
*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Put** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [ApiResponse](docs/ApiResponse.md)
|
||||||
|
- [Category](docs/Category.md)
|
||||||
|
- [Order](docs/Order.md)
|
||||||
|
- [Pet](docs/Pet.md)
|
||||||
|
- [Tag](docs/Tag.md)
|
||||||
|
- [User](docs/User.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
|
## api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- **write:pets**: modify pets in your account
|
||||||
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
apiteam@swagger.io
|
||||||
|
|
12
samples/client/petstore/go/go-petstore/docs/ApiResponse.md
Normal file
12
samples/client/petstore/go/go-petstore/docs/ApiResponse.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# ApiResponse
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Code** | **int32** | | [optional] [default to null]
|
||||||
|
**Type_** | **string** | | [optional] [default to null]
|
||||||
|
**Message** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/go/go-petstore/docs/Category.md
Normal file
11
samples/client/petstore/go/go-petstore/docs/Category.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Category
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **int64** | | [optional] [default to null]
|
||||||
|
**Name** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/go/go-petstore/docs/Order.md
Normal file
15
samples/client/petstore/go/go-petstore/docs/Order.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Order
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **int64** | | [optional] [default to null]
|
||||||
|
**PetId** | **int64** | | [optional] [default to null]
|
||||||
|
**Quantity** | **int32** | | [optional] [default to null]
|
||||||
|
**ShipDate** | [**time.Time**](time.Time.md) | | [optional] [default to null]
|
||||||
|
**Status** | **string** | Order Status | [optional] [default to null]
|
||||||
|
**Complete** | **bool** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/go/go-petstore/docs/Pet.md
Normal file
15
samples/client/petstore/go/go-petstore/docs/Pet.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Pet
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **int64** | | [optional] [default to null]
|
||||||
|
**Category** | [**Category**](Category.md) | | [optional] [default to null]
|
||||||
|
**Name** | **string** | | [default to null]
|
||||||
|
**PhotoUrls** | **[]string** | | [default to null]
|
||||||
|
**Tags** | [**[]Tag**](Tag.md) | | [optional] [default to null]
|
||||||
|
**Status** | **string** | pet status in the store | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
253
samples/client/petstore/go/go-petstore/docs/PetApi.md
Normal file
253
samples/client/petstore/go/go-petstore/docs/PetApi.md
Normal file
@ -0,0 +1,253 @@
|
|||||||
|
# \PetApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**AddPet**](PetApi.md#AddPet) | **Post** /pet | Add a new pet to the store
|
||||||
|
[**DeletePet**](PetApi.md#DeletePet) | **Delete** /pet/{petId} | Deletes a pet
|
||||||
|
[**FindPetsByStatus**](PetApi.md#FindPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status
|
||||||
|
[**FindPetsByTags**](PetApi.md#FindPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags
|
||||||
|
[**GetPetById**](PetApi.md#GetPetById) | **Get** /pet/{petId} | Find pet by ID
|
||||||
|
[**UpdatePet**](PetApi.md#UpdatePet) | **Put** /pet | Update an existing pet
|
||||||
|
[**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
[**UploadFile**](PetApi.md#UploadFile) | **Post** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
# **AddPet**
|
||||||
|
> AddPet($body)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **DeletePet**
|
||||||
|
> DeletePet($petId, $apiKey)
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **int64**| Pet id to delete |
|
||||||
|
**apiKey** | **string**| | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **FindPetsByStatus**
|
||||||
|
> []Pet FindPetsByStatus($status)
|
||||||
|
|
||||||
|
Finds Pets by status
|
||||||
|
|
||||||
|
Multiple status values can be provided with comma separated strings
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | [**[]string**](string.md)| Status values that need to be considered for filter |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **FindPetsByTags**
|
||||||
|
> []Pet FindPetsByTags($tags)
|
||||||
|
|
||||||
|
Finds Pets by tags
|
||||||
|
|
||||||
|
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**tags** | [**[]string**](string.md)| Tags to filter by |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**[]Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **GetPetById**
|
||||||
|
> Pet GetPetById($petId)
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
|
||||||
|
Returns a single pet
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **int64**| ID of pet to return |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Pet**](Pet.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **UpdatePet**
|
||||||
|
> UpdatePet($body)
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **UpdatePetWithForm**
|
||||||
|
> UpdatePetWithForm($petId, $name, $status)
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **int64**| ID of pet that needs to be updated |
|
||||||
|
**name** | **string**| Updated name of the pet | [optional]
|
||||||
|
**status** | **string**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **UploadFile**
|
||||||
|
> ApiResponse UploadFile($petId, $additionalMetadata, $file)
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **int64**| ID of pet to update |
|
||||||
|
**additionalMetadata** | **string**| Additional data to pass to server | [optional]
|
||||||
|
**file** | ***os.File**| file to upload | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ApiResponse**](ApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
125
samples/client/petstore/go/go-petstore/docs/StoreApi.md
Normal file
125
samples/client/petstore/go/go-petstore/docs/StoreApi.md
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
# \StoreApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status
|
||||||
|
[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
[**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
# **DeleteOrder**
|
||||||
|
> DeleteOrder($orderId)
|
||||||
|
|
||||||
|
Delete purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**orderId** | **string**| ID of the order that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **GetInventory**
|
||||||
|
> map[string]int32 GetInventory()
|
||||||
|
|
||||||
|
Returns pet inventories by status
|
||||||
|
|
||||||
|
Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**map[string]int32**](map.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **GetOrderById**
|
||||||
|
> Order GetOrderById($orderId)
|
||||||
|
|
||||||
|
Find purchase order by ID
|
||||||
|
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**orderId** | **int64**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **PlaceOrder**
|
||||||
|
> Order PlaceOrder($body)
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Order**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
11
samples/client/petstore/go/go-petstore/docs/Tag.md
Normal file
11
samples/client/petstore/go/go-petstore/docs/Tag.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Tag
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **int64** | | [optional] [default to null]
|
||||||
|
**Name** | **string** | | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
17
samples/client/petstore/go/go-petstore/docs/User.md
Normal file
17
samples/client/petstore/go/go-petstore/docs/User.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# User
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**Id** | **int64** | | [optional] [default to null]
|
||||||
|
**Username** | **string** | | [optional] [default to null]
|
||||||
|
**FirstName** | **string** | | [optional] [default to null]
|
||||||
|
**LastName** | **string** | | [optional] [default to null]
|
||||||
|
**Email** | **string** | | [optional] [default to null]
|
||||||
|
**Password** | **string** | | [optional] [default to null]
|
||||||
|
**Phone** | **string** | | [optional] [default to null]
|
||||||
|
**UserStatus** | **int32** | User Status | [optional] [default to null]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
247
samples/client/petstore/go/go-petstore/docs/UserApi.md
Normal file
247
samples/client/petstore/go/go-petstore/docs/UserApi.md
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
# \UserApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**CreateUser**](UserApi.md#CreateUser) | **Post** /user | Create user
|
||||||
|
[**CreateUsersWithArrayInput**](UserApi.md#CreateUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array
|
||||||
|
[**CreateUsersWithListInput**](UserApi.md#CreateUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array
|
||||||
|
[**DeleteUser**](UserApi.md#DeleteUser) | **Delete** /user/{username} | Delete user
|
||||||
|
[**GetUserByName**](UserApi.md#GetUserByName) | **Get** /user/{username} | Get user by user name
|
||||||
|
[**LoginUser**](UserApi.md#LoginUser) | **Get** /user/login | Logs user into the system
|
||||||
|
[**LogoutUser**](UserApi.md#LogoutUser) | **Get** /user/logout | Logs out current logged in user session
|
||||||
|
[**UpdateUser**](UserApi.md#UpdateUser) | **Put** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
# **CreateUser**
|
||||||
|
> CreateUser($body)
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**User**](User.md)| Created user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **CreateUsersWithArrayInput**
|
||||||
|
> CreateUsersWithArrayInput($body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**[]User**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **CreateUsersWithListInput**
|
||||||
|
> CreateUsersWithListInput($body)
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**[]User**](User.md)| List of user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **DeleteUser**
|
||||||
|
> DeleteUser($username)
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The name that needs to be deleted |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **GetUserByName**
|
||||||
|
> User GetUserByName($username)
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The name that needs to be fetched. Use user1 for testing. |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**User**](User.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **LoginUser**
|
||||||
|
> string LoginUser($username, $password)
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| The user name for login |
|
||||||
|
**password** | **string**| The password for login in clear text |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**string**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **LogoutUser**
|
||||||
|
> LogoutUser()
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **UpdateUser**
|
||||||
|
> UpdateUser($username, $body)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **string**| name that need to be deleted |
|
||||||
|
**body** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
52
samples/client/petstore/go/go-petstore/git_push.sh
Normal file
52
samples/client/petstore/go/go-petstore/git_push.sh
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
|
#
|
||||||
|
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||||
|
|
||||||
|
git_user_id=$1
|
||||||
|
git_repo_id=$2
|
||||||
|
release_note=$3
|
||||||
|
|
||||||
|
if [ "$git_user_id" = "" ]; then
|
||||||
|
git_user_id="YOUR_GIT_USR_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="YOUR_GIT_REPO_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="Minor update"
|
||||||
|
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Initialize the local directory as a Git repository
|
||||||
|
git init
|
||||||
|
|
||||||
|
# Adds the files in the local repository and stages them for commit.
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||||
|
git commit -m "$release_note"
|
||||||
|
|
||||||
|
# Sets the new remote
|
||||||
|
git_remote=`git remote`
|
||||||
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||||
|
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
else
|
||||||
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
|
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||||
|
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||||
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
|
|
@ -36,7 +36,10 @@ func NewPetApiWithBasePath(basePath string) *PetApi{
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a PetApi) AddPet (body Pet) (error) {
|
func (a PetApi) AddPet (body Pet) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling PetApi->AddPet")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -124,7 +127,10 @@ func (a PetApi) AddPet (body Pet) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a PetApi) DeletePet (petId int64, apiKey string) (error) {
|
func (a PetApi) DeletePet (petId int64, apiKey string) (error) {
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if &petId == nil {
|
||||||
|
return errors.New("Missing required parameter 'petId' when calling PetApi->DeletePet")
|
||||||
|
}
|
||||||
_sling := sling.New().Delete(a.Configuration.BasePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -210,7 +216,10 @@ func (a PetApi) DeletePet (petId int64, apiKey string) (error) {
|
|||||||
* @return []Pet
|
* @return []Pet
|
||||||
*/
|
*/
|
||||||
func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
||||||
|
// verify the required parameter 'status' is set
|
||||||
|
if &status == nil {
|
||||||
|
return *new([]Pet), errors.New("Missing required parameter 'status' when calling PetApi->FindPetsByStatus")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -297,7 +306,10 @@ func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
|||||||
* @return []Pet
|
* @return []Pet
|
||||||
*/
|
*/
|
||||||
func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
||||||
|
// verify the required parameter 'tags' is set
|
||||||
|
if &tags == nil {
|
||||||
|
return *new([]Pet), errors.New("Missing required parameter 'tags' when calling PetApi->FindPetsByTags")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -384,7 +396,10 @@ func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
|||||||
* @return Pet
|
* @return Pet
|
||||||
*/
|
*/
|
||||||
func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if &petId == nil {
|
||||||
|
return *new(Pet), errors.New("Missing required parameter 'petId' when calling PetApi->GetPetById")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (api_key) required
|
// authentication (api_key) required
|
||||||
@ -467,7 +482,10 @@ func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a PetApi) UpdatePet (body Pet) (error) {
|
func (a PetApi) UpdatePet (body Pet) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling PetApi->UpdatePet")
|
||||||
|
}
|
||||||
_sling := sling.New().Put(a.Configuration.BasePath)
|
_sling := sling.New().Put(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -556,7 +574,10 @@ func (a PetApi) UpdatePet (body Pet) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (error) {
|
func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (error) {
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if &petId == nil {
|
||||||
|
return errors.New("Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -648,7 +669,10 @@ func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (err
|
|||||||
* @return ApiResponse
|
* @return ApiResponse
|
||||||
*/
|
*/
|
||||||
func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.File) (ApiResponse, error) {
|
func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.File) (ApiResponse, error) {
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if &petId == nil {
|
||||||
|
return *new(ApiResponse), errors.New("Missing required parameter 'petId' when calling PetApi->UploadFile")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
75
samples/client/petstore/go/go-petstore/pom.xml
Normal file
75
samples/client/petstore/go/go-petstore/pom.xml
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<project>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>com.wordnik</groupId>
|
||||||
|
<artifactId>Goswagger</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<name>Goswagger</name>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>go-get-testify</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>get</argument>
|
||||||
|
<argument>github.com/stretchr/testify/assert</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>go-get-sling</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>get</argument>
|
||||||
|
<argument>github.com/dghubble/sling</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>go-test</id>
|
||||||
|
<phase>integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>test</argument>
|
||||||
|
<argument>-v</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -35,7 +35,10 @@ func NewStoreApiWithBasePath(basePath string) *StoreApi{
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a StoreApi) DeleteOrder (orderId string) (error) {
|
func (a StoreApi) DeleteOrder (orderId string) (error) {
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if &orderId == nil {
|
||||||
|
return errors.New("Missing required parameter 'orderId' when calling StoreApi->DeleteOrder")
|
||||||
|
}
|
||||||
_sling := sling.New().Delete(a.Configuration.BasePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -112,7 +115,6 @@ func (a StoreApi) DeleteOrder (orderId string) (error) {
|
|||||||
* @return map[string]int32
|
* @return map[string]int32
|
||||||
*/
|
*/
|
||||||
func (a StoreApi) GetInventory () (map[string]int32, error) {
|
func (a StoreApi) GetInventory () (map[string]int32, error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (api_key) required
|
// authentication (api_key) required
|
||||||
@ -193,7 +195,10 @@ func (a StoreApi) GetInventory () (map[string]int32, error) {
|
|||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
func (a StoreApi) GetOrderById (orderId int64) (Order, error) {
|
func (a StoreApi) GetOrderById (orderId int64) (Order, error) {
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if &orderId == nil {
|
||||||
|
return *new(Order), errors.New("Missing required parameter 'orderId' when calling StoreApi->GetOrderById")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -271,7 +276,10 @@ func (a StoreApi) GetOrderById (orderId int64) (Order, error) {
|
|||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return *new(Order), errors.New("Missing required parameter 'body' when calling StoreApi->PlaceOrder")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
@ -35,7 +35,10 @@ func NewUserApiWithBasePath(basePath string) *UserApi{
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) CreateUser (body User) (error) {
|
func (a UserApi) CreateUser (body User) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling UserApi->CreateUser")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -114,7 +117,10 @@ func (a UserApi) CreateUser (body User) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -193,7 +199,10 @@ func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -272,7 +281,10 @@ func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) DeleteUser (username string) (error) {
|
func (a UserApi) DeleteUser (username string) (error) {
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if &username == nil {
|
||||||
|
return errors.New("Missing required parameter 'username' when calling UserApi->DeleteUser")
|
||||||
|
}
|
||||||
_sling := sling.New().Delete(a.Configuration.BasePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -350,7 +362,10 @@ func (a UserApi) DeleteUser (username string) (error) {
|
|||||||
* @return User
|
* @return User
|
||||||
*/
|
*/
|
||||||
func (a UserApi) GetUserByName (username string) (User, error) {
|
func (a UserApi) GetUserByName (username string) (User, error) {
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if &username == nil {
|
||||||
|
return *new(User), errors.New("Missing required parameter 'username' when calling UserApi->GetUserByName")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -429,7 +444,14 @@ func (a UserApi) GetUserByName (username string) (User, error) {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
func (a UserApi) LoginUser (username string, password string) (string, error) {
|
func (a UserApi) LoginUser (username string, password string) (string, error) {
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if &username == nil {
|
||||||
|
return *new(string), errors.New("Missing required parameter 'username' when calling UserApi->LoginUser")
|
||||||
|
}
|
||||||
|
// verify the required parameter 'password' is set
|
||||||
|
if &password == nil {
|
||||||
|
return *new(string), errors.New("Missing required parameter 'password' when calling UserApi->LoginUser")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -510,7 +532,6 @@ Password string `url:"password,omitempty"`
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) LogoutUser () (error) {
|
func (a UserApi) LogoutUser () (error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -588,7 +609,14 @@ func (a UserApi) LogoutUser () (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) UpdateUser (username string, body User) (error) {
|
func (a UserApi) UpdateUser (username string, body User) (error) {
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if &username == nil {
|
||||||
|
return errors.New("Missing required parameter 'username' when calling UserApi->UpdateUser")
|
||||||
|
}
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling UserApi->UpdateUser")
|
||||||
|
}
|
||||||
_sling := sling.New().Put(a.Configuration.BasePath)
|
_sling := sling.New().Put(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
sw "./go-petstore"
|
||||||
|
|
||||||
sw "./swagger"
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAddPet(t *testing.T) {
|
func TestAddPet(t *testing.T) {
|
||||||
@ -29,11 +28,11 @@ func TestGetPetById(t *testing.T) {
|
|||||||
t.Errorf("Error while getting pet by id")
|
t.Errorf("Error while getting pet by id")
|
||||||
t.Log(err)
|
t.Log(err)
|
||||||
} else {
|
} else {
|
||||||
assert.Equal(resp.Id, "12830", "Pet id should be equal")
|
assert.Equal(resp.Id, int64(12830), "Pet id should be equal")
|
||||||
assert.Equal(resp.Name, "gopher", "Pet name should be gopher")
|
assert.Equal(resp.Name, "gopher", "Pet name should be gopher")
|
||||||
assert.Equal(resp.Status, "pending", "Pet status should be pending")
|
assert.Equal(resp.Status, "pending", "Pet status should be pending")
|
||||||
|
|
||||||
t.Log(resp)
|
//t.Log(resp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
75
samples/client/petstore/go/pom.xml
Normal file
75
samples/client/petstore/go/pom.xml
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<project>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>com.wordnik</groupId>
|
||||||
|
<artifactId>Goswagger</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<name>Goswagger</name>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>go-get-testify</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>get</argument>
|
||||||
|
<argument>github.com/stretchr/testify/assert</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>go-get-sling</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>get</argument>
|
||||||
|
<argument>github.com/dghubble/sling</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>go-test</id>
|
||||||
|
<phase>integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>go</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>test</argument>
|
||||||
|
<argument>-v</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
sw "./swagger"
|
sw "./go-petstore"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
@ -165,7 +165,7 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
- **Flow**: implicit
|
- **Flow**: implicit
|
||||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
- **Scopes**:
|
- **Scopes**:
|
||||||
- write:pets: modify pets in your account
|
- write:pets: modify pets in your account
|
||||||
- read:pets: read your pets
|
- read:pets: read your pets
|
||||||
|
@ -61,7 +61,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -110,7 +110,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -162,7 +162,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -211,7 +211,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -260,7 +260,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -314,7 +314,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -368,7 +368,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -422,7 +422,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -471,7 +471,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -525,7 +525,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/x-www-form-urlencoded
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -579,7 +579,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
|
@ -50,7 +50,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -107,7 +107,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -151,7 +151,7 @@ This endpoint does not need any parameter.
|
|||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -195,7 +195,7 @@ This endpoint does not need any parameter.
|
|||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -251,7 +251,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -308,7 +308,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
|
@ -53,7 +53,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -97,7 +97,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -141,7 +141,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -190,7 +190,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[test_http_basic](../README.md#test_http_basic)
|
[test_http_basic](../README.md#test_http_basic)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -233,7 +233,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -279,7 +279,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -316,7 +316,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -363,7 +363,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
|
@ -168,7 +168,7 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
- **Flow**: implicit
|
- **Flow**: implicit
|
||||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
- **Scopes**:
|
- **Scopes**:
|
||||||
- write:pets: modify pets in your account
|
- write:pets: modify pets in your account
|
||||||
- read:pets: read your pets
|
- read:pets: read your pets
|
||||||
|
@ -64,7 +64,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -116,7 +116,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -171,7 +171,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -223,7 +223,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -275,7 +275,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -332,7 +332,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -389,7 +389,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -446,7 +446,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -498,7 +498,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -555,7 +555,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/x-www-form-urlencoded
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -612,7 +612,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
|
@ -53,7 +53,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -113,7 +113,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -160,7 +160,7 @@ This endpoint does not need any parameter.
|
|||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -207,7 +207,7 @@ This endpoint does not need any parameter.
|
|||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -266,7 +266,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -326,7 +326,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
|
@ -56,7 +56,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -103,7 +103,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -150,7 +150,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -202,7 +202,7 @@ null (empty response body)
|
|||||||
|
|
||||||
[test_http_basic](../README.md#test_http_basic)
|
[test_http_basic](../README.md#test_http_basic)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -248,7 +248,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -297,7 +297,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -337,7 +337,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
@ -387,7 +387,7 @@ null (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/xml
|
- **Accept**: application/json, application/xml
|
||||||
|
@ -10,10 +10,13 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||||
|
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||||
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
@ -48,7 +51,7 @@ if ($@) {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -58,10 +61,56 @@ void (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **add_pet_using_byte_array**
|
||||||
|
> add_pet_using_byte_array(body => $body)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```perl
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||||
|
my $body = WWW::SwaggerClient::Object::string->new(); # string | Pet object in the form of byte array
|
||||||
|
|
||||||
|
eval {
|
||||||
|
$api_instance->add_pet_using_byte_array(body => $body);
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
warn "Exception when calling PetApi->add_pet_using_byte_array: $@\n";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **string**| Pet object in the form of byte array | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -106,10 +155,10 @@ void (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -128,7 +177,7 @@ use Data::Dumper;
|
|||||||
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||||
my $status = (); # ARRAY[string] | Status values that need to be considered for filter
|
my $status = (); # ARRAY[string] | Status values that need to be considered for query
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
my $result = $api_instance->find_pets_by_status(status => $status);
|
my $result = $api_instance->find_pets_by_status(status => $status);
|
||||||
@ -143,7 +192,7 @@ if ($@) {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**ARRAY[string]**](string.md)| Status values that need to be considered for filter |
|
**status** | [**ARRAY[string]**](string.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -153,10 +202,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -165,7 +214,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
Finds Pets by tags
|
Finds Pets by tags
|
||||||
|
|
||||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```perl
|
```perl
|
||||||
@ -190,7 +239,7 @@ if ($@) {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**tags** | [**ARRAY[string]**](string.md)| Tags to filter by |
|
**tags** | [**ARRAY[string]**](string.md)| Tags to filter by | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -200,10 +249,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -212,7 +261,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
Find pet by ID
|
Find pet by ID
|
||||||
|
|
||||||
Returns a single pet
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```perl
|
```perl
|
||||||
@ -222,9 +271,11 @@ use Data::Dumper;
|
|||||||
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
||||||
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||||
my $pet_id = 789; # int | ID of pet to return
|
my $pet_id = 789; # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
my $result = $api_instance->get_pet_by_id(pet_id => $pet_id);
|
my $result = $api_instance->get_pet_by_id(pet_id => $pet_id);
|
||||||
@ -239,7 +290,7 @@ if ($@) {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pet_id** | **int**| ID of pet to return |
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -247,12 +298,114 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **get_pet_by_id_in_object**
|
||||||
|
> InlineResponse200 get_pet_by_id_in_object(pet_id => $pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```perl
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||||
|
my $pet_id = 789; # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
eval {
|
||||||
|
my $result = $api_instance->get_pet_by_id_in_object(pet_id => $pet_id);
|
||||||
|
print Dumper($result);
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
warn "Exception when calling PetApi->get_pet_by_id_in_object: $@\n";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**InlineResponse200**](InlineResponse200.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **pet_pet_idtesting_byte_arraytrue_get**
|
||||||
|
> string pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```perl
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||||
|
my $pet_id = 789; # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
eval {
|
||||||
|
my $result = $api_instance->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id);
|
||||||
|
print Dumper($result);
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
warn "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: $@\n";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**string**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -285,7 +438,7 @@ if ($@) {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -295,10 +448,10 @@ void (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -317,7 +470,7 @@ use Data::Dumper;
|
|||||||
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
my $api_instance = WWW::SwaggerClient::PetApi->new();
|
||||||
my $pet_id = 789; # int | ID of pet that needs to be updated
|
my $pet_id = 'pet_id_example'; # string | ID of pet that needs to be updated
|
||||||
my $name = 'name_example'; # string | Updated name of the pet
|
my $name = 'name_example'; # string | Updated name of the pet
|
||||||
my $status = 'status_example'; # string | Updated status of the pet
|
my $status = 'status_example'; # string | Updated status of the pet
|
||||||
|
|
||||||
@ -333,7 +486,7 @@ if ($@) {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pet_id** | **int**| ID of pet that needs to be updated |
|
**pet_id** | **string**| ID of pet that needs to be updated |
|
||||||
**name** | **string**| Updated name of the pet | [optional]
|
**name** | **string**| Updated name of the pet | [optional]
|
||||||
**status** | **string**| Updated status of the pet | [optional]
|
**status** | **string**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
@ -345,15 +498,15 @@ void (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/x-www-form-urlencoded
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
# **upload_file**
|
# **upload_file**
|
||||||
> ApiResponse upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file)
|
> upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file)
|
||||||
|
|
||||||
uploads an image
|
uploads an image
|
||||||
|
|
||||||
@ -372,8 +525,7 @@ my $additional_metadata = 'additional_metadata_example'; # string | Additional d
|
|||||||
my $file = '/path/to/file.txt'; # File | file to upload
|
my $file = '/path/to/file.txt'; # File | file to upload
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
my $result = $api_instance->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file);
|
$api_instance->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file);
|
||||||
print Dumper($result);
|
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
warn "Exception when calling PetApi->upload_file: $@\n";
|
warn "Exception when calling PetApi->upload_file: $@\n";
|
||||||
@ -390,16 +542,16 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
[**ApiResponse**](ApiResponse.md)
|
void (empty response body)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
|
@ -10,7 +10,9 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||||
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
@ -51,10 +53,63 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **find_orders_by_status**
|
||||||
|
> ARRAY[Order] find_orders_by_status(status => $status)
|
||||||
|
|
||||||
|
Finds orders by status
|
||||||
|
|
||||||
|
A single status value can be provided as a string
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```perl
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_client_id
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER";
|
||||||
|
# Configure API key authorization: test_api_client_secret
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER";
|
||||||
|
|
||||||
|
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
||||||
|
my $status = 'status_example'; # string | Status value that needs to be considered for query
|
||||||
|
|
||||||
|
eval {
|
||||||
|
my $result = $api_instance->find_orders_by_status(status => $status);
|
||||||
|
print Dumper($result);
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
warn "Exception when calling StoreApi->find_orders_by_status: $@\n";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | **string**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ARRAY[Order]**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -96,10 +151,55 @@ This endpoint does not need any parameter.
|
|||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **get_inventory_in_object**
|
||||||
|
> object get_inventory_in_object()
|
||||||
|
|
||||||
|
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
|
||||||
|
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```perl
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "BEARER";
|
||||||
|
|
||||||
|
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
||||||
|
|
||||||
|
eval {
|
||||||
|
my $result = $api_instance->get_inventory_in_object();
|
||||||
|
print Dumper($result);
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
warn "Exception when calling StoreApi->get_inventory_in_object: $@\n";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**object**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -114,8 +214,17 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
```perl
|
```perl
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_key_header
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'test_api_key_header'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'test_api_key_header'} = "BEARER";
|
||||||
|
# Configure API key authorization: test_api_key_query
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'test_api_key_query'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'test_api_key_query'} = "BEARER";
|
||||||
|
|
||||||
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
||||||
my $order_id = 789; # int | ID of pet that needs to be fetched
|
my $order_id = 'order_id_example'; # string | ID of pet that needs to be fetched
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
my $result = $api_instance->get_order_by_id(order_id => $order_id);
|
my $result = $api_instance->get_order_by_id(order_id => $order_id);
|
||||||
@ -130,7 +239,7 @@ if ($@) {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**order_id** | **int**| ID of pet that needs to be fetched |
|
**order_id** | **string**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -138,12 +247,12 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -158,6 +267,15 @@ Place an order for a pet
|
|||||||
```perl
|
```perl
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_client_id
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_id'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_id'} = "BEARER";
|
||||||
|
# Configure API key authorization: test_api_client_secret
|
||||||
|
$WWW::SwaggerClient::Configuration::api_key->{'x-test_api_client_secret'} = 'YOUR_API_KEY';
|
||||||
|
# uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'x-test_api_client_secret'} = "BEARER";
|
||||||
|
|
||||||
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
my $api_instance = WWW::SwaggerClient::StoreApi->new();
|
||||||
my $body = WWW::SwaggerClient::Object::Order->new(); # Order | order placed for purchasing the pet
|
my $body = WWW::SwaggerClient::Object::Order->new(); # Order | order placed for purchasing the pet
|
||||||
|
|
||||||
@ -174,7 +292,7 @@ if ($@) {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -182,12 +300,12 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -98,7 +98,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -141,7 +141,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -184,7 +184,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -228,7 +228,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -274,7 +274,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -313,7 +313,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -358,7 +358,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
|
@ -132,7 +132,7 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
- **Flow**: implicit
|
- **Flow**: implicit
|
||||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
- **Scopes**:
|
- **Scopes**:
|
||||||
- **write:pets**: modify pets in your account
|
- **write:pets**: modify pets in your account
|
||||||
- **read:pets**: read your pets
|
- **read:pets**: read your pets
|
||||||
|
@ -5,10 +5,13 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||||
|
[**addPetUsingByteArray**](PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
[**getPetByIdInObject**](PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
[**petPetIdtestingByteArraytrueGet**](PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
@ -44,7 +47,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store |
|
**body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -54,10 +57,57 @@ void (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **addPetUsingByteArray**
|
||||||
|
> addPetUsingByteArray($body)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
|
$body = "B"; // string | Pet object in the form of byte array
|
||||||
|
|
||||||
|
try {
|
||||||
|
$api_instance->addPetUsingByteArray($body);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo 'Exception when calling PetApi->addPetUsingByteArray: ', $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **string**| Pet object in the form of byte array | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -103,10 +153,10 @@ void (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -126,7 +176,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
|
|||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$status = array("status_example"); // string[] | Status values that need to be considered for filter
|
$status = array("available"); // string[] | Status values that need to be considered for query
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $api_instance->findPetsByStatus($status);
|
$result = $api_instance->findPetsByStatus($status);
|
||||||
@ -141,7 +191,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**string[]**](string.md)| Status values that need to be considered for filter |
|
**status** | [**string[]**](string.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -151,10 +201,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -163,7 +213,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
Finds Pets by tags
|
Finds Pets by tags
|
||||||
|
|
||||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```php
|
```php
|
||||||
@ -189,7 +239,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**tags** | [**string[]**](string.md)| Tags to filter by |
|
**tags** | [**string[]**](string.md)| Tags to filter by | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -199,10 +249,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -211,7 +261,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
Find pet by ID
|
Find pet by ID
|
||||||
|
|
||||||
Returns a single pet
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```php
|
```php
|
||||||
@ -222,9 +272,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
|
|||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet to return
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $api_instance->getPetById($pet_id);
|
$result = $api_instance->getPetById($pet_id);
|
||||||
@ -239,7 +291,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pet_id** | **int**| ID of pet to return |
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -247,12 +299,116 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **getPetByIdInObject**
|
||||||
|
> \Swagger\Client\Model\InlineResponse200 getPetByIdInObject($pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try {
|
||||||
|
$result = $api_instance->getPetByIdInObject($pet_id);
|
||||||
|
print_r($result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo 'Exception when calling PetApi->getPetByIdInObject: ', $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**\Swagger\Client\Model\InlineResponse200**](InlineResponse200.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **petPetIdtestingByteArraytrueGet**
|
||||||
|
> string petPetIdtestingByteArraytrueGet($pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try {
|
||||||
|
$result = $api_instance->petPetIdtestingByteArraytrueGet($pet_id);
|
||||||
|
print_r($result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo 'Exception when calling PetApi->petPetIdtestingByteArraytrueGet: ', $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**string**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -286,7 +442,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store |
|
**body** | [**\Swagger\Client\Model\Pet**](\Swagger\Client\Model\Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -296,10 +452,10 @@ void (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -319,7 +475,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
|
|||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet that needs to be updated
|
$pet_id = "pet_id_example"; // string | ID of pet that needs to be updated
|
||||||
$name = "name_example"; // string | Updated name of the pet
|
$name = "name_example"; // string | Updated name of the pet
|
||||||
$status = "status_example"; // string | Updated status of the pet
|
$status = "status_example"; // string | Updated status of the pet
|
||||||
|
|
||||||
@ -335,7 +491,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pet_id** | **int**| ID of pet that needs to be updated |
|
**pet_id** | **string**| ID of pet that needs to be updated |
|
||||||
**name** | **string**| Updated name of the pet | [optional]
|
**name** | **string**| Updated name of the pet | [optional]
|
||||||
**status** | **string**| Updated status of the pet | [optional]
|
**status** | **string**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
@ -347,15 +503,15 @@ void (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/x-www-form-urlencoded
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
# **uploadFile**
|
# **uploadFile**
|
||||||
> \Swagger\Client\Model\ApiResponse uploadFile($pet_id, $additional_metadata, $file)
|
> uploadFile($pet_id, $additional_metadata, $file)
|
||||||
|
|
||||||
uploads an image
|
uploads an image
|
||||||
|
|
||||||
@ -375,8 +531,7 @@ $additional_metadata = "additional_metadata_example"; // string | Additional dat
|
|||||||
$file = "/path/to/file.txt"; // \SplFileObject | file to upload
|
$file = "/path/to/file.txt"; // \SplFileObject | file to upload
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $api_instance->uploadFile($pet_id, $additional_metadata, $file);
|
$api_instance->uploadFile($pet_id, $additional_metadata, $file);
|
||||||
print_r($result);
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), "\n";
|
echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), "\n";
|
||||||
}
|
}
|
||||||
@ -393,16 +548,16 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
[**\Swagger\Client\Model\ApiResponse**](ApiResponse.md)
|
void (empty response body)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
|
@ -5,7 +5,9 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
|
||||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
[**getInventoryInObject**](StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
@ -47,10 +49,64 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **findOrdersByStatus**
|
||||||
|
> \Swagger\Client\Model\Order[] findOrdersByStatus($status)
|
||||||
|
|
||||||
|
Finds orders by status
|
||||||
|
|
||||||
|
A single status value can be provided as a string
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure API key authorization: test_api_client_id
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
|
||||||
|
// Configure API key authorization: test_api_client_secret
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
|
||||||
|
|
||||||
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
|
$status = "placed"; // string | Status value that needs to be considered for query
|
||||||
|
|
||||||
|
try {
|
||||||
|
$result = $api_instance->findOrdersByStatus($status);
|
||||||
|
print_r($result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo 'Exception when calling StoreApi->findOrdersByStatus: ', $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | **string**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**\Swagger\Client\Model\Order[]**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -93,10 +149,56 @@ This endpoint does not need any parameter.
|
|||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **getInventoryInObject**
|
||||||
|
> object getInventoryInObject()
|
||||||
|
|
||||||
|
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
|
||||||
|
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
|
|
||||||
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$result = $api_instance->getInventoryInObject();
|
||||||
|
print_r($result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo 'Exception when calling StoreApi->getInventoryInObject: ', $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**object**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -112,8 +214,17 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure API key authorization: test_api_key_header
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_header', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_header', 'BEARER');
|
||||||
|
// Configure API key authorization: test_api_key_query
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_query', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_query', 'BEARER');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
$order_id = 789; // int | ID of pet that needs to be fetched
|
$order_id = "order_id_example"; // string | ID of pet that needs to be fetched
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $api_instance->getOrderById($order_id);
|
$result = $api_instance->getOrderById($order_id);
|
||||||
@ -128,7 +239,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**order_id** | **int**| ID of pet that needs to be fetched |
|
**order_id** | **string**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -136,12 +247,12 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -157,6 +268,15 @@ Place an order for a pet
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure API key authorization: test_api_client_id
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_id', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_id', 'BEARER');
|
||||||
|
// Configure API key authorization: test_api_client_secret
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-test_api_client_secret', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-test_api_client_secret', 'BEARER');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
$body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet
|
$body = new \Swagger\Client\Model\Order(); // \Swagger\Client\Model\Order | order placed for purchasing the pet
|
||||||
|
|
||||||
@ -173,7 +293,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**\Swagger\Client\Model\Order**](\Swagger\Client\Model\Order.md)| order placed for purchasing the pet |
|
**body** | [**\Swagger\Client\Model\Order**](\Swagger\Client\Model\Order.md)| order placed for purchasing the pet | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -181,12 +301,12 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -95,7 +95,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -139,7 +139,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -183,7 +183,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -228,7 +228,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -275,7 +275,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -315,7 +315,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -361,7 +361,7 @@ void (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
|
@ -124,7 +124,7 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
- **Flow**: implicit
|
- **Flow**: implicit
|
||||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
- **Scopes**:
|
- **Scopes**:
|
||||||
- **write:pets**: modify pets in your account
|
- **write:pets**: modify pets in your account
|
||||||
- **read:pets**: read your pets
|
- **read:pets**: read your pets
|
||||||
|
@ -5,17 +5,20 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||||
|
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||||
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
|
||||||
|
|
||||||
# **add_pet**
|
# **add_pet**
|
||||||
> add_pet(body)
|
> add_pet(body=body)
|
||||||
|
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
|
|
||||||
@ -33,11 +36,11 @@ swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = swagger_client.PetApi()
|
api_instance = swagger_client.PetApi()
|
||||||
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store
|
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Add a new pet to the store
|
# Add a new pet to the store
|
||||||
api_instance.add_pet(body)
|
api_instance.add_pet(body=body)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print "Exception when calling PetApi->add_pet: %s\n" % e
|
print "Exception when calling PetApi->add_pet: %s\n" % e
|
||||||
```
|
```
|
||||||
@ -46,7 +49,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -59,7 +62,56 @@ void (empty response body)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **add_pet_using_byte_array**
|
||||||
|
> add_pet_using_byte_array(body=body)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
body = 'B' # str | Pet object in the form of byte array (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
api_instance.add_pet_using_byte_array(body=body)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->add_pet_using_byte_array: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **str**| Pet object in the form of byte array | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -110,12 +162,12 @@ void (empty response body)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
# **find_pets_by_status**
|
# **find_pets_by_status**
|
||||||
> list[Pet] find_pets_by_status(status)
|
> list[Pet] find_pets_by_status(status=status)
|
||||||
|
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
@ -133,11 +185,11 @@ swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = swagger_client.PetApi()
|
api_instance = swagger_client.PetApi()
|
||||||
status = ['status_example'] # list[str] | Status values that need to be considered for filter
|
status = ['available'] # list[str] | Status values that need to be considered for query (optional) (default to available)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Finds Pets by status
|
# Finds Pets by status
|
||||||
api_response = api_instance.find_pets_by_status(status)
|
api_response = api_instance.find_pets_by_status(status=status)
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print "Exception when calling PetApi->find_pets_by_status: %s\n" % e
|
print "Exception when calling PetApi->find_pets_by_status: %s\n" % e
|
||||||
@ -147,7 +199,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**list[str]**](str.md)| Status values that need to be considered for filter |
|
**status** | [**list[str]**](str.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -160,16 +212,16 @@ Name | Type | Description | Notes
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
# **find_pets_by_tags**
|
# **find_pets_by_tags**
|
||||||
> list[Pet] find_pets_by_tags(tags)
|
> list[Pet] find_pets_by_tags(tags=tags)
|
||||||
|
|
||||||
Finds Pets by tags
|
Finds Pets by tags
|
||||||
|
|
||||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```python
|
```python
|
||||||
@ -183,11 +235,11 @@ swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = swagger_client.PetApi()
|
api_instance = swagger_client.PetApi()
|
||||||
tags = ['tags_example'] # list[str] | Tags to filter by
|
tags = ['tags_example'] # list[str] | Tags to filter by (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Finds Pets by tags
|
# Finds Pets by tags
|
||||||
api_response = api_instance.find_pets_by_tags(tags)
|
api_response = api_instance.find_pets_by_tags(tags=tags)
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print "Exception when calling PetApi->find_pets_by_tags: %s\n" % e
|
print "Exception when calling PetApi->find_pets_by_tags: %s\n" % e
|
||||||
@ -197,7 +249,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**tags** | [**list[str]**](str.md)| Tags to filter by |
|
**tags** | [**list[str]**](str.md)| Tags to filter by | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -210,7 +262,7 @@ Name | Type | Description | Notes
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -219,7 +271,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
Find pet by ID
|
Find pet by ID
|
||||||
|
|
||||||
Returns a single pet
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```python
|
```python
|
||||||
@ -232,10 +284,12 @@ from pprint import pprint
|
|||||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = swagger_client.PetApi()
|
api_instance = swagger_client.PetApi()
|
||||||
pet_id = 789 # int | ID of pet to return
|
pet_id = 789 # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Find pet by ID
|
# Find pet by ID
|
||||||
@ -249,7 +303,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pet_id** | **int**| ID of pet to return |
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -257,17 +311,125 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **get_pet_by_id_in_object**
|
||||||
|
> InlineResponse200 get_pet_by_id_in_object(pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
pet_id = 789 # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
api_response = api_instance.get_pet_by_id_in_object(pet_id)
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->get_pet_by_id_in_object: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**InlineResponse200**](InlineResponse200.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **pet_pet_idtesting_byte_arraytrue_get**
|
||||||
|
> str pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.PetApi()
|
||||||
|
pet_id = 789 # int | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
api_response = api_instance.pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**str**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
# **update_pet**
|
# **update_pet**
|
||||||
> update_pet(body)
|
> update_pet(body=body)
|
||||||
|
|
||||||
Update an existing pet
|
Update an existing pet
|
||||||
|
|
||||||
@ -285,11 +447,11 @@ swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = swagger_client.PetApi()
|
api_instance = swagger_client.PetApi()
|
||||||
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store
|
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Update an existing pet
|
# Update an existing pet
|
||||||
api_instance.update_pet(body)
|
api_instance.update_pet(body=body)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print "Exception when calling PetApi->update_pet: %s\n" % e
|
print "Exception when calling PetApi->update_pet: %s\n" % e
|
||||||
```
|
```
|
||||||
@ -298,7 +460,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -311,7 +473,7 @@ void (empty response body)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -334,7 +496,7 @@ swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = swagger_client.PetApi()
|
api_instance = swagger_client.PetApi()
|
||||||
pet_id = 789 # int | ID of pet that needs to be updated
|
pet_id = 'pet_id_example' # str | ID of pet that needs to be updated
|
||||||
name = 'name_example' # str | Updated name of the pet (optional)
|
name = 'name_example' # str | Updated name of the pet (optional)
|
||||||
status = 'status_example' # str | Updated status of the pet (optional)
|
status = 'status_example' # str | Updated status of the pet (optional)
|
||||||
|
|
||||||
@ -349,7 +511,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pet_id** | **int**| ID of pet that needs to be updated |
|
**pet_id** | **str**| ID of pet that needs to be updated |
|
||||||
**name** | **str**| Updated name of the pet | [optional]
|
**name** | **str**| Updated name of the pet | [optional]
|
||||||
**status** | **str**| Updated status of the pet | [optional]
|
**status** | **str**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
@ -364,12 +526,12 @@ void (empty response body)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/x-www-form-urlencoded
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
# **upload_file**
|
# **upload_file**
|
||||||
> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file)
|
> upload_file(pet_id, additional_metadata=additional_metadata, file=file)
|
||||||
|
|
||||||
uploads an image
|
uploads an image
|
||||||
|
|
||||||
@ -393,8 +555,7 @@ file = '/path/to/file.txt' # file | file to upload (optional)
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# uploads an image
|
# uploads an image
|
||||||
api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
|
api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
|
||||||
pprint(api_response)
|
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print "Exception when calling PetApi->upload_file: %s\n" % e
|
print "Exception when calling PetApi->upload_file: %s\n" % e
|
||||||
```
|
```
|
||||||
@ -409,7 +570,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
[**ApiResponse**](ApiResponse.md)
|
void (empty response body)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
@ -418,7 +579,7 @@ Name | Type | Description | Notes
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
|
@ -5,7 +5,9 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||||
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
@ -52,7 +54,63 @@ No authorization required
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **find_orders_by_status**
|
||||||
|
> list[Order] find_orders_by_status(status=status)
|
||||||
|
|
||||||
|
Finds orders by status
|
||||||
|
|
||||||
|
A single status value can be provided as a string
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_client_id
|
||||||
|
swagger_client.configuration.api_key['x-test_api_client_id'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||||
|
# Configure API key authorization: test_api_client_secret
|
||||||
|
swagger_client.configuration.api_key['x-test_api_client_secret'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.StoreApi()
|
||||||
|
status = 'placed' # str | Status value that needs to be considered for query (optional) (default to placed)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Finds orders by status
|
||||||
|
api_response = api_instance.find_orders_by_status(status=status)
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling StoreApi->find_orders_by_status: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | **str**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**list[Order]**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -100,7 +158,55 @@ This endpoint does not need any parameter.
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
|
# **get_inventory_in_object**
|
||||||
|
> object get_inventory_in_object()
|
||||||
|
|
||||||
|
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
|
||||||
|
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```python
|
||||||
|
import time
|
||||||
|
import swagger_client
|
||||||
|
from swagger_client.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = swagger_client.StoreApi()
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
api_response = api_instance.get_inventory_in_object()
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print "Exception when calling StoreApi->get_inventory_in_object: %s\n" % e
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**object**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
@ -118,9 +224,18 @@ import swagger_client
|
|||||||
from swagger_client.rest import ApiException
|
from swagger_client.rest import ApiException
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_key_header
|
||||||
|
swagger_client.configuration.api_key['test_api_key_header'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['test_api_key_header'] = 'BEARER'
|
||||||
|
# Configure API key authorization: test_api_key_query
|
||||||
|
swagger_client.configuration.api_key['test_api_key_query'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['test_api_key_query'] = 'BEARER'
|
||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = swagger_client.StoreApi()
|
api_instance = swagger_client.StoreApi()
|
||||||
order_id = 789 # int | ID of pet that needs to be fetched
|
order_id = 'order_id_example' # str | ID of pet that needs to be fetched
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Find purchase order by ID
|
# Find purchase order by ID
|
||||||
@ -134,7 +249,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**order_id** | **int**| ID of pet that needs to be fetched |
|
**order_id** | **str**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -142,17 +257,17 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
# **place_order**
|
# **place_order**
|
||||||
> Order place_order(body)
|
> Order place_order(body=body)
|
||||||
|
|
||||||
Place an order for a pet
|
Place an order for a pet
|
||||||
|
|
||||||
@ -165,13 +280,22 @@ import swagger_client
|
|||||||
from swagger_client.rest import ApiException
|
from swagger_client.rest import ApiException
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_client_id
|
||||||
|
swagger_client.configuration.api_key['x-test_api_client_id'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||||
|
# Configure API key authorization: test_api_client_secret
|
||||||
|
swagger_client.configuration.api_key['x-test_api_client_secret'] = 'YOUR_API_KEY'
|
||||||
|
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
# swagger_client.configuration.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = swagger_client.StoreApi()
|
api_instance = swagger_client.StoreApi()
|
||||||
body = swagger_client.Order() # Order | order placed for purchasing the pet
|
body = swagger_client.Order() # Order | order placed for purchasing the pet (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Place an order for a pet
|
# Place an order for a pet
|
||||||
api_response = api_instance.place_order(body)
|
api_response = api_instance.place_order(body=body)
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print "Exception when calling StoreApi->place_order: %s\n" % e
|
print "Exception when calling StoreApi->place_order: %s\n" % e
|
||||||
@ -181,7 +305,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -189,12 +313,12 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
[[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)
|
[[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)
|
||||||
|
|
||||||
|
@ -5,17 +5,20 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||||
|
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||||
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
|
||||||
|
|
||||||
# **add_pet**
|
# **add_pet**
|
||||||
> add_pet(body)
|
> add_pet(opts)
|
||||||
|
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
|
|
||||||
@ -33,12 +36,13 @@ end
|
|||||||
|
|
||||||
api_instance = Petstore::PetApi.new
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
opts = {
|
||||||
|
body: Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
||||||
|
}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
#Add a new pet to the store
|
#Add a new pet to the store
|
||||||
api_instance.add_pet(body)
|
api_instance.add_pet(opts)
|
||||||
rescue Petstore::ApiError => e
|
rescue Petstore::ApiError => e
|
||||||
puts "Exception when calling PetApi->add_pet: #{e}"
|
puts "Exception when calling PetApi->add_pet: #{e}"
|
||||||
end
|
end
|
||||||
@ -48,7 +52,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -58,10 +62,62 @@ nil (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# **add_pet_using_byte_array**
|
||||||
|
> add_pet_using_byte_array(opts)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```ruby
|
||||||
|
# load the gem
|
||||||
|
require 'petstore'
|
||||||
|
# setup authorization
|
||||||
|
Petstore.configure do |config|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.access_token = 'YOUR ACCESS TOKEN'
|
||||||
|
end
|
||||||
|
|
||||||
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
body: "B" # String | Pet object in the form of byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
begin
|
||||||
|
#Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||||
|
api_instance.add_pet_using_byte_array(opts)
|
||||||
|
rescue Petstore::ApiError => e
|
||||||
|
puts "Exception when calling PetApi->add_pet_using_byte_array: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **String**| Pet object in the form of byte array | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
nil (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -113,15 +169,15 @@ nil (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# **find_pets_by_status**
|
# **find_pets_by_status**
|
||||||
> Array<Pet> find_pets_by_status(status)
|
> Array<Pet> find_pets_by_status(opts)
|
||||||
|
|
||||||
Finds Pets by status
|
Finds Pets by status
|
||||||
|
|
||||||
@ -139,12 +195,13 @@ end
|
|||||||
|
|
||||||
api_instance = Petstore::PetApi.new
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
status = ["status_example"] # Array<String> | Status values that need to be considered for filter
|
opts = {
|
||||||
|
status: ["available"] # Array<String> | Status values that need to be considered for query
|
||||||
|
}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
#Finds Pets by status
|
#Finds Pets by status
|
||||||
result = api_instance.find_pets_by_status(status)
|
result = api_instance.find_pets_by_status(opts)
|
||||||
p result
|
p result
|
||||||
rescue Petstore::ApiError => e
|
rescue Petstore::ApiError => e
|
||||||
puts "Exception when calling PetApi->find_pets_by_status: #{e}"
|
puts "Exception when calling PetApi->find_pets_by_status: #{e}"
|
||||||
@ -155,7 +212,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**Array<String>**](String.md)| Status values that need to be considered for filter |
|
**status** | [**Array<String>**](String.md)| Status values that need to be considered for query | [optional] [default to available]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -165,19 +222,19 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# **find_pets_by_tags**
|
# **find_pets_by_tags**
|
||||||
> Array<Pet> find_pets_by_tags(tags)
|
> Array<Pet> find_pets_by_tags(opts)
|
||||||
|
|
||||||
Finds Pets by tags
|
Finds Pets by tags
|
||||||
|
|
||||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```ruby
|
```ruby
|
||||||
@ -191,12 +248,13 @@ end
|
|||||||
|
|
||||||
api_instance = Petstore::PetApi.new
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
tags = ["tags_example"] # Array<String> | Tags to filter by
|
opts = {
|
||||||
|
tags: ["tags_example"] # Array<String> | Tags to filter by
|
||||||
|
}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
#Finds Pets by tags
|
#Finds Pets by tags
|
||||||
result = api_instance.find_pets_by_tags(tags)
|
result = api_instance.find_pets_by_tags(opts)
|
||||||
p result
|
p result
|
||||||
rescue Petstore::ApiError => e
|
rescue Petstore::ApiError => e
|
||||||
puts "Exception when calling PetApi->find_pets_by_tags: #{e}"
|
puts "Exception when calling PetApi->find_pets_by_tags: #{e}"
|
||||||
@ -207,7 +265,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**tags** | [**Array<String>**](String.md)| Tags to filter by |
|
**tags** | [**Array<String>**](String.md)| Tags to filter by | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -217,10 +275,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -229,7 +287,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
Find pet by ID
|
Find pet by ID
|
||||||
|
|
||||||
Returns a single pet
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```ruby
|
```ruby
|
||||||
@ -241,11 +299,14 @@ Petstore.configure do |config|
|
|||||||
config.api_key['api_key'] = 'YOUR API KEY'
|
config.api_key['api_key'] = 'YOUR API KEY'
|
||||||
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
#config.api_key_prefix['api_key'] = 'BEARER'
|
#config.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.access_token = 'YOUR ACCESS TOKEN'
|
||||||
end
|
end
|
||||||
|
|
||||||
api_instance = Petstore::PetApi.new
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
pet_id = 789 # Integer | ID of pet to return
|
pet_id = 789 # Integer | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -261,7 +322,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pet_id** | **Integer**| ID of pet to return |
|
**pet_id** | **Integer**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -269,17 +330,131 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# **get_pet_by_id_in_object**
|
||||||
|
> InlineResponse200 get_pet_by_id_in_object(pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```ruby
|
||||||
|
# load the gem
|
||||||
|
require 'petstore'
|
||||||
|
# setup authorization
|
||||||
|
Petstore.configure do |config|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
config.api_key['api_key'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.access_token = 'YOUR ACCESS TOKEN'
|
||||||
|
end
|
||||||
|
|
||||||
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
|
pet_id = 789 # Integer | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
#Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||||
|
result = api_instance.get_pet_by_id_in_object(pet_id)
|
||||||
|
p result
|
||||||
|
rescue Petstore::ApiError => e
|
||||||
|
puts "Exception when calling PetApi->get_pet_by_id_in_object: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **Integer**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**InlineResponse200**](InlineResponse200.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# **pet_pet_idtesting_byte_arraytrue_get**
|
||||||
|
> String pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||||
|
|
||||||
|
Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
|
||||||
|
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```ruby
|
||||||
|
# load the gem
|
||||||
|
require 'petstore'
|
||||||
|
# setup authorization
|
||||||
|
Petstore.configure do |config|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
config.api_key['api_key'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
config.access_token = 'YOUR ACCESS TOKEN'
|
||||||
|
end
|
||||||
|
|
||||||
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
|
pet_id = 789 # Integer | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
#Fake endpoint to test byte array return by 'Find pet by ID'
|
||||||
|
result = api_instance.pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||||
|
p result
|
||||||
|
rescue Petstore::ApiError => e
|
||||||
|
puts "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **Integer**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**String**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# **update_pet**
|
# **update_pet**
|
||||||
> update_pet(body)
|
> update_pet(opts)
|
||||||
|
|
||||||
Update an existing pet
|
Update an existing pet
|
||||||
|
|
||||||
@ -297,12 +472,13 @@ end
|
|||||||
|
|
||||||
api_instance = Petstore::PetApi.new
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
opts = {
|
||||||
|
body: Petstore::Pet.new # Pet | Pet object that needs to be added to the store
|
||||||
|
}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
#Update an existing pet
|
#Update an existing pet
|
||||||
api_instance.update_pet(body)
|
api_instance.update_pet(opts)
|
||||||
rescue Petstore::ApiError => e
|
rescue Petstore::ApiError => e
|
||||||
puts "Exception when calling PetApi->update_pet: #{e}"
|
puts "Exception when calling PetApi->update_pet: #{e}"
|
||||||
end
|
end
|
||||||
@ -312,7 +488,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -322,10 +498,10 @@ nil (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, application/xml
|
- **Content-Type**: application/json, application/xml
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -348,7 +524,7 @@ end
|
|||||||
|
|
||||||
api_instance = Petstore::PetApi.new
|
api_instance = Petstore::PetApi.new
|
||||||
|
|
||||||
pet_id = 789 # Integer | ID of pet that needs to be updated
|
pet_id = "pet_id_example" # String | ID of pet that needs to be updated
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
name: "name_example", # String | Updated name of the pet
|
name: "name_example", # String | Updated name of the pet
|
||||||
@ -367,7 +543,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pet_id** | **Integer**| ID of pet that needs to be updated |
|
**pet_id** | **String**| ID of pet that needs to be updated |
|
||||||
**name** | **String**| Updated name of the pet | [optional]
|
**name** | **String**| Updated name of the pet | [optional]
|
||||||
**status** | **String**| Updated status of the pet | [optional]
|
**status** | **String**| Updated status of the pet | [optional]
|
||||||
|
|
||||||
@ -379,15 +555,15 @@ nil (empty response body)
|
|||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/x-www-form-urlencoded
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# **upload_file**
|
# **upload_file**
|
||||||
> ApiResponse upload_file(pet_id, opts)
|
> upload_file(pet_id, opts)
|
||||||
|
|
||||||
uploads an image
|
uploads an image
|
||||||
|
|
||||||
@ -414,8 +590,7 @@ opts = {
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
#uploads an image
|
#uploads an image
|
||||||
result = api_instance.upload_file(pet_id, opts)
|
api_instance.upload_file(pet_id, opts)
|
||||||
p result
|
|
||||||
rescue Petstore::ApiError => e
|
rescue Petstore::ApiError => e
|
||||||
puts "Exception when calling PetApi->upload_file: #{e}"
|
puts "Exception when calling PetApi->upload_file: #{e}"
|
||||||
end
|
end
|
||||||
@ -431,16 +606,16 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
[**ApiResponse**](ApiResponse.md)
|
nil (empty response body)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,9 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
[**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status
|
||||||
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
[**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
@ -49,10 +51,70 @@ nil (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# **find_orders_by_status**
|
||||||
|
> Array<Order> find_orders_by_status(opts)
|
||||||
|
|
||||||
|
Finds orders by status
|
||||||
|
|
||||||
|
A single status value can be provided as a string
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```ruby
|
||||||
|
# load the gem
|
||||||
|
require 'petstore'
|
||||||
|
# setup authorization
|
||||||
|
Petstore.configure do |config|
|
||||||
|
# Configure API key authorization: test_api_client_id
|
||||||
|
config.api_key['x-test_api_client_id'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_client_secret
|
||||||
|
config.api_key['x-test_api_client_secret'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||||
|
end
|
||||||
|
|
||||||
|
api_instance = Petstore::StoreApi.new
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
status: "placed" # String | Status value that needs to be considered for query
|
||||||
|
}
|
||||||
|
|
||||||
|
begin
|
||||||
|
#Finds orders by status
|
||||||
|
result = api_instance.find_orders_by_status(opts)
|
||||||
|
p result
|
||||||
|
rescue Petstore::ApiError => e
|
||||||
|
puts "Exception when calling StoreApi->find_orders_by_status: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**status** | **String**| Status value that needs to be considered for query | [optional] [default to placed]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Array<Order>**](Order.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -97,10 +159,58 @@ This endpoint does not need any parameter.
|
|||||||
|
|
||||||
[api_key](../README.md#api_key)
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# **get_inventory_in_object**
|
||||||
|
> Object get_inventory_in_object
|
||||||
|
|
||||||
|
Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
|
||||||
|
Returns an arbitrary object which is actually a map of status codes to quantities
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```ruby
|
||||||
|
# load the gem
|
||||||
|
require 'petstore'
|
||||||
|
# setup authorization
|
||||||
|
Petstore.configure do |config|
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
config.api_key['api_key'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['api_key'] = 'BEARER'
|
||||||
|
end
|
||||||
|
|
||||||
|
api_instance = Petstore::StoreApi.new
|
||||||
|
|
||||||
|
begin
|
||||||
|
#Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||||
|
result = api_instance.get_inventory_in_object
|
||||||
|
p result
|
||||||
|
rescue Petstore::ApiError => e
|
||||||
|
puts "Exception when calling StoreApi->get_inventory_in_object: #{e}"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Object**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key](../README.md#api_key)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -115,10 +225,22 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
```ruby
|
```ruby
|
||||||
# load the gem
|
# load the gem
|
||||||
require 'petstore'
|
require 'petstore'
|
||||||
|
# setup authorization
|
||||||
|
Petstore.configure do |config|
|
||||||
|
# Configure API key authorization: test_api_key_header
|
||||||
|
config.api_key['test_api_key_header'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['test_api_key_header'] = 'BEARER'
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_key_query
|
||||||
|
config.api_key['test_api_key_query'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['test_api_key_query'] = 'BEARER'
|
||||||
|
end
|
||||||
|
|
||||||
api_instance = Petstore::StoreApi.new
|
api_instance = Petstore::StoreApi.new
|
||||||
|
|
||||||
order_id = 789 # Integer | ID of pet that needs to be fetched
|
order_id = "order_id_example" # String | ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -134,7 +256,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**order_id** | **Integer**| ID of pet that needs to be fetched |
|
**order_id** | **String**| ID of pet that needs to be fetched |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -142,17 +264,17 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# **place_order**
|
# **place_order**
|
||||||
> Order place_order(body)
|
> Order place_order(opts)
|
||||||
|
|
||||||
Place an order for a pet
|
Place an order for a pet
|
||||||
|
|
||||||
@ -162,15 +284,28 @@ Place an order for a pet
|
|||||||
```ruby
|
```ruby
|
||||||
# load the gem
|
# load the gem
|
||||||
require 'petstore'
|
require 'petstore'
|
||||||
|
# setup authorization
|
||||||
|
Petstore.configure do |config|
|
||||||
|
# Configure API key authorization: test_api_client_id
|
||||||
|
config.api_key['x-test_api_client_id'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['x-test_api_client_id'] = 'BEARER'
|
||||||
|
|
||||||
|
# Configure API key authorization: test_api_client_secret
|
||||||
|
config.api_key['x-test_api_client_secret'] = 'YOUR API KEY'
|
||||||
|
# Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
|
||||||
|
#config.api_key_prefix['x-test_api_client_secret'] = 'BEARER'
|
||||||
|
end
|
||||||
|
|
||||||
api_instance = Petstore::StoreApi.new
|
api_instance = Petstore::StoreApi.new
|
||||||
|
|
||||||
body = Petstore::Order.new # Order | order placed for purchasing the pet
|
opts = {
|
||||||
|
body: Petstore::Order.new # Order | order placed for purchasing the pet
|
||||||
|
}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
#Place an order for a pet
|
#Place an order for a pet
|
||||||
result = api_instance.place_order(body)
|
result = api_instance.place_order(opts)
|
||||||
p result
|
p result
|
||||||
rescue Petstore::ApiError => e
|
rescue Petstore::ApiError => e
|
||||||
puts "Exception when calling StoreApi->place_order: #{e}"
|
puts "Exception when calling StoreApi->place_order: #{e}"
|
||||||
@ -181,7 +316,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -189,12 +324,12 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/json, application/xml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ nil (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -99,7 +99,7 @@ nil (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -145,7 +145,7 @@ nil (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -191,7 +191,7 @@ nil (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -238,7 +238,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -288,7 +288,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -328,7 +328,7 @@ nil (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
@ -377,7 +377,7 @@ nil (empty response body)
|
|||||||
|
|
||||||
No authorization required
|
No authorization required
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
|
@ -159,7 +159,7 @@
|
|||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<properties>
|
<properties>
|
||||||
<swagger-core-version>1.5.7</swagger-core-version>
|
<swagger-core-version>1.5.8</swagger-core-version>
|
||||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||||
<jersey-version>1.13</jersey-version>
|
<jersey-version>1.13</jersey-version>
|
||||||
<slf4j-version>1.6.3</slf4j-version>
|
<slf4j-version>1.6.3</slf4j-version>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-02-26T13:59:02.543Z")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00")
|
||||||
public class ApiException extends Exception{
|
public class ApiException extends Exception{
|
||||||
private int code;
|
private int code;
|
||||||
public ApiException (int code, String msg) {
|
public ApiException (int code, String msg) {
|
||||||
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
|||||||
import javax.servlet.*;
|
import javax.servlet.*;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-02-26T13:59:02.543Z")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00")
|
||||||
public class ApiOriginFilter implements javax.servlet.Filter {
|
public class ApiOriginFilter implements javax.servlet.Filter {
|
||||||
@Override
|
@Override
|
||||||
public void doFilter(ServletRequest request, ServletResponse response,
|
public void doFilter(ServletRequest request, ServletResponse response,
|
||||||
|
@ -3,7 +3,7 @@ package io.swagger.api;
|
|||||||
import javax.xml.bind.annotation.XmlTransient;
|
import javax.xml.bind.annotation.XmlTransient;
|
||||||
|
|
||||||
@javax.xml.bind.annotation.XmlRootElement
|
@javax.xml.bind.annotation.XmlRootElement
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-02-26T13:59:02.543Z")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00")
|
||||||
public class ApiResponseMessage {
|
public class ApiResponseMessage {
|
||||||
public static final int ERROR = 1;
|
public static final int ERROR = 1;
|
||||||
public static final int WARNING = 2;
|
public static final int WARNING = 2;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-02-26T13:59:02.543Z")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringMVCServerCodegen", date = "2016-04-17T17:50:52.711+08:00")
|
||||||
public class NotFoundException extends ApiException {
|
public class NotFoundException extends ApiException {
|
||||||
private int code;
|
private int code;
|
||||||
public NotFoundException (int code, String msg) {
|
public NotFoundException (int code, String msg) {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user