forked from loafle/openapi-generator-original
add new files
This commit is contained in:
parent
79decc53a1
commit
0b42b533d9
52
modules/swagger-codegen/src/main/resources/flash/git_push.sh.mustache
Executable file
52
modules/swagger-codegen/src/main/resources/flash/git_push.sh.mustache
Executable 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="{{{gitUserId}}}"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="{{{gitRepoId}}}"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="{{{releaseNote}}}"
|
||||
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'
|
||||
|
@ -0,0 +1,11 @@
|
||||
# Build and Release Folders
|
||||
bin/
|
||||
bin-debug/
|
||||
bin-release/
|
||||
|
||||
# Other files and folders
|
||||
.settings/
|
||||
|
||||
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||
# should NOT be excluded as they contain compiler settings and other important
|
||||
# information for Eclipse / Flash Builder.
|
@ -0,0 +1,11 @@
|
||||
package io.swagger.client.model
|
||||
|
||||
import org.joda.time.DateTime
|
||||
import java.util.UUID
|
||||
|
||||
|
||||
case class ApiResponse (
|
||||
code: Option[Integer],
|
||||
_type: Option[String],
|
||||
message: Option[String]
|
||||
)
|
@ -0,0 +1,80 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ApiResponse
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class ApiResponseTests
|
||||
{
|
||||
private ApiResponse instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
instance = new ApiResponse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ApiResponse
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ApiResponseInstanceTest()
|
||||
{
|
||||
Assert.IsInstanceOf<ApiResponse> (instance, "instance is a ApiResponse");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Code'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CodeTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Code'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Type'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TypeTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Type'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Message'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void MessageTest()
|
||||
{
|
||||
// TODO: unit test for the property 'Message'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
27
samples/client/petstore/dart/.gitignore
vendored
Normal file
27
samples/client/petstore/dart/.gitignore
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
# See https://www.dartlang.org/tools/private-files.html
|
||||
|
||||
# Files and directories created by pub
|
||||
.buildlog
|
||||
.packages
|
||||
.project
|
||||
.pub/
|
||||
build/
|
||||
**/packages/
|
||||
|
||||
# Files created by dart2js
|
||||
# (Most Dart developers will use pub build to compile Dart, use/modify these
|
||||
# rules if you intend to use dart2js directly
|
||||
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
|
||||
# differentiate from explicit Javascript files)
|
||||
*.dart.js
|
||||
*.part.js
|
||||
*.js.deps
|
||||
*.js.map
|
||||
*.info.json
|
||||
|
||||
# Directory created by dartdoc
|
||||
doc/api/
|
||||
|
||||
# Don't commit pubspec lock file
|
||||
# (Library packages only! Remove pattern if developing an application package)
|
||||
pubspec.lock
|
52
samples/client/petstore/dart/git_push.sh
Normal file
52
samples/client/petstore/dart/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'
|
||||
|
23
samples/client/petstore/dart/lib/model/api_response.dart
Normal file
23
samples/client/petstore/dart/lib/model/api_response.dart
Normal file
@ -0,0 +1,23 @@
|
||||
part of api;
|
||||
|
||||
|
||||
@Entity()
|
||||
class ApiResponse {
|
||||
|
||||
int code = null;
|
||||
|
||||
|
||||
String type = null;
|
||||
|
||||
|
||||
String message = null;
|
||||
|
||||
ApiResponse();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ApiResponse[code=$code, type=$type, message=$message, ]';
|
||||
}
|
||||
|
||||
}
|
||||
|
1
samples/client/petstore/dart/test/packages
Symbolic link
1
samples/client/petstore/dart/test/packages
Symbolic link
@ -0,0 +1 @@
|
||||
../packages
|
11
samples/client/petstore/flash/.gitignore
vendored
Normal file
11
samples/client/petstore/flash/.gitignore
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
# Build and Release Folders
|
||||
bin/
|
||||
bin-debug/
|
||||
bin-release/
|
||||
|
||||
# Other files and folders
|
||||
.settings/
|
||||
|
||||
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||
# should NOT be excluded as they contain compiler settings and other important
|
||||
# information for Eclipse / Flash Builder.
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
|
||||
[XmlRootNode(name="200Response")]
|
||||
public class 200Response {
|
||||
[XmlElement(name="name")]
|
||||
public var name: Number = 0;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "200Response: ";
|
||||
str += " (name: " + name + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
|
||||
public class 200ResponseList implements ListWrapper {
|
||||
// This declaration below of _200_response_obj_class is to force flash compiler to include this class
|
||||
private var _200Response__obj_class: io.swagger.client.model.200Response = null;
|
||||
[XmlElements(name="200Response_", type="io.swagger.client.model.200Response")]
|
||||
public var 200Response_: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return 200Response_;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
|
||||
[XmlRootNode(name="Animal")]
|
||||
public class Animal {
|
||||
[XmlElement(name="className")]
|
||||
public var className: String = null;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "Animal: ";
|
||||
str += " (className: " + className + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
|
||||
public class AnimalList implements ListWrapper {
|
||||
// This declaration below of _Animal_obj_class is to force flash compiler to include this class
|
||||
private var _animal_obj_class: io.swagger.client.model.Animal = null;
|
||||
[XmlElements(name="animal", type="io.swagger.client.model.Animal")]
|
||||
public var animal: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return animal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.client.model.Animal;
|
||||
|
||||
[XmlRootNode(name="Cat")]
|
||||
public class Cat {
|
||||
[XmlElement(name="className")]
|
||||
public var className: String = null;
|
||||
[XmlElement(name="declawed")]
|
||||
public var declawed: Boolean = false;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "Cat: ";
|
||||
str += " (className: " + className + ")";
|
||||
str += " (declawed: " + declawed + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
import io.swagger.client.model.Animal;
|
||||
|
||||
public class CatList implements ListWrapper {
|
||||
// This declaration below of _Cat_obj_class is to force flash compiler to include this class
|
||||
private var _cat_obj_class: io.swagger.client.model.Cat = null;
|
||||
[XmlElements(name="cat", type="io.swagger.client.model.Cat")]
|
||||
public var cat: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return cat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.client.model.Animal;
|
||||
|
||||
[XmlRootNode(name="Dog")]
|
||||
public class Dog {
|
||||
[XmlElement(name="className")]
|
||||
public var className: String = null;
|
||||
[XmlElement(name="breed")]
|
||||
public var breed: String = null;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "Dog: ";
|
||||
str += " (className: " + className + ")";
|
||||
str += " (breed: " + breed + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
import io.swagger.client.model.Animal;
|
||||
|
||||
public class DogList implements ListWrapper {
|
||||
// This declaration below of _Dog_obj_class is to force flash compiler to include this class
|
||||
private var _dog_obj_class: io.swagger.client.model.Dog = null;
|
||||
[XmlElements(name="dog", type="io.swagger.client.model.Dog")]
|
||||
public var dog: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return dog;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.client.model.ByteArray;
|
||||
|
||||
[XmlRootNode(name="FormatTest")]
|
||||
public class FormatTest {
|
||||
[XmlElement(name="integer")]
|
||||
public var integer: Number = NaN;
|
||||
[XmlElement(name="int32")]
|
||||
public var int32: Number = 0;
|
||||
[XmlElement(name="int64")]
|
||||
public var int64: Number = 0;
|
||||
[XmlElement(name="number")]
|
||||
public var number: Number = NaN;
|
||||
[XmlElement(name="float")]
|
||||
public var float: Number = 0.0;
|
||||
[XmlElement(name="double")]
|
||||
public var double: Number = 0.0;
|
||||
[XmlElement(name="string")]
|
||||
public var string: String = null;
|
||||
[XmlElement(name="byte")]
|
||||
public var byte: ByteArray = NaN;
|
||||
[XmlElement(name="binary")]
|
||||
public var binary: String = NaN;
|
||||
[XmlElement(name="date")]
|
||||
public var date: Date = null;
|
||||
[XmlElement(name="dateTime")]
|
||||
public var dateTime: Date = null;
|
||||
[XmlElement(name="password")]
|
||||
public var password: String = null;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "FormatTest: ";
|
||||
str += " (integer: " + integer + ")";
|
||||
str += " (int32: " + int32 + ")";
|
||||
str += " (int64: " + int64 + ")";
|
||||
str += " (number: " + number + ")";
|
||||
str += " (float: " + float + ")";
|
||||
str += " (double: " + double + ")";
|
||||
str += " (string: " + string + ")";
|
||||
str += " (byte: " + byte + ")";
|
||||
str += " (binary: " + binary + ")";
|
||||
str += " (date: " + date + ")";
|
||||
str += " (dateTime: " + dateTime + ")";
|
||||
str += " (password: " + password + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
import io.swagger.client.model.ByteArray;
|
||||
|
||||
public class FormatTestList implements ListWrapper {
|
||||
// This declaration below of _format_test_obj_class is to force flash compiler to include this class
|
||||
private var _formatTest_obj_class: io.swagger.client.model.FormatTest = null;
|
||||
[XmlElements(name="formatTest", type="io.swagger.client.model.FormatTest")]
|
||||
public var formatTest: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return formatTest;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.client.model.Object;
|
||||
import io.swagger.client.model.Tag;
|
||||
|
||||
[XmlRootNode(name="InlineResponse200")]
|
||||
public class InlineResponse200 {
|
||||
// This declaration below of _tags_obj_class is to force flash compiler to include this class
|
||||
private var _tags_obj_class: Array = null;
|
||||
[XmlElementWrapper(name="tags")]
|
||||
[XmlElements(name="tags", type="Array")]
|
||||
public var tags: Array = new Array();
|
||||
[XmlElement(name="id")]
|
||||
public var id: Number = 0;
|
||||
[XmlElement(name="category")]
|
||||
public var category: Object = NaN;
|
||||
/* pet status in the store */
|
||||
[XmlElement(name="status")]
|
||||
public var status: String = null;
|
||||
[XmlElement(name="name")]
|
||||
public var name: String = null;
|
||||
// This declaration below of _photoUrls_obj_class is to force flash compiler to include this class
|
||||
private var _photoUrls_obj_class: Array = null;
|
||||
[XmlElementWrapper(name="photoUrls")]
|
||||
[XmlElements(name="photoUrls", type="Array")]
|
||||
public var photoUrls: Array = new Array();
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "InlineResponse200: ";
|
||||
str += " (tags: " + tags + ")";
|
||||
str += " (id: " + id + ")";
|
||||
str += " (category: " + category + ")";
|
||||
str += " (status: " + status + ")";
|
||||
str += " (name: " + name + ")";
|
||||
str += " (photoUrls: " + photoUrls + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
import io.swagger.client.model.Object;
|
||||
import io.swagger.client.model.Tag;
|
||||
|
||||
public class InlineResponse200List implements ListWrapper {
|
||||
// This declaration below of _inline_response_200_obj_class is to force flash compiler to include this class
|
||||
private var _inlineResponse200_obj_class: io.swagger.client.model.InlineResponse200 = null;
|
||||
[XmlElements(name="inlineResponse200", type="io.swagger.client.model.InlineResponse200")]
|
||||
public var inlineResponse200: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return inlineResponse200;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
|
||||
[XmlRootNode(name="ModelReturn")]
|
||||
public class ModelReturn {
|
||||
[XmlElement(name="return")]
|
||||
public var return_: Number = 0;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "ModelReturn: ";
|
||||
str += " (return_: " + return_ + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
|
||||
public class ModelReturnList implements ListWrapper {
|
||||
// This declaration below of _Return_obj_class is to force flash compiler to include this class
|
||||
private var _return__obj_class: io.swagger.client.model.ModelReturn = null;
|
||||
[XmlElements(name="return_", type="io.swagger.client.model.ModelReturn")]
|
||||
public var return_: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return return_;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
|
||||
[XmlRootNode(name="Name")]
|
||||
public class Name {
|
||||
[XmlElement(name="name")]
|
||||
public var name: Number = 0;
|
||||
[XmlElement(name="snake_case")]
|
||||
public var snakeCase: Number = 0;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "Name: ";
|
||||
str += " (name: " + name + ")";
|
||||
str += " (snakeCase: " + snakeCase + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
|
||||
public class NameList implements ListWrapper {
|
||||
// This declaration below of _Name_obj_class is to force flash compiler to include this class
|
||||
private var _name_obj_class: io.swagger.client.model.Name = null;
|
||||
[XmlElements(name="name", type="io.swagger.client.model.Name")]
|
||||
public var name: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
|
||||
[XmlRootNode(name="SpecialModelName")]
|
||||
public class SpecialModelName {
|
||||
[XmlElement(name="$special[property.name]")]
|
||||
public var $Special[propertyName]: Number = 0;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "SpecialModelName: ";
|
||||
str += " ($Special[propertyName]: " + $Special[propertyName] + ")";
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.swagger.client.model {
|
||||
|
||||
import io.swagger.common.ListWrapper;
|
||||
|
||||
public class SpecialModelNameList implements ListWrapper {
|
||||
// This declaration below of _$special[model.name]_obj_class is to force flash compiler to include this class
|
||||
private var _$Special[modelName]_obj_class: io.swagger.client.model.SpecialModelName = null;
|
||||
[XmlElements(name="$Special[modelName]", type="io.swagger.client.model.SpecialModelName")]
|
||||
public var $Special[modelName]: Array = new Array();
|
||||
|
||||
public function getList(): Array{
|
||||
return $Special[modelName];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
52
samples/client/petstore/flash/git_push.sh
Normal file
52
samples/client/petstore/flash/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'
|
||||
|
17
samples/client/petstore/perl/docs/ApiResponse.md
Normal file
17
samples/client/petstore/perl/docs/ApiResponse.md
Normal file
@ -0,0 +1,17 @@
|
||||
# WWW::SwaggerClient::Object::ApiResponse
|
||||
|
||||
## Load the model package
|
||||
```perl
|
||||
use WWW::SwaggerClient::Object::ApiResponse;
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | | [optional]
|
||||
**type** | **string** | | [optional]
|
||||
**message** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -0,0 +1,144 @@
|
||||
package WWW::SwaggerClient::Object::ApiResponse;
|
||||
|
||||
require 5.6.0;
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use JSON qw(decode_json);
|
||||
use Data::Dumper;
|
||||
use Module::Runtime qw(use_module);
|
||||
use Log::Any qw($log);
|
||||
use Date::Parse;
|
||||
use DateTime;
|
||||
|
||||
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
#NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
|
||||
#
|
||||
|
||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
||||
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||
|
||||
# new object
|
||||
sub new {
|
||||
my ($class, %args) = @_;
|
||||
|
||||
my $self = bless {}, $class;
|
||||
|
||||
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||
my $args_key = $class->attribute_map->{$attribute};
|
||||
$self->$attribute( $args{ $args_key } );
|
||||
}
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
# return perl hash
|
||||
sub to_hash {
|
||||
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||
}
|
||||
|
||||
# used by JSON for serialization
|
||||
sub TO_JSON {
|
||||
my $self = shift;
|
||||
my $_data = {};
|
||||
foreach my $_key (keys %{$self->attribute_map}) {
|
||||
if (defined $self->{$_key}) {
|
||||
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||
}
|
||||
}
|
||||
return $_data;
|
||||
}
|
||||
|
||||
# from Perl hashref
|
||||
sub from_hash {
|
||||
my ($self, $hash) = @_;
|
||||
|
||||
# loop through attributes and use swagger_types to deserialize the data
|
||||
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||
my $_json_attribute = $self->attribute_map->{$_key};
|
||||
if ($_type =~ /^array\[/i) { # array
|
||||
my $_subclass = substr($_type, 6, -1);
|
||||
my @_array = ();
|
||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||
push @_array, $self->_deserialize($_subclass, $_element);
|
||||
}
|
||||
$self->{$_key} = \@_array;
|
||||
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||
} else {
|
||||
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||
}
|
||||
}
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
# deserialize non-array data
|
||||
sub _deserialize {
|
||||
my ($self, $type, $data) = @_;
|
||||
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||
|
||||
if ($type eq 'DateTime') {
|
||||
return DateTime->from_epoch(epoch => str2time($data));
|
||||
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||
return $data;
|
||||
} else { # hash(model)
|
||||
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||
return $_instance->from_hash($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
__PACKAGE__->class_documentation({description => '',
|
||||
class => 'ApiResponse',
|
||||
required => [], # TODO
|
||||
} );
|
||||
|
||||
__PACKAGE__->method_documentation({
|
||||
'code' => {
|
||||
datatype => 'int',
|
||||
base_name => 'code',
|
||||
description => '',
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
'type' => {
|
||||
datatype => 'string',
|
||||
base_name => 'type',
|
||||
description => '',
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
'message' => {
|
||||
datatype => 'string',
|
||||
base_name => 'message',
|
||||
description => '',
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
});
|
||||
|
||||
__PACKAGE__->swagger_types( {
|
||||
'code' => 'int',
|
||||
'type' => 'string',
|
||||
'message' => 'string'
|
||||
} );
|
||||
|
||||
__PACKAGE__->attribute_map( {
|
||||
'code' => 'code',
|
||||
'type' => 'type',
|
||||
'message' => 'message'
|
||||
} );
|
||||
|
||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||
|
||||
|
||||
1;
|
17
samples/client/petstore/perl/t/ApiResponseTest.t
Normal file
17
samples/client/petstore/perl/t/ApiResponseTest.t
Normal file
@ -0,0 +1,17 @@
|
||||
# NOTE: This class is auto generated by the Swagger Codegen
|
||||
# Please update the test case below to test the model.
|
||||
|
||||
use Test::More tests => 2;
|
||||
use Test::Exception;
|
||||
|
||||
use lib 'lib';
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
use_ok('WWW::SwaggerClient::Object::ApiResponse');
|
||||
|
||||
my $instance = WWW::SwaggerClient::Object::ApiResponse->new();
|
||||
|
||||
isa_ok($instance, 'WWW::SwaggerClient::Object::ApiResponse');
|
||||
|
@ -0,0 +1,12 @@
|
||||
# ApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | | [optional]
|
||||
**type** | **string** | | [optional]
|
||||
**message** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -0,0 +1,254 @@
|
||||
<?php
|
||||
/**
|
||||
* ApiResponse
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author http://github.com/swagger-api/swagger-codegen
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
/**
|
||||
* Copyright 2016 SmartBear Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
/**
|
||||
* ApiResponse Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description
|
||||
* @package Swagger\Client
|
||||
* @author http://github.com/swagger-api/swagger-codegen
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class ApiResponse implements ArrayAccess
|
||||
{
|
||||
/**
|
||||
* The original name of the model.
|
||||
* @var string
|
||||
*/
|
||||
static $swaggerModelName = 'ApiResponse';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
* @var string[]
|
||||
*/
|
||||
static $swaggerTypes = array(
|
||||
'code' => 'int',
|
||||
'type' => 'string',
|
||||
'message' => 'string'
|
||||
);
|
||||
|
||||
static function swaggerTypes() {
|
||||
return self::$swaggerTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name, and the value is the original name
|
||||
* @var string[]
|
||||
*/
|
||||
static $attributeMap = array(
|
||||
'code' => 'code',
|
||||
'type' => 'type',
|
||||
'message' => 'message'
|
||||
);
|
||||
|
||||
static function attributeMap() {
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
* @var string[]
|
||||
*/
|
||||
static $setters = array(
|
||||
'code' => 'setCode',
|
||||
'type' => 'setType',
|
||||
'message' => 'setMessage'
|
||||
);
|
||||
|
||||
static function setters() {
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
* @var string[]
|
||||
*/
|
||||
static $getters = array(
|
||||
'code' => 'getCode',
|
||||
'type' => 'getType',
|
||||
'message' => 'getMessage'
|
||||
);
|
||||
|
||||
static function getters() {
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* $code
|
||||
* @var int
|
||||
*/
|
||||
protected $code;
|
||||
/**
|
||||
* $type
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
/**
|
||||
* $message
|
||||
* @var string
|
||||
*/
|
||||
protected $message;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param mixed[] $data Associated array of property value initalizing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
|
||||
|
||||
if ($data != null) {
|
||||
$this->code = $data["code"];
|
||||
$this->type = $data["type"];
|
||||
$this->message = $data["message"];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Gets code
|
||||
* @return int
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets code
|
||||
* @param int $code
|
||||
* @return $this
|
||||
*/
|
||||
public function setCode($code)
|
||||
{
|
||||
|
||||
$this->code = $code;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Gets type
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
* @param string $type
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Gets message
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets message
|
||||
* @param string $message
|
||||
* @return $this
|
||||
*/
|
||||
public function setMessage($message)
|
||||
{
|
||||
|
||||
$this->message = $message;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
* @param integer $offset Offset
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->$offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
* @param integer $offset Offset
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->$offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
$this->$offset = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
* @param integer $offset Offset
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->$offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* ApiResponseTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author http://github.com/swagger-api/swagger-codegen
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
/**
|
||||
* Copyright 2016 SmartBear Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
/**
|
||||
* ApiResponseTest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description
|
||||
* @package Swagger\Client
|
||||
* @author http://github.com/swagger-api/swagger-codegen
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class ApiResponseTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public static function setUpBeforeClass() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public static function tearDownAfterClass() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test ApiResponse
|
||||
*/
|
||||
public function testApiResponse() {
|
||||
|
||||
}
|
||||
|
||||
}
|
12
samples/client/petstore/python/docs/ApiResponse.md
Normal file
12
samples/client/petstore/python/docs/ApiResponse.md
Normal file
@ -0,0 +1,12 @@
|
||||
# ApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | | [optional]
|
||||
**type** | **str** | | [optional]
|
||||
**message** | **str** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -0,0 +1,170 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Copyright 2016 SmartBear Software
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Ref: https://github.com/swagger-api/swagger-codegen
|
||||
"""
|
||||
|
||||
from pprint import pformat
|
||||
from six import iteritems
|
||||
|
||||
|
||||
class ApiResponse(object):
|
||||
"""
|
||||
NOTE: This class is auto generated by the swagger code generator program.
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
def __init__(self):
|
||||
"""
|
||||
ApiResponse - a model defined in Swagger
|
||||
|
||||
:param dict swaggerTypes: The key is attribute name
|
||||
and the value is attribute type.
|
||||
:param dict attributeMap: The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
self.swagger_types = {
|
||||
'code': 'int',
|
||||
'type': 'str',
|
||||
'message': 'str'
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'code': 'code',
|
||||
'type': 'type',
|
||||
'message': 'message'
|
||||
}
|
||||
|
||||
self._code = None
|
||||
self._type = None
|
||||
self._message = None
|
||||
|
||||
@property
|
||||
def code(self):
|
||||
"""
|
||||
Gets the code of this ApiResponse.
|
||||
|
||||
|
||||
:return: The code of this ApiResponse.
|
||||
:rtype: int
|
||||
"""
|
||||
return self._code
|
||||
|
||||
@code.setter
|
||||
def code(self, code):
|
||||
"""
|
||||
Sets the code of this ApiResponse.
|
||||
|
||||
|
||||
:param code: The code of this ApiResponse.
|
||||
:type: int
|
||||
"""
|
||||
self._code = code
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
Gets the type of this ApiResponse.
|
||||
|
||||
|
||||
:return: The type of this ApiResponse.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._type
|
||||
|
||||
@type.setter
|
||||
def type(self, type):
|
||||
"""
|
||||
Sets the type of this ApiResponse.
|
||||
|
||||
|
||||
:param type: The type of this ApiResponse.
|
||||
:type: str
|
||||
"""
|
||||
self._type = type
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
"""
|
||||
Gets the message of this ApiResponse.
|
||||
|
||||
|
||||
:return: The message of this ApiResponse.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._message
|
||||
|
||||
@message.setter
|
||||
def message(self, message):
|
||||
"""
|
||||
Sets the message of this ApiResponse.
|
||||
|
||||
|
||||
:param message: The message of this ApiResponse.
|
||||
:type: str
|
||||
"""
|
||||
self._message = message
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Returns the model properties as a dict
|
||||
"""
|
||||
result = {}
|
||||
|
||||
for attr, _ in iteritems(self.swagger_types):
|
||||
value = getattr(self, attr)
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""
|
||||
Returns the string representation of the model
|
||||
"""
|
||||
return pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""
|
||||
For `print` and `pprint`
|
||||
"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""
|
||||
Returns true if both objects are equal
|
||||
"""
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""
|
||||
Returns true if both objects are not equal
|
||||
"""
|
||||
return not self == other
|
||||
|
@ -0,0 +1,9 @@
|
||||
package io.swagger.client.model
|
||||
|
||||
|
||||
|
||||
|
||||
case class ApiResponse (
|
||||
code: Integer,
|
||||
_type: String,
|
||||
message: String)
|
Loading…
x
Reference in New Issue
Block a user