diff --git a/modules/swagger-codegen-cli/pom.xml b/modules/swagger-codegen-cli/pom.xml index ec0d6875358..5a9efbdd59d 100644 --- a/modules/swagger-codegen-cli/pom.xml +++ b/modules/swagger-codegen-cli/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.1.1 + 2.1.2 ../.. 4.0.0 diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index 1b6712ba32f..195c0c0fe07 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.1.1 + 2.1.2 ../.. 4.0.0 diff --git a/modules/swagger-generator/pom.xml b/modules/swagger-generator/pom.xml index 121c489d551..a7c3caf45dc 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.1.1 + 2.1.2 ../.. swagger-generator diff --git a/pom.xml b/pom.xml index d206403e82b..89c0fc2978c 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.1.1 + 2.1.2 https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/android-java/build.gradle b/samples/client/petstore/android-java/build.gradle index a6c25c358a3..028b56beae6 100644 --- a/samples/client/petstore/android-java/build.gradle +++ b/samples/client/petstore/android-java/build.gradle @@ -1,85 +1,87 @@ - group = 'io.swagger' - project.version = '1.0.0' +group = 'io.swagger' +project.version = '1.0.0' buildscript { -repositories { -jcenter() -} -dependencies { -classpath 'com.android.tools.build:gradle:1.2.2' - classpath 'com.github.dcendents:android-maven-plugin:1.2' -} + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.2.2' + + classpath 'com.github.dcendents:android-maven-plugin:1.2' + + } } allprojects { -repositories { -jcenter() -} + repositories { + jcenter() + } } apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.github.dcendents.android-maven' android { -compileSdkVersion 22 -buildToolsVersion '22.0.0' -defaultConfig { -minSdkVersion 14 -targetSdkVersion 22 -} + compileSdkVersion 22 + buildToolsVersion '22.0.0' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } -// Rename the aar correctly -libraryVariants.all { variant -> -variant.outputs.each { output -> -def outputFile = output.outputFile -if (outputFile != null && outputFile.name.endsWith('.aar')) { -def fileName = "${project.name}-${variant.baseName}-${version}.aar" -output.outputFile = new File(outputFile.parent, fileName) -} -} -} + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } } ext { -swagger_annotations_version = "1.5.0" -gson_version = "2.3.1" -httpclient_version = "4.3.3" -junit_version = "4.8.1" + swagger_annotations_version = "1.5.0" + gson_version = "2.3.1" + httpclient_version = "4.3.3" + junit_version = "4.8.1" } dependencies { -compile "io.swagger:swagger-annotations:$swagger_annotations_version" -compile "com.google.code.gson:gson:$gson_version" -compile "org.apache.httpcomponents:httpcore:$httpclient_version" -compile "org.apache.httpcomponents:httpclient:$httpclient_version" -compile ("org.apache.httpcomponents:httpcore:$httpclient_version") { -exclude(group: 'org.apache.httpcomponents', module: 'httpclient') -} -compile ("org.apache.httpcomponents:httpmime:$httpclient_version") { -exclude(group: 'org.apache.httpcomponents', module: 'httpclient') -} -testCompile "junit:junit:$junit_version" + compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "com.google.code.gson:gson:$gson_version" + compile "org.apache.httpcomponents:httpcore:$httpclient_version" + compile "org.apache.httpcomponents:httpclient:$httpclient_version" + compile ("org.apache.httpcomponents:httpcore:$httpclient_version") { + exclude(group: 'org.apache.httpcomponents', module: 'httpclient') + } + compile ("org.apache.httpcomponents:httpmime:$httpclient_version") { + exclude(group: 'org.apache.httpcomponents', module: 'httpclient') + } + testCompile "junit:junit:$junit_version" } afterEvaluate { -android.libraryVariants.all { variant -> -def task = project.tasks.create "jar${variant.name.capitalize()}", Jar -task.description = "Create jar artifact for ${variant.name}" -task.dependsOn variant.javaCompile -task.from variant.javaCompile.destinationDir -task.destinationDir = project.file("${project.buildDir}/outputs/jar") -task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" -artifacts.add('archives', task); -} + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } } - task sourcesJar(type: Jar) { +task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' - } +} - artifacts { +artifacts { archives sourcesJar - } +} diff --git a/samples/client/petstore/android-java/pom.xml b/samples/client/petstore/android-java/pom.xml index aa8596a1f24..639000ecc6d 100644 --- a/samples/client/petstore/android-java/pom.xml +++ b/samples/client/petstore/android-java/pom.xml @@ -1,158 +1,155 @@ - 4.0.0 - io.swagger - swagger-android-client - jar - swagger-android-client - 1.0.0 - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-android-client + jar + swagger-android-client + 1.0.0 + + scm:git:git@github.com:swagger-api/swagger-mustache.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - - 1.6 - 1.6 - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - com.google.code.gson - gson - ${gson-version} - - - org.apache.httpcomponents - httpclient - ${httpclient-version} - compile - - - org.apache.httpcomponents - httpmime - ${httpclient-version} - compile - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + com.google.code.gson + gson + ${gson-version} + + + org.apache.httpcomponents + httpclient + ${httpclient-version} + compile + + + org.apache.httpcomponents + httpmime + ${httpclient-version} + compile + - - - junit - junit - ${junit-version} - test - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - - 1.5.0 - 2.3.1 - 4.8.1 - 1.0.0 - 4.8.1 - 4.3.6 - + + + junit + junit + ${junit-version} + test + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + + 1.5.0 + 2.3.1 + 4.8.1 + 1.0.0 + 4.8.1 + 4.3.6 + \ No newline at end of file diff --git a/samples/client/petstore/android-java/src/main/AndroidManifest.xml b/samples/client/petstore/android-java/src/main/AndroidManifest.xml index 1850229fc17..3042699fd86 100644 --- a/samples/client/petstore/android-java/src/main/AndroidManifest.xml +++ b/samples/client/petstore/android-java/src/main/AndroidManifest.xml @@ -1,3 +1,3 @@ - + diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/ApiException.java index 6f0c84c465a..31bc8a0978a 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/ApiException.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/ApiException.java @@ -1,29 +1,29 @@ package io.swagger.client; public class ApiException extends Exception { -int code = 0; -String message = null; + int code = 0; + String message = null; -public ApiException() {} + public ApiException() {} -public ApiException(int code, String message) { -this.code = code; -this.message = message; -} + public ApiException(int code, String message) { + this.code = code; + this.message = message; + } -public int getCode() { -return code; -} - -public void setCode(int code) { -this.code = code; -} - -public String getMessage() { -return message; -} - -public void setMessage(String message) { -this.message = message; -} + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } } \ No newline at end of file diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/ApiInvoker.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/ApiInvoker.java index bc4e7b52026..ec6218e602c 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/ApiInvoker.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/ApiInvoker.java @@ -52,345 +52,338 @@ import javax.net.ssl.X509TrustManager; import com.google.gson.JsonParseException; public class ApiInvoker { -private static ApiInvoker INSTANCE = new ApiInvoker(); -private Map - defaultHeaderMap = new HashMap -(); + private static ApiInvoker INSTANCE = new ApiInvoker(); + private Map defaultHeaderMap = new HashMap(); -private HttpClient client = null; + private HttpClient client = null; -private boolean ignoreSSLCertificates = false; + private boolean ignoreSSLCertificates = false; -private ClientConnectionManager ignoreSSLConnectionManager; + private ClientConnectionManager ignoreSSLConnectionManager; -/** Content type "text/plain" with UTF-8 encoding. */ -public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8); + /** Content type "text/plain" with UTF-8 encoding. */ + public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8); -/** -* ISO 8601 date time format. -* @see https://en.wikipedia.org/wiki/ISO_8601 -*/ -public static final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + /** + * ISO 8601 date time format. + * @see https://en.wikipedia.org/wiki/ISO_8601 + */ + public static final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); -/** -* ISO 8601 date format. -* @see https://en.wikipedia.org/wiki/ISO_8601 -*/ -public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + /** + * ISO 8601 date format. + * @see https://en.wikipedia.org/wiki/ISO_8601 + */ + public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); -static { -// Use UTC as the default time zone. -DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); -DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + static { + // Use UTC as the default time zone. + DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); -// Set default User-Agent. -setUserAgent("Android-Java-Swagger"); -} + // Set default User-Agent. + setUserAgent("Android-Java-Swagger"); + } -public static void setUserAgent(String userAgent) { -INSTANCE.addDefaultHeader("User-Agent", userAgent); -} + public static void setUserAgent(String userAgent) { + INSTANCE.addDefaultHeader("User-Agent", userAgent); + } -public static Date parseDateTime(String str) { -try { -return DATE_TIME_FORMAT.parse(str); -} catch (java.text.ParseException e) { -throw new RuntimeException(e); -} -} + public static Date parseDateTime(String str) { + try { + return DATE_TIME_FORMAT.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } -public static Date parseDate(String str) { -try { -return DATE_FORMAT.parse(str); -} catch (java.text.ParseException e) { -throw new RuntimeException(e); -} -} + public static Date parseDate(String str) { + try { + return DATE_FORMAT.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } -public static String formatDateTime(Date datetime) { -return DATE_TIME_FORMAT.format(datetime); -} + public static String formatDateTime(Date datetime) { + return DATE_TIME_FORMAT.format(datetime); + } -public static String formatDate(Date date) { -return DATE_FORMAT.format(date); -} + public static String formatDate(Date date) { + return DATE_FORMAT.format(date); + } -public static String parameterToString(Object param) { -if (param == null) { -return ""; -} else if (param instanceof Date) { -return formatDateTime((Date) param); -} else if (param instanceof Collection) { -StringBuilder b = new StringBuilder(); -for(Object o : (Collection)param) { -if(b.length() > 0) { -b.append(","); -} -b.append(String.valueOf(o)); -} -return b.toString(); -} else { -return String.valueOf(param); -} -} + public static String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDateTime((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } -public ApiInvoker() { -initConnectionManager(); -} + public ApiInvoker() { + initConnectionManager(); + } -public static ApiInvoker getInstance() { -return INSTANCE; -} + public static ApiInvoker getInstance() { + return INSTANCE; + } -public void ignoreSSLCertificates(boolean ignoreSSLCertificates) { -this.ignoreSSLCertificates = ignoreSSLCertificates; -} + public void ignoreSSLCertificates(boolean ignoreSSLCertificates) { + this.ignoreSSLCertificates = ignoreSSLCertificates; + } -public void addDefaultHeader(String key, String value) { -defaultHeaderMap.put(key, value); -} + public void addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + } -public String escapeString(String str) { -return str; -} + public String escapeString(String str) { + return str; + } -public static Object deserialize(String json, String containerType, Class cls) throws ApiException { -try{ -if("list".equalsIgnoreCase(containerType) || "array".equalsIgnoreCase(containerType)) { -return JsonUtil.deserializeToList(json, cls); -} -else if(String.class.equals(cls)) { -if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) -return json.substring(1, json.length() - 2); -else -return json; -} -else { -return JsonUtil.deserializeToObject(json, cls); -} -} -catch (JsonParseException e) { -throw new ApiException(500, e.getMessage()); -} -} + public static Object deserialize(String json, String containerType, Class cls) throws ApiException { + try{ + if("list".equalsIgnoreCase(containerType) || "array".equalsIgnoreCase(containerType)) { + return JsonUtil.deserializeToList(json, cls); + } + else if(String.class.equals(cls)) { + if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) + return json.substring(1, json.length() - 2); + else + return json; + } + else { + return JsonUtil.deserializeToObject(json, cls); + } + } + catch (JsonParseException e) { + throw new ApiException(500, e.getMessage()); + } + } -public static String serialize(Object obj) throws ApiException { -try { -if (obj != null) -return JsonUtil.serialize(obj); -else -return null; -} -catch (Exception e) { -throw new ApiException(500, e.getMessage()); -} -} + public static String serialize(Object obj) throws ApiException { + try { + if (obj != null) + return JsonUtil.serialize(obj); + else + return null; + } + catch (Exception e) { + throw new ApiException(500, e.getMessage()); + } + } -public String invokeAPI(String host, String path, String method, Map - queryParams, Object body, Map - headerParams, Map - formParams, String contentType) throws ApiException { -HttpClient client = getClient(host); + public String invokeAPI(String host, String path, String method, Map queryParams, Object body, Map headerParams, Map formParams, String contentType) throws ApiException { + HttpClient client = getClient(host); -StringBuilder b = new StringBuilder(); -for(String key : queryParams.keySet()) { -String value = queryParams.get(key); -if (value != null){ -if(b.toString().length() == 0) -b.append("?"); -else -b.append("&"); -b.append(escapeString(key)).append("=").append(escapeString(value)); -} -} -String url = host + path + b.toString(); + StringBuilder b = new StringBuilder(); + for(String key : queryParams.keySet()) { + String value = queryParams.get(key); + if (value != null){ + if(b.toString().length() == 0) + b.append("?"); + else + b.append("&"); + b.append(escapeString(key)).append("=").append(escapeString(value)); + } + } + String url = host + path + b.toString(); -HashMap - headers = new HashMap -(); + HashMap headers = new HashMap(); -for(String key : headerParams.keySet()) { -headers.put(key, headerParams.get(key)); -} + for(String key : headerParams.keySet()) { + headers.put(key, headerParams.get(key)); + } -for(String key : defaultHeaderMap.keySet()) { -if(!headerParams.containsKey(key)) { -headers.put(key, defaultHeaderMap.get(key)); -} -} -headers.put("Accept", "application/json"); + for(String key : defaultHeaderMap.keySet()) { + if(!headerParams.containsKey(key)) { + headers.put(key, defaultHeaderMap.get(key)); + } + } + headers.put("Accept", "application/json"); -// URL encoded string from form parameters -String formParamStr = null; + // URL encoded string from form parameters + String formParamStr = null; -// for form data -if ("application/x-www-form-urlencoded".equals(contentType)) { -StringBuilder formParamBuilder = new StringBuilder(); + // for form data + if ("application/x-www-form-urlencoded".equals(contentType)) { + StringBuilder formParamBuilder = new StringBuilder(); -// encode the form params -for (String key : formParams.keySet()) { -String value = formParams.get(key); -if (value != null && !"".equals(value.trim())) { -if (formParamBuilder.length() > 0) { -formParamBuilder.append("&"); -} -try { -formParamBuilder.append(URLEncoder.encode(key, "utf8")).append("=").append(URLEncoder.encode(value, "utf8")); -} -catch (Exception e) { -// move on to next -} -} -} -formParamStr = formParamBuilder.toString(); -} + // encode the form params + for (String key : formParams.keySet()) { + String value = formParams.get(key); + if (value != null && !"".equals(value.trim())) { + if (formParamBuilder.length() > 0) { + formParamBuilder.append("&"); + } + try { + formParamBuilder.append(URLEncoder.encode(key, "utf8")).append("=").append(URLEncoder.encode(value, "utf8")); + } + catch (Exception e) { + // move on to next + } + } + } + formParamStr = formParamBuilder.toString(); + } -HttpResponse response = null; -try { -if ("GET".equals(method)) { -HttpGet get = new HttpGet(url); -get.addHeader("Accept", "application/json"); -for(String key : headers.keySet()) { -get.setHeader(key, headers.get(key)); -} -response = client.execute(get); -} -else if ("POST".equals(method)) { -HttpPost post = new HttpPost(url); -if (formParamStr != null) { -post.setHeader("Content-Type", contentType); -post.setEntity(new StringEntity(formParamStr, "UTF-8")); -} else if (body != null) { -if (body instanceof HttpEntity) { -// this is for file uploading -post.setEntity((HttpEntity) body); -} else { -post.setHeader("Content-Type", contentType); -post.setEntity(new StringEntity(serialize(body), "UTF-8")); -} -} -for(String key : headers.keySet()) { -post.setHeader(key, headers.get(key)); -} -response = client.execute(post); -} -else if ("PUT".equals(method)) { -HttpPut put = new HttpPut(url); -if (formParamStr != null) { -put.setHeader("Content-Type", contentType); -put.setEntity(new StringEntity(formParamStr, "UTF-8")); -} else if (body != null) { -put.setHeader("Content-Type", contentType); -put.setEntity(new StringEntity(serialize(body), "UTF-8")); -} -for(String key : headers.keySet()) { -put.setHeader(key, headers.get(key)); -} -response = client.execute(put); -} -else if ("DELETE".equals(method)) { -HttpDelete delete = new HttpDelete(url); -for(String key : headers.keySet()) { -delete.setHeader(key, headers.get(key)); -} -response = client.execute(delete); -} -else if ("PATCH".equals(method)) { -HttpPatch patch = new HttpPatch(url); -if (formParamStr != null) { -patch.setHeader("Content-Type", contentType); -patch.setEntity(new StringEntity(formParamStr, "UTF-8")); -} else if (body != null) { -patch.setHeader("Content-Type", contentType); -patch.setEntity(new StringEntity(serialize(body), "UTF-8")); -} -for(String key : headers.keySet()) { -patch.setHeader(key, headers.get(key)); -} -response = client.execute(patch); -} + HttpResponse response = null; + try { + if ("GET".equals(method)) { + HttpGet get = new HttpGet(url); + get.addHeader("Accept", "application/json"); + for(String key : headers.keySet()) { + get.setHeader(key, headers.get(key)); + } + response = client.execute(get); + } + else if ("POST".equals(method)) { + HttpPost post = new HttpPost(url); + if (formParamStr != null) { + post.setHeader("Content-Type", contentType); + post.setEntity(new StringEntity(formParamStr, "UTF-8")); + } else if (body != null) { + if (body instanceof HttpEntity) { + // this is for file uploading + post.setEntity((HttpEntity) body); + } else { + post.setHeader("Content-Type", contentType); + post.setEntity(new StringEntity(serialize(body), "UTF-8")); + } + } + for(String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + response = client.execute(post); + } + else if ("PUT".equals(method)) { + HttpPut put = new HttpPut(url); + if (formParamStr != null) { + put.setHeader("Content-Type", contentType); + put.setEntity(new StringEntity(formParamStr, "UTF-8")); + } else if (body != null) { + put.setHeader("Content-Type", contentType); + put.setEntity(new StringEntity(serialize(body), "UTF-8")); + } + for(String key : headers.keySet()) { + put.setHeader(key, headers.get(key)); + } + response = client.execute(put); + } + else if ("DELETE".equals(method)) { + HttpDelete delete = new HttpDelete(url); + for(String key : headers.keySet()) { + delete.setHeader(key, headers.get(key)); + } + response = client.execute(delete); + } + else if ("PATCH".equals(method)) { + HttpPatch patch = new HttpPatch(url); + if (formParamStr != null) { + patch.setHeader("Content-Type", contentType); + patch.setEntity(new StringEntity(formParamStr, "UTF-8")); + } else if (body != null) { + patch.setHeader("Content-Type", contentType); + patch.setEntity(new StringEntity(serialize(body), "UTF-8")); + } + for(String key : headers.keySet()) { + patch.setHeader(key, headers.get(key)); + } + response = client.execute(patch); + } -int code = response.getStatusLine().getStatusCode(); -String responseString = null; -if(code == 204) -responseString = ""; -else if(code >= 200 && code < 300) { -if(response.getEntity() != null) { -HttpEntity resEntity = response.getEntity(); -responseString = EntityUtils.toString(resEntity); -} -return responseString; -} -else { -if(response.getEntity() != null) { -HttpEntity resEntity = response.getEntity(); -responseString = EntityUtils.toString(resEntity); -} -else -responseString = "no data"; -} -throw new ApiException(code, responseString); -} -catch(IOException e) { -throw new ApiException(500, e.getMessage()); -} -} + int code = response.getStatusLine().getStatusCode(); + String responseString = null; + if(code == 204) + responseString = ""; + else if(code >= 200 && code < 300) { + if(response.getEntity() != null) { + HttpEntity resEntity = response.getEntity(); + responseString = EntityUtils.toString(resEntity); + } + return responseString; + } + else { + if(response.getEntity() != null) { + HttpEntity resEntity = response.getEntity(); + responseString = EntityUtils.toString(resEntity); + } + else + responseString = "no data"; + } + throw new ApiException(code, responseString); + } + catch(IOException e) { + throw new ApiException(500, e.getMessage()); + } + } -private HttpClient getClient(String host) { -if (client == null) { -if (ignoreSSLCertificates && ignoreSSLConnectionManager != null) { -// Trust self signed certificates -client = new DefaultHttpClient(ignoreSSLConnectionManager, new BasicHttpParams()); -} else { -client = new DefaultHttpClient(); -} -} -return client; -} + private HttpClient getClient(String host) { + if (client == null) { + if (ignoreSSLCertificates && ignoreSSLConnectionManager != null) { + // Trust self signed certificates + client = new DefaultHttpClient(ignoreSSLConnectionManager, new BasicHttpParams()); + } else { + client = new DefaultHttpClient(); + } + } + return client; + } -private void initConnectionManager() { -try { -final SSLContext sslContext = SSLContext.getInstance("SSL"); + private void initConnectionManager() { + try { + final SSLContext sslContext = SSLContext.getInstance("SSL"); -// set up a TrustManager that trusts everything -TrustManager[] trustManagers = new TrustManager[] { -new X509TrustManager() { -public X509Certificate[] getAcceptedIssuers() { -return null; -} -public void checkClientTrusted(X509Certificate[] certs, String authType) {} -public void checkServerTrusted(X509Certificate[] certs, String authType) {} -}}; - -sslContext.init(null, trustManagers, new SecureRandom()); - -SSLSocketFactory sf = new SSLSocketFactory((KeyStore)null) { -private javax.net.ssl.SSLSocketFactory sslFactory = sslContext.getSocketFactory(); - -public Socket createSocket(Socket socket, String host, int port, boolean autoClose) -throws IOException, UnknownHostException { -return sslFactory.createSocket(socket, host, port, autoClose); -} - -public Socket createSocket() throws IOException { -return sslFactory.createSocket(); -} -}; - -sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); -Scheme httpsScheme = new Scheme("https", sf, 443); -SchemeRegistry schemeRegistry = new SchemeRegistry(); -schemeRegistry.register(httpsScheme); -schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); - -ignoreSSLConnectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(), schemeRegistry); -} catch (NoSuchAlgorithmException e) { -// This will only be thrown if SSL isn't available for some reason. -} catch (KeyManagementException e) { -// This might be thrown when passing a key into init(), but no key is being passed. -} catch (GeneralSecurityException e) { -// This catches anything else that might go wrong. -// If anything goes wrong we default to the standard connection manager. -} -} + // set up a TrustManager that trusts everything + TrustManager[] trustManagers = new TrustManager[] { + new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + public void checkClientTrusted(X509Certificate[] certs, String authType) {} + public void checkServerTrusted(X509Certificate[] certs, String authType) {} + }}; + + sslContext.init(null, trustManagers, new SecureRandom()); + + SSLSocketFactory sf = new SSLSocketFactory((KeyStore)null) { + private javax.net.ssl.SSLSocketFactory sslFactory = sslContext.getSocketFactory(); + + public Socket createSocket(Socket socket, String host, int port, boolean autoClose) + throws IOException, UnknownHostException { + return sslFactory.createSocket(socket, host, port, autoClose); + } + + public Socket createSocket() throws IOException { + return sslFactory.createSocket(); + } + }; + + sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + Scheme httpsScheme = new Scheme("https", sf, 443); + SchemeRegistry schemeRegistry = new SchemeRegistry(); + schemeRegistry.register(httpsScheme); + schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); + + ignoreSSLConnectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(), schemeRegistry); + } catch (NoSuchAlgorithmException e) { + // This will only be thrown if SSL isn't available for some reason. + } catch (KeyManagementException e) { + // This might be thrown when passing a key into init(), but no key is being passed. + } catch (GeneralSecurityException e) { + // This catches anything else that might go wrong. + // If anything goes wrong we default to the standard connection manager. + } + } } diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/HttpPatch.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/HttpPatch.java index 627bd7adf50..cb97056dbc9 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/HttpPatch.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/HttpPatch.java @@ -3,14 +3,14 @@ package io.swagger.client; import org.apache.http.client.methods.*; public class HttpPatch extends HttpPost { -public static final String METHOD_PATCH = "PATCH"; + public static final String METHOD_PATCH = "PATCH"; -public HttpPatch(final String url) { -super(url); -} + public HttpPatch(final String url) { + super(url); + } -@Override -public String getMethod() { -return METHOD_PATCH; -} + @Override + public String getMethod() { + return METHOD_PATCH; + } } \ No newline at end of file diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/JsonUtil.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/JsonUtil.java index 6c2eb9dd4f4..5aa10d3ea82 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/JsonUtil.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/JsonUtil.java @@ -8,95 +8,80 @@ import java.util.List; import io.swagger.client.model.*; public class JsonUtil { -public static GsonBuilder gsonBuilder; + public static GsonBuilder gsonBuilder; -static { -gsonBuilder = new GsonBuilder(); -gsonBuilder.serializeNulls(); -gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); -} + static { + gsonBuilder = new GsonBuilder(); + gsonBuilder.serializeNulls(); + gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + } -public static Gson getGson() { -return gsonBuilder.create(); -} + public static Gson getGson() { + return gsonBuilder.create(); + } -public static String serialize(Object obj){ -return getGson().toJson(obj); -} + public static String serialize(Object obj){ + return getGson().toJson(obj); + } -public static - T deserializeToList(String jsonString, Class cls){ + public static T deserializeToList(String jsonString, Class cls){ return getGson().fromJson(jsonString, getListTypeForDeserialization(cls)); + } + + public static T deserializeToObject(String jsonString, Class cls){ + return getGson().fromJson(jsonString, getTypeForDeserialization(cls)); + } + + public static Type getListTypeForDeserialization(Class cls) { + String className = cls.getSimpleName(); + + if ("User".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); } + + if ("Category".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Pet".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Tag".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("Order".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + return new TypeToken>(){}.getType(); + } - public static - T deserializeToObject(String jsonString, Class cls){ - return getGson().fromJson(jsonString, getTypeForDeserialization(cls)); - } + public static Type getTypeForDeserialization(Class cls) { + String className = cls.getSimpleName(); + + if ("User".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Category".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Pet".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Tag".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("Order".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + return new TypeToken(){}.getType(); + } - public static Type getListTypeForDeserialization(Class cls) { - String className = cls.getSimpleName(); - - if ("User".equalsIgnoreCase(className)) { - return new TypeToken - >(){}.getType(); - } - - if ("Category".equalsIgnoreCase(className)) { - return new TypeToken - >(){}.getType(); - } - - if ("Pet".equalsIgnoreCase(className)) { - return new TypeToken - >(){}.getType(); - } - - if ("Tag".equalsIgnoreCase(className)) { - return new TypeToken - >(){}.getType(); - } - - if ("Order".equalsIgnoreCase(className)) { - return new TypeToken - >(){}.getType(); - } - - return new TypeToken - >(){}.getType(); - } - - public static Type getTypeForDeserialization(Class cls) { - String className = cls.getSimpleName(); - - if ("User".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("Category".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("Pet".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("Tag".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("Order".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - return new TypeToken - (){}.getType(); - } - - }; +}; diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/PetApi.java index c0956b0b85a..ebf600d787e 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/PetApi.java @@ -17,555 +17,507 @@ import java.util.Map; import java.util.HashMap; import java.io.File; - public class PetApi { - String basePath = "http://petstore.swagger.io/v2"; - ApiInvoker apiInvoker = ApiInvoker.getInstance(); +public class PetApi { + String basePath = "http://petstore.swagger.io/v2"; + ApiInvoker apiInvoker = ApiInvoker.getInstance(); - public void addHeader(String key, String value) { + public void addHeader(String key, String value) { getInvoker().addDefaultHeader(key, value); - } + } - public ApiInvoker getInvoker() { + public ApiInvoker getInvoker() { return apiInvoker; - } + } - public void setBasePath(String basePath) { + public void setBasePath(String basePath) { this.basePath = basePath; - } + } - public String getBasePath() { + public String getBasePath() { return basePath; + } + + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + public void updatePet (Pet body) throws ApiException { + Object postBody = body; + + + // create path and map variables + String path = "/pet".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + "application/json","application/xml" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + } + try { + String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + public void addPet (Pet body) throws ApiException { + Object postBody = body; - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - */ - public void updatePet (Pet body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); + // create path and map variables + String path = "/pet".replaceAll("\\{format\\}","json"); - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); - - - - - String[] contentTypes = { - "application/json","application/xml" - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - */ - public void addPet (Pet body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - "application/json","application/xml" - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Finds Pets by status - * Multiple status values can be provided with comma seperated strings - * @param status Status values that need to be considered for filter - * @return List - */ - public List findPetsByStatus (List status) throws ApiException { - Object postBody = null; - - // create path and map variables - String path = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + String[] contentTypes = { + "application/json","application/xml" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + - if (status != null) - queryParams.put("status", ApiInvoker.parameterToString(status)); - + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } - + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma seperated strings + * @param status Status values that need to be considered for filter + * @return List + */ + public List findPetsByStatus (List status) throws ApiException { + Object postBody = null; + - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + // create path and map variables + String path = "/pet/findByStatus".replaceAll("\\{format\\}","json"); - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } + if (status != null) + queryParams.put("status", ApiInvoker.parameterToString(status)); + - try { - String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ return (List) ApiInvoker.deserialize(response, "array", Pet.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Finds Pets by tags + * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return List + */ + public List findPetsByTags (List tags) throws ApiException { + Object postBody = null; - /** - * Finds Pets by tags - * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return List - */ - public List findPetsByTags (List tags) throws ApiException { - Object postBody = null; - - // create path and map variables - String path = "/pet/findByTags".replaceAll("\\{format\\}","json"); + // create path and map variables + String path = "/pet/findByTags".replaceAll("\\{format\\}","json"); - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); - if (tags != null) - queryParams.put("tags", ApiInvoker.parameterToString(tags)); - + if (tags != null) + queryParams.put("tags", ApiInvoker.parameterToString(tags)); + - + - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } - try { - String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ return (List) ApiInvoker.deserialize(response, "array", Pet.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Find pet by ID + * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * @param petId ID of pet that needs to be fetched + * @return Pet + */ + public Pet getPetById (Long petId) throws ApiException { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); + } - /** - * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched - * @return Pet - */ - public Pet getPetById (Long petId) throws ApiException { - Object postBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); - + - + - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } - try { - String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ return (Pet) ApiInvoker.deserialize(response, "", Pet.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - * @return void - */ - public void updatePetWithForm (String petId, String name, String status) throws ApiException { - Object postBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); - } - - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - "application/x-www-form-urlencoded" - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - if (name != null) { - builder.addTextBody("name", ApiInvoker.parameterToString(name), ApiInvoker.TEXT_PLAIN_UTF8); - } - - if (status != null) { - builder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8); - } - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - formParams.put("name", ApiInvoker.parameterToString(name)); - formParams.put("status", ApiInvoker.parameterToString(status)); - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Deletes a pet - * - * @param apiKey - * @param petId Pet id to delete - * @return void - */ - public void deletePet (String apiKey, Long petId) throws ApiException { - Object postBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); - } - - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - headerParams.put("api_key", ApiInvoker.parameterToString(apiKey)); - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - * @return void - */ - public void uploadFile (Long petId, String additionalMetadata, File file) throws ApiException { - Object postBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); - } - - - // create path and map variables - String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - "multipart/form-data" - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - if (additionalMetadata != null) { - builder.addTextBody("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata), ApiInvoker.TEXT_PLAIN_UTF8); - } - - if (file != null) { - builder.addBinaryBody("file", file); - } - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - formParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); - - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - + } + } catch (ApiException ex) { + throw ex; } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return void + */ + public void updatePetWithForm (String petId, String name, String status) throws ApiException { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); + } + + + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + "application/x-www-form-urlencoded" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + if (name != null) { + builder.addTextBody("name", ApiInvoker.parameterToString(name), ApiInvoker.TEXT_PLAIN_UTF8); + } + + if (status != null) { + builder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8); + } + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + formParams.put("name", ApiInvoker.parameterToString(name)); + formParams.put("status", ApiInvoker.parameterToString(status)); + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Deletes a pet + * + * @param apiKey + * @param petId Pet id to delete + * @return void + */ + public void deletePet (String apiKey, Long petId) throws ApiException { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); + } + + + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + headerParams.put("api_key", ApiInvoker.parameterToString(apiKey)); + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @return void + */ + public void uploadFile (Long petId, String additionalMetadata, File file) throws ApiException { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); + } + + + // create path and map variables + String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + "multipart/form-data" + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + if (additionalMetadata != null) { + builder.addTextBody("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata), ApiInvoker.TEXT_PLAIN_UTF8); + } + + if (file != null) { + builder.addBinaryBody("file", file); + } + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + formParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); + + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + +} diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/StoreApi.java index a246d7c9de8..ecd8e833049 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/StoreApi.java @@ -17,274 +17,250 @@ import java.util.Map; import java.util.HashMap; import java.io.File; - public class StoreApi { - String basePath = "http://petstore.swagger.io/v2"; - ApiInvoker apiInvoker = ApiInvoker.getInstance(); +public class StoreApi { + String basePath = "http://petstore.swagger.io/v2"; + ApiInvoker apiInvoker = ApiInvoker.getInstance(); - public void addHeader(String key, String value) { + public void addHeader(String key, String value) { getInvoker().addDefaultHeader(key, value); - } + } - public ApiInvoker getInvoker() { + public ApiInvoker getInvoker() { return apiInvoker; - } + } - public void setBasePath(String basePath) { + public void setBasePath(String basePath) { this.basePath = basePath; - } + } - public String getBasePath() { + public String getBasePath() { return basePath; - } + } + + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map + */ + public Map getInventory () throws ApiException { + Object postBody = null; + + + // create path and map variables + String path = "/store/inventory".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map - */ - public Map getInventory () throws ApiException { - Object postBody = null; - - // create path and map variables - String path = "/store/inventory".replaceAll("\\{format\\}","json"); + - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + - + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ return (Map) ApiInvoker.deserialize(response, "map", Map.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - */ - public Order placeOrder (Order body) throws ApiException { - Object postBody = body; - - - // create path and map variables - String path = "/store/order".replaceAll("\\{format\\}","json"); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return (Order) ApiInvoker.deserialize(response, "", Order.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - public Order getOrderById (String orderId) throws ApiException { - Object postBody = null; - - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); - } - - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return (Order) ApiInvoker.deserialize(response, "", Order.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - */ - public void deleteOrder (String orderId) throws ApiException { - Object postBody = null; - - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); - } - - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - + } + } catch (ApiException ex) { + throw ex; } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + public Order placeOrder (Order body) throws ApiException { + Object postBody = body; + + + // create path and map variables + String path = "/store/order".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return (Order) ApiInvoker.deserialize(response, "", Order.class); + } + else { + return null; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + public Order getOrderById (String orderId) throws ApiException { + Object postBody = null; + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); + } + + + // create path and map variables + String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return (Order) ApiInvoker.deserialize(response, "", Order.class); + } + else { + return null; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + public void deleteOrder (String orderId) throws ApiException { + Object postBody = null; + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); + } + + + // create path and map variables + String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + +} diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/UserApi.java index 85f89497498..e1df3fd4f12 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/api/UserApi.java @@ -17,525 +17,477 @@ import java.util.Map; import java.util.HashMap; import java.io.File; - public class UserApi { - String basePath = "http://petstore.swagger.io/v2"; - ApiInvoker apiInvoker = ApiInvoker.getInstance(); +public class UserApi { + String basePath = "http://petstore.swagger.io/v2"; + ApiInvoker apiInvoker = ApiInvoker.getInstance(); - public void addHeader(String key, String value) { + public void addHeader(String key, String value) { getInvoker().addDefaultHeader(key, value); - } + } - public ApiInvoker getInvoker() { + public ApiInvoker getInvoker() { return apiInvoker; - } + } - public void setBasePath(String basePath) { + public void setBasePath(String basePath) { this.basePath = basePath; - } + } - public String getBasePath() { + public String getBasePath() { return basePath; + } + + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + public void createUser (User body) throws ApiException { + Object postBody = body; + + + // create path and map variables + String path = "/user".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + } + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + public void createUsersWithArrayInput (List body) throws ApiException { + Object postBody = body; - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - */ - public void createUser (User body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/user".replaceAll("\\{format\\}","json"); + // create path and map variables + String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - public void createUsersWithArrayInput (List body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - public void createUsersWithListInput (List body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/user/createWithList".replaceAll("\\{format\\}","json"); + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + - + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ return ; - } - else { + } + else { return ; - } - } catch (ApiException ex) { - throw ex; - } - } + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + public void createUsersWithListInput (List body) throws ApiException { + Object postBody = body; - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return String - */ - public String loginUser (String username, String password) throws ApiException { - Object postBody = null; - - // create path and map variables - String path = "/user/login".replaceAll("\\{format\\}","json"); + // create path and map variables + String path = "/user/createWithList".replaceAll("\\{format\\}","json"); - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); - if (username != null) - queryParams.put("username", ApiInvoker.parameterToString(username)); - if (password != null) - queryParams.put("password", ApiInvoker.parameterToString(password)); - + - + - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } - try { - String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return String + */ + public String loginUser (String username, String password) throws ApiException { + Object postBody = null; + + + // create path and map variables + String path = "/user/login".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + if (username != null) + queryParams.put("username", ApiInvoker.parameterToString(username)); + if (password != null) + queryParams.put("password", ApiInvoker.parameterToString(password)); + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ return (String) ApiInvoker.deserialize(response, "", String.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Logs out current logged in user session - * - * @return void - */ - public void logoutUser () throws ApiException { - Object postBody = null; - - - // create path and map variables - String path = "/user/logout".replaceAll("\\{format\\}","json"); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - public User getUserByName (String username) throws ApiException { - Object postBody = null; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); - } - - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return (User) ApiInvoker.deserialize(response, "", User.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - */ - public void updateUser (String username, User body) throws ApiException { - Object postBody = body; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); - } - - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - */ - public void deleteUser (String username) throws ApiException { - Object postBody = null; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); - } - - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - Map - queryParams = new HashMap - (); - // header params - Map - headerParams = new HashMap - (); - // form params - Map - formParams = new HashMap - (); - - - - - - String[] contentTypes = { - - }; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - if (contentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - - - HttpEntity httpEntity = builder.build(); - postBody = httpEntity; - } else { - // normal form params - - } - - try { - String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - + } + } catch (ApiException ex) { + throw ex; } + } + + /** + * Logs out current logged in user session + * + * @return void + */ + public void logoutUser () throws ApiException { + Object postBody = null; + + + // create path and map variables + String path = "/user/logout".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + public User getUserByName (String username) throws ApiException { + Object postBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); + } + + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return (User) ApiInvoker.deserialize(response, "", User.class); + } + else { + return null; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + public void updateUser (String username, User body) throws ApiException { + Object postBody = body; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); + } + + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + public void deleteUser (String username) throws ApiException { + Object postBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); + } + + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); + + // query params + Map queryParams = new HashMap(); + // header params + Map headerParams = new HashMap(); + // form params + Map formParams = new HashMap(); + + + + + + String[] contentTypes = { + + }; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if (contentType.startsWith("multipart/form-data")) { + // file uploading + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + + + HttpEntity httpEntity = builder.build(); + postBody = httpEntity; + } else { + // normal form params + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + +} diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Category.java index ac50716bfda..44c71e8a620 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Category.java @@ -4,41 +4,41 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class Category { - - @SerializedName("id") - private Long id = null; - @SerializedName("name") - private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class Category { + + @SerializedName("id") + private Long id = null; + @SerializedName("name") + private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } + + /** + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - + + /** + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Category {\n"); @@ -46,6 +46,5 @@ import com.google.gson.annotations.SerializedName; sb.append(" name: ").append(name).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Order.java index 4eec77f9270..f3f42db615c 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Order.java @@ -5,97 +5,97 @@ import java.util.Date; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class Order { - - @SerializedName("id") - private Long id = null; - @SerializedName("petId") - private Long petId = null; - @SerializedName("quantity") - private Integer quantity = null; - @SerializedName("shipDate") - private Date shipDate = null; - public enum StatusEnum { - placed, approved, delivered, - }; - @SerializedName("status") - private StatusEnum status = null; - @SerializedName("complete") - private Boolean complete = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class Order { + + @SerializedName("id") + private Long id = null; + @SerializedName("petId") + private Long petId = null; + @SerializedName("quantity") + private Integer quantity = null; + @SerializedName("shipDate") + private Date shipDate = null; + public enum StatusEnum { + placed, approved, delivered, + }; + @SerializedName("status") + private StatusEnum status = null; + @SerializedName("complete") + private Boolean complete = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getPetId() { - return petId; - } - public void setPetId(Long petId) { - this.petId = petId; - } + + /** + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - - /** - **/ - @ApiModelProperty(value = "") - public Integer getQuantity() { - return quantity; - } - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } + + /** + **/ + @ApiModelProperty(value = "") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } - - /** - **/ - @ApiModelProperty(value = "") - public Date getShipDate() { - return shipDate; - } - public void setShipDate(Date shipDate) { - this.shipDate = shipDate; - } + + /** + **/ + @ApiModelProperty(value = "") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } - - /** - * Order Status - **/ - @ApiModelProperty(value = "Order Status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } + + /** + **/ + @ApiModelProperty(value = "") + public Date getShipDate() { + return shipDate; + } + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } - - /** - **/ - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - public void setComplete(Boolean complete) { - this.complete = complete; - } + + /** + * Order Status + **/ + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } - + + /** + **/ + @ApiModelProperty(value = "") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Order {\n"); @@ -107,6 +107,5 @@ import com.google.gson.annotations.SerializedName; sb.append(" complete: ").append(complete).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Pet.java index a1e7c632132..26219b16a45 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Pet.java @@ -1,103 +1,103 @@ package io.swagger.client.model; import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; import java.util.*; +import io.swagger.client.model.Tag; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class Pet { - - @SerializedName("id") - private Long id = null; - @SerializedName("category") - private Category category = null; - @SerializedName("name") - private String name = null; - @SerializedName("photoUrls") - private List photoUrls = new ArrayList() ; - @SerializedName("tags") - private List tags = new ArrayList() ; - public enum StatusEnum { - available, pending, sold, - }; - @SerializedName("status") - private StatusEnum status = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class Pet { + + @SerializedName("id") + private Long id = null; + @SerializedName("category") + private Category category = null; + @SerializedName("name") + private String name = null; + @SerializedName("photoUrls") + private List photoUrls = new ArrayList() ; + @SerializedName("tags") + private List tags = new ArrayList() ; + public enum StatusEnum { + available, pending, sold, + }; + @SerializedName("status") + private StatusEnum status = null; - - /** - **/ - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - public void setCategory(Category category) { - this.category = category; - } + + /** + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - - /** - **/ - @ApiModelProperty(required = true, value = "") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } + + /** + **/ + @ApiModelProperty(value = "") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } - - /** - **/ - @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } + + /** + **/ + @ApiModelProperty(required = true, value = "") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - - /** - **/ - @ApiModelProperty(value = "") - public List getTags() { - return tags; - } - public void setTags(List tags) { - this.tags = tags; - } + + /** + **/ + @ApiModelProperty(required = true, value = "") + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } - - /** - * pet status in the store - **/ - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } + + /** + **/ + @ApiModelProperty(value = "") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } - + + /** + * pet status in the store + **/ + @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Pet {\n"); @@ -109,6 +109,5 @@ import com.google.gson.annotations.SerializedName; sb.append(" status: ").append(status).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Tag.java index 2356a1c1b4c..7c9651b1ba8 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/Tag.java @@ -4,41 +4,41 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class Tag { - - @SerializedName("id") - private Long id = null; - @SerializedName("name") - private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class Tag { + + @SerializedName("id") + private Long id = null; + @SerializedName("name") + private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } + + /** + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - + + /** + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Tag {\n"); @@ -46,6 +46,5 @@ import com.google.gson.annotations.SerializedName; sb.append(" name: ").append(name).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/User.java index 40803f3cfb1..dc022697eb0 100644 --- a/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/android-java/src/main/java/io/swagger/client/model/User.java @@ -4,120 +4,120 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class User { - - @SerializedName("id") - private Long id = null; - @SerializedName("username") - private String username = null; - @SerializedName("firstName") - private String firstName = null; - @SerializedName("lastName") - private String lastName = null; - @SerializedName("email") - private String email = null; - @SerializedName("password") - private String password = null; - @SerializedName("phone") - private String phone = null; - @SerializedName("userStatus") - private Integer userStatus = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class User { + + @SerializedName("id") + private Long id = null; + @SerializedName("username") + private String username = null; + @SerializedName("firstName") + private String firstName = null; + @SerializedName("lastName") + private String lastName = null; + @SerializedName("email") + private String email = null; + @SerializedName("password") + private String password = null; + @SerializedName("phone") + private String phone = null; + @SerializedName("userStatus") + private Integer userStatus = null; - - /** - **/ - @ApiModelProperty(value = "") - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } + + /** + **/ + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - - /** - **/ - @ApiModelProperty(value = "") - public String getFirstName() { - return firstName; - } - public void setFirstName(String firstName) { - this.firstName = firstName; - } + + /** + **/ + @ApiModelProperty(value = "") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } - - /** - **/ - @ApiModelProperty(value = "") - public String getLastName() { - return lastName; - } - public void setLastName(String lastName) { - this.lastName = lastName; - } + + /** + **/ + @ApiModelProperty(value = "") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } - - /** - **/ - @ApiModelProperty(value = "") - public String getEmail() { - return email; - } - public void setEmail(String email) { - this.email = email; - } + + /** + **/ + @ApiModelProperty(value = "") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } - - /** - **/ - @ApiModelProperty(value = "") - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } + + /** + **/ + @ApiModelProperty(value = "") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } - - /** - **/ - @ApiModelProperty(value = "") - public String getPhone() { - return phone; - } - public void setPhone(String phone) { - this.phone = phone; - } + + /** + **/ + @ApiModelProperty(value = "") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } - - /** - * User Status - **/ - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } + + /** + **/ + @ApiModelProperty(value = "") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } - + + /** + * User Status + **/ + @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class User {\n"); @@ -131,6 +131,5 @@ import com.google.gson.annotations.SerializedName; sb.append(" userStatus: ").append(userStatus).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/PetApi.cs b/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/PetApi.cs index 5fdb38f2da9..44cd63d4fc7 100644 --- a/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/PetApi.cs @@ -500,7 +500,7 @@ namespace IO.Swagger.Api { // authentication setting, if any - String[] authSettings = new String[] { "api_key", "petstore_auth" }; + String[] authSettings = new String[] { "petstore_auth", "api_key" }; // make the HTTP request IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); @@ -540,7 +540,7 @@ namespace IO.Swagger.Api { // authentication setting, if any - String[] authSettings = new String[] { "api_key", "petstore_auth" }; + String[] authSettings = new String[] { "petstore_auth", "api_key" }; // make the HTTP request IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); diff --git a/samples/client/petstore/java/pom.xml b/samples/client/petstore/java/pom.xml index 87e92fa652d..058733e08fc 100644 --- a/samples/client/petstore/java/pom.xml +++ b/samples/client/petstore/java/pom.xml @@ -1,170 +1,167 @@ - 4.0.0 - io.swagger - swagger-java-client - jar - swagger-java-client - 1.0.0 - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-java-client + jar + swagger-java-client + 1.0.0 + + scm:git:git@github.com:swagger-api/swagger-mustache.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - - 1.6 - 1.6 - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - com.sun.jersey - jersey-client - ${jersey-version} - - - com.sun.jersey.contribs - jersey-multipart - ${jersey-version} - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - 2.1.5 - - - joda-time - joda-time - ${jodatime-version} - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + com.sun.jersey + jersey-client + ${jersey-version} + + + com.sun.jersey.contribs + jersey-multipart + ${jersey-version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.1.5 + + + joda-time + joda-time + ${jodatime-version} + - - - junit - junit - ${junit-version} - test - - - - 1.5.0 - 1.18 - 2.4.2 - 2.3 - 1.0.0 - 4.8.1 - + + + junit + junit + ${junit-version} + test + + + + 1.5.0 + 1.18 + 2.4.2 + 2.3 + 1.0.0 + 4.8.1 + diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/src/main/java/io/swagger/client/ApiClient.java index 3eb82036a14..0adcbe7031d 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/ApiClient.java @@ -40,481 +40,467 @@ import io.swagger.client.auth.ApiKeyAuth; import io.swagger.client.auth.OAuth; public class ApiClient { -private Map - hostMap = new HashMap -(); -private Map - defaultHeaderMap = new HashMap -(); -private boolean debugging = false; -private String basePath = "http://petstore.swagger.io/v2"; + private Map hostMap = new HashMap(); + private Map defaultHeaderMap = new HashMap(); + private boolean debugging = false; + private String basePath = "http://petstore.swagger.io/v2"; -private Map - authentications; + private Map authentications; -private DateFormat dateFormat; + private DateFormat dateFormat; -public ApiClient() { -// Use ISO 8601 format for date and datetime. -// See https://en.wikipedia.org/wiki/ISO_8601 -this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + public ApiClient() { + // Use ISO 8601 format for date and datetime. + // See https://en.wikipedia.org/wiki/ISO_8601 + this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); -// Use UTC as the default time zone. -this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + // Use UTC as the default time zone. + this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); -// Set default User-Agent. -setUserAgent("Java-Swagger"); + // Set default User-Agent. + setUserAgent("Java-Swagger"); -// Setup authentications (key: authentication name, value: authentication). -authentications = new HashMap -(); + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); authentications.put("api_key", new ApiKeyAuth("header", "api_key")); authentications.put("petstore_auth", new OAuth()); -// Prevent the authentications from being modified. -authentications = Collections.unmodifiableMap(authentications); -} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } -public String getBasePath() { -return basePath; -} + public String getBasePath() { + return basePath; + } -public ApiClient setBasePath(String basePath) { -this.basePath = basePath; -return this; -} + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } -/** -* Get authentications (key: authentication name, value: authentication). -*/ -public Map - getAuthentications() { -return authentications; -} + /** + * Get authentications (key: authentication name, value: authentication). + */ + public Map getAuthentications() { + return authentications; + } -/** -* Get authentication for the given name. -* -* @param authName The authentication name -* @return The authentication, null if not found -*/ -public Authentication getAuthentication(String authName) { -return authentications.get(authName); -} + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } -/** -* Helper method to set username for the first HTTP basic authentication. -*/ -public void setUsername(String username) { -for (Authentication auth : authentications.values()) { -if (auth instanceof HttpBasicAuth) { -((HttpBasicAuth) auth).setUsername(username); -return; -} -} -throw new RuntimeException("No HTTP basic authentication configured!"); -} + /** + * Helper method to set username for the first HTTP basic authentication. + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } -/** -* Helper method to set password for the first HTTP basic authentication. -*/ -public void setPassword(String password) { -for (Authentication auth : authentications.values()) { -if (auth instanceof HttpBasicAuth) { -((HttpBasicAuth) auth).setPassword(password); -return; -} -} -throw new RuntimeException("No HTTP basic authentication configured!"); -} + /** + * Helper method to set password for the first HTTP basic authentication. + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } -/** -* Helper method to set API key value for the first API key authentication. -*/ -public void setApiKey(String apiKey) { -for (Authentication auth : authentications.values()) { -if (auth instanceof ApiKeyAuth) { -((ApiKeyAuth) auth).setApiKey(apiKey); -return; -} -} -throw new RuntimeException("No API key authentication configured!"); -} + /** + * Helper method to set API key value for the first API key authentication. + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } -/** -* Helper method to set API key prefix for the first API key authentication. -*/ -public void setApiKeyPrefix(String apiKeyPrefix) { -for (Authentication auth : authentications.values()) { -if (auth instanceof ApiKeyAuth) { -((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); -return; -} -} -throw new RuntimeException("No API key authentication configured!"); -} + /** + * Helper method to set API key prefix for the first API key authentication. + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } -/** -* Set the User-Agent header's value (by adding to the default header map). -*/ -public ApiClient setUserAgent(String userAgent) { -addDefaultHeader("User-Agent", userAgent); -return this; -} + /** + * Set the User-Agent header's value (by adding to the default header map). + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } -/** -* Add a default header. -* -* @param key The header's key -* @param value The header's value -*/ -public ApiClient addDefaultHeader(String key, String value) { -defaultHeaderMap.put(key, value); -return this; -} + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } -/** -* Check that whether debugging is enabled for this API client. -*/ -public boolean isDebugging() { -return debugging; -} + /** + * Check that whether debugging is enabled for this API client. + */ + public boolean isDebugging() { + return debugging; + } -/** -* Enable/disable debugging for this API client. -* -* @param debugging To enable (true) or disable (false) debugging -*/ -public ApiClient setDebugging(boolean debugging) { -this.debugging = debugging; -return this; -} + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + */ + public ApiClient setDebugging(boolean debugging) { + this.debugging = debugging; + return this; + } -/** -* Get the date format used to parse/format date parameters. -*/ -public DateFormat getDateFormat() { -return dateFormat; -} + /** + * Get the date format used to parse/format date parameters. + */ + public DateFormat getDateFormat() { + return dateFormat; + } -/** -* Set the date format used to parse/format date parameters. -*/ -public ApiClient getDateFormat(DateFormat dateFormat) { -this.dateFormat = dateFormat; -return this; -} + /** + * Set the date format used to parse/format date parameters. + */ + public ApiClient getDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + return this; + } -/** -* Parse the given string into Date object. -*/ -public Date parseDate(String str) { -try { -return dateFormat.parse(str); -} catch (java.text.ParseException e) { -throw new RuntimeException(e); -} -} + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } -/** -* Format the given Date object into string. -*/ -public String formatDate(Date date) { -return dateFormat.format(date); -} + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } -/** -* Format the given parameter object into string. -*/ -public String parameterToString(Object param) { -if (param == null) { -return ""; -} else if (param instanceof Date) { -return formatDate((Date) param); -} else if (param instanceof Collection) { -StringBuilder b = new StringBuilder(); -for(Object o : (Collection)param) { -if(b.length() > 0) { -b.append(","); -} -b.append(String.valueOf(o)); -} -return b.toString(); -} else { -return String.valueOf(param); -} -} + /** + * Format the given parameter object into string. + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } -/** -* Select the Accept header's value from the given accepts array: -* if JSON exists in the given array, use it; -* otherwise use all of them (joining into a string) -* -* @param accepts The accepts array to select from -* @return The Accept header to use. If the given array is empty, -* null will be returned (not to set the Accept header explicitly). -*/ -public String selectHeaderAccept(String[] accepts) { -if (accepts.length == 0) return null; -if (StringUtil.containsIgnoreCase(accepts, "application/json")) return "application/json"; -return StringUtil.join(accepts, ","); -} + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) return null; + if (StringUtil.containsIgnoreCase(accepts, "application/json")) return "application/json"; + return StringUtil.join(accepts, ","); + } -/** -* Select the Content-Type header's value from the given array: -* if JSON exists in the given array, use it; -* otherwise use the first one of the array. -* -* @param contentTypes The Content-Type array to select from -* @return The Content-Type header to use. If the given array is empty, -* JSON will be used. -*/ -public String selectHeaderContentType(String[] contentTypes) { -if (contentTypes.length == 0) return "application/json"; -if (StringUtil.containsIgnoreCase(contentTypes, "application/json")) return "application/json"; -return contentTypes[0]; -} + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) return "application/json"; + if (StringUtil.containsIgnoreCase(contentTypes, "application/json")) return "application/json"; + return contentTypes[0]; + } -/** -* Escape the given string to be used as URL query value. -*/ -public String escapeString(String str) { -try { -return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); -} catch (UnsupportedEncodingException e) { -return str; -} -} + /** + * Escape the given string to be used as URL query value. + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } -/** -* Deserialize the given JSON string to Java object. -* -* @param json The JSON string -* @param containerType The container type, one of "list", "array" or "" -* @param cls The type of the Java object -* @return The deserialized Java object -*/ -public Object deserialize(String json, String containerType, Class cls) throws ApiException { -if(null != containerType) { -containerType = containerType.toLowerCase(); -} -try{ -if("list".equals(containerType) || "array".equals(containerType)) { -JavaType typeInfo = JsonUtil.getJsonMapper().getTypeFactory().constructCollectionType(List.class, cls); -List response = (List) JsonUtil.getJsonMapper().readValue(json, typeInfo); -return response; -} -else if(String.class.equals(cls)) { -if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) -return json.substring(1, json.length() - 2); -else -return json; -} -else { -return JsonUtil.getJsonMapper().readValue(json, cls); -} -} -catch (IOException e) { -throw new ApiException(500, e.getMessage(), null, json); -} -} + /** + * Deserialize the given JSON string to Java object. + * + * @param json The JSON string + * @param containerType The container type, one of "list", "array" or "" + * @param cls The type of the Java object + * @return The deserialized Java object + */ + public Object deserialize(String json, String containerType, Class cls) throws ApiException { + if(null != containerType) { + containerType = containerType.toLowerCase(); + } + try{ + if("list".equals(containerType) || "array".equals(containerType)) { + JavaType typeInfo = JsonUtil.getJsonMapper().getTypeFactory().constructCollectionType(List.class, cls); + List response = (List) JsonUtil.getJsonMapper().readValue(json, typeInfo); + return response; + } + else if(String.class.equals(cls)) { + if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) + return json.substring(1, json.length() - 2); + else + return json; + } + else { + return JsonUtil.getJsonMapper().readValue(json, cls); + } + } + catch (IOException e) { + throw new ApiException(500, e.getMessage(), null, json); + } + } -/** -* Serialize the given Java object into JSON string. -*/ -public String serialize(Object obj) throws ApiException { -try { -if (obj != null) -return JsonUtil.getJsonMapper().writeValueAsString(obj); -else -return null; -} -catch (Exception e) { -throw new ApiException(500, e.getMessage()); -} -} + /** + * Serialize the given Java object into JSON string. + */ + public String serialize(Object obj) throws ApiException { + try { + if (obj != null) + return JsonUtil.getJsonMapper().writeValueAsString(obj); + else + return null; + } + catch (Exception e) { + throw new ApiException(500, e.getMessage()); + } + } -/** -* Invoke API by sending HTTP request with the given options. -* -* @param path The sub-path of the HTTP URL -* @param method The request method, one of "GET", "POST", "PUT", and "DELETE" -* @param queryParams The query parameters -* @param body The request body object -* @param headerParams The header parameters -* @param formParams The form parameters -* @param accept The request's Accept header -* @param contentType The request's Content-Type header -* @param authNames The authentications to apply -* @return The response body in type of string -*/ -public String invokeAPI(String path, String method, Map - queryParams, Object body, Map - headerParams, Map - formParams, String accept, String contentType, String[] authNames) throws ApiException { -updateParamsForAuth(authNames, queryParams, headerParams); + /** + * Invoke API by sending HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @return The response body in type of string + */ + public String invokeAPI(String path, String method, Map queryParams, Object body, Map headerParams, Map formParams, String accept, String contentType, String[] authNames) throws ApiException { + updateParamsForAuth(authNames, queryParams, headerParams); -Client client = getClient(); + Client client = getClient(); -StringBuilder b = new StringBuilder(); -for(String key : queryParams.keySet()) { -String value = queryParams.get(key); -if (value != null){ -if(b.toString().length() == 0) -b.append("?"); -else -b.append("&"); -b.append(escapeString(key)).append("=").append(escapeString(value)); -} -} -String querystring = b.toString(); + StringBuilder b = new StringBuilder(); + for(String key : queryParams.keySet()) { + String value = queryParams.get(key); + if (value != null){ + if(b.toString().length() == 0) + b.append("?"); + else + b.append("&"); + b.append(escapeString(key)).append("=").append(escapeString(value)); + } + } + String querystring = b.toString(); -Builder builder; -if (accept == null) -builder = client.resource(basePath + path + querystring).getRequestBuilder(); -else -builder = client.resource(basePath + path + querystring).accept(accept); + Builder builder; + if (accept == null) + builder = client.resource(basePath + path + querystring).getRequestBuilder(); + else + builder = client.resource(basePath + path + querystring).accept(accept); -for(String key : headerParams.keySet()) { -builder = builder.header(key, headerParams.get(key)); -} -for(String key : defaultHeaderMap.keySet()) { -if(!headerParams.containsKey(key)) { -builder = builder.header(key, defaultHeaderMap.get(key)); -} -} + for(String key : headerParams.keySet()) { + builder = builder.header(key, headerParams.get(key)); + } + for(String key : defaultHeaderMap.keySet()) { + if(!headerParams.containsKey(key)) { + builder = builder.header(key, defaultHeaderMap.get(key)); + } + } -ClientResponse response = null; + ClientResponse response = null; -if("GET".equals(method)) { -response = (ClientResponse) builder.get(ClientResponse.class); -} -else if ("POST".equals(method)) { -if (contentType.startsWith("application/x-www-form-urlencoded")) { -String encodedFormParams = this -.getXWWWFormUrlencodedParams(formParams); -response = builder.type(contentType).post(ClientResponse.class, -encodedFormParams); -} else if (body == null) { -response = builder.post(ClientResponse.class, null); -} else if(body instanceof FormDataMultiPart) { -response = builder.type(contentType).post(ClientResponse.class, body); -} -else -response = builder.type(contentType).post(ClientResponse.class, serialize(body)); -} -else if ("PUT".equals(method)) { -if ("application/x-www-form-urlencoded".equals(contentType)) { -String encodedFormParams = this -.getXWWWFormUrlencodedParams(formParams); -response = builder.type(contentType).put(ClientResponse.class, -encodedFormParams); -} else if(body == null) { -response = builder.put(ClientResponse.class, serialize(body)); -} else { -response = builder.type(contentType).put(ClientResponse.class, serialize(body)); -} -} -else if ("DELETE".equals(method)) { -if ("application/x-www-form-urlencoded".equals(contentType)) { -String encodedFormParams = this -.getXWWWFormUrlencodedParams(formParams); -response = builder.type(contentType).delete(ClientResponse.class, -encodedFormParams); -} else if(body == null) { -response = builder.delete(ClientResponse.class); -} else { -response = builder.type(contentType).delete(ClientResponse.class, serialize(body)); -} -} -else { -throw new ApiException(500, "unknown method type " + method); -} + if("GET".equals(method)) { + response = (ClientResponse) builder.get(ClientResponse.class); + } + else if ("POST".equals(method)) { + if (contentType.startsWith("application/x-www-form-urlencoded")) { + String encodedFormParams = this + .getXWWWFormUrlencodedParams(formParams); + response = builder.type(contentType).post(ClientResponse.class, + encodedFormParams); + } else if (body == null) { + response = builder.post(ClientResponse.class, null); + } else if(body instanceof FormDataMultiPart) { + response = builder.type(contentType).post(ClientResponse.class, body); + } + else + response = builder.type(contentType).post(ClientResponse.class, serialize(body)); + } + else if ("PUT".equals(method)) { + if ("application/x-www-form-urlencoded".equals(contentType)) { + String encodedFormParams = this + .getXWWWFormUrlencodedParams(formParams); + response = builder.type(contentType).put(ClientResponse.class, + encodedFormParams); + } else if(body == null) { + response = builder.put(ClientResponse.class, serialize(body)); + } else { + response = builder.type(contentType).put(ClientResponse.class, serialize(body)); + } + } + else if ("DELETE".equals(method)) { + if ("application/x-www-form-urlencoded".equals(contentType)) { + String encodedFormParams = this + .getXWWWFormUrlencodedParams(formParams); + response = builder.type(contentType).delete(ClientResponse.class, + encodedFormParams); + } else if(body == null) { + response = builder.delete(ClientResponse.class); + } else { + response = builder.type(contentType).delete(ClientResponse.class, serialize(body)); + } + } + else { + throw new ApiException(500, "unknown method type " + method); + } -if(response.getClientResponseStatus() == ClientResponse.Status.NO_CONTENT) { -return null; -} -else if(response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) { -if(response.hasEntity()) { -return (String) response.getEntity(String.class); -} -else { -return ""; -} -} -else { -String message = "error"; -String respBody = null; -if(response.hasEntity()) { -try{ -respBody = String.valueOf(response.getEntity(String.class)); -message = respBody; -} -catch (RuntimeException e) { -// e.printStackTrace(); -} -} -throw new ApiException( -response.getClientResponseStatus().getStatusCode(), -message, -response.getHeaders(), -respBody); -} -} + if(response.getClientResponseStatus() == ClientResponse.Status.NO_CONTENT) { + return null; + } + else if(response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) { + if(response.hasEntity()) { + return (String) response.getEntity(String.class); + } + else { + return ""; + } + } + else { + String message = "error"; + String respBody = null; + if(response.hasEntity()) { + try{ + respBody = String.valueOf(response.getEntity(String.class)); + message = respBody; + } + catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getClientResponseStatus().getStatusCode(), + message, + response.getHeaders(), + respBody); + } + } -/** -* Update query and header parameters based on authentication settings. -* -* @param authNames The authentications to apply -*/ -private void updateParamsForAuth(String[] authNames, Map - queryParams, Map - headerParams) { -for (String authName : authNames) { -Authentication auth = authentications.get(authName); -if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); -auth.applyToParams(queryParams, headerParams); -} -} + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + */ + private void updateParamsForAuth(String[] authNames, Map queryParams, Map headerParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams); + } + } -/** -* Encode the given form parameters as request body. -*/ -private String getXWWWFormUrlencodedParams(Map - formParams) { -StringBuilder formParamBuilder = new StringBuilder(); + /** + * Encode the given form parameters as request body. + */ + private String getXWWWFormUrlencodedParams(Map formParams) { + StringBuilder formParamBuilder = new StringBuilder(); -for (Entry - param : formParams.entrySet()) { -String keyStr = parameterToString(param.getKey()); -String valueStr = parameterToString(param.getValue()); + for (Entry param : formParams.entrySet()) { + String keyStr = parameterToString(param.getKey()); + String valueStr = parameterToString(param.getValue()); -try { -formParamBuilder.append(URLEncoder.encode(keyStr, "utf8")) -.append("=") -.append(URLEncoder.encode(valueStr, "utf8")); -formParamBuilder.append("&"); -} catch (UnsupportedEncodingException e) { -// move on to next -} -} -String encodedFormParams = formParamBuilder.toString(); -if (encodedFormParams.endsWith("&")) { -encodedFormParams = encodedFormParams.substring(0, -encodedFormParams.length() - 1); -} -return encodedFormParams; -} + try { + formParamBuilder.append(URLEncoder.encode(keyStr, "utf8")) + .append("=") + .append(URLEncoder.encode(valueStr, "utf8")); + formParamBuilder.append("&"); + } catch (UnsupportedEncodingException e) { + // move on to next + } + } + String encodedFormParams = formParamBuilder.toString(); + if (encodedFormParams.endsWith("&")) { + encodedFormParams = encodedFormParams.substring(0, + encodedFormParams.length() - 1); + } + return encodedFormParams; + } -/** -* Get an existing client or create a new client to handle HTTP request. -*/ -private Client getClient() { -if(!hostMap.containsKey(basePath)) { -Client client = Client.create(); -if (debugging) -client.addFilter(new LoggingFilter()); -hostMap.put(basePath, client); -} -return hostMap.get(basePath); -} + /** + * Get an existing client or create a new client to handle HTTP request. + */ + private Client getClient() { + if(!hostMap.containsKey(basePath)) { + Client client = Client.create(); + if (debugging) + client.addFilter(new LoggingFilter()); + hostMap.put(basePath, client); + } + return hostMap.get(basePath); + } } diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/java/src/main/java/io/swagger/client/ApiException.java index 77ab741efe9..a39785eb47e 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/ApiException.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/ApiException.java @@ -4,52 +4,44 @@ import java.util.Map; import java.util.List; public class ApiException extends Exception { -private int code = 0; -private String message = null; -private Map -> responseHeaders = null; - private String responseBody = null; + private int code = 0; + private String message = null; + private Map> responseHeaders = null; + private String responseBody = null; - public ApiException() {} + public ApiException() {} - public ApiException(int code, String message) { + public ApiException(int code, String message) { this.code = code; this.message = message; - } + } - public ApiException(int code, String message, Map - > responseHeaders, String responseBody) { - this.code = code; - this.message = message; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this.code = code; + this.message = message; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } - public int getCode() { - return code; - } + public int getCode() { + return code; + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } - /** - * Get the HTTP response headers. - */ - public Map - > getResponseHeaders() { - return responseHeaders; - } + /** + * Get the HTTP response headers. + */ + public Map> getResponseHeaders() { + return responseHeaders; + } - /** - * Get the HTTP response body. - */ - public String getResponseBody() { - return responseBody; - } - } + /** + * Get the HTTP response body. + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/Configuration.java b/samples/client/petstore/java/src/main/java/io/swagger/client/Configuration.java index 9c429f5df31..04899a110f6 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/Configuration.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/Configuration.java @@ -1,21 +1,21 @@ package io.swagger.client; public class Configuration { -private static ApiClient defaultApiClient = new ApiClient(); + private static ApiClient defaultApiClient = new ApiClient(); -/** -* Get the default API client, which would be used when creating API -* instances without providing an API client. -*/ -public static ApiClient getDefaultApiClient() { -return defaultApiClient; -} + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } -/** -* Set the default API client, which would be used when creating API -* instances without providing an API client. -*/ -public static void setDefaultApiClient(ApiClient apiClient) { -defaultApiClient = apiClient; -} + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } } diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/JsonUtil.java b/samples/client/petstore/java/src/main/java/io/swagger/client/JsonUtil.java index a2b18b74574..8e7e686dd0c 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/JsonUtil.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/JsonUtil.java @@ -8,16 +8,16 @@ import com.fasterxml.jackson.core.JsonGenerator.Feature; import com.fasterxml.jackson.datatype.joda.*; public class JsonUtil { -public static ObjectMapper mapper; + public static ObjectMapper mapper; -static { -mapper = new ObjectMapper(); -mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); -mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); -mapper.registerModule(new JodaModule()); -} + static { + mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.registerModule(new JodaModule()); + } -public static ObjectMapper getJsonMapper() { -return mapper; -} + public static ObjectMapper getJsonMapper() { + return mapper; + } } diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/src/main/java/io/swagger/client/StringUtil.java index 99b76d84166..5b5af2d5ce0 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/StringUtil.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/StringUtil.java @@ -1,41 +1,41 @@ package io.swagger.client; public class StringUtil { -/** -* Check if the given array contains the given value (with case-insensitive comparison). -* -* @param array The array -* @param value The value to search -* @return true if the array contains the value -*/ -public static boolean containsIgnoreCase(String[] array, String value) { -for (String str : array) { -if (value == null && str == null) return true; -if (value != null && value.equalsIgnoreCase(str)) return true; -} -return false; -} + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) return true; + if (value != null && value.equalsIgnoreCase(str)) return true; + } + return false; + } -/** -* Join an array of strings with the given separator. -*

- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

-* -* @param array The array of strings -* @param separator The separator -* @return the resulting string -*/ -public static String join(String[] array, String separator) { -int len = array.length; -if (len == 0) return ""; + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) return ""; -StringBuilder out = new StringBuilder(); -out.append(array[0]); -for (int i = 1; i < len; i++) { -out.append(separator).append(array[i]); -} -return out.toString(); -} + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } } diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java index 72ca45ba907..c102cf00b51 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java @@ -20,591 +20,543 @@ import java.io.File; import java.util.Map; import java.util.HashMap; - public class PetApi { - private ApiClient apiClient; +public class PetApi { + private ApiClient apiClient; - public PetApi() { + public PetApi() { this(Configuration.getDefaultApiClient()); - } + } - public PetApi(ApiClient apiClient) { + public PetApi(ApiClient apiClient) { this.apiClient = apiClient; - } + } - public ApiClient getApiClient() { + public ApiClient getApiClient() { return apiClient; - } + } - public void setApiClient(ApiClient apiClient) { + public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; + } + + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + public void updatePet (Pet body) throws ApiException { + Object postBody = body; + + + // create path and map variables + String path = "/pet".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + "application/json", "application/xml" + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + } + try { + String[] authNames = new String[] { "petstore_auth" }; + String response = apiClient.invokeAPI(path, "PUT", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + public void addPet (Pet body) throws ApiException { + Object postBody = body; - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - */ - public void updatePet (Pet body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); + // create path and map variables + String path = "/pet".replaceAll("\\{format\\}","json"); - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - "application/json", "application/xml" - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { "petstore_auth" }; - String response = apiClient.invokeAPI(path, "PUT", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - */ - public void addPet (Pet body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/pet".replaceAll("\\{format\\}","json"); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - "application/json", "application/xml" - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { "petstore_auth" }; - String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Finds Pets by status - * Multiple status values can be provided with comma seperated strings - * @param status Status values that need to be considered for filter - * @return List - */ - public List findPetsByStatus (List status) throws ApiException { - Object postBody = null; - - // create path and map variables - String path = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); + final String[] contentTypes = { + "application/json", "application/xml" + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); - if (status != null) - queryParams.put("status", apiClient.parameterToString(status)); - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) postBody = mp; - } - else { - - } + } + else { + + } - try { - String[] authNames = new String[] { "petstore_auth" }; - String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ + try { + String[] authNames = new String[] { "petstore_auth" }; + String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma seperated strings + * @param status Status values that need to be considered for filter + * @return List + */ + public List findPetsByStatus (List status) throws ApiException { + Object postBody = null; + + + // create path and map variables + String path = "/pet/findByStatus".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + if (status != null) + queryParams.put("status", apiClient.parameterToString(status)); + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { "petstore_auth" }; + String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ return (List) apiClient.deserialize(response, "array", Pet.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Finds Pets by tags + * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return List + */ + public List findPetsByTags (List tags) throws ApiException { + Object postBody = null; - /** - * Finds Pets by tags - * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return List - */ - public List findPetsByTags (List tags) throws ApiException { - Object postBody = null; - - // create path and map variables - String path = "/pet/findByTags".replaceAll("\\{format\\}","json"); + // create path and map variables + String path = "/pet/findByTags".replaceAll("\\{format\\}","json"); - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); - if (tags != null) - queryParams.put("tags", apiClient.parameterToString(tags)); - + if (tags != null) + queryParams.put("tags", apiClient.parameterToString(tags)); + - + - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) postBody = mp; - } - else { - - } + } + else { + + } - try { - String[] authNames = new String[] { "petstore_auth" }; - String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ + try { + String[] authNames = new String[] { "petstore_auth" }; + String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ return (List) apiClient.deserialize(response, "array", Pet.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Find pet by ID + * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * @param petId ID of pet that needs to be fetched + * @return Pet + */ + public Pet getPetById (Long petId) throws ApiException { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); + } - /** - * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched - * @return Pet - */ - public Pet getPetById (Long petId) throws ApiException { - Object postBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); - } - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); - + - + - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) postBody = mp; - } - else { - - } + } + else { + + } - try { - String[] authNames = new String[] { "api_key", "petstore_auth" }; - String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ + try { + String[] authNames = new String[] { "petstore_auth", "api_key" }; + String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ return (Pet) apiClient.deserialize(response, "", Pet.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - * @return void - */ - public void updatePetWithForm (String petId, String name, String status) throws ApiException { - Object postBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); - } - - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - "application/x-www-form-urlencoded" - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if (name != null) { - hasFields = true; - mp.field("name", apiClient.parameterToString(name), MediaType.MULTIPART_FORM_DATA_TYPE); - } - - if (status != null) { - hasFields = true; - mp.field("status", apiClient.parameterToString(status), MediaType.MULTIPART_FORM_DATA_TYPE); - } - - if(hasFields) - postBody = mp; - } - else { - if (name != null) - formParams.put("name", apiClient.parameterToString(name)); - if (status != null) - formParams.put("status", apiClient.parameterToString(status)); - - } - - try { - String[] authNames = new String[] { "petstore_auth" }; - String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Deletes a pet - * - * @param apiKey - * @param petId Pet id to delete - * @return void - */ - public void deletePet (String apiKey, Long petId) throws ApiException { - Object postBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); - } - - - // create path and map variables - String path = "/pet/{petId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - if (apiKey != null) - headerParams.put("api_key", apiClient.parameterToString(apiKey)); - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { "petstore_auth" }; - String response = apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - * @return void - */ - public void uploadFile (Long petId, String additionalMetadata, File file) throws ApiException { - Object postBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); - } - - - // create path and map variables - String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - "multipart/form-data" - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if (additionalMetadata != null) { - hasFields = true; - mp.field("additionalMetadata", apiClient.parameterToString(additionalMetadata), MediaType.MULTIPART_FORM_DATA_TYPE); - } - - if (file != null) { - hasFields = true; - mp.field("file", file.getName()); - mp.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)); - } - - if(hasFields) - postBody = mp; - } - else { - if (additionalMetadata != null) - formParams.put("additionalMetadata", apiClient.parameterToString(additionalMetadata)); - - - } - - try { - String[] authNames = new String[] { "petstore_auth" }; - String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - + } + } catch (ApiException ex) { + throw ex; } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return void + */ + public void updatePetWithForm (String petId, String name, String status) throws ApiException { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); + } + + + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + "application/x-www-form-urlencoded" + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if (name != null) { + hasFields = true; + mp.field("name", apiClient.parameterToString(name), MediaType.MULTIPART_FORM_DATA_TYPE); + } + + if (status != null) { + hasFields = true; + mp.field("status", apiClient.parameterToString(status), MediaType.MULTIPART_FORM_DATA_TYPE); + } + + if(hasFields) + postBody = mp; + } + else { + if (name != null) + formParams.put("name", apiClient.parameterToString(name)); + if (status != null) + formParams.put("status", apiClient.parameterToString(status)); + + } + + try { + String[] authNames = new String[] { "petstore_auth" }; + String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Deletes a pet + * + * @param apiKey + * @param petId Pet id to delete + * @return void + */ + public void deletePet (String apiKey, Long petId) throws ApiException { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); + } + + + // create path and map variables + String path = "/pet/{petId}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + if (apiKey != null) + headerParams.put("api_key", apiClient.parameterToString(apiKey)); + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { "petstore_auth" }; + String response = apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @return void + */ + public void uploadFile (Long petId, String additionalMetadata, File file) throws ApiException { + Object postBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); + } + + + // create path and map variables + String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + "multipart/form-data" + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if (additionalMetadata != null) { + hasFields = true; + mp.field("additionalMetadata", apiClient.parameterToString(additionalMetadata), MediaType.MULTIPART_FORM_DATA_TYPE); + } + + if (file != null) { + hasFields = true; + mp.field("file", file.getName()); + mp.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)); + } + + if(hasFields) + postBody = mp; + } + else { + if (additionalMetadata != null) + formParams.put("additionalMetadata", apiClient.parameterToString(additionalMetadata)); + + + } + + try { + String[] authNames = new String[] { "petstore_auth" }; + String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java index 1aa551e26ee..727e791c603 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java @@ -20,287 +20,263 @@ import java.io.File; import java.util.Map; import java.util.HashMap; - public class StoreApi { - private ApiClient apiClient; +public class StoreApi { + private ApiClient apiClient; - public StoreApi() { + public StoreApi() { this(Configuration.getDefaultApiClient()); - } + } - public StoreApi(ApiClient apiClient) { + public StoreApi(ApiClient apiClient) { this.apiClient = apiClient; - } + } - public ApiClient getApiClient() { + public ApiClient getApiClient() { return apiClient; - } + } - public void setApiClient(ApiClient apiClient) { + public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; - } + } + + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map + */ + public Map getInventory () throws ApiException { + Object postBody = null; + + + // create path and map variables + String path = "/store/inventory".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map - */ - public Map getInventory () throws ApiException { - Object postBody = null; - - // create path and map variables - String path = "/store/inventory".replaceAll("\\{format\\}","json"); + - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); - + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) postBody = mp; - } - else { - - } + } + else { + + } - try { - String[] authNames = new String[] { "api_key" }; - String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ + try { + String[] authNames = new String[] { "api_key" }; + String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ return (Map) apiClient.deserialize(response, "map", Map.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - */ - public Order placeOrder (Order body) throws ApiException { - Object postBody = body; - - - // create path and map variables - String path = "/store/order".replaceAll("\\{format\\}","json"); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return (Order) apiClient.deserialize(response, "", Order.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - public Order getOrderById (String orderId) throws ApiException { - Object postBody = null; - - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); - } - - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return (Order) apiClient.deserialize(response, "", Order.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - */ - public void deleteOrder (String orderId) throws ApiException { - Object postBody = null; - - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); - } - - - // create path and map variables - String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - + } + } catch (ApiException ex) { + throw ex; } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + public Order placeOrder (Order body) throws ApiException { + Object postBody = body; + + + // create path and map variables + String path = "/store/order".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return (Order) apiClient.deserialize(response, "", Order.class); + } + else { + return null; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + public Order getOrderById (String orderId) throws ApiException { + Object postBody = null; + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); + } + + + // create path and map variables + String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return (Order) apiClient.deserialize(response, "", Order.class); + } + else { + return null; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + public void deleteOrder (String orderId) throws ApiException { + Object postBody = null; + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); + } + + + // create path and map variables + String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java index 8f03ada8d66..9e55bbed590 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java @@ -20,551 +20,503 @@ import java.io.File; import java.util.Map; import java.util.HashMap; - public class UserApi { - private ApiClient apiClient; +public class UserApi { + private ApiClient apiClient; - public UserApi() { + public UserApi() { this(Configuration.getDefaultApiClient()); - } + } - public UserApi(ApiClient apiClient) { + public UserApi(ApiClient apiClient) { this.apiClient = apiClient; - } + } - public ApiClient getApiClient() { + public ApiClient getApiClient() { return apiClient; - } + } - public void setApiClient(ApiClient apiClient) { + public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; + } + + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + public void createUser (User body) throws ApiException { + Object postBody = body; + + + // create path and map variables + String path = "/user".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + } + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + public void createUsersWithArrayInput (List body) throws ApiException { + Object postBody = body; - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - */ - public void createUser (User body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/user".replaceAll("\\{format\\}","json"); + // create path and map variables + String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - public void createUsersWithArrayInput (List body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - public void createUsersWithListInput (List body) throws ApiException { - Object postBody = body; - - // create path and map variables - String path = "/user/createWithList".replaceAll("\\{format\\}","json"); + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) postBody = mp; - } - else { - - } + } + else { + + } - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ return ; - } - else { + } + else { return ; - } - } catch (ApiException ex) { - throw ex; - } - } + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + public void createUsersWithListInput (List body) throws ApiException { + Object postBody = body; - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return String - */ - public String loginUser (String username, String password) throws ApiException { - Object postBody = null; - - // create path and map variables - String path = "/user/login".replaceAll("\\{format\\}","json"); + // create path and map variables + String path = "/user/createWithList".replaceAll("\\{format\\}","json"); - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); - if (username != null) - queryParams.put("username", apiClient.parameterToString(username)); - if (password != null) - queryParams.put("password", apiClient.parameterToString(password)); - + - + - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) postBody = mp; - } - else { - - } + } + else { + + } - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "POST", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return String + */ + public String loginUser (String username, String password) throws ApiException { + Object postBody = null; + + + // create path and map variables + String path = "/user/login".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + if (username != null) + queryParams.put("username", apiClient.parameterToString(username)); + if (password != null) + queryParams.put("password", apiClient.parameterToString(password)); + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ return (String) apiClient.deserialize(response, "", String.class); - } - else { + } + else { return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Logs out current logged in user session - * - * @return void - */ - public void logoutUser () throws ApiException { - Object postBody = null; - - - // create path and map variables - String path = "/user/logout".replaceAll("\\{format\\}","json"); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - public User getUserByName (String username) throws ApiException { - Object postBody = null; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); - } - - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return (User) apiClient.deserialize(response, "", User.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - */ - public void updateUser (String username, User body) throws ApiException { - Object postBody = body; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); - } - - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "PUT", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - */ - public void deleteUser (String username) throws ApiException { - Object postBody = null; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); - } - - - // create path and map variables - String path = "/user/{username}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - Map - queryParams = new HashMap - (); - Map - headerParams = new HashMap - (); - Map - formParams = new HashMap - (); - - - - - - final String[] accepts = { - "application/json", "application/xml" - }; - final String accept = apiClient.selectHeaderAccept(accepts); - - final String[] contentTypes = { - - }; - final String contentType = apiClient.selectHeaderContentType(contentTypes); - - if(contentType.startsWith("multipart/form-data")) { - boolean hasFields = false; - FormDataMultiPart mp = new FormDataMultiPart(); - - if(hasFields) - postBody = mp; - } - else { - - } - - try { - String[] authNames = new String[] { }; - String response = apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - + } + } catch (ApiException ex) { + throw ex; } + } + + /** + * Logs out current logged in user session + * + * @return void + */ + public void logoutUser () throws ApiException { + Object postBody = null; + + + // create path and map variables + String path = "/user/logout".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + public User getUserByName (String username) throws ApiException { + Object postBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); + } + + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return (User) apiClient.deserialize(response, "", User.class); + } + else { + return null; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + public void updateUser (String username, User body) throws ApiException { + Object postBody = body; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); + } + + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "PUT", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + public void deleteUser (String username) throws ApiException { + Object postBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); + } + + + // create path and map variables + String path = "/user/{username}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + + + final String[] accepts = { + "application/json", "application/xml" + }; + final String accept = apiClient.selectHeaderAccept(accepts); + + final String[] contentTypes = { + + }; + final String contentType = apiClient.selectHeaderContentType(contentTypes); + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String[] authNames = new String[] { }; + String response = apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + throw ex; + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/src/main/java/io/swagger/client/auth/ApiKeyAuth.java index 8d17873b0e9..ce55babb51d 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/auth/ApiKeyAuth.java @@ -3,55 +3,53 @@ package io.swagger.client.auth; import java.util.Map; public class ApiKeyAuth implements Authentication { -private final String location; -private final String paramName; + private final String location; + private final String paramName; -private String apiKey; -private String apiKeyPrefix; + private String apiKey; + private String apiKeyPrefix; -public ApiKeyAuth(String location, String paramName) { -this.location = location; -this.paramName = paramName; -} + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } -public String getLocation() { -return location; -} + public String getLocation() { + return location; + } -public String getParamName() { -return paramName; -} + public String getParamName() { + return paramName; + } -public String getApiKey() { -return apiKey; -} + public String getApiKey() { + return apiKey; + } -public void setApiKey(String apiKey) { -this.apiKey = apiKey; -} + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } -public String getApiKeyPrefix() { -return apiKeyPrefix; -} + public String getApiKeyPrefix() { + return apiKeyPrefix; + } -public void setApiKeyPrefix(String apiKeyPrefix) { -this.apiKeyPrefix = apiKeyPrefix; -} + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } -@Override -public void applyToParams(Map - queryParams, Map - headerParams) { -String value; -if (apiKeyPrefix != null) { -value = apiKeyPrefix + " " + apiKey; -} else { -value = apiKey; -} -if (location == "query") { -queryParams.put(paramName, value); -} else if (location == "header") { -headerParams.put(paramName, value); -} -} + @Override + public void applyToParams(Map queryParams, Map headerParams) { + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location == "query") { + queryParams.put(paramName, value); + } else if (location == "header") { + headerParams.put(paramName, value); + } + } } diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/auth/Authentication.java b/samples/client/petstore/java/src/main/java/io/swagger/client/auth/Authentication.java index e88af689acc..3f372404c8d 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/auth/Authentication.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/auth/Authentication.java @@ -3,8 +3,6 @@ package io.swagger.client.auth; import java.util.Map; public interface Authentication { -/** Apply authentication settings to header and query params. */ -void applyToParams(Map - queryParams, Map - headerParams); + /** Apply authentication settings to header and query params. */ + void applyToParams(Map queryParams, Map headerParams); } diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/src/main/java/io/swagger/client/auth/HttpBasicAuth.java index fa1727e1252..24bff8c2266 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/auth/HttpBasicAuth.java @@ -6,34 +6,32 @@ import java.io.UnsupportedEncodingException; import javax.xml.bind.DatatypeConverter; public class HttpBasicAuth implements Authentication { -private String username; -private String password; + private String username; + private String password; -public String getUsername() { -return username; -} + public String getUsername() { + return username; + } -public void setUsername(String username) { -this.username = username; -} + public void setUsername(String username) { + this.username = username; + } -public String getPassword() { -return password; -} + public String getPassword() { + return password; + } -public void setPassword(String password) { -this.password = password; -} + public void setPassword(String password) { + this.password = password; + } -@Override -public void applyToParams(Map - queryParams, Map - headerParams) { -String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -try { -headerParams.put("Authorization", "Basic " + DatatypeConverter.printBase64Binary(str.getBytes("UTF-8"))); -} catch (UnsupportedEncodingException e) { -throw new RuntimeException(e); -} -} + @Override + public void applyToParams(Map queryParams, Map headerParams) { + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + try { + headerParams.put("Authorization", "Basic " + DatatypeConverter.printBase64Binary(str.getBytes("UTF-8"))); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } } diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/auth/OAuth.java b/samples/client/petstore/java/src/main/java/io/swagger/client/auth/OAuth.java index fe0fa052bbf..d834f4580c2 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/auth/OAuth.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/auth/OAuth.java @@ -3,10 +3,8 @@ package io.swagger.client.auth; import java.util.Map; public class OAuth implements Authentication { -@Override -public void applyToParams(Map - queryParams, Map - headerParams) { -// TODO: support oauth -} + @Override + public void applyToParams(Map queryParams, Map headerParams) { + // TODO: support oauth + } } diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Category.java index 7c8e4819f6e..d43f6a9758f 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Category.java @@ -4,41 +4,41 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.fasterxml.jackson.annotation.JsonProperty; - - @ApiModel(description = "") - public class Category { - - private Long id = null; - private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class Category { + + private Long id = null; + private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Category {\n"); @@ -46,6 +46,5 @@ import com.fasterxml.jackson.annotation.JsonProperty; sb.append(" name: ").append(name).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Order.java index 301f8fb1c44..25864d8c9cc 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Order.java @@ -5,97 +5,97 @@ import java.util.Date; import io.swagger.annotations.*; import com.fasterxml.jackson.annotation.JsonProperty; - - @ApiModel(description = "") - public class Order { - - private Long id = null; - private Long petId = null; - private Integer quantity = null; - private Date shipDate = null; - public enum StatusEnum { - placed, approved, delivered, - }; - private StatusEnum status = null; - private Boolean complete = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private Date shipDate = null; + public enum StatusEnum { + placed, approved, delivered, + }; + private StatusEnum status = null; + private Boolean complete = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("petId") - public Long getPetId() { - return petId; - } - public void setPetId(Long petId) { - this.petId = petId; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("quantity") - public Integer getQuantity() { - return quantity; - } - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("shipDate") - public Date getShipDate() { - return shipDate; - } - public void setShipDate(Date shipDate) { - this.shipDate = shipDate; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } - - /** - * Order Status - **/ - @ApiModelProperty(value = "Order Status") - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("complete") - public Boolean getComplete() { - return complete; - } - public void setComplete(Boolean complete) { - this.complete = complete; - } + + /** + * Order Status + **/ + @ApiModelProperty(value = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } - + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Order {\n"); @@ -107,6 +107,5 @@ import com.fasterxml.jackson.annotation.JsonProperty; sb.append(" complete: ").append(complete).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Pet.java index fcb4b51113f..ddd0e1038c0 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Pet.java @@ -1,103 +1,103 @@ package io.swagger.client.model; import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; import java.util.*; +import io.swagger.client.model.Tag; import io.swagger.annotations.*; import com.fasterxml.jackson.annotation.JsonProperty; - - @ApiModel(description = "") - public class Pet { - - private Long id = null; - private Category category = null; - private String name = null; - private List photoUrls = new ArrayList() ; - private List tags = new ArrayList() ; - public enum StatusEnum { - available, pending, sold, - }; - private StatusEnum status = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class Pet { + + private Long id = null; + private Category category = null; + private String name = null; + private List photoUrls = new ArrayList() ; + private List tags = new ArrayList() ; + public enum StatusEnum { + available, pending, sold, + }; + private StatusEnum status = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("category") - public Category getCategory() { - return category; - } - public void setCategory(Category category) { - this.category = category; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - - /** - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } - - /** - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty("photoUrls") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } + + /** + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("tags") - public List getTags() { - return tags; - } - public void setTags(List tags) { - this.tags = tags; - } + + /** + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } - - /** - * pet status in the store - **/ - @ApiModelProperty(value = "pet status in the store") - @JsonProperty("status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } - + + /** + * pet status in the store + **/ + @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Pet {\n"); @@ -109,6 +109,5 @@ import com.fasterxml.jackson.annotation.JsonProperty; sb.append(" status: ").append(status).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java index 739eba7d0af..63a2ca3b739 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java @@ -4,41 +4,41 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.fasterxml.jackson.annotation.JsonProperty; - - @ApiModel(description = "") - public class Tag { - - private Long id = null; - private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class Tag { + + private Long id = null; + private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("name") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Tag {\n"); @@ -46,6 +46,5 @@ import com.fasterxml.jackson.annotation.JsonProperty; sb.append(" name: ").append(name).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java index 5f4e2d6e36f..0ace5b7e30a 100644 --- a/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java @@ -4,120 +4,120 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.fasterxml.jackson.annotation.JsonProperty; - - @ApiModel(description = "") - public class User { - - private Long id = null; - private String username = null; - private String firstName = null; - private String lastName = null; - private String email = null; - private String password = null; - private String phone = null; - private Integer userStatus = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("id") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } +@ApiModel(description = "") +public class User { + + private Long id = null; + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("username") - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("firstName") - public String getFirstName() { - return firstName; - } - public void setFirstName(String firstName) { - this.firstName = firstName; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("lastName") - public String getLastName() { - return lastName; - } - public void setLastName(String lastName) { - this.lastName = lastName; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("email") - public String getEmail() { - return email; - } - public void setEmail(String email) { - this.email = email; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("password") - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } - - /** - **/ - @ApiModelProperty(value = "") - @JsonProperty("phone") - public String getPhone() { - return phone; - } - public void setPhone(String phone) { - this.phone = phone; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } - - /** - * User Status - **/ - @ApiModelProperty(value = "User Status") - @JsonProperty("userStatus") - public Integer getUserStatus() { - return userStatus; - } - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } + + /** + **/ + @ApiModelProperty(value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } - + + /** + * User Status + **/ + @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } - @Override - public String toString() { + + + @Override + public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class User {\n"); @@ -131,6 +131,5 @@ import com.fasterxml.jackson.annotation.JsonProperty; sb.append(" userStatus: ").append(userStatus).append("\n"); sb.append("}\n"); return sb.toString(); - } - } - + } +} diff --git a/samples/client/petstore/objc/Podfile b/samples/client/petstore/objc/Podfile index 9a1ad058940..61b00df61ad 100644 --- a/samples/client/petstore/objc/Podfile +++ b/samples/client/petstore/objc/Podfile @@ -1,5 +1,5 @@ platform :ios, '6.0' -xcodeproj 'PetstoreClient/PetstoreClient.xcodeproj' +xcodeproj 'swaggerClient/swaggerClient.xcodeproj' pod 'AFNetworking', '~> 2.1' pod 'JSONModel', '~> 1.0' pod 'ISO8601' diff --git a/samples/client/petstore/objc/client/SWGCategory.h b/samples/client/petstore/objc/client/SWGCategory.h index a46376c4f8b..a2fed79b4a3 100644 --- a/samples/client/petstore/objc/client/SWGCategory.h +++ b/samples/client/petstore/objc/client/SWGCategory.h @@ -1,21 +1,15 @@ -#import - +#import #import "SWGObject.h" - - @protocol SWGCategory - @end +@protocol SWGCategory +@end + +@interface SWGCategory : SWGObject - @interface SWGCategory : SWGObject - - - @property(nonatomic) NSNumber* _id; - - - @property(nonatomic) NSString* name; - +@property(nonatomic) NSNumber* _id; - @end - +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/client/SWGCategory.m b/samples/client/petstore/objc/client/SWGCategory.m index 7ea47e56bb8..c41f76a5247 100644 --- a/samples/client/petstore/objc/client/SWGCategory.m +++ b/samples/client/petstore/objc/client/SWGCategory.m @@ -1,24 +1,22 @@ - - #import "SWGCategory.h" +#import "SWGCategory.h" - @implementation SWGCategory +@implementation SWGCategory + ++ (JSONKeyMapper *)keyMapper +{ + return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }]; +} - + (JSONKeyMapper *)keyMapper - { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }]; - } ++ (BOOL)propertyIsOptional:(NSString *)propertyName +{ + NSArray *optionalProperties = @[@"_id", @"name"]; - + (BOOL)propertyIsOptional:(NSString *)propertyName - { - NSArray *optionalProperties = @[@"_id", @"name"]; + if ([optionalProperties containsObject:propertyName]) { + return YES; + } + else { + return NO; + } +} - if ([optionalProperties containsObject:propertyName]) { - return YES; - } - else { - return NO; - } - } - - - @end +@end diff --git a/samples/client/petstore/objc/client/SWGConfiguration.h b/samples/client/petstore/objc/client/SWGConfiguration.h index 529e07aa81c..33023ca3c6f 100644 --- a/samples/client/petstore/objc/client/SWGConfiguration.h +++ b/samples/client/petstore/objc/client/SWGConfiguration.h @@ -1,57 +1,56 @@ -#import - +#import @interface SWGConfiguration : NSObject /** -* Api key values for Api Key type Authentication -* -* To add or remove api key, use `setValue:forApiKeyField:`. -*/ + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setValue:forApiKeyField:`. + */ @property (readonly, nonatomic, strong) NSDictionary *apiKey; /** -* Api key prefix values to be prepend to the respective api key -* -* To add or remove prefix, use `setValue:forApiKeyPrefixField:`. -*/ + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setValue:forApiKeyPrefixField:`. + */ @property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; /** -* Usename and Password for Basic type Authentication -*/ + * Usename and Password for Basic type Authentication + */ @property (nonatomic) NSString *username; @property (nonatomic) NSString *password; /** -* Get configuration singleton instance -*/ + * Get configuration singleton instance + */ + (instancetype) sharedConfig; /** -* Sets field in `apiKey` -*/ + * Sets field in `apiKey` + */ - (void) setValue:(NSString *)value forApiKeyField:(NSString*)field; /** -* Sets field in `apiKeyPrefix` -*/ + * Sets field in `apiKeyPrefix` + */ - (void) setValue:(NSString *)value forApiKeyPrefixField:(NSString *)field; /** -* Get API key (with prefix if set) -*/ + * Get API key (with prefix if set) + */ - (NSString *) getApiKeyWithPrefix:(NSString *) key; /** -* Get Basic Auth token -*/ + * Get Basic Auth token + */ - (NSString *) getBasicAuthToken; /** -* Get Authentication Setings -*/ + * Get Authentication Setings + */ - (NSDictionary *) authSettings; @end diff --git a/samples/client/petstore/objc/client/SWGConfiguration.m b/samples/client/petstore/objc/client/SWGConfiguration.m index dc0bdb44d42..89d5a597946 100644 --- a/samples/client/petstore/objc/client/SWGConfiguration.m +++ b/samples/client/petstore/objc/client/SWGConfiguration.m @@ -12,81 +12,81 @@ #pragma mark - Singletion Methods + (instancetype) sharedConfig { -static SWGConfiguration *shardConfig = nil; -static dispatch_once_t onceToken; -dispatch_once(&onceToken, ^{ -shardConfig = [[self alloc] init]; -}); -return shardConfig; + static SWGConfiguration *shardConfig = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardConfig = [[self alloc] init]; + }); + return shardConfig; } #pragma mark - Initialize Methods - (instancetype) init { -self = [super init]; -if (self) { -self.username = @""; -self.password = @""; -self.mutableApiKey = [NSMutableDictionary dictionary]; -self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; -} -return self; + self = [super init]; + if (self) { + self.username = @""; + self.password = @""; + self.mutableApiKey = [NSMutableDictionary dictionary]; + self.mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + } + return self; } #pragma mark - Instance Methods - (NSString *) getApiKeyWithPrefix:(NSString *)key { -if ([self.apiKeyPrefix objectForKey:key] && [self.apiKey objectForKey:key]) { -return [NSString stringWithFormat:@"%@ %@", [self.apiKeyPrefix objectForKey:key], [self.apiKey objectForKey:key]]; -} -else if ([self.apiKey objectForKey:key]) { -return [NSString stringWithFormat:@"%@", [self.apiKey objectForKey:key]]; -} -else { -return @""; -} + if ([self.apiKeyPrefix objectForKey:key] && [self.apiKey objectForKey:key]) { + return [NSString stringWithFormat:@"%@ %@", [self.apiKeyPrefix objectForKey:key], [self.apiKey objectForKey:key]]; + } + else if ([self.apiKey objectForKey:key]) { + return [NSString stringWithFormat:@"%@", [self.apiKey objectForKey:key]]; + } + else { + return @""; + } } - (NSString *) getBasicAuthToken { -NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password]; -NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; -basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; - -return basicAuthCredentials; + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", self.username, self.password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; } #pragma mark - Setter Methods - (void) setValue:(NSString *)value forApiKeyField:(NSString *)field { -[self.mutableApiKey setValue:value forKey:field]; + [self.mutableApiKey setValue:value forKey:field]; } - (void) setValue:(NSString *)value forApiKeyPrefixField:(NSString *)field { -[self.mutableApiKeyPrefix setValue:value forKey:field]; + [self.mutableApiKeyPrefix setValue:value forKey:field]; } #pragma mark - Getter Methods - (NSDictionary *) apiKey { -return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; + return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; } - (NSDictionary *) apiKeyPrefix { -return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; + return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; } #pragma mark - - (NSDictionary *) authSettings { -return @{ - @"api_key": @{ - @"type": @"api_key", - @"in": @"header", - @"key": @"api_key", - @"value": [self getApiKeyWithPrefix:@"api_key"] - }, - -}; + return @{ + @"api_key": @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"api_key", + @"value": [self getApiKeyWithPrefix:@"api_key"] + }, + + }; } @end diff --git a/samples/client/petstore/objc/client/SWGOrder.h b/samples/client/petstore/objc/client/SWGOrder.h index 397158e4e7e..c4f4f6e81ad 100644 --- a/samples/client/petstore/objc/client/SWGOrder.h +++ b/samples/client/petstore/objc/client/SWGOrder.h @@ -1,34 +1,24 @@ -#import - +#import #import "SWGObject.h" - - @protocol SWGOrder - @end +@protocol SWGOrder +@end + +@interface SWGOrder : SWGObject - @interface SWGOrder : SWGObject - - - @property(nonatomic) NSNumber* _id; - - - @property(nonatomic) NSNumber* petId; - - - @property(nonatomic) NSNumber* quantity; - - - @property(nonatomic) NSDate* shipDate; - - /* Order Status [optional] - */ - @property(nonatomic) NSString* status; - - - @property(nonatomic) BOOL complete; - +@property(nonatomic) NSNumber* _id; - @end - +@property(nonatomic) NSNumber* petId; + +@property(nonatomic) NSNumber* quantity; + +@property(nonatomic) NSDate* shipDate; +/* Order Status [optional] + */ +@property(nonatomic) NSString* status; + +@property(nonatomic) BOOL complete; + +@end diff --git a/samples/client/petstore/objc/client/SWGOrder.m b/samples/client/petstore/objc/client/SWGOrder.m index 19da01c2ad4..5d3179446ed 100644 --- a/samples/client/petstore/objc/client/SWGOrder.m +++ b/samples/client/petstore/objc/client/SWGOrder.m @@ -1,24 +1,22 @@ - - #import "SWGOrder.h" +#import "SWGOrder.h" - @implementation SWGOrder +@implementation SWGOrder + ++ (JSONKeyMapper *)keyMapper +{ + return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; +} - + (JSONKeyMapper *)keyMapper - { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; - } ++ (BOOL)propertyIsOptional:(NSString *)propertyName +{ + NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; - + (BOOL)propertyIsOptional:(NSString *)propertyName - { - NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; + if ([optionalProperties containsObject:propertyName]) { + return YES; + } + else { + return NO; + } +} - if ([optionalProperties containsObject:propertyName]) { - return YES; - } - else { - return NO; - } - } - - - @end +@end diff --git a/samples/client/petstore/objc/client/SWGPet.h b/samples/client/petstore/objc/client/SWGPet.h index d979eaa3845..73ff540386d 100644 --- a/samples/client/petstore/objc/client/SWGPet.h +++ b/samples/client/petstore/objc/client/SWGPet.h @@ -1,36 +1,26 @@ -#import - +#import #import "SWGObject.h" -#import "SWGTag.h" #import "SWGCategory.h" +#import "SWGTag.h" - - @protocol SWGPet - @end +@protocol SWGPet +@end + +@interface SWGPet : SWGObject - @interface SWGPet : SWGObject - - - @property(nonatomic) NSNumber* _id; - - - @property(nonatomic) SWGCategory* category; - - - @property(nonatomic) NSString* name; - - - @property(nonatomic) NSArray* photoUrls; - - - @property(nonatomic) NSArray* tags; - - /* pet status in the store [optional] - */ - @property(nonatomic) NSString* status; - +@property(nonatomic) NSNumber* _id; - @end - +@property(nonatomic) SWGCategory* category; + +@property(nonatomic) NSString* name; + +@property(nonatomic) NSArray* photoUrls; + +@property(nonatomic) NSArray* tags; +/* pet status in the store [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/client/SWGPet.m b/samples/client/petstore/objc/client/SWGPet.m index 07acd4087bc..d5559aa6f72 100644 --- a/samples/client/petstore/objc/client/SWGPet.m +++ b/samples/client/petstore/objc/client/SWGPet.m @@ -1,24 +1,22 @@ - - #import "SWGPet.h" +#import "SWGPet.h" - @implementation SWGPet +@implementation SWGPet + ++ (JSONKeyMapper *)keyMapper +{ + return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; +} - + (JSONKeyMapper *)keyMapper - { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; - } ++ (BOOL)propertyIsOptional:(NSString *)propertyName +{ + NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; - + (BOOL)propertyIsOptional:(NSString *)propertyName - { - NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; + if ([optionalProperties containsObject:propertyName]) { + return YES; + } + else { + return NO; + } +} - if ([optionalProperties containsObject:propertyName]) { - return YES; - } - else { - return NO; - } - } - - - @end +@end diff --git a/samples/client/petstore/objc/client/SWGPetApi.h b/samples/client/petstore/objc/client/SWGPetApi.h index a164578f6be..aa255cd144e 100644 --- a/samples/client/petstore/objc/client/SWGPetApi.h +++ b/samples/client/petstore/objc/client/SWGPetApi.h @@ -1,167 +1,157 @@ -#import - +#import #import "SWGPet.h" #import "SWGFile.h" #import "SWGObject.h" #import "SWGApiClient.h" - @interface SWGPetApi: NSObject +@interface SWGPetApi: NSObject - @property(nonatomic, assign)SWGApiClient *apiClient; +@property(nonatomic, assign)SWGApiClient *apiClient; - -(instancetype) initWithApiClient:(SWGApiClient *)apiClient; - -(void) addHeader:(NSString*)value forKey:(NSString*)key; - -(unsigned long) requestQueueSize; - +(SWGPetApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; - +(void) setBasePath:(NSString*)basePath; - +(NSString*) getBasePath; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; +-(void) addHeader:(NSString*)value forKey:(NSString*)key; +-(unsigned long) requestQueueSize; ++(SWGPetApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; ++(void) setBasePath:(NSString*)basePath; ++(NSString*) getBasePath; +/** + + Update an existing pet + + + @param body Pet object that needs to be added to the store + + + return type: + */ +-(NSNumber*) updatePetWithCompletionBlock :(SWGPet*) body - /** - - Update an existing pet - - - @param body Pet object that needs to be added to the store - - - return type: - */ - -(NSNumber*) updatePetWithCompletionBlock :(SWGPet*) body - - - completionHandler: (void (^)(NSError* error))completionBlock; - - - /** + completionHandler: (void (^)(NSError* error))completionBlock; - Add a new pet to the store - - @param body Pet object that needs to be added to the store - +/** - return type: - */ - -(NSNumber*) addPetWithCompletionBlock :(SWGPet*) body - - - completionHandler: (void (^)(NSError* error))completionBlock; + Add a new pet to the store + - + @param body Pet object that needs to be added to the store + + + return type: + */ +-(NSNumber*) addPetWithCompletionBlock :(SWGPet*) body - /** - - Finds Pets by status - Multiple status values can be provided with comma seperated strings - - @param status Status values that need to be considered for filter - - - return type: NSArray* - */ - -(NSNumber*) findPetsByStatusWithCompletionBlock :(NSArray*) status - - completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock; - - - - /** + completionHandler: (void (^)(NSError* error))completionBlock; - Finds Pets by tags - Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - @param tags Tags to filter by - +/** - return type: NSArray* - */ - -(NSNumber*) findPetsByTagsWithCompletionBlock :(NSArray*) tags - - completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock; - + Finds Pets by status + Multiple status values can be provided with comma seperated strings - + @param status Status values that need to be considered for filter + + + return type: NSArray* + */ +-(NSNumber*) findPetsByStatusWithCompletionBlock :(NSArray*) status - /** - - Find pet by ID - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - @param petId ID of pet that needs to be fetched - - - return type: SWGPet* - */ - -(NSNumber*) getPetByIdWithCompletionBlock :(NSNumber*) petId - - completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock; - - - + completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock; - /** - Updates a pet in the store with form data - - @param petId ID of pet that needs to be updated - @param name Updated name of the pet - @param status Updated status of the pet - +/** - return type: - */ - -(NSNumber*) updatePetWithFormWithCompletionBlock :(NSString*) petId - name:(NSString*) name - status:(NSString*) status - - - completionHandler: (void (^)(NSError* error))completionBlock; + Finds Pets by tags + Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - + @param tags Tags to filter by + + + return type: NSArray* + */ +-(NSNumber*) findPetsByTagsWithCompletionBlock :(NSArray*) tags - /** - - Deletes a pet - - - @param apiKey - @param petId Pet id to delete - - - return type: - */ - -(NSNumber*) deletePetWithCompletionBlock :(NSString*) apiKey - petId:(NSNumber*) petId - - - completionHandler: (void (^)(NSError* error))completionBlock; - - + completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock; - /** - uploads an image - - @param petId ID of pet to update - @param additionalMetadata Additional data to pass to server - @param file file to upload - +/** - return type: - */ - -(NSNumber*) uploadFileWithCompletionBlock :(NSNumber*) petId - additionalMetadata:(NSString*) additionalMetadata - file:(SWGFile*) file - - - completionHandler: (void (^)(NSError* error))completionBlock; + Find pet by ID + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - + @param petId ID of pet that needs to be fetched + + + return type: SWGPet* + */ +-(NSNumber*) getPetByIdWithCompletionBlock :(NSNumber*) petId + completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock; + + + +/** + + Updates a pet in the store with form data + + + @param petId ID of pet that needs to be updated + @param name Updated name of the pet + @param status Updated status of the pet + + + return type: + */ +-(NSNumber*) updatePetWithFormWithCompletionBlock :(NSString*) petId + name:(NSString*) name + status:(NSString*) status + + + completionHandler: (void (^)(NSError* error))completionBlock; + + +/** + + Deletes a pet + + + @param apiKey + @param petId Pet id to delete + + + return type: + */ +-(NSNumber*) deletePetWithCompletionBlock :(NSString*) apiKey + petId:(NSNumber*) petId + + + completionHandler: (void (^)(NSError* error))completionBlock; + + +/** + + uploads an image + + + @param petId ID of pet to update + @param additionalMetadata Additional data to pass to server + @param file file to upload + + + return type: + */ +-(NSNumber*) uploadFileWithCompletionBlock :(NSNumber*) petId + additionalMetadata:(NSString*) additionalMetadata + file:(SWGFile*) file + + + completionHandler: (void (^)(NSError* error))completionBlock; + + @end diff --git a/samples/client/petstore/objc/client/SWGPetApi.m b/samples/client/petstore/objc/client/SWGPetApi.m index 64349d7dcc0..e35e462c733 100644 --- a/samples/client/petstore/objc/client/SWGPetApi.m +++ b/samples/client/petstore/objc/client/SWGPetApi.m @@ -1,924 +1,918 @@ - #import "SWGPetApi.h" - #import "SWGFile.h" - #import "SWGQueryParamCollection.h" - #import "SWGPet.h" - #import "SWGFile.h" - - +#import "SWGPetApi.h" +#import "SWGFile.h" +#import "SWGQueryParamCollection.h" +#import "SWGPet.h" +#import "SWGFile.h" - @interface SWGPetApi () + +@interface SWGPetApi () @property (readwrite, nonatomic, strong) NSMutableDictionary *defaultHeaders; - @end +@end - @implementation SWGPetApi +@implementation SWGPetApi - static NSString * basePath = @"http://petstore.swagger.io/v2"; +static NSString * basePath = @"http://petstore.swagger.io/v2"; - #pragma mark - Initialize methods +#pragma mark - Initialize methods - - (id) init { +- (id) init { self = [super init]; if (self) { - self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; - self.defaultHeaders = [NSMutableDictionary dictionary]; + self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; + self.defaultHeaders = [NSMutableDictionary dictionary]; } return self; - } +} - - (id) initWithApiClient:(SWGApiClient *)apiClient { +- (id) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { - if (apiClient) { - self.apiClient = apiClient; - } - else { - self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; - } - self.defaultHeaders = [NSMutableDictionary dictionary]; + if (apiClient) { + self.apiClient = apiClient; + } + else { + self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; + } + self.defaultHeaders = [NSMutableDictionary dictionary]; } return self; - } +} - #pragma mark - +#pragma mark - - +(SWGPetApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key { ++(SWGPetApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key { static SWGPetApi* singletonAPI = nil; if (singletonAPI == nil) { - singletonAPI = [[SWGPetApi alloc] init]; - [singletonAPI addHeader:headerValue forKey:key]; + singletonAPI = [[SWGPetApi alloc] init]; + [singletonAPI addHeader:headerValue forKey:key]; } return singletonAPI; - } +} - +(void) setBasePath:(NSString*)path { ++(void) setBasePath:(NSString*)path { basePath = path; - } +} - +(NSString*) getBasePath { ++(NSString*) getBasePath { return basePath; - } +} - -(void) addHeader:(NSString*)value forKey:(NSString*)key { +-(void) addHeader:(NSString*)value forKey:(NSString*)key { [self.defaultHeaders setValue:value forKey:key]; - } +} - -(void) setHeaderValue:(NSString*) value - forKey:(NSString*)key { +-(void) setHeaderValue:(NSString*) value + forKey:(NSString*)key { [self.defaultHeaders setValue:value forKey:key]; - } +} - -(unsigned long) requestQueueSize { +-(unsigned long) requestQueueSize { return [SWGApiClient requestQueueSize]; - } +} - - /*! - * Update an existing pet - * - * \param body Pet object that needs to be added to the store - * \returns void - */ - -(NSNumber*) updatePetWithCompletionBlock: (SWGPet*) body +/*! + * Update an existing pet + * + * \param body Pet object that needs to be added to the store + * \returns void + */ +-(NSNumber*) updatePetWithCompletionBlock: (SWGPet*) body completionHandler: (void (^)(NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyDictionary = nil; - - id __body = body; - - if(__body != nil && [__body isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] init]; - for (id dict in (NSArray*)__body) { - if([dict respondsToSelector:@selector(toDictionary)]) { - [objs addObject:[(SWGObject*)dict toDictionary]]; - } - else{ - [objs addObject:dict]; - } - } - bodyDictionary = objs; - } - else if([__body respondsToSelector:@selector(toDictionary)]) { - bodyDictionary = [(SWGObject*)__body toDictionary]; - } - else if([__body isKindOfClass:[NSString class]]) { - // convert it to a dictionary - NSError * error; - NSString * str = (NSString*)__body; - NSDictionary *JSON = - [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] - options: NSJSONReadingMutableContainers - error: &error]; - bodyDictionary = JSON; - } - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"PUT" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - - } + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - /*! - * Add a new pet to the store - * - * \param body Pet object that needs to be added to the store - * \returns void - */ - -(NSNumber*) addPetWithCompletionBlock: (SWGPet*) body + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { + [headerParams removeObjectForKey:@"Accept"]; + } + + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { + responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; + } + else { + responseContentType = @""; + } + + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyDictionary = nil; + + id __body = body; + + if(__body != nil && [__body isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] init]; + for (id dict in (NSArray*)__body) { + if([dict respondsToSelector:@selector(toDictionary)]) { + [objs addObject:[(SWGObject*)dict toDictionary]]; + } + else{ + [objs addObject:dict]; + } + } + bodyDictionary = objs; + } + else if([__body respondsToSelector:@selector(toDictionary)]) { + bodyDictionary = [(SWGObject*)__body toDictionary]; + } + else if([__body isKindOfClass:[NSString class]]) { + // convert it to a dictionary + NSError * error; + NSString * str = (NSString*)__body; + NSDictionary *JSON = + [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] + options: NSJSONReadingMutableContainers + error: &error]; + bodyDictionary = JSON; + } + + + + + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"PUT" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * Add a new pet to the store + * + * \param body Pet object that needs to be added to the store + * \returns void + */ +-(NSNumber*) addPetWithCompletionBlock: (SWGPet*) body completionHandler: (void (^)(NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/json", @"application/xml"]]; - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyDictionary = nil; + + id __body = body; - id bodyDictionary = nil; - - id __body = body; - - if(__body != nil && [__body isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] init]; - for (id dict in (NSArray*)__body) { + if(__body != nil && [__body isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] init]; + for (id dict in (NSArray*)__body) { if([dict respondsToSelector:@selector(toDictionary)]) { - [objs addObject:[(SWGObject*)dict toDictionary]]; + [objs addObject:[(SWGObject*)dict toDictionary]]; } else{ - [objs addObject:dict]; + [objs addObject:dict]; } - } - bodyDictionary = objs; - } - else if([__body respondsToSelector:@selector(toDictionary)]) { - bodyDictionary = [(SWGObject*)__body toDictionary]; - } - else if([__body isKindOfClass:[NSString class]]) { - // convert it to a dictionary - NSError * error; - NSString * str = (NSString*)__body; - NSDictionary *JSON = + } + bodyDictionary = objs; + } + else if([__body respondsToSelector:@selector(toDictionary)]) { + bodyDictionary = [(SWGObject*)__body toDictionary]; + } + else if([__body isKindOfClass:[NSString class]]) { + // convert it to a dictionary + NSError * error; + NSString * str = (NSString*)__body; + NSDictionary *JSON = [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] - options: NSJSONReadingMutableContainers - error: &error]; - bodyDictionary = JSON; - } - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"POST" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - - } + options: NSJSONReadingMutableContainers + error: &error]; + bodyDictionary = JSON; + } + + - /*! - * Finds Pets by status - * Multiple status values can be provided with comma seperated strings - * \param status Status values that need to be considered for filter - * \returns NSArray* - */ - -(NSNumber*) findPetsByStatusWithCompletionBlock: (NSArray*) status + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"POST" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * Finds Pets by status + * Multiple status values can be provided with comma seperated strings + * \param status Status values that need to be considered for filter + * \returns NSArray* + */ +-(NSNumber*) findPetsByStatusWithCompletionBlock: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/findByStatus", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/findByStatus", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if(status != nil) { + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if(status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; - } - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + } + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; - - + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + - - + - + + // response is in a container + // array container response type + return [self.apiClient dictionary: requestUrl + method: @"GET" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + completionBlock(nil, error); + return; + } + + if([data isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[data count]]; + for (NSDictionary* dict in (NSArray*)data) { + + + SWGPet* d = [[SWGPet alloc] initWithDictionary:dict error:nil]; + + [objs addObject:d]; + } + completionBlock((NSArray*)objs, nil); + } + + + }]; + - - // response is in a container - // array container response type -return [self.apiClient dictionary: requestUrl -method: @"GET" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSDictionary *data, NSError *error) { -if (error) { -completionBlock(nil, error); -return; + + + + } - if([data isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[data count]]; - for (NSDictionary* dict in (NSArray*)data) { - - - SWGPet* d = [[SWGPet alloc] initWithDictionary:dict error:nil]; - - [objs addObject:d]; - } - completionBlock((NSArray*)objs, nil); - } - -}]; - - - - - - - } - - - /*! - * Finds Pets by tags - * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * \param tags Tags to filter by - * \returns NSArray* - */ - -(NSNumber*) findPetsByTagsWithCompletionBlock: (NSArray*) tags +/*! + * Finds Pets by tags + * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + * \param tags Tags to filter by + * \returns NSArray* + */ +-(NSNumber*) findPetsByTagsWithCompletionBlock: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/findByTags", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/findByTags", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if(tags != nil) { + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if(tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; - } - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + } + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; - - + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + - - + - + + // response is in a container + // array container response type + return [self.apiClient dictionary: requestUrl + method: @"GET" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + completionBlock(nil, error); + return; + } + + if([data isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[data count]]; + for (NSDictionary* dict in (NSArray*)data) { + + + SWGPet* d = [[SWGPet alloc] initWithDictionary:dict error:nil]; + + [objs addObject:d]; + } + completionBlock((NSArray*)objs, nil); + } + + + }]; + - - // response is in a container - // array container response type -return [self.apiClient dictionary: requestUrl -method: @"GET" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSDictionary *data, NSError *error) { -if (error) { -completionBlock(nil, error); -return; + + + + } - if([data isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[data count]]; - for (NSDictionary* dict in (NSArray*)data) { - - - SWGPet* d = [[SWGPet alloc] initWithDictionary:dict error:nil]; - - [objs addObject:d]; - } - completionBlock((NSArray*)objs, nil); - } - -}]; - - - - - - - } - - - /*! - * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * \param petId ID of pet that needs to be fetched - * \returns SWGPet* - */ - -(NSNumber*) getPetByIdWithCompletionBlock: (NSNumber*) petId +/*! + * Find pet by ID + * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * \param petId ID of pet that needs to be fetched + * \returns SWGPet* + */ +-(NSNumber*) getPetByIdWithCompletionBlock: (NSNumber*) petId completionHandler: (void (^)(SWGPet* output, NSError* error))completionBlock { - - // verify the required parameter 'petId' is set - NSAssert(petId != nil, @"Missing the required parameter `petId` when calling getPetById"); - + + // verify the required parameter 'petId' is set + NSAssert(petId != nil, @"Missing the required parameter `petId` when calling getPetById"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[@"api_key", @"petstore_auth"]; + // Authentication setting + NSArray *authSettings = @[@"petstore_auth", @"api_key"]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + + + + + + + + + // non container response + + + + + // complex response - - - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - - - - - - - - - - // non container response - - - - - // complex response - // comples response type + // comples response type return [self.apiClient dictionary: requestUrl - method: @"GET" - queryParams: queryParams - body: bodyDictionary - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - completionBlock: ^(NSDictionary *data, NSError *error) { - if (error) { - completionBlock(nil, error); + method: @"GET" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + completionBlock(nil, error); + + return; + } + SWGPet* result = nil; + if (data) { + result = [[SWGPet alloc] initWithDictionary:data error:nil]; + } + completionBlock(result , nil); + + }]; - return; - } - SWGPet* result = nil; - if (data) { - result = [[SWGPet alloc] initWithDictionary:data error:nil]; - } - completionBlock(result , nil); - - }]; - - - - - } - /*! - * Updates a pet in the store with form data - * - * \param petId ID of pet that needs to be updated - * \param name Updated name of the pet - * \param status Updated status of the pet - * \returns void - */ - -(NSNumber*) updatePetWithFormWithCompletionBlock: (NSString*) petId + + +} + +/*! + * Updates a pet in the store with form data + * + * \param petId ID of pet that needs to be updated + * \param name Updated name of the pet + * \param status Updated status of the pet + * \returns void + */ +-(NSNumber*) updatePetWithFormWithCompletionBlock: (NSString*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error))completionBlock { - - // verify the required parameter 'petId' is set - NSAssert(petId != nil, @"Missing the required parameter `petId` when calling updatePetWithForm"); - + + // verify the required parameter 'petId' is set + NSAssert(petId != nil, @"Missing the required parameter `petId` when calling updatePetWithForm"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/x-www-form-urlencoded"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyDictionary = nil; - - - - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - - - - formParams[@"name"] = name; - - if(bodyDictionary == nil) { - bodyDictionary = [[NSMutableArray alloc] init]; - } - [bodyDictionary addObject:formParams]; - - - formParams[@"status"] = status; - - if(bodyDictionary == nil) { - bodyDictionary = [[NSMutableArray alloc] init]; - } - [bodyDictionary addObject:formParams]; - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"POST" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - - } + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - /*! - * Deletes a pet - * - * \param apiKey - * \param petId Pet id to delete - * \returns void - */ - -(NSNumber*) deletePetWithCompletionBlock: (NSString*) apiKey + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { + [headerParams removeObjectForKey:@"Accept"]; + } + + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { + responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; + } + else { + responseContentType = @""; + } + + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"application/x-www-form-urlencoded"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyDictionary = nil; + + + + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + + + formParams[@"name"] = name; + + if(bodyDictionary == nil) { + bodyDictionary = [[NSMutableArray alloc] init]; + } + [bodyDictionary addObject:formParams]; + + + formParams[@"status"] = status; + + if(bodyDictionary == nil) { + bodyDictionary = [[NSMutableArray alloc] init]; + } + [bodyDictionary addObject:formParams]; + + + + + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"POST" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * Deletes a pet + * + * \param apiKey + * \param petId Pet id to delete + * \returns void + */ +-(NSNumber*) deletePetWithCompletionBlock: (NSString*) apiKey petId: (NSNumber*) petId completionHandler: (void (^)(NSError* error))completionBlock { - - // verify the required parameter 'petId' is set - NSAssert(petId != nil, @"Missing the required parameter `petId` when calling deletePet"); - + + // verify the required parameter 'petId' is set + NSAssert(petId != nil, @"Missing the required parameter `petId` when calling deletePet"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - if(apiKey != nil) + if(apiKey != nil) headerParams[@"api_key"] = apiKey; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; - - - - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"DELETE" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - - } + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - /*! - * uploads an image - * - * \param petId ID of pet to update - * \param additionalMetadata Additional data to pass to server - * \param file file to upload - * \returns void - */ - -(NSNumber*) uploadFileWithCompletionBlock: (NSNumber*) petId + + + + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"DELETE" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * uploads an image + * + * \param petId ID of pet to update + * \param additionalMetadata Additional data to pass to server + * \param file file to upload + * \returns void + */ +-(NSNumber*) uploadFileWithCompletionBlock: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (SWGFile*) file completionHandler: (void (^)(NSError* error))completionBlock { - - // verify the required parameter 'petId' is set - NSAssert(petId != nil, @"Missing the required parameter `petId` when calling uploadFile"); - + + // verify the required parameter 'petId' is set + NSAssert(petId != nil, @"Missing the required parameter `petId` when calling uploadFile"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}/uploadImage", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet/{petId}/uploadImage", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"petId", @"}"]] withString: [SWGApiClient escape:petId]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"multipart/form-data"]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[@"multipart/form-data"]]; - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; - - + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + + formParams[@"additionalMetadata"] = additionalMetadata; + + if(bodyDictionary == nil) { + bodyDictionary = [[NSMutableArray alloc] init]; + } + [bodyDictionary addObject:formParams]; + + + requestContentType = @"multipart/form-data"; + if(bodyDictionary == nil) { + bodyDictionary = [[NSMutableArray alloc] init]; + } + if(file != nil) { + [bodyDictionary addObject:file]; + file.paramName = @"file"; + } + + if(bodyDictionary == nil) { + bodyDictionary = [[NSMutableArray alloc] init]; + } + [bodyDictionary addObject:formParams]; + + - - - formParams[@"additionalMetadata"] = additionalMetadata; - - if(bodyDictionary == nil) { - bodyDictionary = [[NSMutableArray alloc] init]; + + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"POST" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; } - [bodyDictionary addObject:formParams]; - - - requestContentType = @"multipart/form-data"; - if(bodyDictionary == nil) { - bodyDictionary = [[NSMutableArray alloc] init]; - } - if(file != nil) { - [bodyDictionary addObject:file]; - file.paramName = @"file"; - } - - if(bodyDictionary == nil) { - bodyDictionary = [[NSMutableArray alloc] init]; - } - [bodyDictionary addObject:formParams]; - - + completionBlock(nil); + }]; - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"POST" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; + } -completionBlock(nil); -}]; - - } - - @end diff --git a/samples/client/petstore/objc/client/SWGStoreApi.h b/samples/client/petstore/objc/client/SWGStoreApi.h index b24b00aea7a..49d8db806c8 100644 --- a/samples/client/petstore/objc/client/SWGStoreApi.h +++ b/samples/client/petstore/objc/client/SWGStoreApi.h @@ -1,86 +1,80 @@ -#import - +#import #import "SWGOrder.h" #import "SWGObject.h" #import "SWGApiClient.h" - @interface SWGStoreApi: NSObject +@interface SWGStoreApi: NSObject - @property(nonatomic, assign)SWGApiClient *apiClient; +@property(nonatomic, assign)SWGApiClient *apiClient; - -(instancetype) initWithApiClient:(SWGApiClient *)apiClient; - -(void) addHeader:(NSString*)value forKey:(NSString*)key; - -(unsigned long) requestQueueSize; - +(SWGStoreApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; - +(void) setBasePath:(NSString*)basePath; - +(NSString*) getBasePath; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; +-(void) addHeader:(NSString*)value forKey:(NSString*)key; +-(unsigned long) requestQueueSize; ++(SWGStoreApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; ++(void) setBasePath:(NSString*)basePath; ++(NSString*) getBasePath; +/** + + Returns pet inventories by status + Returns a map of status codes to quantities + + + + return type: NSDictionary* + */ +-(NSNumber*) getInventoryWithCompletionBlock : + (void (^)(NSDictionary* output, NSError* error))completionBlock; - /** - Returns pet inventories by status - Returns a map of status codes to quantities - +/** - return type: NSDictionary* - */ - -(NSNumber*) getInventoryWithCompletionBlock : - (void (^)(NSDictionary* output, NSError* error))completionBlock; - + Place an order for a pet + - + @param body order placed for purchasing the pet + + + return type: SWGOrder* + */ +-(NSNumber*) placeOrderWithCompletionBlock :(SWGOrder*) body - /** - - Place an order for a pet - - - @param body order placed for purchasing the pet - - - return type: SWGOrder* - */ - -(NSNumber*) placeOrderWithCompletionBlock :(SWGOrder*) body - - completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock; - - - + completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock; - /** - Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @param orderId ID of pet that needs to be fetched - +/** - return type: SWGOrder* - */ - -(NSNumber*) getOrderByIdWithCompletionBlock :(NSString*) orderId - - completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock; - + Find purchase order by ID + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - + @param orderId ID of pet that needs to be fetched + + + return type: SWGOrder* + */ +-(NSNumber*) getOrderByIdWithCompletionBlock :(NSString*) orderId - /** - - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - - @param orderId ID of the order that needs to be deleted - - - return type: - */ - -(NSNumber*) deleteOrderWithCompletionBlock :(NSString*) orderId - - - completionHandler: (void (^)(NSError* error))completionBlock; - - + completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock; + +/** + + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + @param orderId ID of the order that needs to be deleted + + + return type: + */ +-(NSNumber*) deleteOrderWithCompletionBlock :(NSString*) orderId + + + completionHandler: (void (^)(NSError* error))completionBlock; + + + @end diff --git a/samples/client/petstore/objc/client/SWGStoreApi.m b/samples/client/petstore/objc/client/SWGStoreApi.m index 6f548410dc8..a112db6d639 100644 --- a/samples/client/petstore/objc/client/SWGStoreApi.m +++ b/samples/client/petstore/objc/client/SWGStoreApi.m @@ -1,478 +1,478 @@ - #import "SWGStoreApi.h" - #import "SWGFile.h" - #import "SWGQueryParamCollection.h" - #import "SWGOrder.h" - - +#import "SWGStoreApi.h" +#import "SWGFile.h" +#import "SWGQueryParamCollection.h" +#import "SWGOrder.h" - @interface SWGStoreApi () + +@interface SWGStoreApi () @property (readwrite, nonatomic, strong) NSMutableDictionary *defaultHeaders; - @end +@end - @implementation SWGStoreApi +@implementation SWGStoreApi - static NSString * basePath = @"http://petstore.swagger.io/v2"; +static NSString * basePath = @"http://petstore.swagger.io/v2"; - #pragma mark - Initialize methods +#pragma mark - Initialize methods - - (id) init { +- (id) init { self = [super init]; if (self) { - self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; - self.defaultHeaders = [NSMutableDictionary dictionary]; + self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; + self.defaultHeaders = [NSMutableDictionary dictionary]; } return self; - } +} - - (id) initWithApiClient:(SWGApiClient *)apiClient { +- (id) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { - if (apiClient) { - self.apiClient = apiClient; - } - else { - self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; - } - self.defaultHeaders = [NSMutableDictionary dictionary]; + if (apiClient) { + self.apiClient = apiClient; + } + else { + self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; + } + self.defaultHeaders = [NSMutableDictionary dictionary]; } return self; - } +} - #pragma mark - +#pragma mark - - +(SWGStoreApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key { ++(SWGStoreApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key { static SWGStoreApi* singletonAPI = nil; if (singletonAPI == nil) { - singletonAPI = [[SWGStoreApi alloc] init]; - [singletonAPI addHeader:headerValue forKey:key]; + singletonAPI = [[SWGStoreApi alloc] init]; + [singletonAPI addHeader:headerValue forKey:key]; } return singletonAPI; - } +} - +(void) setBasePath:(NSString*)path { ++(void) setBasePath:(NSString*)path { basePath = path; - } +} - +(NSString*) getBasePath { ++(NSString*) getBasePath { return basePath; - } +} - -(void) addHeader:(NSString*)value forKey:(NSString*)key { +-(void) addHeader:(NSString*)value forKey:(NSString*)key { [self.defaultHeaders setValue:value forKey:key]; - } +} - -(void) setHeaderValue:(NSString*) value - forKey:(NSString*)key { +-(void) setHeaderValue:(NSString*) value + forKey:(NSString*)key { [self.defaultHeaders setValue:value forKey:key]; - } +} - -(unsigned long) requestQueueSize { +-(unsigned long) requestQueueSize { return [SWGApiClient requestQueueSize]; - } +} - - /*! - * Returns pet inventories by status - * Returns a map of status codes to quantities - * \returns NSDictionary* - */ - -(NSNumber*) getInventoryWithCompletionBlock: +/*! + * Returns pet inventories by status + * Returns a map of status codes to quantities + * \returns NSDictionary* + */ +-(NSNumber*) getInventoryWithCompletionBlock: (void (^)(NSDictionary* output, NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/inventory", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/inventory", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"api_key"]; - - id bodyDictionary = nil; - - - - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - - - - - - - - // response is in a container - // map container response type -return [self.apiClient dictionary: requestUrl -method: @"GET" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSDictionary *data, NSError *error) { -if (error) { -completionBlock(nil, error); -return; -} - NSDictionary *result = nil; - if (data) { - result = [[NSDictionary alloc]initWithDictionary: data]; } - completionBlock(data, nil); -}]; + + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { + responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; + } + else { + responseContentType = @""; + } + + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"api_key"]; + + id bodyDictionary = nil; + + + + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + + + + + + + // response is in a container + // map container response type + return [self.apiClient dictionary: requestUrl + method: @"GET" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + completionBlock(nil, error); + return; + } + + NSDictionary *result = nil; + if (data) { + result = [[NSDictionary alloc]initWithDictionary: data]; + } + completionBlock(data, nil); + + }]; - - - - } + - /*! - * Place an order for a pet - * - * \param body order placed for purchasing the pet - * \returns SWGOrder* - */ - -(NSNumber*) placeOrderWithCompletionBlock: (SWGOrder*) body +} + +/*! + * Place an order for a pet + * + * \param body order placed for purchasing the pet + * \returns SWGOrder* + */ +-(NSNumber*) placeOrderWithCompletionBlock: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[]; + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + id __body = body; - id bodyDictionary = nil; - - id __body = body; - - if(__body != nil && [__body isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] init]; - for (id dict in (NSArray*)__body) { + if(__body != nil && [__body isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] init]; + for (id dict in (NSArray*)__body) { if([dict respondsToSelector:@selector(toDictionary)]) { - [objs addObject:[(SWGObject*)dict toDictionary]]; + [objs addObject:[(SWGObject*)dict toDictionary]]; } else{ - [objs addObject:dict]; + [objs addObject:dict]; } - } - bodyDictionary = objs; - } - else if([__body respondsToSelector:@selector(toDictionary)]) { - bodyDictionary = [(SWGObject*)__body toDictionary]; - } - else if([__body isKindOfClass:[NSString class]]) { - // convert it to a dictionary - NSError * error; - NSString * str = (NSString*)__body; - NSDictionary *JSON = - [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] - options: NSJSONReadingMutableContainers - error: &error]; - bodyDictionary = JSON; - } - - - - - - - - - // non container response - - - - - // complex response - // comples response type - return [self.apiClient dictionary: requestUrl - method: @"POST" - queryParams: queryParams - body: bodyDictionary - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - completionBlock: ^(NSDictionary *data, NSError *error) { - if (error) { - completionBlock(nil, error); - - return; - } - SWGOrder* result = nil; - if (data) { - result = [[SWGOrder alloc] initWithDictionary:data error:nil]; - } - completionBlock(result , nil); - - }]; - - - - } + bodyDictionary = objs; + } + else if([__body respondsToSelector:@selector(toDictionary)]) { + bodyDictionary = [(SWGObject*)__body toDictionary]; + } + else if([__body isKindOfClass:[NSString class]]) { + // convert it to a dictionary + NSError * error; + NSString * str = (NSString*)__body; + NSDictionary *JSON = + [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] + options: NSJSONReadingMutableContainers + error: &error]; + bodyDictionary = JSON; + } + + - /*! - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * \param orderId ID of pet that needs to be fetched - * \returns SWGOrder* - */ - -(NSNumber*) getOrderByIdWithCompletionBlock: (NSString*) orderId + + + + + // non container response + + + + + // complex response + + // comples response type + return [self.apiClient dictionary: requestUrl + method: @"POST" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + completionBlock(nil, error); + + return; + } + SWGOrder* result = nil; + if (data) { + result = [[SWGOrder alloc] initWithDictionary:data error:nil]; + } + completionBlock(result , nil); + + }]; + + + + + +} + +/*! + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * \param orderId ID of pet that needs to be fetched + * \returns SWGOrder* + */ +-(NSNumber*) getOrderByIdWithCompletionBlock: (NSString*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error))completionBlock { - - // verify the required parameter 'orderId' is set - NSAssert(orderId != nil, @"Missing the required parameter `orderId` when calling getOrderById"); - + + // verify the required parameter 'orderId' is set + NSAssert(orderId != nil, @"Missing the required parameter `orderId` when calling getOrderById"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"orderId", @"}"]] withString: [SWGApiClient escape:orderId]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"orderId", @"}"]] withString: [SWGApiClient escape:orderId]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[]; + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + + + + + + + + + // non container response + + + + + // complex response - - - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - - - - - - - - - - // non container response - - - - - // complex response - // comples response type + // comples response type return [self.apiClient dictionary: requestUrl - method: @"GET" - queryParams: queryParams - body: bodyDictionary - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - completionBlock: ^(NSDictionary *data, NSError *error) { - if (error) { - completionBlock(nil, error); + method: @"GET" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + completionBlock(nil, error); + + return; + } + SWGOrder* result = nil; + if (data) { + result = [[SWGOrder alloc] initWithDictionary:data error:nil]; + } + completionBlock(result , nil); + + }]; - return; - } - SWGOrder* result = nil; - if (data) { - result = [[SWGOrder alloc] initWithDictionary:data error:nil]; - } - completionBlock(result , nil); - - }]; - - - - - } - /*! - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * \param orderId ID of the order that needs to be deleted - * \returns void - */ - -(NSNumber*) deleteOrderWithCompletionBlock: (NSString*) orderId + + +} + +/*! + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * \param orderId ID of the order that needs to be deleted + * \returns void + */ +-(NSNumber*) deleteOrderWithCompletionBlock: (NSString*) orderId completionHandler: (void (^)(NSError* error))completionBlock { - - // verify the required parameter 'orderId' is set - NSAssert(orderId != nil, @"Missing the required parameter `orderId` when calling deleteOrder"); - + + // verify the required parameter 'orderId' is set + NSAssert(orderId != nil, @"Missing the required parameter `orderId` when calling deleteOrder"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store/order/{orderId}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"orderId", @"}"]] withString: [SWGApiClient escape:orderId]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"orderId", @"}"]] withString: [SWGApiClient escape:orderId]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[]; + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; - - + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + - - + - + - + - + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"DELETE" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"DELETE" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; + } -completionBlock(nil); -}]; - - } - - @end diff --git a/samples/client/petstore/objc/client/SWGTag.h b/samples/client/petstore/objc/client/SWGTag.h index 0938ab30905..d9cc84be270 100644 --- a/samples/client/petstore/objc/client/SWGTag.h +++ b/samples/client/petstore/objc/client/SWGTag.h @@ -1,21 +1,15 @@ -#import - +#import #import "SWGObject.h" - - @protocol SWGTag - @end +@protocol SWGTag +@end + +@interface SWGTag : SWGObject - @interface SWGTag : SWGObject - - - @property(nonatomic) NSNumber* _id; - - - @property(nonatomic) NSString* name; - +@property(nonatomic) NSNumber* _id; - @end - +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/client/SWGTag.m b/samples/client/petstore/objc/client/SWGTag.m index 8425464dbd5..5d48a099070 100644 --- a/samples/client/petstore/objc/client/SWGTag.m +++ b/samples/client/petstore/objc/client/SWGTag.m @@ -1,24 +1,22 @@ - - #import "SWGTag.h" +#import "SWGTag.h" - @implementation SWGTag +@implementation SWGTag + ++ (JSONKeyMapper *)keyMapper +{ + return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }]; +} - + (JSONKeyMapper *)keyMapper - { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"name": @"name" }]; - } ++ (BOOL)propertyIsOptional:(NSString *)propertyName +{ + NSArray *optionalProperties = @[@"_id", @"name"]; - + (BOOL)propertyIsOptional:(NSString *)propertyName - { - NSArray *optionalProperties = @[@"_id", @"name"]; + if ([optionalProperties containsObject:propertyName]) { + return YES; + } + else { + return NO; + } +} - if ([optionalProperties containsObject:propertyName]) { - return YES; - } - else { - return NO; - } - } - - - @end +@end diff --git a/samples/client/petstore/objc/client/SWGUser.h b/samples/client/petstore/objc/client/SWGUser.h index a4ffaf6ae72..f505ca2c041 100644 --- a/samples/client/petstore/objc/client/SWGUser.h +++ b/samples/client/petstore/objc/client/SWGUser.h @@ -1,40 +1,28 @@ -#import - +#import #import "SWGObject.h" - - @protocol SWGUser - @end +@protocol SWGUser +@end + +@interface SWGUser : SWGObject - @interface SWGUser : SWGObject - - - @property(nonatomic) NSNumber* _id; - - - @property(nonatomic) NSString* username; - - - @property(nonatomic) NSString* firstName; - - - @property(nonatomic) NSString* lastName; - - - @property(nonatomic) NSString* email; - - - @property(nonatomic) NSString* password; - - - @property(nonatomic) NSString* phone; - - /* User Status [optional] - */ - @property(nonatomic) NSNumber* userStatus; - +@property(nonatomic) NSNumber* _id; - @end - +@property(nonatomic) NSString* username; + +@property(nonatomic) NSString* firstName; + +@property(nonatomic) NSString* lastName; + +@property(nonatomic) NSString* email; + +@property(nonatomic) NSString* password; + +@property(nonatomic) NSString* phone; +/* User Status [optional] + */ +@property(nonatomic) NSNumber* userStatus; + +@end diff --git a/samples/client/petstore/objc/client/SWGUser.m b/samples/client/petstore/objc/client/SWGUser.m index 4fd1dbdbe28..060b65ffa12 100644 --- a/samples/client/petstore/objc/client/SWGUser.m +++ b/samples/client/petstore/objc/client/SWGUser.m @@ -1,24 +1,22 @@ - - #import "SWGUser.h" +#import "SWGUser.h" - @implementation SWGUser +@implementation SWGUser + ++ (JSONKeyMapper *)keyMapper +{ + return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; +} - + (JSONKeyMapper *)keyMapper - { - return [[JSONKeyMapper alloc] initWithDictionary:@{ @"id": @"_id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; - } ++ (BOOL)propertyIsOptional:(NSString *)propertyName +{ + NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; - + (BOOL)propertyIsOptional:(NSString *)propertyName - { - NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; + if ([optionalProperties containsObject:propertyName]) { + return YES; + } + else { + return NO; + } +} - if ([optionalProperties containsObject:propertyName]) { - return YES; - } - else { - return NO; - } - } - - - @end +@end diff --git a/samples/client/petstore/objc/client/SWGUserApi.h b/samples/client/petstore/objc/client/SWGUserApi.h index acaa861a536..e6e73ddfba6 100644 --- a/samples/client/petstore/objc/client/SWGUserApi.h +++ b/samples/client/petstore/objc/client/SWGUserApi.h @@ -1,158 +1,148 @@ -#import - +#import #import "SWGUser.h" #import "SWGObject.h" #import "SWGApiClient.h" - @interface SWGUserApi: NSObject +@interface SWGUserApi: NSObject - @property(nonatomic, assign)SWGApiClient *apiClient; +@property(nonatomic, assign)SWGApiClient *apiClient; - -(instancetype) initWithApiClient:(SWGApiClient *)apiClient; - -(void) addHeader:(NSString*)value forKey:(NSString*)key; - -(unsigned long) requestQueueSize; - +(SWGUserApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; - +(void) setBasePath:(NSString*)basePath; - +(NSString*) getBasePath; +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; +-(void) addHeader:(NSString*)value forKey:(NSString*)key; +-(unsigned long) requestQueueSize; ++(SWGUserApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; ++(void) setBasePath:(NSString*)basePath; ++(NSString*) getBasePath; +/** + + Create user + This can only be done by the logged in user. + + @param body Created user object + + + return type: + */ +-(NSNumber*) createUserWithCompletionBlock :(SWGUser*) body - /** - - Create user - This can only be done by the logged in user. - - @param body Created user object - - - return type: - */ - -(NSNumber*) createUserWithCompletionBlock :(SWGUser*) body - - - completionHandler: (void (^)(NSError* error))completionBlock; - - - /** + completionHandler: (void (^)(NSError* error))completionBlock; - Creates list of users with given input array - - @param body List of user object - +/** - return type: - */ - -(NSNumber*) createUsersWithArrayInputWithCompletionBlock :(NSArray*) body - - - completionHandler: (void (^)(NSError* error))completionBlock; + Creates list of users with given input array + - + @param body List of user object + + + return type: + */ +-(NSNumber*) createUsersWithArrayInputWithCompletionBlock :(NSArray*) body - /** - - Creates list of users with given input array - - - @param body List of user object - - - return type: - */ - -(NSNumber*) createUsersWithListInputWithCompletionBlock :(NSArray*) body - - - completionHandler: (void (^)(NSError* error))completionBlock; - - - /** + completionHandler: (void (^)(NSError* error))completionBlock; - Logs user into the system - - @param username The user name for login - @param password The password for login in clear text - +/** - return type: NSString* - */ - -(NSNumber*) loginUserWithCompletionBlock :(NSString*) username - password:(NSString*) password - - completionHandler: (void (^)(NSString* output, NSError* error))completionBlock; - + Creates list of users with given input array + - + @param body List of user object + + + return type: + */ +-(NSNumber*) createUsersWithListInputWithCompletionBlock :(NSArray*) body - /** - - Logs out current logged in user session - - - - - return type: - */ - -(NSNumber*) logoutUserWithCompletionBlock : - - (void (^)(NSError* error))completionBlock; - - - /** + completionHandler: (void (^)(NSError* error))completionBlock; - Get user by user name - - @param username The name that needs to be fetched. Use user1 for testing. - +/** - return type: SWGUser* - */ - -(NSNumber*) getUserByNameWithCompletionBlock :(NSString*) username - - completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock; - + Logs user into the system + - + @param username The user name for login + @param password The password for login in clear text + + + return type: NSString* + */ +-(NSNumber*) loginUserWithCompletionBlock :(NSString*) username + password:(NSString*) password - /** - - Updated user - This can only be done by the logged in user. - - @param username name that need to be deleted - @param body Updated user object - - - return type: - */ - -(NSNumber*) updateUserWithCompletionBlock :(NSString*) username - body:(SWGUser*) body - - - completionHandler: (void (^)(NSError* error))completionBlock; - - + completionHandler: (void (^)(NSString* output, NSError* error))completionBlock; - /** - Delete user - This can only be done by the logged in user. - @param username The name that needs to be deleted - +/** - return type: - */ - -(NSNumber*) deleteUserWithCompletionBlock :(NSString*) username - - - completionHandler: (void (^)(NSError* error))completionBlock; + Logs out current logged in user session + - + + + return type: + */ +-(NSNumber*) logoutUserWithCompletionBlock : + (void (^)(NSError* error))completionBlock; + + +/** + + Get user by user name + + + @param username The name that needs to be fetched. Use user1 for testing. + + + return type: SWGUser* + */ +-(NSNumber*) getUserByNameWithCompletionBlock :(NSString*) username + + completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock; + + + +/** + + Updated user + This can only be done by the logged in user. + + @param username name that need to be deleted + @param body Updated user object + + + return type: + */ +-(NSNumber*) updateUserWithCompletionBlock :(NSString*) username + body:(SWGUser*) body + + + completionHandler: (void (^)(NSError* error))completionBlock; + + +/** + + Delete user + This can only be done by the logged in user. + + @param username The name that needs to be deleted + + + return type: + */ +-(NSNumber*) deleteUserWithCompletionBlock :(NSString*) username + + + completionHandler: (void (^)(NSError* error))completionBlock; + + @end diff --git a/samples/client/petstore/objc/client/SWGUserApi.m b/samples/client/petstore/objc/client/SWGUserApi.m index 7c861609f36..e2fe69aca8d 100644 --- a/samples/client/petstore/objc/client/SWGUserApi.m +++ b/samples/client/petstore/objc/client/SWGUserApi.m @@ -1,896 +1,891 @@ - #import "SWGUserApi.h" - #import "SWGFile.h" - #import "SWGQueryParamCollection.h" - #import "SWGUser.h" - - +#import "SWGUserApi.h" +#import "SWGFile.h" +#import "SWGQueryParamCollection.h" +#import "SWGUser.h" - @interface SWGUserApi () + +@interface SWGUserApi () @property (readwrite, nonatomic, strong) NSMutableDictionary *defaultHeaders; - @end +@end - @implementation SWGUserApi +@implementation SWGUserApi - static NSString * basePath = @"http://petstore.swagger.io/v2"; +static NSString * basePath = @"http://petstore.swagger.io/v2"; - #pragma mark - Initialize methods +#pragma mark - Initialize methods - - (id) init { +- (id) init { self = [super init]; if (self) { - self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; - self.defaultHeaders = [NSMutableDictionary dictionary]; + self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; + self.defaultHeaders = [NSMutableDictionary dictionary]; } return self; - } +} - - (id) initWithApiClient:(SWGApiClient *)apiClient { +- (id) initWithApiClient:(SWGApiClient *)apiClient { self = [super init]; if (self) { - if (apiClient) { - self.apiClient = apiClient; - } - else { - self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; - } - self.defaultHeaders = [NSMutableDictionary dictionary]; + if (apiClient) { + self.apiClient = apiClient; + } + else { + self.apiClient = [SWGApiClient sharedClientFromPool:basePath]; + } + self.defaultHeaders = [NSMutableDictionary dictionary]; } return self; - } +} - #pragma mark - +#pragma mark - - +(SWGUserApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key { ++(SWGUserApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key { static SWGUserApi* singletonAPI = nil; if (singletonAPI == nil) { - singletonAPI = [[SWGUserApi alloc] init]; - [singletonAPI addHeader:headerValue forKey:key]; + singletonAPI = [[SWGUserApi alloc] init]; + [singletonAPI addHeader:headerValue forKey:key]; } return singletonAPI; - } +} - +(void) setBasePath:(NSString*)path { ++(void) setBasePath:(NSString*)path { basePath = path; - } +} - +(NSString*) getBasePath { ++(NSString*) getBasePath { return basePath; - } +} - -(void) addHeader:(NSString*)value forKey:(NSString*)key { +-(void) addHeader:(NSString*)value forKey:(NSString*)key { [self.defaultHeaders setValue:value forKey:key]; - } +} - -(void) setHeaderValue:(NSString*) value - forKey:(NSString*)key { +-(void) setHeaderValue:(NSString*) value + forKey:(NSString*)key { [self.defaultHeaders setValue:value forKey:key]; - } +} - -(unsigned long) requestQueueSize { +-(unsigned long) requestQueueSize { return [SWGApiClient requestQueueSize]; +} + + +/*! + * Create user + * This can only be done by the logged in user. + * \param body Created user object + * \returns void + */ +-(NSNumber*) createUserWithCompletionBlock: (SWGUser*) body + + + completionHandler: (void (^)(NSError* error))completionBlock { + + + + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user", basePath]; + + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; + + + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { + [headerParams removeObjectForKey:@"Accept"]; } + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { + responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; + } + else { + responseContentType = @""; + } + + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + id __body = body; + + if(__body != nil && [__body isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] init]; + for (id dict in (NSArray*)__body) { + if([dict respondsToSelector:@selector(toDictionary)]) { + [objs addObject:[(SWGObject*)dict toDictionary]]; + } + else{ + [objs addObject:dict]; + } + } + bodyDictionary = objs; + } + else if([__body respondsToSelector:@selector(toDictionary)]) { + bodyDictionary = [(SWGObject*)__body toDictionary]; + } + else if([__body isKindOfClass:[NSString class]]) { + // convert it to a dictionary + NSError * error; + NSString * str = (NSString*)__body; + NSDictionary *JSON = + [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] + options: NSJSONReadingMutableContainers + error: &error]; + bodyDictionary = JSON; + } + + - /*! - * Create user - * This can only be done by the logged in user. - * \param body Created user object - * \returns void - */ - -(NSNumber*) createUserWithCompletionBlock: (SWGUser*) body + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"POST" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * Creates list of users with given input array + * + * \param body List of user object + * \returns void + */ +-(NSNumber*) createUsersWithArrayInputWithCompletionBlock: (NSArray*) body completionHandler: (void (^)(NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/createWithArray", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyDictionary = nil; - - id __body = body; - - if(__body != nil && [__body isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] init]; - for (id dict in (NSArray*)__body) { - if([dict respondsToSelector:@selector(toDictionary)]) { - [objs addObject:[(SWGObject*)dict toDictionary]]; - } - else{ - [objs addObject:dict]; - } - } - bodyDictionary = objs; - } - else if([__body respondsToSelector:@selector(toDictionary)]) { - bodyDictionary = [(SWGObject*)__body toDictionary]; - } - else if([__body isKindOfClass:[NSString class]]) { - // convert it to a dictionary - NSError * error; - NSString * str = (NSString*)__body; - NSDictionary *JSON = - [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] - options: NSJSONReadingMutableContainers - error: &error]; - bodyDictionary = JSON; - } - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"POST" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - - } + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - /*! - * Creates list of users with given input array - * - * \param body List of user object - * \returns void - */ - -(NSNumber*) createUsersWithArrayInputWithCompletionBlock: (NSArray*) body + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { + [headerParams removeObjectForKey:@"Accept"]; + } + + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { + responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; + } + else { + responseContentType = @""; + } + + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + id __body = body; + + if(__body != nil && [__body isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] init]; + for (id dict in (NSArray*)__body) { + if([dict respondsToSelector:@selector(toDictionary)]) { + [objs addObject:[(SWGObject*)dict toDictionary]]; + } + else{ + [objs addObject:dict]; + } + } + bodyDictionary = objs; + } + else if([__body respondsToSelector:@selector(toDictionary)]) { + bodyDictionary = [(SWGObject*)__body toDictionary]; + } + else if([__body isKindOfClass:[NSString class]]) { + // convert it to a dictionary + NSError * error; + NSString * str = (NSString*)__body; + NSDictionary *JSON = + [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] + options: NSJSONReadingMutableContainers + error: &error]; + bodyDictionary = JSON; + } + + + + + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"POST" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * Creates list of users with given input array + * + * \param body List of user object + * \returns void + */ +-(NSNumber*) createUsersWithListInputWithCompletionBlock: (NSArray*) body completionHandler: (void (^)(NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/createWithArray", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/createWithList", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyDictionary = nil; - - id __body = body; - - if(__body != nil && [__body isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] init]; - for (id dict in (NSArray*)__body) { - if([dict respondsToSelector:@selector(toDictionary)]) { - [objs addObject:[(SWGObject*)dict toDictionary]]; - } - else{ - [objs addObject:dict]; - } - } - bodyDictionary = objs; - } - else if([__body respondsToSelector:@selector(toDictionary)]) { - bodyDictionary = [(SWGObject*)__body toDictionary]; - } - else if([__body isKindOfClass:[NSString class]]) { - // convert it to a dictionary - NSError * error; - NSString * str = (NSString*)__body; - NSDictionary *JSON = - [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] - options: NSJSONReadingMutableContainers - error: &error]; - bodyDictionary = JSON; - } - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"POST" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - - } + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - /*! - * Creates list of users with given input array - * - * \param body List of user object - * \returns void - */ - -(NSNumber*) createUsersWithListInputWithCompletionBlock: (NSArray*) body - - - completionHandler: (void (^)(NSError* error))completionBlock { - - - - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/createWithList", basePath]; - - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - - - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[]; + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + id __body = body; - id bodyDictionary = nil; - - id __body = body; - - if(__body != nil && [__body isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] init]; - for (id dict in (NSArray*)__body) { + if(__body != nil && [__body isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] init]; + for (id dict in (NSArray*)__body) { if([dict respondsToSelector:@selector(toDictionary)]) { - [objs addObject:[(SWGObject*)dict toDictionary]]; + [objs addObject:[(SWGObject*)dict toDictionary]]; } else{ - [objs addObject:dict]; + [objs addObject:dict]; } - } - bodyDictionary = objs; - } - else if([__body respondsToSelector:@selector(toDictionary)]) { - bodyDictionary = [(SWGObject*)__body toDictionary]; - } - else if([__body isKindOfClass:[NSString class]]) { - // convert it to a dictionary - NSError * error; - NSString * str = (NSString*)__body; - NSDictionary *JSON = - [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] - options: NSJSONReadingMutableContainers - error: &error]; - bodyDictionary = JSON; - } - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"POST" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - } + bodyDictionary = objs; + } + else if([__body respondsToSelector:@selector(toDictionary)]) { + bodyDictionary = [(SWGObject*)__body toDictionary]; + } + else if([__body isKindOfClass:[NSString class]]) { + // convert it to a dictionary + NSError * error; + NSString * str = (NSString*)__body; + NSDictionary *JSON = + [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] + options: NSJSONReadingMutableContainers + error: &error]; + bodyDictionary = JSON; + } + + - /*! - * Logs user into the system - * - * \param username The user name for login - * \param password The password for login in clear text - * \returns NSString* - */ - -(NSNumber*) loginUserWithCompletionBlock: (NSString*) username + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"POST" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * Logs user into the system + * + * \param username The user name for login + * \param password The password for login in clear text + * \returns NSString* + */ +-(NSNumber*) loginUserWithCompletionBlock: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/login", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/login", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if(username != nil) { + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if(username != nil) { queryParams[@"username"] = username; - } - if(password != nil) { + } + if(password != nil) { queryParams[@"password"] = password; - } - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + } + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[]; + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; - + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + + + + + + + + + // non container response + + + // primitive response + // primitive response type + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"GET" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(nil, error); + return; + } + NSString *result = data ? [[NSString alloc]initWithString: data] : nil; + completionBlock(result, nil); + }]; + + + + + + + // complex response - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + - - - - - - - - - // non container response - - - // primitive response - // primitive response type -return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"GET" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(nil, error); -return; + } -NSString *result = data ? [[NSString alloc]initWithString: data] : nil; -completionBlock(result, nil); -}]; - - - - // complex response - - - - - } - - - /*! - * Logs out current logged in user session - * - * \returns void - */ - -(NSNumber*) logoutUserWithCompletionBlock: +/*! + * Logs out current logged in user session + * + * \returns void + */ +-(NSNumber*) logoutUserWithCompletionBlock: (void (^)(NSError* error))completionBlock { - + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/logout", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/logout", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyDictionary = nil; - - - - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"GET" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - - } + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - /*! - * Get user by user name - * - * \param username The name that needs to be fetched. Use user1 for testing. - * \returns SWGUser* - */ - -(NSNumber*) getUserByNameWithCompletionBlock: (NSString*) username + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { + [headerParams removeObjectForKey:@"Accept"]; + } + + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { + responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; + } + else { + responseContentType = @""; + } + + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + + + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + + + + + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"GET" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * Get user by user name + * + * \param username The name that needs to be fetched. Use user1 for testing. + * \returns SWGUser* + */ +-(NSNumber*) getUserByNameWithCompletionBlock: (NSString*) username completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock { - - // verify the required parameter 'username' is set - NSAssert(username != nil, @"Missing the required parameter `username` when calling getUserByName"); - + + // verify the required parameter 'username' is set + NSAssert(username != nil, @"Missing the required parameter `username` when calling getUserByName"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[]; + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + + + + + + + + + // non container response + + + + + // complex response - - - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - - - - - - - - - - // non container response - - - - - // complex response - // comples response type + // comples response type return [self.apiClient dictionary: requestUrl - method: @"GET" - queryParams: queryParams - body: bodyDictionary - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - completionBlock: ^(NSDictionary *data, NSError *error) { - if (error) { - completionBlock(nil, error); + method: @"GET" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSDictionary *data, NSError *error) { + if (error) { + completionBlock(nil, error); + + return; + } + SWGUser* result = nil; + if (data) { + result = [[SWGUser alloc] initWithDictionary:data error:nil]; + } + completionBlock(result , nil); + + }]; - return; - } - SWGUser* result = nil; - if (data) { - result = [[SWGUser alloc] initWithDictionary:data error:nil]; - } - completionBlock(result , nil); - - }]; - - - - - } - /*! - * Updated user - * This can only be done by the logged in user. - * \param username name that need to be deleted - * \param body Updated user object - * \returns void - */ - -(NSNumber*) updateUserWithCompletionBlock: (NSString*) username + + +} + +/*! + * Updated user + * This can only be done by the logged in user. + * \param username name that need to be deleted + * \param body Updated user object + * \returns void + */ +-(NSNumber*) updateUserWithCompletionBlock: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error))completionBlock { - - // verify the required parameter 'username' is set - NSAssert(username != nil, @"Missing the required parameter `username` when calling updateUser"); - + + // verify the required parameter 'username' is set + NSAssert(username != nil, @"Missing the required parameter `username` when calling updateUser"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { - [headerParams removeObjectForKey:@"Accept"]; - } - - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { - responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { - responseContentType = @""; - } - - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyDictionary = nil; - - id __body = body; - - if(__body != nil && [__body isKindOfClass:[NSArray class]]){ - NSMutableArray * objs = [[NSMutableArray alloc] init]; - for (id dict in (NSArray*)__body) { - if([dict respondsToSelector:@selector(toDictionary)]) { - [objs addObject:[(SWGObject*)dict toDictionary]]; - } - else{ - [objs addObject:dict]; - } - } - bodyDictionary = objs; - } - else if([__body respondsToSelector:@selector(toDictionary)]) { - bodyDictionary = [(SWGObject*)__body toDictionary]; - } - else if([__body isKindOfClass:[NSString class]]) { - // convert it to a dictionary - NSError * error; - NSString * str = (NSString*)__body; - NSDictionary *JSON = - [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] - options: NSJSONReadingMutableContainers - error: &error]; - bodyDictionary = JSON; - } - - - - - - - - - - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"PUT" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; -} -completionBlock(nil); -}]; - - - } + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - /*! - * Delete user - * This can only be done by the logged in user. - * \param username The name that needs to be deleted - * \returns void - */ - -(NSNumber*) deleteUserWithCompletionBlock: (NSString*) username + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { + [headerParams removeObjectForKey:@"Accept"]; + } + + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { + responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; + } + else { + responseContentType = @""; + } + + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + id __body = body; + + if(__body != nil && [__body isKindOfClass:[NSArray class]]){ + NSMutableArray * objs = [[NSMutableArray alloc] init]; + for (id dict in (NSArray*)__body) { + if([dict respondsToSelector:@selector(toDictionary)]) { + [objs addObject:[(SWGObject*)dict toDictionary]]; + } + else{ + [objs addObject:dict]; + } + } + bodyDictionary = objs; + } + else if([__body respondsToSelector:@selector(toDictionary)]) { + bodyDictionary = [(SWGObject*)__body toDictionary]; + } + else if([__body isKindOfClass:[NSString class]]) { + // convert it to a dictionary + NSError * error; + NSString * str = (NSString*)__body; + NSDictionary *JSON = + [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding: NSUTF8StringEncoding] + options: NSJSONReadingMutableContainers + error: &error]; + bodyDictionary = JSON; + } + + + + + + + + + + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"PUT" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; + + +} + +/*! + * Delete user + * This can only be done by the logged in user. + * \param username The name that needs to be deleted + * \returns void + */ +-(NSNumber*) deleteUserWithCompletionBlock: (NSString*) username completionHandler: (void (^)(NSError* error))completionBlock { - - // verify the required parameter 'username' is set - NSAssert(username != nil, @"Missing the required parameter `username` when calling deleteUser"); - + + // verify the required parameter 'username' is set + NSAssert(username != nil, @"Missing the required parameter `username` when calling deleteUser"); + - NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; + NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user/{username}", basePath]; - // remove format in URL if needed - if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) + // remove format in URL if needed + if ([requestUrl rangeOfString:@".{format}"].location != NSNotFound) [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:@".{format}"] withString:@".json"]; - [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]]; - + [requestUrl replaceCharactersInRange: [requestUrl rangeOfString:[NSString stringWithFormat:@"%@%@%@", @"{", @"username", @"}"]] withString: [SWGApiClient escape:username]]; + - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders]; - - - // HTTP header `Accept` - headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if ([headerParams[@"Accept"] length] == 0) { + + + // HTTP header `Accept` + headerParams[@"Accept"] = [SWGApiClient selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if ([headerParams[@"Accept"] length] == 0) { [headerParams removeObjectForKey:@"Accept"]; - } + } - // response content type - NSString *responseContentType; - if ([headerParams objectForKey:@"Accept"]) { + // response content type + NSString *responseContentType; + if ([headerParams objectForKey:@"Accept"]) { responseContentType = [headerParams[@"Accept"] componentsSeparatedByString:@", "][0]; - } - else { + } + else { responseContentType = @""; - } + } - // request content type - NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; + // request content type + NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]]; - // Authentication setting - NSArray *authSettings = @[]; + // Authentication setting + NSArray *authSettings = @[]; + + id bodyDictionary = nil; + + - id bodyDictionary = nil; - - + NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; - NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init]; + + - - + - + - + - + + // it's void + return [self.apiClient stringWithCompletionBlock: requestUrl + method: @"DELETE" + queryParams: queryParams + body: bodyDictionary + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + completionBlock: ^(NSString *data, NSError *error) { + if (error) { + completionBlock(error); + return; + } + completionBlock(nil); + }]; - - // it's void - return [self.apiClient stringWithCompletionBlock: requestUrl -method: @"DELETE" -queryParams: queryParams -body: bodyDictionary -headerParams: headerParams -authSettings: authSettings -requestContentType: requestContentType -responseContentType: responseContentType -completionBlock: ^(NSString *data, NSError *error) { -if (error) { -completionBlock(error); -return; + } -completionBlock(nil); -}]; - - } - - @end diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm index 0a926625b74..dd5ff29a803 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm @@ -317,7 +317,7 @@ sub new { # authentication setting, if any - my $auth_settings = ['api_key', 'petstore_auth']; + my $auth_settings = ['petstore_auth', 'api_key']; # make the API Call my $response = $self->{api_client}->call_api($_resource_path, $_method, diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/PetApi.php index a022430b9cd..2e1b2aa262e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/PetApi.php @@ -327,7 +327,7 @@ class PetApi { } // authentication setting, if any - $authSettings = array('api_key', 'petstore_auth'); + $authSettings = array('petstore_auth', 'api_key'); // make the API Call $response = $this->apiClient->callAPI($resourcePath, $method, diff --git a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/__init__.py b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/__init__.py index 3e7b51b8467..30e93608274 100644 --- a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/__init__.py +++ b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/__init__.py @@ -9,8 +9,8 @@ from .models.order import Order # import apis into sdk package from .apis.user_api import UserApi -from .apis.pet_api import PetApi from .apis.store_api import StoreApi +from .apis.pet_api import PetApi # import ApiClient from .api_client import ApiClient diff --git a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/__init__.py b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/__init__.py index 128b25dad82..67ab226c734 100644 --- a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/__init__.py +++ b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/__init__.py @@ -2,6 +2,6 @@ from __future__ import absolute_import # import apis into api package from .user_api import UserApi -from .pet_api import PetApi from .store_api import StoreApi +from .pet_api import PetApi diff --git a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/pet_api.py b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/pet_api.py index 5f5c2fe81fa..19f11fea66b 100644 --- a/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/pet_api.py +++ b/samples/client/petstore/python/SwaggerPetstore-python/SwaggerPetstore/apis/pet_api.py @@ -298,7 +298,7 @@ class PetApi(object): header_params['Content-Type'] = self.api_client.select_header_content_type([]) # Authentication setting - auth_settings = ['api_key', 'petstore_auth'] + auth_settings = ['petstore_auth', 'api_key'] response = self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, files=files, diff --git a/samples/client/petstore/qt5cpp/client/SWGCategory.cpp b/samples/client/petstore/qt5cpp/client/SWGCategory.cpp index 5676a27b0dd..9a5aaa14af7 100644 --- a/samples/client/petstore/qt5cpp/client/SWGCategory.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGCategory.cpp @@ -1,112 +1,105 @@ - #include "SWGCategory.h" +#include "SWGCategory.h" - #include "SWGHelpers.h" +#include "SWGHelpers.h" - #include - - #include - - #include - - #include - +#include +#include +#include +#include - namespace Swagger { +namespace Swagger { - SWGCategory::SWGCategory(QString* json) { - init(); - this->fromJson(*json); - } +SWGCategory::SWGCategory(QString* json) { + init(); + this->fromJson(*json); +} - SWGCategory::SWGCategory() { - init(); - } +SWGCategory::SWGCategory() { + init(); +} - SWGCategory::~SWGCategory() { - this->cleanup(); - } +SWGCategory::~SWGCategory() { + this->cleanup(); +} - void - SWGCategory::init() { +void +SWGCategory::init() { id = 0L; name = new QString(""); - } +} - void - SWGCategory::cleanup() { +void +SWGCategory::cleanup() { if(name != NULL) { - delete name; - } + delete name; + } - } +} - SWGCategory* - SWGCategory::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; - } +SWGCategory* +SWGCategory::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} - void - SWGCategory::fromJsonObject(QJsonObject &pJson) { +void +SWGCategory::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); setValue(&name, pJson["name"], "QString", "QString"); - } +} - QString - SWGCategory::asJson () - { - QJsonObject* obj = this->asJsonObject(); +QString +SWGCategory::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); - } - - QJsonObject* - SWGCategory::asJsonObject() { - QJsonObject* obj = new QJsonObject(); +QJsonObject* +SWGCategory::asJsonObject() { + QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); - - toJsonValue(QString("name"), name, obj, QString("QString")); - - + + toJsonValue(QString("name"), name, obj, QString("QString")); + + - return obj; - } + return obj; +} - - qint64 - SWGCategory::getId() { - return id; - } - void - SWGCategory::setId(qint64 id) { - this->id = id; - } +qint64 +SWGCategory::getId() { + return id; +} +void +SWGCategory::setId(qint64 id) { + this->id = id; +} - - QString* - SWGCategory::getName() { - return name; - } - void - SWGCategory::setName(QString* name) { - this->name = name; - } - - +QString* +SWGCategory::getName() { + return name; +} +void +SWGCategory::setName(QString* name) { + this->name = name; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGCategory.h b/samples/client/petstore/qt5cpp/client/SWGCategory.h index 2e7072f9111..b1d5b65538f 100644 --- a/samples/client/petstore/qt5cpp/client/SWGCategory.h +++ b/samples/client/petstore/qt5cpp/client/SWGCategory.h @@ -1,48 +1,47 @@ /* -* SWGCategory.h -* -* -*/ + * SWGCategory.h + * + * + */ #ifndef SWGCategory_H_ #define SWGCategory_H_ -#include - +#include #include - #include "SWGObject.h" +#include "SWGObject.h" - namespace Swagger { +namespace Swagger { - class SWGCategory: public SWGObject { - public: +class SWGCategory: public SWGObject { +public: SWGCategory(); SWGCategory(QString* json); - virtual ~SWGCategory(); - void init(); - void cleanup(); + virtual ~SWGCategory(); + void init(); + void cleanup(); - QString asJson (); - QJsonObject* asJsonObject(); - void fromJsonObject(QJsonObject &json); + QString asJson (); + QJsonObject* asJsonObject(); + void fromJsonObject(QJsonObject &json); SWGCategory* fromJson(QString &jsonString); qint64 getId(); - void setId(qint64 id); + void setId(qint64 id); QString* getName(); - void setName(QString* name); + void setName(QString* name); - private: +private: qint64 id; QString* name; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SWGCategory_H_ */ +#endif /* SWGCategory_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp b/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp index 0cc60d91b90..7f4d748c2dc 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp @@ -1,201 +1,166 @@ #include "SWGHelpers.h" #include "SWGModelFactory.h" #include "SWGObject.h" -#import - - #import - - #import - +#import +#import +#import - namespace Swagger { +namespace Swagger { - void - setValue(void* value, QJsonValue obj, QString type, QString complexType) { - if(value == NULL) { - // can't set value with a null pointer - return; - } - if(QStringLiteral("bool").compare(type) == 0) { - bool * val = static_cast - (value); - *val = obj.toBool(); - } - else if(QStringLiteral("qint32").compare(type) == 0) { - qint32 *val = static_cast - (value); - *val = obj.toInt(); - } - else if(QStringLiteral("qint64").compare(type) == 0) { - qint64 *val = static_cast - (value); - *val = obj.toVariant().toLongLong(); - } - else if (QStringLiteral("QString").compare(type) == 0) { - QString **val = static_cast - (value); +void +setValue(void* value, QJsonValue obj, QString type, QString complexType) { + if(value == NULL) { + // can't set value with a null pointer + return; + } + if(QStringLiteral("bool").compare(type) == 0) { + bool * val = static_cast(value); + *val = obj.toBool(); + } + else if(QStringLiteral("qint32").compare(type) == 0) { + qint32 *val = static_cast(value); + *val = obj.toInt(); + } + else if(QStringLiteral("qint64").compare(type) == 0) { + qint64 *val = static_cast(value); + *val = obj.toVariant().toLongLong(); + } + else if (QStringLiteral("QString").compare(type) == 0) { + QString **val = static_cast(value); - if(val != NULL) { + if(val != NULL) { if(!obj.isNull()) { - // create a new value and return - delete *val; - *val = new QString(obj.toString()); - return; + // create a new value and return + delete *val; + *val = new QString(obj.toString()); + return; } else { - // set target to NULL - delete *val; - *val = NULL; + // set target to NULL + delete *val; + *val = NULL; } - } - else { + } + else { qDebug() << "Can't set value because the target pointer is NULL"; - } - } - else if(type.startsWith("SWG") && obj.isObject()) { - // complex type - QJsonObject jsonObj = obj.toObject(); - SWGObject * so = (SWGObject*)Swagger::create(type); - if(so != NULL) { + } + } + else if(type.startsWith("SWG") && obj.isObject()) { + // complex type + QJsonObject jsonObj = obj.toObject(); + SWGObject * so = (SWGObject*)Swagger::create(type); + if(so != NULL) { so->fromJsonObject(jsonObj); - SWGObject **val = static_cast - (value); + SWGObject **val = static_cast(value); delete *val; *val = so; - } - } - else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) { - // list of values - QList - * output = new QList - (); - QJsonArray arr = obj.toArray(); - foreach (const QJsonValue & jval, arr) { + } + } + else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) { + // list of values + QList* output = new QList(); + QJsonArray arr = obj.toArray(); + foreach (const QJsonValue & jval, arr) { if(complexType.startsWith("SWG")) { - // it's an object - SWGObject * val = (SWGObject*)create(complexType); - QJsonObject t = jval.toObject(); + // it's an object + SWGObject * val = (SWGObject*)create(complexType); + QJsonObject t = jval.toObject(); - val->fromJsonObject(t); - output->append(val); + val->fromJsonObject(t); + output->append(val); } else { - // primitives - if(QStringLiteral("qint32").compare(complexType) == 0) { - qint32 val; - setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("qint64").compare(complexType) == 0) { - qint64 val; - setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("bool").compare(complexType) == 0) { - bool val; - setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); - output->append((void*)&val); - } - } - } - QList - **val = static_cast - **>(value); - delete *val; - *val = output; - } + // primitives + if(QStringLiteral("qint32").compare(complexType) == 0) { + qint32 val; + setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); + output->append((void*)&val); + } + else if(QStringLiteral("qint64").compare(complexType) == 0) { + qint64 val; + setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); + output->append((void*)&val); + } + else if(QStringLiteral("bool").compare(complexType) == 0) { + bool val; + setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); + output->append((void*)&val); + } } + } + QList **val = static_cast**>(value); + delete *val; + *val = output; + } +} - void - toJsonValue(QString name, void* value, QJsonObject* output, QString type) { - if(value == NULL) { - return; - } - if(type.startsWith("SWG")) { - SWGObject *swgObject = reinterpret_cast - (value); - if(swgObject != NULL) { - QJsonObject* o = (*swgObject).asJsonObject(); - if(name != NULL) { +void +toJsonValue(QString name, void* value, QJsonObject* output, QString type) { + if(value == NULL) { + return; + } + if(type.startsWith("SWG")) { + SWGObject *swgObject = reinterpret_cast(value); + if(swgObject != NULL) { + QJsonObject* o = (*swgObject).asJsonObject(); + if(name != NULL) { output->insert(name, *o); delete o; - } - else { + } + else { output->empty(); foreach(QString key, o->keys()) { - output->insert(key, o->value(key)); - } - } - } - } - else if(QStringLiteral("QString").compare(type) == 0) { - QString* str = static_cast - (value); - output->insert(name, QJsonValue(*str)); - } - else if(QStringLiteral("qint32").compare(type) == 0) { - qint32* str = static_cast - (value); - output->insert(name, QJsonValue(*str)); - } - else if(QStringLiteral("qint64").compare(type) == 0) { - qint64* str = static_cast - (value); - output->insert(name, QJsonValue(*str)); - } - else if(QStringLiteral("bool").compare(type) == 0) { - bool* str = static_cast - (value); - output->insert(name, QJsonValue(*str)); - } + output->insert(key, o->value(key)); } + } + } + } + else if(QStringLiteral("QString").compare(type) == 0) { + QString* str = static_cast(value); + output->insert(name, QJsonValue(*str)); + } + else if(QStringLiteral("qint32").compare(type) == 0) { + qint32* str = static_cast(value); + output->insert(name, QJsonValue(*str)); + } + else if(QStringLiteral("qint64").compare(type) == 0) { + qint64* str = static_cast(value); + output->insert(name, QJsonValue(*str)); + } + else if(QStringLiteral("bool").compare(type) == 0) { + bool* str = static_cast(value); + output->insert(name, QJsonValue(*str)); + } +} - void - toJsonArray(QList - * value, QJsonArray* output, QString innerName, QString innerType) { - foreach(void* obj, *value) { - QJsonObject element; +void +toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType) { + foreach(void* obj, *value) { + QJsonObject element; - toJsonValue(NULL, obj, &element, innerType); - output->append(element); - } - } + toJsonValue(NULL, obj, &element, innerType); + output->append(element); + } +} - QString - stringValue(QString* value) { - QString* str = static_cast - (value); - return QString(*str); - } +QString +stringValue(QString* value) { + QString* str = static_cast(value); + return QString(*str); +} - QString - stringValue(qint32 value) { - return QString::number(value); - } +QString +stringValue(qint32 value) { + return QString::number(value); +} - QString - stringValue(qint64 value) { - return QString::number(value); - } +QString +stringValue(qint64 value) { + return QString::number(value); +} - QString - stringValue(bool value) { - return QString(value ? "true" : "false"); - } - } /* namespace Swagger */ +QString +stringValue(bool value) { + return QString(value ? "true" : "false"); +} +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGHelpers.h b/samples/client/petstore/qt5cpp/client/SWGHelpers.h index 52bba0455bc..3a02c0952d5 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHelpers.h +++ b/samples/client/petstore/qt5cpp/client/SWGHelpers.h @@ -1,20 +1,17 @@ #ifndef SWGHELPERS_H #define SWGHELPERS_H -#include - +#include - namespace Swagger { +namespace Swagger { void setValue(void* value, QJsonValue obj, QString type, QString complexType); - void toJsonArray(QList - * value, QJsonArray* output, QString innerName, QString innerType); + void toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType); void toJsonValue(QString name, void* value, QJsonObject* output, QString type); bool isCompatibleJsonValue(QString type); QString stringValue(QString* value); QString stringValue(qint32 value); QString stringValue(qint64 value); QString stringValue(bool value); - } +} - #endif // SWGHELPERS_H +#endif // SWGHELPERS_H diff --git a/samples/client/petstore/qt5cpp/client/SWGModelFactory.h b/samples/client/petstore/qt5cpp/client/SWGModelFactory.h index cdcfc123ee3..588a7ad952b 100644 --- a/samples/client/petstore/qt5cpp/client/SWGModelFactory.h +++ b/samples/client/petstore/qt5cpp/client/SWGModelFactory.h @@ -2,45 +2,44 @@ #define ModelFactory_H_ - #include "SWGUser.h" - #include "SWGCategory.h" - #include "SWGPet.h" - #include "SWGTag.h" - #include "SWGOrder.h" +#include "SWGUser.h" +#include "SWGCategory.h" +#include "SWGPet.h" +#include "SWGTag.h" +#include "SWGOrder.h" namespace Swagger { -inline void* create(QString type) { -if(QString("SWGUser").compare(type) == 0) { -return new SWGUser(); -} -if(QString("SWGCategory").compare(type) == 0) { -return new SWGCategory(); -} -if(QString("SWGPet").compare(type) == 0) { -return new SWGPet(); -} -if(QString("SWGTag").compare(type) == 0) { -return new SWGTag(); -} -if(QString("SWGOrder").compare(type) == 0) { -return new SWGOrder(); -} + inline void* create(QString type) { + if(QString("SWGUser").compare(type) == 0) { + return new SWGUser(); + } + if(QString("SWGCategory").compare(type) == 0) { + return new SWGCategory(); + } + if(QString("SWGPet").compare(type) == 0) { + return new SWGPet(); + } + if(QString("SWGTag").compare(type) == 0) { + return new SWGTag(); + } + if(QString("SWGOrder").compare(type) == 0) { + return new SWGOrder(); + } + + return NULL; + } -return NULL; -} - -inline void* create(QString json, QString type) { -void* val = create(type); -if(val != NULL) { -SWGObject* obj = static_cast -(val); -return obj->fromJson(json); -} -if(type.startsWith("QString")) { -return new QString(); -} -return NULL; -} + inline void* create(QString json, QString type) { + void* val = create(type); + if(val != NULL) { + SWGObject* obj = static_cast(val); + return obj->fromJson(json); + } + if(type.startsWith("QString")) { + return new QString(); + } + return NULL; + } } /* namespace Swagger */ #endif /* ModelFactory_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGObject.h b/samples/client/petstore/qt5cpp/client/SWGObject.h index f9ccab6ac1d..6cb5c042772 100644 --- a/samples/client/petstore/qt5cpp/client/SWGObject.h +++ b/samples/client/petstore/qt5cpp/client/SWGObject.h @@ -1,25 +1,24 @@ #ifndef _SWG_OBJECT_H_ #define _SWG_OBJECT_H_ -#include - +#include - class SWGObject { - public: +class SWGObject { + public: virtual QJsonObject* asJsonObject() { - return NULL; + return NULL; } virtual ~SWGObject() {} virtual SWGObject* fromJson(QString &jsonString) { - Q_UNUSED(jsonString); - return NULL; + Q_UNUSED(jsonString); + return NULL; } virtual void fromJsonObject(QJsonObject &json) { - Q_UNUSED(json); + Q_UNUSED(json); } virtual QString asJson() { - return QString(""); + return QString(""); } - }; +}; - #endif /* _SWG_OBJECT_H_ */ +#endif /* _SWG_OBJECT_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGOrder.cpp b/samples/client/petstore/qt5cpp/client/SWGOrder.cpp index 67cc01ad614..3e34f2669c7 100644 --- a/samples/client/petstore/qt5cpp/client/SWGOrder.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGOrder.cpp @@ -1,35 +1,31 @@ - #include "SWGOrder.h" +#include "SWGOrder.h" - #include "SWGHelpers.h" +#include "SWGHelpers.h" - #include - - #include - - #include - - #include - +#include +#include +#include +#include - namespace Swagger { +namespace Swagger { - SWGOrder::SWGOrder(QString* json) { - init(); - this->fromJson(*json); - } +SWGOrder::SWGOrder(QString* json) { + init(); + this->fromJson(*json); +} - SWGOrder::SWGOrder() { - init(); - } +SWGOrder::SWGOrder() { + init(); +} - SWGOrder::~SWGOrder() { - this->cleanup(); - } +SWGOrder::~SWGOrder() { + this->cleanup(); +} - void - SWGOrder::init() { +void +SWGOrder::init() { id = 0L; petId = 0L; quantity = 0; @@ -37,34 +33,34 @@ status = new QString(""); complete = false; - } +} - void - SWGOrder::cleanup() { +void +SWGOrder::cleanup() { if(shipDate != NULL) { - delete shipDate; - } + delete shipDate; + } if(status != NULL) { - delete status; - } + delete status; + } - } +} - SWGOrder* - SWGOrder::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; - } +SWGOrder* +SWGOrder::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} - void - SWGOrder::fromJsonObject(QJsonObject &pJson) { +void +SWGOrder::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); setValue(&petId, pJson["petId"], "qint64", ""); setValue(&quantity, pJson["quantity"], "qint32", ""); @@ -72,104 +68,97 @@ setValue(&status, pJson["status"], "QString", "QString"); setValue(&complete, pJson["complete"], "bool", ""); - } +} - QString - SWGOrder::asJson () - { - QJsonObject* obj = this->asJsonObject(); +QString +SWGOrder::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); - } - - QJsonObject* - SWGOrder::asJsonObject() { - QJsonObject* obj = new QJsonObject(); +QJsonObject* +SWGOrder::asJsonObject() { + QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); obj->insert("petId", QJsonValue(petId)); obj->insert("quantity", QJsonValue(quantity)); - - toJsonValue(QString("shipDate"), shipDate, obj, QString("QDateTime")); - - + + toJsonValue(QString("shipDate"), shipDate, obj, QString("QDateTime")); + + + + + + toJsonValue(QString("status"), status, obj, QString("QString")); - - toJsonValue(QString("status"), status, obj, QString("QString")); - - obj->insert("complete", QJsonValue(complete)); - return obj; - } + return obj; +} - - qint64 - SWGOrder::getId() { - return id; - } - void - SWGOrder::setId(qint64 id) { - this->id = id; - } +qint64 +SWGOrder::getId() { + return id; +} +void +SWGOrder::setId(qint64 id) { + this->id = id; +} - - qint64 - SWGOrder::getPetId() { - return petId; - } - void - SWGOrder::setPetId(qint64 petId) { - this->petId = petId; - } +qint64 +SWGOrder::getPetId() { + return petId; +} +void +SWGOrder::setPetId(qint64 petId) { + this->petId = petId; +} - - qint32 - SWGOrder::getQuantity() { - return quantity; - } - void - SWGOrder::setQuantity(qint32 quantity) { - this->quantity = quantity; - } +qint32 +SWGOrder::getQuantity() { + return quantity; +} +void +SWGOrder::setQuantity(qint32 quantity) { + this->quantity = quantity; +} - - QDateTime* - SWGOrder::getShipDate() { - return shipDate; - } - void - SWGOrder::setShipDate(QDateTime* shipDate) { - this->shipDate = shipDate; - } +QDateTime* +SWGOrder::getShipDate() { + return shipDate; +} +void +SWGOrder::setShipDate(QDateTime* shipDate) { + this->shipDate = shipDate; +} - - QString* - SWGOrder::getStatus() { - return status; - } - void - SWGOrder::setStatus(QString* status) { - this->status = status; - } +QString* +SWGOrder::getStatus() { + return status; +} +void +SWGOrder::setStatus(QString* status) { + this->status = status; +} - - bool - SWGOrder::getComplete() { - return complete; - } - void - SWGOrder::setComplete(bool complete) { - this->complete = complete; - } - - +bool +SWGOrder::getComplete() { + return complete; +} +void +SWGOrder::setComplete(bool complete) { + this->complete = complete; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGOrder.h b/samples/client/petstore/qt5cpp/client/SWGOrder.h index 1127afa9fce..d17713afe78 100644 --- a/samples/client/petstore/qt5cpp/client/SWGOrder.h +++ b/samples/client/petstore/qt5cpp/client/SWGOrder.h @@ -1,52 +1,51 @@ /* -* SWGOrder.h -* -* -*/ + * SWGOrder.h + * + * + */ #ifndef SWGOrder_H_ #define SWGOrder_H_ -#include - +#include #include "QDateTime.h" #include - #include "SWGObject.h" +#include "SWGObject.h" - namespace Swagger { +namespace Swagger { - class SWGOrder: public SWGObject { - public: +class SWGOrder: public SWGObject { +public: SWGOrder(); SWGOrder(QString* json); - virtual ~SWGOrder(); - void init(); - void cleanup(); + virtual ~SWGOrder(); + void init(); + void cleanup(); - QString asJson (); - QJsonObject* asJsonObject(); - void fromJsonObject(QJsonObject &json); + QString asJson (); + QJsonObject* asJsonObject(); + void fromJsonObject(QJsonObject &json); SWGOrder* fromJson(QString &jsonString); qint64 getId(); - void setId(qint64 id); + void setId(qint64 id); qint64 getPetId(); - void setPetId(qint64 petId); + void setPetId(qint64 petId); qint32 getQuantity(); - void setQuantity(qint32 quantity); + void setQuantity(qint32 quantity); QDateTime* getShipDate(); - void setShipDate(QDateTime* shipDate); + void setShipDate(QDateTime* shipDate); QString* getStatus(); - void setStatus(QString* status); + void setStatus(QString* status); bool getComplete(); - void setComplete(bool complete); + void setComplete(bool complete); - private: +private: qint64 id; qint64 petId; qint32 quantity; @@ -54,8 +53,8 @@ QString* status; bool complete; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SWGOrder_H_ */ +#endif /* SWGOrder_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGPet.cpp b/samples/client/petstore/qt5cpp/client/SWGPet.cpp index 9ee24fb7d4f..d0e5b8280e2 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPet.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPet.cpp @@ -1,35 +1,31 @@ - #include "SWGPet.h" +#include "SWGPet.h" - #include "SWGHelpers.h" +#include "SWGHelpers.h" - #include - - #include - - #include - - #include - +#include +#include +#include +#include - namespace Swagger { +namespace Swagger { - SWGPet::SWGPet(QString* json) { - init(); - this->fromJson(*json); - } +SWGPet::SWGPet(QString* json) { + init(); + this->fromJson(*json); +} - SWGPet::SWGPet() { - init(); - } +SWGPet::SWGPet() { + init(); +} - SWGPet::~SWGPet() { - this->cleanup(); - } +SWGPet::~SWGPet() { + this->cleanup(); +} - void - SWGPet::init() { +void +SWGPet::init() { id = 0L; category = new SWGCategory(); name = new QString(""); @@ -37,48 +33,48 @@ tags = new QList(); status = new QString(""); - } +} - void - SWGPet::cleanup() { +void +SWGPet::cleanup() { if(category != NULL) { - delete category; - } + delete category; + } if(name != NULL) { - delete name; - } + delete name; + } if(photoUrls != NULL) { - QList* arr = photoUrls; + QList* arr = photoUrls; foreach(QString* o, *arr) { - delete o; - } - delete photoUrls; + delete o; } + delete photoUrls; + } if(tags != NULL) { - QList* arr = tags; + QList* arr = tags; foreach(SWGTag* o, *arr) { - delete o; - } - delete tags; + delete o; } + delete tags; + } if(status != NULL) { - delete status; - } + delete status; + } - } +} - SWGPet* - SWGPet::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; - } +SWGPet* +SWGPet::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} - void - SWGPet::fromJsonObject(QJsonObject &pJson) { +void +SWGPet::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); setValue(&category, pJson["category"], "SWGCategory", "SWGCategory"); setValue(&name, pJson["name"], "QString", "QString"); @@ -86,127 +82,118 @@ setValue(&tags, pJson["tags"], "QList", "SWGTag"); setValue(&status, pJson["status"], "QString", "QString"); - } +} - QString - SWGPet::asJson () - { - QJsonObject* obj = this->asJsonObject(); +QString +SWGPet::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); - } - - QJsonObject* - SWGPet::asJsonObject() { - QJsonObject* obj = new QJsonObject(); +QJsonObject* +SWGPet::asJsonObject() { + QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); - - toJsonValue(QString("category"), category, obj, QString("SWGCategory")); - - + + toJsonValue(QString("category"), category, obj, QString("SWGCategory")); - - toJsonValue(QString("name"), name, obj, QString("QString")); - - - - QList* photoUrlsList = photoUrls; - QJsonArray photoUrlsJsonArray; - toJsonArray((QList - *)photoUrls, &photoUrlsJsonArray, "photoUrls", "QString"); + + toJsonValue(QString("name"), name, obj, QString("QString")); + + + + + + QList* photoUrlsList = photoUrls; + QJsonArray photoUrlsJsonArray; + toJsonArray((QList*)photoUrls, &photoUrlsJsonArray, "photoUrls", "QString"); - obj->insert("photoUrls", photoUrlsJsonArray); - + obj->insert("photoUrls", photoUrlsJsonArray); - - QList* tagsList = tags; - QJsonArray tagsJsonArray; - toJsonArray((QList - *)tags, &tagsJsonArray, "tags", "SWGTag"); + + + QList* tagsList = tags; + QJsonArray tagsJsonArray; + toJsonArray((QList*)tags, &tagsJsonArray, "tags", "SWGTag"); - obj->insert("tags", tagsJsonArray); - + obj->insert("tags", tagsJsonArray); + + + + + toJsonValue(QString("status"), status, obj, QString("QString")); - - toJsonValue(QString("status"), status, obj, QString("QString")); - - - return obj; - } + return obj; +} - - qint64 - SWGPet::getId() { - return id; - } - void - SWGPet::setId(qint64 id) { - this->id = id; - } +qint64 +SWGPet::getId() { + return id; +} +void +SWGPet::setId(qint64 id) { + this->id = id; +} - - SWGCategory* - SWGPet::getCategory() { - return category; - } - void - SWGPet::setCategory(SWGCategory* category) { - this->category = category; - } +SWGCategory* +SWGPet::getCategory() { + return category; +} +void +SWGPet::setCategory(SWGCategory* category) { + this->category = category; +} - - QString* - SWGPet::getName() { - return name; - } - void - SWGPet::setName(QString* name) { - this->name = name; - } +QString* +SWGPet::getName() { + return name; +} +void +SWGPet::setName(QString* name) { + this->name = name; +} - - QList* - SWGPet::getPhotoUrls() { - return photoUrls; - } - void - SWGPet::setPhotoUrls(QList* photoUrls) { - this->photoUrls = photoUrls; - } +QList* +SWGPet::getPhotoUrls() { + return photoUrls; +} +void +SWGPet::setPhotoUrls(QList* photoUrls) { + this->photoUrls = photoUrls; +} - - QList* - SWGPet::getTags() { - return tags; - } - void - SWGPet::setTags(QList* tags) { - this->tags = tags; - } +QList* +SWGPet::getTags() { + return tags; +} +void +SWGPet::setTags(QList* tags) { + this->tags = tags; +} - - QString* - SWGPet::getStatus() { - return status; - } - void - SWGPet::setStatus(QString* status) { - this->status = status; - } - - +QString* +SWGPet::getStatus() { + return status; +} +void +SWGPet::setStatus(QString* status) { + this->status = status; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGPet.h b/samples/client/petstore/qt5cpp/client/SWGPet.h index e0bd3f0f8df..3f9320f1507 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPet.h +++ b/samples/client/petstore/qt5cpp/client/SWGPet.h @@ -1,54 +1,53 @@ /* -* SWGPet.h -* -* -*/ + * SWGPet.h + * + * + */ #ifndef SWGPet_H_ #define SWGPet_H_ -#include - +#include -#include "SWGTag.h" -#include -#include "SWGCategory.h" #include +#include "SWGCategory.h" +#include +#include "SWGTag.h" - #include "SWGObject.h" +#include "SWGObject.h" - namespace Swagger { +namespace Swagger { - class SWGPet: public SWGObject { - public: +class SWGPet: public SWGObject { +public: SWGPet(); SWGPet(QString* json); - virtual ~SWGPet(); - void init(); - void cleanup(); + virtual ~SWGPet(); + void init(); + void cleanup(); - QString asJson (); - QJsonObject* asJsonObject(); - void fromJsonObject(QJsonObject &json); + QString asJson (); + QJsonObject* asJsonObject(); + void fromJsonObject(QJsonObject &json); SWGPet* fromJson(QString &jsonString); qint64 getId(); - void setId(qint64 id); + void setId(qint64 id); SWGCategory* getCategory(); - void setCategory(SWGCategory* category); + void setCategory(SWGCategory* category); QString* getName(); - void setName(QString* name); + void setName(QString* name); QList* getPhotoUrls(); - void setPhotoUrls(QList* photoUrls); + void setPhotoUrls(QList* photoUrls); QList* getTags(); - void setTags(QList* tags); + void setTags(QList* tags); QString* getStatus(); - void setStatus(QString* status); + void setStatus(QString* status); - private: +private: qint64 id; SWGCategory* category; QString* name; @@ -56,8 +55,8 @@ QList* tags; QString* status; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SWGPet_H_ */ +#endif /* SWGPet_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp index 08a71c5df0c..0be3a197cd1 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp @@ -2,549 +2,530 @@ #include "SWGHelpers.h" #include "SWGModelFactory.h" -#include - - #include - +#include +#include - namespace Swagger { - SWGPetApi::SWGPetApi() {} +namespace Swagger { +SWGPetApi::SWGPetApi() {} - SWGPetApi::~SWGPetApi() {} +SWGPetApi::~SWGPetApi() {} - SWGPetApi::SWGPetApi(QString host, QString basePath) { - this->host = host; - this->basePath = basePath; +SWGPetApi::SWGPetApi(QString host, QString basePath) { + this->host = host; + this->basePath = basePath; +} + +void +SWGPetApi::updatePet(SWGPet body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/pet"); + + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "PUT"); + + + + + + + QString output = body.asJson(); + input.request_body.append(output); + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGPetApi::updatePetCallback); + + worker->execute(&input); +} + +void +SWGPetApi::updatePetCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit updatePetSignal(); +} +void +SWGPetApi::addPet(SWGPet body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/pet"); + + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "POST"); + + + + + + + QString output = body.asJson(); + input.request_body.append(output); + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGPetApi::addPetCallback); + + worker->execute(&input); +} + +void +SWGPetApi::addPetCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit addPetSignal(); +} +void +SWGPetApi::findPetsByStatus(QList* status) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus"); + + + + + + + + + if(status->size() > 0) { + if(QString("multi").indexOf("multi") == 0) { + foreach(QString* t, *status) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("status=").append(stringValue(t)); } + } + else if (QString("multi").indexOf("ssv") == 0) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("status="); + qint32 count = 0; + foreach(QString* t, *status) { + if(count > 0) { + fullPath.append(" "); + } + fullPath.append(stringValue(t)); + } + } + else if (QString("multi").indexOf("tsv") == 0) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("status="); + qint32 count = 0; + foreach(QString* t, *status) { + if(count > 0) { + fullPath.append("\t"); + } + fullPath.append(stringValue(t)); + } + } + } + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); + + + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGPetApi::findPetsByStatusCallback); + + worker->execute(&input); +} + +void +SWGPetApi::findPetsByStatusCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + QList* output = new QList(); + QString json(worker->response); + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonArray jsonArray = doc.array(); + + foreach(QJsonValue obj, jsonArray) { + SWGPet* o = new SWGPet(); + QJsonObject jv = obj.toObject(); + QJsonObject * ptr = (QJsonObject*)&jv; + o->fromJsonObject(*ptr); + output->append(o); + } + + + + + worker->deleteLater(); + + emit findPetsByStatusSignal(output); + +} +void +SWGPetApi::findPetsByTags(QList* tags) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/pet/findByTags"); + + + + + + + + + if(tags->size() > 0) { + if(QString("multi").indexOf("multi") == 0) { + foreach(QString* t, *tags) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("tags=").append(stringValue(t)); + } + } + else if (QString("multi").indexOf("ssv") == 0) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("tags="); + qint32 count = 0; + foreach(QString* t, *tags) { + if(count > 0) { + fullPath.append(" "); + } + fullPath.append(stringValue(t)); + } + } + else if (QString("multi").indexOf("tsv") == 0) { + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append("tags="); + qint32 count = 0; + foreach(QString* t, *tags) { + if(count > 0) { + fullPath.append("\t"); + } + fullPath.append(stringValue(t)); + } + } + } + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); + + + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGPetApi::findPetsByTagsCallback); + + worker->execute(&input); +} + +void +SWGPetApi::findPetsByTagsCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + QList* output = new QList(); + QString json(worker->response); + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonArray jsonArray = doc.array(); + + foreach(QJsonValue obj, jsonArray) { + SWGPet* o = new SWGPet(); + QJsonObject jv = obj.toObject(); + QJsonObject * ptr = (QJsonObject*)&jv; + o->fromJsonObject(*ptr); + output->append(o); + } + + + + + worker->deleteLater(); + + emit findPetsByTagsSignal(output); + +} +void +SWGPetApi::getPetById(qint64 petId) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); + + + QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); + fullPath.replace(petIdPathParam, stringValue(petId)); + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); + + + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGPetApi::getPetByIdCallback); + + worker->execute(&input); +} + +void +SWGPetApi::getPetByIdCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + + + + QString json(worker->response); + SWGPet* output = static_cast(create(json, QString("SWGPet"))); + + + + + worker->deleteLater(); + + emit getPetByIdSignal(output); + +} +void +SWGPetApi::updatePetWithForm(QString* petId, QString* name, QString* status) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); + + + QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); + fullPath.replace(petIdPathParam, stringValue(petId)); + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "POST"); + + + if(name != NULL) { + input.add_var("name", *name); + } + + if(status != NULL) { + input.add_var("status", *status); + } + + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGPetApi::updatePetWithFormCallback); + + worker->execute(&input); +} + +void +SWGPetApi::updatePetWithFormCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit updatePetWithFormSignal(); +} +void +SWGPetApi::deletePet(QString* apiKey, qint64 petId) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); + + + QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); + fullPath.replace(petIdPathParam, stringValue(petId)); + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "DELETE"); + + + + + + + // TODO: add header support + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGPetApi::deletePetCallback); + + worker->execute(&input); +} + +void +SWGPetApi::deletePetCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit deletePetSignal(); +} +void +SWGPetApi::uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage"); + + + QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); + fullPath.replace(petIdPathParam, stringValue(petId)); + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "POST"); + + + if(additionalMetadata != NULL) { + input.add_var("additionalMetadata", *additionalMetadata); + } + - - - void - SWGPetApi::updatePet(SWGPet body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet"); + - + - + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGPetApi::uploadFileCallback); + + worker->execute(&input); +} + +void +SWGPetApi::uploadFileCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "PUT"); + - + worker->deleteLater(); - - - - QString output = body.asJson(); - input.request_body.append(output); - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGPetApi::updatePetCallback); - - worker->execute(&input); - } - - void - SWGPetApi::updatePetCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit updatePetSignal(); - } - - void - SWGPetApi::addPet(SWGPet body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet"); - - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); - - - - - - - QString output = body.asJson(); - input.request_body.append(output); - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGPetApi::addPetCallback); - - worker->execute(&input); - } - - void - SWGPetApi::addPetCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit addPetSignal(); - } - - void - SWGPetApi::findPetsByStatus(QList* status) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/findByStatus"); - - - - - - - - - if(status->size() > 0) { - if(QString("multi").indexOf("multi") == 0) { - foreach(QString* t, *status) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("status=").append(stringValue(t)); - } - } - else if (QString("multi").indexOf("ssv") == 0) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("status="); - qint32 count = 0; - foreach(QString* t, *status) { - if(count > 0) { - fullPath.append(" "); - } - fullPath.append(stringValue(t)); - } - } - else if (QString("multi").indexOf("tsv") == 0) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("status="); - qint32 count = 0; - foreach(QString* t, *status) { - if(count > 0) { - fullPath.append("\t"); - } - fullPath.append(stringValue(t)); - } - } - } - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); - - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGPetApi::findPetsByStatusCallback); - - worker->execute(&input); - } - - void - SWGPetApi::findPetsByStatusCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QList* output = new QList(); - QString json(worker->response); - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonArray jsonArray = doc.array(); - - foreach(QJsonValue obj, jsonArray) { - SWGPet* o = new SWGPet(); - QJsonObject jv = obj.toObject(); - QJsonObject * ptr = (QJsonObject*)&jv; - o->fromJsonObject(*ptr); - output->append(o); - } - - - - - worker->deleteLater(); - - emit findPetsByStatusSignal(output); - - } - - void - SWGPetApi::findPetsByTags(QList* tags) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/findByTags"); - - - - - - - - - if(tags->size() > 0) { - if(QString("multi").indexOf("multi") == 0) { - foreach(QString* t, *tags) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("tags=").append(stringValue(t)); - } - } - else if (QString("multi").indexOf("ssv") == 0) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("tags="); - qint32 count = 0; - foreach(QString* t, *tags) { - if(count > 0) { - fullPath.append(" "); - } - fullPath.append(stringValue(t)); - } - } - else if (QString("multi").indexOf("tsv") == 0) { - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("tags="); - qint32 count = 0; - foreach(QString* t, *tags) { - if(count > 0) { - fullPath.append("\t"); - } - fullPath.append(stringValue(t)); - } - } - } - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); - - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGPetApi::findPetsByTagsCallback); - - worker->execute(&input); - } - - void - SWGPetApi::findPetsByTagsCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QList* output = new QList(); - QString json(worker->response); - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonArray jsonArray = doc.array(); - - foreach(QJsonValue obj, jsonArray) { - SWGPet* o = new SWGPet(); - QJsonObject jv = obj.toObject(); - QJsonObject * ptr = (QJsonObject*)&jv; - o->fromJsonObject(*ptr); - output->append(o); - } - - - - - worker->deleteLater(); - - emit findPetsByTagsSignal(output); - - } - - void - SWGPetApi::getPetById(qint64 petId) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); - - - QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); - fullPath.replace(petIdPathParam, stringValue(petId)); - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); - - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGPetApi::getPetByIdCallback); - - worker->execute(&input); - } - - void - SWGPetApi::getPetByIdCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - - - - QString json(worker->response); - SWGPet* output = static_cast(create(json, - QString("SWGPet"))); - - - - - worker->deleteLater(); - - emit getPetByIdSignal(output); - - } - - void - SWGPetApi::updatePetWithForm(QString* petId - , QString* name - , QString* status) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); - - - QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); - fullPath.replace(petIdPathParam, stringValue(petId)); - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); - - - if(name != NULL) { - input.add_var("name", *name); - } - - if(status != NULL) { - input.add_var("status", *status); - } - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGPetApi::updatePetWithFormCallback); - - worker->execute(&input); - } - - void - SWGPetApi::updatePetWithFormCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit updatePetWithFormSignal(); - } - - void - SWGPetApi::deletePet(QString* apiKey - , qint64 petId) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/{petId}"); - - - QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); - fullPath.replace(petIdPathParam, stringValue(petId)); - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "DELETE"); - - - - - - - // TODO: add header support - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGPetApi::deletePetCallback); - - worker->execute(&input); - } - - void - SWGPetApi::deletePetCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit deletePetSignal(); - } - - void - SWGPetApi::uploadFile(qint64 petId - , QString* additionalMetadata - , SWGHttpRequestInputFileElement* file) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage"); - - - QString petIdPathParam("{"); petIdPathParam.append("petId").append("}"); - fullPath.replace(petIdPathParam, stringValue(petId)); - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); - - - if(additionalMetadata != NULL) { - input.add_var("additionalMetadata", *additionalMetadata); - } - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGPetApi::uploadFileCallback); - - worker->execute(&input); - } - - void - SWGPetApi::uploadFileCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit uploadFileSignal(); - } - - - } /* namespace Swagger */ + + emit uploadFileSignal(); +} +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.h b/samples/client/petstore/qt5cpp/client/SWGPetApi.h index af70a469614..488865729b9 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.h @@ -7,15 +7,14 @@ #include #include "SWGHttpRequest.h" -#include - +#include - namespace Swagger { +namespace Swagger { - class SWGPetApi: public QObject { +class SWGPetApi: public QObject { Q_OBJECT - public: +public: SWGPetApi(); SWGPetApi(QString host, QString basePath); ~SWGPetApi(); @@ -28,16 +27,11 @@ void findPetsByStatus(QList* status); void findPetsByTags(QList* tags); void getPetById(qint64 petId); - void updatePetWithForm(QString* petId - , QString* name - , QString* status); - void deletePet(QString* apiKey - , qint64 petId); - void uploadFile(qint64 petId - , QString* additionalMetadata - , SWGHttpRequestInputFileElement* file); + void updatePetWithForm(QString* petId, QString* name, QString* status); + void deletePet(QString* apiKey, qint64 petId); + void uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file); - private: +private: void updatePetCallback (HttpRequestWorker * worker); void addPetCallback (HttpRequestWorker * worker); void findPetsByStatusCallback (HttpRequestWorker * worker); @@ -47,7 +41,7 @@ void deletePetCallback (HttpRequestWorker * worker); void uploadFileCallback (HttpRequestWorker * worker); - signals: +signals: void updatePetSignal(); void addPetSignal(); void findPetsByStatusSignal(QList* summary); @@ -57,6 +51,6 @@ void deletePetSignal(); void uploadFileSignal(); - }; - } - #endif \ No newline at end of file +}; +} +#endif \ No newline at end of file diff --git a/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp b/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp index 888935e31b1..be603573f62 100644 --- a/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp @@ -2,249 +2,238 @@ #include "SWGHelpers.h" #include "SWGModelFactory.h" -#include - - #include - +#include +#include - namespace Swagger { - SWGStoreApi::SWGStoreApi() {} +namespace Swagger { +SWGStoreApi::SWGStoreApi() {} - SWGStoreApi::~SWGStoreApi() {} +SWGStoreApi::~SWGStoreApi() {} - SWGStoreApi::SWGStoreApi(QString host, QString basePath) { - this->host = host; - this->basePath = basePath; - } +SWGStoreApi::SWGStoreApi(QString host, QString basePath) { + this->host = host; + this->basePath = basePath; +} - - - void - SWGStoreApi::getInventory() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/store/inventory"); +void +SWGStoreApi::getInventory() { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/store/inventory"); - + - + - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); - + - + - + - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGStoreApi::getInventoryCallback); + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGStoreApi::getInventoryCallback); - worker->execute(&input); - } + worker->execute(&input); +} - void - SWGStoreApi::getInventoryCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } +void +SWGStoreApi::getInventoryCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } - + - - - QMap* output = new QMap(); + + + QMap* output = new QMap(); - QString json(worker->response); - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject obj = doc.object(); + QString json(worker->response); + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject obj = doc.object(); - foreach(QString key, obj.keys()) { - qint32* val; - setValue(&val, obj[key], "QMap", ""); - output->insert(key, *val); - } + foreach(QString key, obj.keys()) { + qint32* val; + setValue(&val, obj[key], "QMap", ""); + output->insert(key, *val); + } - - - + + + - worker->deleteLater(); + worker->deleteLater(); - emit getInventorySignal(output); - - } - - void - SWGStoreApi::placeOrder(SWGOrder body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/store/order"); + emit getInventorySignal(output); + +} +void +SWGStoreApi::placeOrder(SWGOrder body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/store/order"); - + - + - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "POST"); - + - - - - QString output = body.asJson(); - input.request_body.append(output); - + + + + QString output = body.asJson(); + input.request_body.append(output); + - + - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGStoreApi::placeOrderCallback); + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGStoreApi::placeOrderCallback); - worker->execute(&input); - } + worker->execute(&input); +} - void - SWGStoreApi::placeOrderCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } +void +SWGStoreApi::placeOrderCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } - + - - - - QString json(worker->response); - SWGOrder* output = static_cast(create(json, - QString("SWGOrder"))); - - - + + + + QString json(worker->response); + SWGOrder* output = static_cast(create(json, QString("SWGOrder"))); + + + - worker->deleteLater(); + worker->deleteLater(); - emit placeOrderSignal(output); - - } - - void - SWGStoreApi::getOrderById(QString* orderId) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); + emit placeOrderSignal(output); + +} +void +SWGStoreApi::getOrderById(QString* orderId) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); - - QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}"); - fullPath.replace(orderIdPathParam, stringValue(orderId)); - + + QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}"); + fullPath.replace(orderIdPathParam, stringValue(orderId)); + - + - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); - + - + - + - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGStoreApi::getOrderByIdCallback); + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGStoreApi::getOrderByIdCallback); - worker->execute(&input); - } + worker->execute(&input); +} - void - SWGStoreApi::getOrderByIdCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } +void +SWGStoreApi::getOrderByIdCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } - + - - - - QString json(worker->response); - SWGOrder* output = static_cast(create(json, - QString("SWGOrder"))); - - - + + + + QString json(worker->response); + SWGOrder* output = static_cast(create(json, QString("SWGOrder"))); + + + - worker->deleteLater(); + worker->deleteLater(); - emit getOrderByIdSignal(output); - - } - - void - SWGStoreApi::deleteOrder(QString* orderId) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); + emit getOrderByIdSignal(output); + +} +void +SWGStoreApi::deleteOrder(QString* orderId) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}"); - - QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}"); - fullPath.replace(orderIdPathParam, stringValue(orderId)); - + + QString orderIdPathParam("{"); orderIdPathParam.append("orderId").append("}"); + fullPath.replace(orderIdPathParam, stringValue(orderId)); + - + - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "DELETE"); + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "DELETE"); - + - + - + - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGStoreApi::deleteOrderCallback); + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGStoreApi::deleteOrderCallback); - worker->execute(&input); - } + worker->execute(&input); +} - void - SWGStoreApi::deleteOrderCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } +void +SWGStoreApi::deleteOrderCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } - + - worker->deleteLater(); + worker->deleteLater(); - - emit deleteOrderSignal(); - } - - - } /* namespace Swagger */ + + emit deleteOrderSignal(); +} +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGStoreApi.h b/samples/client/petstore/qt5cpp/client/SWGStoreApi.h index cb801248863..7bbe8e5f92a 100644 --- a/samples/client/petstore/qt5cpp/client/SWGStoreApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGStoreApi.h @@ -7,15 +7,14 @@ #include "SWGOrder.h" #include -#include - +#include - namespace Swagger { +namespace Swagger { - class SWGStoreApi: public QObject { +class SWGStoreApi: public QObject { Q_OBJECT - public: +public: SWGStoreApi(); SWGStoreApi(QString host, QString basePath); ~SWGStoreApi(); @@ -28,18 +27,18 @@ void getOrderById(QString* orderId); void deleteOrder(QString* orderId); - private: +private: void getInventoryCallback (HttpRequestWorker * worker); void placeOrderCallback (HttpRequestWorker * worker); void getOrderByIdCallback (HttpRequestWorker * worker); void deleteOrderCallback (HttpRequestWorker * worker); - signals: +signals: void getInventorySignal(QMap* summary); void placeOrderSignal(SWGOrder* summary); void getOrderByIdSignal(SWGOrder* summary); void deleteOrderSignal(); - }; - } - #endif \ No newline at end of file +}; +} +#endif \ No newline at end of file diff --git a/samples/client/petstore/qt5cpp/client/SWGTag.cpp b/samples/client/petstore/qt5cpp/client/SWGTag.cpp index da3406abc68..bb4404de8df 100644 --- a/samples/client/petstore/qt5cpp/client/SWGTag.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGTag.cpp @@ -1,112 +1,105 @@ - #include "SWGTag.h" +#include "SWGTag.h" - #include "SWGHelpers.h" +#include "SWGHelpers.h" - #include - - #include - - #include - - #include - +#include +#include +#include +#include - namespace Swagger { +namespace Swagger { - SWGTag::SWGTag(QString* json) { - init(); - this->fromJson(*json); - } +SWGTag::SWGTag(QString* json) { + init(); + this->fromJson(*json); +} - SWGTag::SWGTag() { - init(); - } +SWGTag::SWGTag() { + init(); +} - SWGTag::~SWGTag() { - this->cleanup(); - } +SWGTag::~SWGTag() { + this->cleanup(); +} - void - SWGTag::init() { +void +SWGTag::init() { id = 0L; name = new QString(""); - } +} - void - SWGTag::cleanup() { +void +SWGTag::cleanup() { if(name != NULL) { - delete name; - } + delete name; + } - } +} - SWGTag* - SWGTag::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; - } +SWGTag* +SWGTag::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} - void - SWGTag::fromJsonObject(QJsonObject &pJson) { +void +SWGTag::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); setValue(&name, pJson["name"], "QString", "QString"); - } +} - QString - SWGTag::asJson () - { - QJsonObject* obj = this->asJsonObject(); +QString +SWGTag::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); - } - - QJsonObject* - SWGTag::asJsonObject() { - QJsonObject* obj = new QJsonObject(); +QJsonObject* +SWGTag::asJsonObject() { + QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); - - toJsonValue(QString("name"), name, obj, QString("QString")); - - + + toJsonValue(QString("name"), name, obj, QString("QString")); + + - return obj; - } + return obj; +} - - qint64 - SWGTag::getId() { - return id; - } - void - SWGTag::setId(qint64 id) { - this->id = id; - } +qint64 +SWGTag::getId() { + return id; +} +void +SWGTag::setId(qint64 id) { + this->id = id; +} - - QString* - SWGTag::getName() { - return name; - } - void - SWGTag::setName(QString* name) { - this->name = name; - } - - +QString* +SWGTag::getName() { + return name; +} +void +SWGTag::setName(QString* name) { + this->name = name; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGTag.h b/samples/client/petstore/qt5cpp/client/SWGTag.h index f1d650fe1ea..067b200675b 100644 --- a/samples/client/petstore/qt5cpp/client/SWGTag.h +++ b/samples/client/petstore/qt5cpp/client/SWGTag.h @@ -1,48 +1,47 @@ /* -* SWGTag.h -* -* -*/ + * SWGTag.h + * + * + */ #ifndef SWGTag_H_ #define SWGTag_H_ -#include - +#include #include - #include "SWGObject.h" +#include "SWGObject.h" - namespace Swagger { +namespace Swagger { - class SWGTag: public SWGObject { - public: +class SWGTag: public SWGObject { +public: SWGTag(); SWGTag(QString* json); - virtual ~SWGTag(); - void init(); - void cleanup(); + virtual ~SWGTag(); + void init(); + void cleanup(); - QString asJson (); - QJsonObject* asJsonObject(); - void fromJsonObject(QJsonObject &json); + QString asJson (); + QJsonObject* asJsonObject(); + void fromJsonObject(QJsonObject &json); SWGTag* fromJson(QString &jsonString); qint64 getId(); - void setId(qint64 id); + void setId(qint64 id); QString* getName(); - void setName(QString* name); + void setName(QString* name); - private: +private: qint64 id; QString* name; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SWGTag_H_ */ +#endif /* SWGTag_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGUser.cpp b/samples/client/petstore/qt5cpp/client/SWGUser.cpp index 58aa806e9a4..f0d58c7e97b 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUser.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGUser.cpp @@ -1,35 +1,31 @@ - #include "SWGUser.h" +#include "SWGUser.h" - #include "SWGHelpers.h" +#include "SWGHelpers.h" - #include - - #include - - #include - - #include - +#include +#include +#include +#include - namespace Swagger { +namespace Swagger { - SWGUser::SWGUser(QString* json) { - init(); - this->fromJson(*json); - } +SWGUser::SWGUser(QString* json) { + init(); + this->fromJson(*json); +} - SWGUser::SWGUser() { - init(); - } +SWGUser::SWGUser() { + init(); +} - SWGUser::~SWGUser() { - this->cleanup(); - } +SWGUser::~SWGUser() { + this->cleanup(); +} - void - SWGUser::init() { +void +SWGUser::init() { id = 0L; username = new QString(""); firstName = new QString(""); @@ -39,44 +35,44 @@ phone = new QString(""); userStatus = 0; - } +} - void - SWGUser::cleanup() { +void +SWGUser::cleanup() { if(username != NULL) { - delete username; - } + delete username; + } if(firstName != NULL) { - delete firstName; - } + delete firstName; + } if(lastName != NULL) { - delete lastName; - } + delete lastName; + } if(email != NULL) { - delete email; - } + delete email; + } if(password != NULL) { - delete password; - } + delete password; + } if(phone != NULL) { - delete phone; - } + delete phone; + } - } +} - SWGUser* - SWGUser::fromJson(QString &json) { - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); - return this; - } +SWGUser* +SWGUser::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} - void - SWGUser::fromJsonObject(QJsonObject &pJson) { +void +SWGUser::fromJsonObject(QJsonObject &pJson) { setValue(&id, pJson["id"], "qint64", ""); setValue(&username, pJson["username"], "QString", "QString"); setValue(&firstName, pJson["firstName"], "QString", "QString"); @@ -86,146 +82,137 @@ setValue(&phone, pJson["phone"], "QString", "QString"); setValue(&userStatus, pJson["userStatus"], "qint32", ""); - } +} - QString - SWGUser::asJson () - { - QJsonObject* obj = this->asJsonObject(); +QString +SWGUser::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} - QJsonDocument doc(*obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); - } - - QJsonObject* - SWGUser::asJsonObject() { - QJsonObject* obj = new QJsonObject(); +QJsonObject* +SWGUser::asJsonObject() { + QJsonObject* obj = new QJsonObject(); obj->insert("id", QJsonValue(id)); - - toJsonValue(QString("username"), username, obj, QString("QString")); - - + + toJsonValue(QString("username"), username, obj, QString("QString")); - - toJsonValue(QString("firstName"), firstName, obj, QString("QString")); - - - - toJsonValue(QString("lastName"), lastName, obj, QString("QString")); - - + + toJsonValue(QString("firstName"), firstName, obj, QString("QString")); - - toJsonValue(QString("email"), email, obj, QString("QString")); - - - - toJsonValue(QString("password"), password, obj, QString("QString")); - - + + toJsonValue(QString("lastName"), lastName, obj, QString("QString")); + + + + + + toJsonValue(QString("email"), email, obj, QString("QString")); + + + + + + toJsonValue(QString("password"), password, obj, QString("QString")); + + + + + + toJsonValue(QString("phone"), phone, obj, QString("QString")); - - toJsonValue(QString("phone"), phone, obj, QString("QString")); - - obj->insert("userStatus", QJsonValue(userStatus)); - return obj; - } + return obj; +} - - qint64 - SWGUser::getId() { - return id; - } - void - SWGUser::setId(qint64 id) { - this->id = id; - } +qint64 +SWGUser::getId() { + return id; +} +void +SWGUser::setId(qint64 id) { + this->id = id; +} - - QString* - SWGUser::getUsername() { - return username; - } - void - SWGUser::setUsername(QString* username) { - this->username = username; - } +QString* +SWGUser::getUsername() { + return username; +} +void +SWGUser::setUsername(QString* username) { + this->username = username; +} - - QString* - SWGUser::getFirstName() { - return firstName; - } - void - SWGUser::setFirstName(QString* firstName) { - this->firstName = firstName; - } +QString* +SWGUser::getFirstName() { + return firstName; +} +void +SWGUser::setFirstName(QString* firstName) { + this->firstName = firstName; +} - - QString* - SWGUser::getLastName() { - return lastName; - } - void - SWGUser::setLastName(QString* lastName) { - this->lastName = lastName; - } +QString* +SWGUser::getLastName() { + return lastName; +} +void +SWGUser::setLastName(QString* lastName) { + this->lastName = lastName; +} - - QString* - SWGUser::getEmail() { - return email; - } - void - SWGUser::setEmail(QString* email) { - this->email = email; - } +QString* +SWGUser::getEmail() { + return email; +} +void +SWGUser::setEmail(QString* email) { + this->email = email; +} - - QString* - SWGUser::getPassword() { - return password; - } - void - SWGUser::setPassword(QString* password) { - this->password = password; - } +QString* +SWGUser::getPassword() { + return password; +} +void +SWGUser::setPassword(QString* password) { + this->password = password; +} - - QString* - SWGUser::getPhone() { - return phone; - } - void - SWGUser::setPhone(QString* phone) { - this->phone = phone; - } +QString* +SWGUser::getPhone() { + return phone; +} +void +SWGUser::setPhone(QString* phone) { + this->phone = phone; +} - - qint32 - SWGUser::getUserStatus() { - return userStatus; - } - void - SWGUser::setUserStatus(qint32 userStatus) { - this->userStatus = userStatus; - } - - +qint32 +SWGUser::getUserStatus() { + return userStatus; +} +void +SWGUser::setUserStatus(qint32 userStatus) { + this->userStatus = userStatus; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGUser.h b/samples/client/petstore/qt5cpp/client/SWGUser.h index 6484a2e67b2..eaa0e496c39 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUser.h +++ b/samples/client/petstore/qt5cpp/client/SWGUser.h @@ -1,55 +1,54 @@ /* -* SWGUser.h -* -* -*/ + * SWGUser.h + * + * + */ #ifndef SWGUser_H_ #define SWGUser_H_ -#include - +#include #include - #include "SWGObject.h" +#include "SWGObject.h" - namespace Swagger { +namespace Swagger { - class SWGUser: public SWGObject { - public: +class SWGUser: public SWGObject { +public: SWGUser(); SWGUser(QString* json); - virtual ~SWGUser(); - void init(); - void cleanup(); + virtual ~SWGUser(); + void init(); + void cleanup(); - QString asJson (); - QJsonObject* asJsonObject(); - void fromJsonObject(QJsonObject &json); + QString asJson (); + QJsonObject* asJsonObject(); + void fromJsonObject(QJsonObject &json); SWGUser* fromJson(QString &jsonString); qint64 getId(); - void setId(qint64 id); + void setId(qint64 id); QString* getUsername(); - void setUsername(QString* username); + void setUsername(QString* username); QString* getFirstName(); - void setFirstName(QString* firstName); + void setFirstName(QString* firstName); QString* getLastName(); - void setLastName(QString* lastName); + void setLastName(QString* lastName); QString* getEmail(); - void setEmail(QString* email); + void setEmail(QString* email); QString* getPassword(); - void setPassword(QString* password); + void setPassword(QString* password); QString* getPhone(); - void setPhone(QString* phone); + void setPhone(QString* phone); qint32 getUserStatus(); - void setUserStatus(qint32 userStatus); + void setUserStatus(qint32 userStatus); - private: +private: qint64 id; QString* username; QString* firstName; @@ -59,8 +58,8 @@ QString* phone; qint32 userStatus; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SWGUser_H_ */ +#endif /* SWGUser_H_ */ diff --git a/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp b/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp index 4f90b151e29..6341231a884 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp @@ -2,463 +2,442 @@ #include "SWGHelpers.h" #include "SWGModelFactory.h" -#include - - #include - +#include +#include - namespace Swagger { - SWGUserApi::SWGUserApi() {} +namespace Swagger { +SWGUserApi::SWGUserApi() {} - SWGUserApi::~SWGUserApi() {} +SWGUserApi::~SWGUserApi() {} - SWGUserApi::SWGUserApi(QString host, QString basePath) { - this->host = host; - this->basePath = basePath; - } +SWGUserApi::SWGUserApi(QString host, QString basePath) { + this->host = host; + this->basePath = basePath; +} - - - void - SWGUserApi::createUser(SWGUser body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user"); +void +SWGUserApi::createUser(SWGUser body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/user"); - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + - + - - - - QString output = body.asJson(); - input.request_body.append(output); - + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "POST"); - + - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGUserApi::createUserCallback); + + + + QString output = body.asJson(); + input.request_body.append(output); + - worker->execute(&input); - } + - void - SWGUserApi::createUserCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGUserApi::createUserCallback); - + worker->execute(&input); +} - worker->deleteLater(); +void +SWGUserApi::createUserCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } - - emit createUserSignal(); - } - - void - SWGUserApi::createUsersWithArrayInput(QList* body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/createWithArray"); + - + worker->deleteLater(); - + + emit createUserSignal(); +} +void +SWGUserApi::createUsersWithArrayInput(QList* body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/user/createWithArray"); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + - - - - - QJsonArray* bodyArray = new QJsonArray(); - toJsonArray((QList - *)body, bodyArray, QString("body"), QString("SWGUser*")); + - QJsonDocument doc(*bodyArray); - QByteArray bytes = doc.toJson(); - - input.request_body.append(bytes); - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGUserApi::createUsersWithArrayInputCallback); - - worker->execute(&input); - } - - void - SWGUserApi::createUsersWithArrayInputCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit createUsersWithArrayInputSignal(); - } - - void - SWGUserApi::createUsersWithListInput(QList* body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/createWithList"); - - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); - - - - - - QJsonArray* bodyArray = new QJsonArray(); - toJsonArray((QList - *)body, bodyArray, QString("body"), QString("SWGUser*")); - - QJsonDocument doc(*bodyArray); - QByteArray bytes = doc.toJson(); - - input.request_body.append(bytes); - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGUserApi::createUsersWithListInputCallback); - - worker->execute(&input); - } - - void - SWGUserApi::createUsersWithListInputCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit createUsersWithListInputSignal(); - } - - void - SWGUserApi::loginUser(QString* username - , QString* password) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/login"); - - - - - - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append(QUrl::toPercentEncoding("username")) - .append("=") - .append(QUrl::toPercentEncoding(stringValue(username))); - - - - - - if(fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append(QUrl::toPercentEncoding("password")) - .append("=") - .append(QUrl::toPercentEncoding(stringValue(password))); - - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); - - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGUserApi::loginUserCallback); - - worker->execute(&input); - } - - void - SWGUserApi::loginUserCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - - - - QString json(worker->response); - QString* output = static_cast(create(json, - QString("QString"))); - - - - - worker->deleteLater(); - - emit loginUserSignal(output); - - } - - void - SWGUserApi::logoutUser() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/logout"); - - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); - - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGUserApi::logoutUserCallback); - - worker->execute(&input); - } - - void - SWGUserApi::logoutUserCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit logoutUserSignal(); - } - - void - SWGUserApi::getUserByName(QString* username) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/{username}"); - - - QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, stringValue(username)); - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); - - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGUserApi::getUserByNameCallback); - - worker->execute(&input); - } - - void - SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - - - - QString json(worker->response); - SWGUser* output = static_cast(create(json, - QString("SWGUser"))); - - - - - worker->deleteLater(); - - emit getUserByNameSignal(output); - - } - - void - SWGUserApi::updateUser(QString* username - , SWGUser body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/{username}"); - - - QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, stringValue(username)); - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "PUT"); - - - - - - - QString output = body.asJson(); - input.request_body.append(output); - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGUserApi::updateUserCallback); - - worker->execute(&input); - } - - void - SWGUserApi::updateUserCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit updateUserSignal(); - } - - void - SWGUserApi::deleteUser(QString* username) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/user/{username}"); - - - QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, stringValue(username)); - - - - - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "DELETE"); - - - - - - - - connect(worker, - &HttpRequestWorker::on_execution_finished, - this, - &SWGUserApi::deleteUserCallback); - - worker->execute(&input); - } - - void - SWGUserApi::deleteUserCallback(HttpRequestWorker * worker) { - QString msg; - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - - worker->deleteLater(); - - - emit deleteUserSignal(); - } - - - } /* namespace Swagger */ + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "POST"); + + + + + + QJsonArray* bodyArray = new QJsonArray(); + toJsonArray((QList*)body, bodyArray, QString("body"), QString("SWGUser*")); + + QJsonDocument doc(*bodyArray); + QByteArray bytes = doc.toJson(); + + input.request_body.append(bytes); + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGUserApi::createUsersWithArrayInputCallback); + + worker->execute(&input); +} + +void +SWGUserApi::createUsersWithArrayInputCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit createUsersWithArrayInputSignal(); +} +void +SWGUserApi::createUsersWithListInput(QList* body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/user/createWithList"); + + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "POST"); + + + + + + QJsonArray* bodyArray = new QJsonArray(); + toJsonArray((QList*)body, bodyArray, QString("body"), QString("SWGUser*")); + + QJsonDocument doc(*bodyArray); + QByteArray bytes = doc.toJson(); + + input.request_body.append(bytes); + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGUserApi::createUsersWithListInputCallback); + + worker->execute(&input); +} + +void +SWGUserApi::createUsersWithListInputCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit createUsersWithListInputSignal(); +} +void +SWGUserApi::loginUser(QString* username, QString* password) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/user/login"); + + + + + + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append(QUrl::toPercentEncoding("username")) + .append("=") + .append(QUrl::toPercentEncoding(stringValue(username))); + + + + + + if(fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append(QUrl::toPercentEncoding("password")) + .append("=") + .append(QUrl::toPercentEncoding(stringValue(password))); + + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); + + + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGUserApi::loginUserCallback); + + worker->execute(&input); +} + +void +SWGUserApi::loginUserCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + + + + QString json(worker->response); + QString* output = static_cast(create(json, QString("QString"))); + + + + + worker->deleteLater(); + + emit loginUserSignal(output); + +} +void +SWGUserApi::logoutUser() { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/user/logout"); + + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); + + + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGUserApi::logoutUserCallback); + + worker->execute(&input); +} + +void +SWGUserApi::logoutUserCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit logoutUserSignal(); +} +void +SWGUserApi::getUserByName(QString* username) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/user/{username}"); + + + QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); + fullPath.replace(usernamePathParam, stringValue(username)); + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "GET"); + + + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGUserApi::getUserByNameCallback); + + worker->execute(&input); +} + +void +SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + + + + QString json(worker->response); + SWGUser* output = static_cast(create(json, QString("SWGUser"))); + + + + + worker->deleteLater(); + + emit getUserByNameSignal(output); + +} +void +SWGUserApi::updateUser(QString* username, SWGUser body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/user/{username}"); + + + QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); + fullPath.replace(usernamePathParam, stringValue(username)); + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "PUT"); + + + + + + + QString output = body.asJson(); + input.request_body.append(output); + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGUserApi::updateUserCallback); + + worker->execute(&input); +} + +void +SWGUserApi::updateUserCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit updateUserSignal(); +} +void +SWGUserApi::deleteUser(QString* username) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/user/{username}"); + + + QString usernamePathParam("{"); usernamePathParam.append("username").append("}"); + fullPath.replace(usernamePathParam, stringValue(username)); + + + + + HttpRequestWorker *worker = new HttpRequestWorker(); + HttpRequestInput input(fullPath, "DELETE"); + + + + + + + + connect(worker, + &HttpRequestWorker::on_execution_finished, + this, + &SWGUserApi::deleteUserCallback); + + worker->execute(&input); +} + +void +SWGUserApi::deleteUserCallback(HttpRequestWorker * worker) { + QString msg; + if (worker->error_type == QNetworkReply::NoError) { + msg = QString("Success! %1 bytes").arg(worker->response.length()); + } + else { + msg = "Error: " + worker->error_str; + } + + + + worker->deleteLater(); + + + emit deleteUserSignal(); +} +} /* namespace Swagger */ diff --git a/samples/client/petstore/qt5cpp/client/SWGUserApi.h b/samples/client/petstore/qt5cpp/client/SWGUserApi.h index 62bd43e9a4e..2e3e119dc78 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUserApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGUserApi.h @@ -7,15 +7,14 @@ #include #include -#include - +#include - namespace Swagger { +namespace Swagger { - class SWGUserApi: public QObject { +class SWGUserApi: public QObject { Q_OBJECT - public: +public: SWGUserApi(); SWGUserApi(QString host, QString basePath); ~SWGUserApi(); @@ -26,15 +25,13 @@ void createUser(SWGUser body); void createUsersWithArrayInput(QList* body); void createUsersWithListInput(QList* body); - void loginUser(QString* username - , QString* password); + void loginUser(QString* username, QString* password); void logoutUser(); void getUserByName(QString* username); - void updateUser(QString* username - , SWGUser body); + void updateUser(QString* username, SWGUser body); void deleteUser(QString* username); - private: +private: void createUserCallback (HttpRequestWorker * worker); void createUsersWithArrayInputCallback (HttpRequestWorker * worker); void createUsersWithListInputCallback (HttpRequestWorker * worker); @@ -44,7 +41,7 @@ void updateUserCallback (HttpRequestWorker * worker); void deleteUserCallback (HttpRequestWorker * worker); - signals: +signals: void createUserSignal(); void createUsersWithArrayInputSignal(); void createUsersWithListInputSignal(); @@ -54,6 +51,6 @@ void updateUserSignal(); void deleteUserSignal(); - }; - } - #endif \ No newline at end of file +}; +} +#endif \ No newline at end of file diff --git a/samples/client/petstore/retrofit/pom.xml b/samples/client/petstore/retrofit/pom.xml index 8895c7719fb..45463b449bd 100644 --- a/samples/client/petstore/retrofit/pom.xml +++ b/samples/client/petstore/retrofit/pom.xml @@ -1,146 +1,143 @@ - 4.0.0 - io.swagger - swagger-java-client - jar - swagger-java-client - 1.0.0 - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-java-client + jar + swagger-java-client + 1.0.0 + + scm:git:git@github.com:swagger-api/swagger-mustache.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - - 1.6 - 1.6 - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - com.google.code.gson - gson - ${gson-version} - compile - - - com.squareup.retrofit - retrofit - ${retrofit-version} - compile - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + com.google.code.gson + gson + ${gson-version} + compile + + + com.squareup.retrofit + retrofit + ${retrofit-version} + compile + - - - junit - junit - ${junit-version} - test - - - - 1.5.0 - 2.3.1 - 1.9.0 - 1.0.0 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + 1.5.0 + 2.3.1 + 1.9.0 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/ServiceGenerator.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/ServiceGenerator.java index 81751b50cd1..e443c984fd0 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/ServiceGenerator.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/ServiceGenerator.java @@ -6,18 +6,18 @@ import retrofit.RestAdapter; import retrofit.converter.GsonConverter; public class ServiceGenerator { -// No need to instantiate this class. -private ServiceGenerator() { } + // No need to instantiate this class. + private ServiceGenerator() { } -public static S createService(Class serviceClass) { + public static S createService(Class serviceClass) { Gson gson = new GsonBuilder() - .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .create(); + .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") + .create(); RestAdapter adapter = new RestAdapter.Builder() - .setEndpoint("http://petstore.swagger.io/v2") - .setConverter(new GsonConverter(gson)) - .build(); + .setEndpoint("http://petstore.swagger.io/v2") + .setConverter(new GsonConverter(gson)) + .build(); return adapter.create(serviceClass); - } - } + } +} diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/PetApi.java index e92a43fbae4..3d1b0893b61 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/PetApi.java @@ -9,109 +9,109 @@ import java.util.*; import io.swagger.client.model.Pet; import java.io.File; - public interface PetApi { - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return Void - */ - - @PUT("/pet") - Void updatePet( - @Body Pet body - ); - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return Void - */ - - @POST("/pet") - Void addPet( - @Body Pet body - ); - - /** - * Finds Pets by status - * Multiple status values can be provided with comma seperated strings - * @param status Status values that need to be considered for filter - * @return List - */ - - @GET("/pet/findByStatus") - List findPetsByStatus( - @Query("status") List status - ); - - /** - * Finds Pets by tags - * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return List - */ - - @GET("/pet/findByTags") - List findPetsByTags( - @Query("tags") List tags - ); - - /** - * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched - * @return Pet - */ - - @GET("/pet/{petId}") - Pet getPetById( - @Path("petId") Long petId - ); - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - * @return Void - */ - - @FormUrlEncoded - @POST("/pet/{petId}") - Void updatePetWithForm( - @Path("petId") String petId,@Field("name") String name,@Field("status") String status - ); - - /** - * Deletes a pet - * - * @param apiKey - * @param petId Pet id to delete - * @return Void - */ - - @DELETE("/pet/{petId}") - Void deletePet( - @Header("api_key") String apiKey,@Path("petId") Long petId - ); - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - * @return Void - */ - - @Multipart - @POST("/pet/{petId}/uploadImage") - Void uploadFile( - @Path("petId") Long petId,@Part("additionalMetadata") String additionalMetadata,@Part("file") TypedFile file - ); - - } +public interface PetApi { + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return Void + */ + + @PUT("/pet") + Void updatePet( + @Body Pet body + ); + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return Void + */ + + @POST("/pet") + Void addPet( + @Body Pet body + ); + + /** + * Finds Pets by status + * Multiple status values can be provided with comma seperated strings + * @param status Status values that need to be considered for filter + * @return List + */ + + @GET("/pet/findByStatus") + List findPetsByStatus( + @Query("status") List status + ); + + /** + * Finds Pets by tags + * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return List + */ + + @GET("/pet/findByTags") + List findPetsByTags( + @Query("tags") List tags + ); + + /** + * Find pet by ID + * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * @param petId ID of pet that needs to be fetched + * @return Pet + */ + + @GET("/pet/{petId}") + Pet getPetById( + @Path("petId") Long petId + ); + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return Void + */ + + @FormUrlEncoded + @POST("/pet/{petId}") + Void updatePetWithForm( + @Path("petId") String petId,@Field("name") String name,@Field("status") String status + ); + + /** + * Deletes a pet + * + * @param apiKey + * @param petId Pet id to delete + * @return Void + */ + + @DELETE("/pet/{petId}") + Void deletePet( + @Header("api_key") String apiKey,@Path("petId") Long petId + ); + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @return Void + */ + + @Multipart + @POST("/pet/{petId}/uploadImage") + Void uploadFile( + @Path("petId") Long petId,@Part("additionalMetadata") String additionalMetadata,@Part("file") TypedFile file + ); + +} diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/StoreApi.java index ead55d0e2c0..fcd47b4b735 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/StoreApi.java @@ -9,52 +9,52 @@ import java.util.*; import java.util.Map; import io.swagger.client.model.Order; - public interface StoreApi { - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map - */ - - @GET("/store/inventory") - Map getInventory(); - - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - */ - - @POST("/store/order") - Order placeOrder( - @Body Order body - ); - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - - @GET("/store/order/{orderId}") - Order getOrderById( - @Path("orderId") 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 - * @param orderId ID of the order that needs to be deleted - * @return Void - */ - - @DELETE("/store/order/{orderId}") - Void deleteOrder( - @Path("orderId") String orderId - ); - - } +public interface StoreApi { + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map + */ + + @GET("/store/inventory") + Map getInventory(); + + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + + @POST("/store/order") + Order placeOrder( + @Body Order body + ); + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + + @GET("/store/order/{orderId}") + Order getOrderById( + @Path("orderId") 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 + * @param orderId ID of the order that needs to be deleted + * @return Void + */ + + @DELETE("/store/order/{orderId}") + Void deleteOrder( + @Path("orderId") String orderId + ); + +} diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/UserApi.java index 824e244526f..4aa39c52e2c 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/api/UserApi.java @@ -9,102 +9,102 @@ import java.util.*; import io.swagger.client.model.User; import java.util.*; - public interface UserApi { - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return Void - */ - - @POST("/user") - Void createUser( - @Body User body - ); - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return Void - */ - - @POST("/user/createWithArray") - Void createUsersWithArrayInput( - @Body List body - ); - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return Void - */ - - @POST("/user/createWithList") - Void createUsersWithListInput( - @Body List body - ); - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return String - */ - - @GET("/user/login") - String loginUser( - @Query("username") String username,@Query("password") String password - ); - - /** - * Logs out current logged in user session - * - * @return Void - */ - - @GET("/user/logout") - Void logoutUser(); - - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - - @GET("/user/{username}") - User getUserByName( - @Path("username") String username - ); - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return Void - */ - - @PUT("/user/{username}") - Void updateUser( - @Path("username") String username,@Body User body - ); - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return Void - */ - - @DELETE("/user/{username}") - Void deleteUser( - @Path("username") String username - ); - - } +public interface UserApi { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return Void + */ + + @POST("/user") + Void createUser( + @Body User body + ); + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return Void + */ + + @POST("/user/createWithArray") + Void createUsersWithArrayInput( + @Body List body + ); + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return Void + */ + + @POST("/user/createWithList") + Void createUsersWithListInput( + @Body List body + ); + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return String + */ + + @GET("/user/login") + String loginUser( + @Query("username") String username,@Query("password") String password + ); + + /** + * Logs out current logged in user session + * + * @return Void + */ + + @GET("/user/logout") + Void logoutUser(); + + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + + @GET("/user/{username}") + User getUserByName( + @Path("username") String username + ); + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return Void + */ + + @PUT("/user/{username}") + Void updateUser( + @Path("username") String username,@Body User body + ); + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return Void + */ + + @DELETE("/user/{username}") + Void deleteUser( + @Path("username") String username + ); + +} diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Category.java index 1a964573856..7f89bcf57a0 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Category.java @@ -4,47 +4,46 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class Category { + +@ApiModel(description = "") +public class Category { /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("id") - private Long id = null; + private Long id = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("name") - private String name = null; + private String name = null; - - public Long getId() { + + public Long getId() { return id; - } - public void setId(Long id) { + } + public void setId(Long id) { this.id = id; - } - - public String getName() { + } + + public String getName() { return name; - } - public void setName(String name) { + } + public void setName(String name) { this.name = name; - } + } @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" name: ").append(name).append("\n"); - sb.append("}\n"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" name: ").append(name).append("\n"); + sb.append("}\n"); + return sb.toString(); } - } - +} diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Order.java index 1f1fe1f7df4..6be69df18c9 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Order.java @@ -5,107 +5,106 @@ import java.util.Date; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class Order { + +@ApiModel(description = "") +public class Order { /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("id") - private Long id = null; + private Long id = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("petId") - private Long petId = null; + private Long petId = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("quantity") - private Integer quantity = null; + private Integer quantity = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("shipDate") - private Date shipDate = null; - public enum StatusEnum { + private Date shipDate = null; + public enum StatusEnum { placed, approved, delivered, - }; + }; /** - * Order Status - **/ - @ApiModelProperty(value = "Order Status") - @SerializedName("status") - private StatusEnum status = null; + * Order Status + **/ + @ApiModelProperty(value = "Order Status") + @SerializedName("status") + private StatusEnum status = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("complete") - private Boolean complete = null; + private Boolean complete = null; - - public Long getId() { + + public Long getId() { return id; - } - public void setId(Long id) { + } + public void setId(Long id) { this.id = id; - } - - public Long getPetId() { + } + + public Long getPetId() { return petId; - } - public void setPetId(Long petId) { + } + public void setPetId(Long petId) { this.petId = petId; - } - - public Integer getQuantity() { + } + + public Integer getQuantity() { return quantity; - } - public void setQuantity(Integer quantity) { + } + public void setQuantity(Integer quantity) { this.quantity = quantity; - } - - public Date getShipDate() { + } + + public Date getShipDate() { return shipDate; - } - public void setShipDate(Date shipDate) { + } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; - } - - public StatusEnum getStatus() { + } + + public StatusEnum getStatus() { return status; - } - public void setStatus(StatusEnum status) { + } + public void setStatus(StatusEnum status) { this.status = status; - } - - public Boolean getComplete() { + } + + public Boolean getComplete() { return complete; - } - public void setComplete(Boolean complete) { + } + public void setComplete(Boolean complete) { this.complete = complete; - } + } @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" petId: ").append(petId).append("\n"); - sb.append(" quantity: ").append(quantity).append("\n"); - sb.append(" shipDate: ").append(shipDate).append("\n"); - sb.append(" status: ").append(status).append("\n"); - sb.append(" complete: ").append(complete).append("\n"); - sb.append("}\n"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" petId: ").append(petId).append("\n"); + sb.append(" quantity: ").append(quantity).append("\n"); + sb.append(" shipDate: ").append(shipDate).append("\n"); + sb.append(" status: ").append(status).append("\n"); + sb.append(" complete: ").append(complete).append("\n"); + sb.append("}\n"); + return sb.toString(); } - } - +} diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Pet.java index e311a11be48..af9ba8880e0 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Pet.java @@ -1,113 +1,112 @@ package io.swagger.client.model; import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; import java.util.*; +import io.swagger.client.model.Tag; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class Pet { + +@ApiModel(description = "") +public class Pet { /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("id") - private Long id = null; + private Long id = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("category") - private Category category = null; + private Category category = null; /** - **/ - @ApiModelProperty(required = true, value = "") + **/ + @ApiModelProperty(required = true, value = "") @SerializedName("name") - private String name = null; + private String name = null; /** - **/ - @ApiModelProperty(required = true, value = "") + **/ + @ApiModelProperty(required = true, value = "") @SerializedName("photoUrls") - private List photoUrls = new ArrayList() ; + private List photoUrls = new ArrayList() ; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("tags") - private List tags = new ArrayList() ; - public enum StatusEnum { + private List tags = new ArrayList() ; + public enum StatusEnum { available, pending, sold, - }; + }; /** - * pet status in the store - **/ - @ApiModelProperty(value = "pet status in the store") - @SerializedName("status") - private StatusEnum status = null; + * pet status in the store + **/ + @ApiModelProperty(value = "pet status in the store") + @SerializedName("status") + private StatusEnum status = null; - - public Long getId() { + + public Long getId() { return id; - } - public void setId(Long id) { + } + public void setId(Long id) { this.id = id; - } - - public Category getCategory() { + } + + public Category getCategory() { return category; - } - public void setCategory(Category category) { + } + public void setCategory(Category category) { this.category = category; - } - - public String getName() { + } + + public String getName() { return name; - } - public void setName(String name) { + } + public void setName(String name) { this.name = name; - } - - public List getPhotoUrls() { + } + + public List getPhotoUrls() { return photoUrls; - } - public void setPhotoUrls(List photoUrls) { + } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; - } - - public List getTags() { + } + + public List getTags() { return tags; - } - public void setTags(List tags) { + } + public void setTags(List tags) { this.tags = tags; - } - - public StatusEnum getStatus() { + } + + public StatusEnum getStatus() { return status; - } - public void setStatus(StatusEnum status) { + } + public void setStatus(StatusEnum status) { this.status = status; - } + } @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" category: ").append(category).append("\n"); - sb.append(" name: ").append(name).append("\n"); - sb.append(" photoUrls: ").append(photoUrls).append("\n"); - sb.append(" tags: ").append(tags).append("\n"); - sb.append(" status: ").append(status).append("\n"); - sb.append("}\n"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" category: ").append(category).append("\n"); + sb.append(" name: ").append(name).append("\n"); + sb.append(" photoUrls: ").append(photoUrls).append("\n"); + sb.append(" tags: ").append(tags).append("\n"); + sb.append(" status: ").append(status).append("\n"); + sb.append("}\n"); + return sb.toString(); } - } - +} diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Tag.java index 0135992c7c6..c1a317bc45c 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/Tag.java @@ -4,47 +4,46 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class Tag { + +@ApiModel(description = "") +public class Tag { /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("id") - private Long id = null; + private Long id = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("name") - private String name = null; + private String name = null; - - public Long getId() { + + public Long getId() { return id; - } - public void setId(Long id) { + } + public void setId(Long id) { this.id = id; - } - - public String getName() { + } + + public String getName() { return name; - } - public void setName(String name) { + } + public void setName(String name) { this.name = name; - } + } @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" name: ").append(name).append("\n"); - sb.append("}\n"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" name: ").append(name).append("\n"); + sb.append("}\n"); + return sb.toString(); } - } - +} diff --git a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/User.java index 10fae2f8318..3beca5c5e86 100644 --- a/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/retrofit/src/main/java/io/swagger/client/model/User.java @@ -4,132 +4,131 @@ package io.swagger.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; - - @ApiModel(description = "") - public class User { + +@ApiModel(description = "") +public class User { /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("id") - private Long id = null; + private Long id = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("username") - private String username = null; + private String username = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("firstName") - private String firstName = null; + private String firstName = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("lastName") - private String lastName = null; + private String lastName = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("email") - private String email = null; + private String email = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("password") - private String password = null; + private String password = null; /** - **/ - @ApiModelProperty(value = "") + **/ + @ApiModelProperty(value = "") @SerializedName("phone") - private String phone = null; + private String phone = null; /** - * User Status - **/ - @ApiModelProperty(value = "User Status") + * User Status + **/ + @ApiModelProperty(value = "User Status") @SerializedName("userStatus") - private Integer userStatus = null; + private Integer userStatus = null; - - public Long getId() { + + public Long getId() { return id; - } - public void setId(Long id) { + } + public void setId(Long id) { this.id = id; - } - - public String getUsername() { + } + + public String getUsername() { return username; - } - public void setUsername(String username) { + } + public void setUsername(String username) { this.username = username; - } - - public String getFirstName() { + } + + public String getFirstName() { return firstName; - } - public void setFirstName(String firstName) { + } + public void setFirstName(String firstName) { this.firstName = firstName; - } - - public String getLastName() { + } + + public String getLastName() { return lastName; - } - public void setLastName(String lastName) { + } + public void setLastName(String lastName) { this.lastName = lastName; - } - - public String getEmail() { + } + + public String getEmail() { return email; - } - public void setEmail(String email) { + } + public void setEmail(String email) { this.email = email; - } - - public String getPassword() { + } + + public String getPassword() { return password; - } - public void setPassword(String password) { + } + public void setPassword(String password) { this.password = password; - } - - public String getPhone() { + } + + public String getPhone() { return phone; - } - public void setPhone(String phone) { + } + public void setPhone(String phone) { this.phone = phone; - } - - public Integer getUserStatus() { + } + + public Integer getUserStatus() { return userStatus; - } - public void setUserStatus(Integer userStatus) { + } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; - } + } @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" username: ").append(username).append("\n"); - sb.append(" firstName: ").append(firstName).append("\n"); - sb.append(" lastName: ").append(lastName).append("\n"); - sb.append(" email: ").append(email).append("\n"); - sb.append(" password: ").append(password).append("\n"); - sb.append(" phone: ").append(phone).append("\n"); - sb.append(" userStatus: ").append(userStatus).append("\n"); - sb.append("}\n"); - return sb.toString(); + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" username: ").append(username).append("\n"); + sb.append(" firstName: ").append(firstName).append("\n"); + sb.append(" lastName: ").append(lastName).append("\n"); + sb.append(" email: ").append(email).append("\n"); + sb.append(" password: ").append(password).append("\n"); + sb.append(" phone: ").append(phone).append("\n"); + sb.append(" userStatus: ").append(userStatus).append("\n"); + sb.append("}\n"); + return sb.toString(); } - } - +} diff --git a/samples/client/petstore/ruby/lib/swagger_client.rb b/samples/client/petstore/ruby/lib/swagger_client.rb index 6d239185005..998658c8b6e 100644 --- a/samples/client/petstore/ruby/lib/swagger_client.rb +++ b/samples/client/petstore/ruby/lib/swagger_client.rb @@ -16,8 +16,8 @@ require 'swagger_client/models/order' # APIs require 'swagger_client/api/user_api' -require 'swagger_client/api/pet_api' require 'swagger_client/api/store_api' +require 'swagger_client/api/pet_api' module SwaggerClient # Initialize the default configuration diff --git a/samples/client/petstore/ruby/lib/swagger_client/api/pet_api.rb b/samples/client/petstore/ruby/lib/swagger_client/api/pet_api.rb index 7bed9b47780..2ce4fb04ecd 100644 --- a/samples/client/petstore/ruby/lib/swagger_client/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/swagger_client/api/pet_api.rb @@ -190,7 +190,7 @@ module SwaggerClient post_body = nil - auth_names = ['api_key', 'petstore_auth'] + auth_names = ['petstore_auth', 'api_key'] response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body obj = Pet.new() and obj.build_from_hash(response) end diff --git a/samples/client/petstore/scala/pom.xml b/samples/client/petstore/scala/pom.xml index 75b711d3ee5..7e56a41c890 100644 --- a/samples/client/petstore/scala/pom.xml +++ b/samples/client/petstore/scala/pom.xml @@ -1,224 +1,221 @@ - 4.0.0 - io.swagger - swagger-scala-client - jar - swagger-scala-client - 1.0.0 - - 2.2.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-scala-client + jar + swagger-scala-client + 1.0.0 + + 2.2.0 + - - - maven-mongodb-plugin-repo - maven mongodb plugin repository - http://maven-mongodb-plugin.googlecode.com/svn/maven/repo - default - - + + + maven-mongodb-plugin-repo + maven mongodb plugin repository + http://maven-mongodb-plugin.googlecode.com/svn/maven/repo + default + + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - - 1.6 - 1.6 - - - - net.alchim31.maven - scala-maven-plugin - ${scala-maven-plugin-version} - - - scala-compile-first - process-resources - - add-source - compile - - - - scala-test-compile - process-test-resources - - testCompile - - - - - - -Xms128m - -Xmx1500m - - - - - - - - - org.scala-tools - maven-scala-plugin - - ${scala-version} - - - - - - - com.fasterxml.jackson.module - jackson-module-scala_2.10 - ${jackson-version} - - - com.sun.jersey - jersey-client - ${jersey-version} - - - com.sun.jersey.contribs - jersey-multipart - ${jersey-version} - - - org.jfarcand - jersey-ahc-client - ${jersey-async-version} - compile - - - org.scala-lang - scala-library - ${scala-version} - - - io.swagger - swagger-core - ${swagger-core-version} - - - org.scalatest - scalatest_2.10 - ${scala-test-version} - test - - - junit - junit - ${junit-version} - test - - - joda-time - joda-time - ${joda-time-version} - - - org.joda - joda-convert - ${joda-version} - - - - 2.10.4 - 1.2 - 2.2 - 1.7 - 1.5.0 - 1.0.5 - 1.0.0 - 2.4.2 + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin-version} + + + scala-compile-first + process-resources + + add-source + compile + + + + scala-test-compile + process-test-resources + + testCompile + + + + + + -Xms128m + -Xmx1500m + + + + + + + + + org.scala-tools + maven-scala-plugin + + ${scala-version} + + + + + + + com.fasterxml.jackson.module + jackson-module-scala_2.10 + ${jackson-version} + + + com.sun.jersey + jersey-client + ${jersey-version} + + + com.sun.jersey.contribs + jersey-multipart + ${jersey-version} + + + org.jfarcand + jersey-ahc-client + ${jersey-async-version} + compile + + + org.scala-lang + scala-library + ${scala-version} + + + io.swagger + swagger-core + ${swagger-core-version} + + + org.scalatest + scalatest_2.10 + ${scala-test-version} + test + + + junit + junit + ${junit-version} + test + + + joda-time + joda-time + ${joda-time-version} + + + org.joda + joda-convert + ${joda-version} + + + + 2.10.4 + 1.2 + 2.2 + 1.7 + 1.5.0 + 1.0.5 + 1.0.0 + 2.4.2 - 4.8.1 - 3.1.5 - 2.1.3 - + 4.8.1 + 3.1.5 + 2.1.3 + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 516e545b19f..91ab98471e9 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -25,179 +25,179 @@ import com.fasterxml.jackson.annotation._ import com.fasterxml.jackson.databind.annotation.JsonSerialize object ScalaJsonUtil { -def getJsonMapper = { -val mapper = new ObjectMapper() -mapper.registerModule(new DefaultScalaModule()) -mapper.registerModule(new JodaModule()); -mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); -mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT) -mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) -mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) -mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY) -mapper -} + def getJsonMapper = { + val mapper = new ObjectMapper() + mapper.registerModule(new DefaultScalaModule()) + mapper.registerModule(new JodaModule()); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT) + mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY) + mapper + } } class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, -httpHeaders: HashMap[String, String] = HashMap(), -hostMap: HashMap[String, Client] = HashMap(), -asyncHttpClient: Boolean = false, -authScheme: String = "", -authPreemptive: Boolean = false) { + httpHeaders: HashMap[String, String] = HashMap(), + hostMap: HashMap[String, Client] = HashMap(), + asyncHttpClient: Boolean = false, + authScheme: String = "", + authPreemptive: Boolean = false) { -var defaultHeaders: HashMap[String, String] = httpHeaders + var defaultHeaders: HashMap[String, String] = httpHeaders -def escape(value: String): String = { -URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") -} + def escape(value: String): String = { + URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + } -def escape(value: Long): String = value.toString -def escape(value: Double): String = value.toString -def escape(value: Float): String = value.toString + def escape(value: Long): String = value.toString + def escape(value: Double): String = value.toString + def escape(value: Float): String = value.toString -def deserialize(json: String, containerType: String, cls: Class[_]) = { -if (cls == classOf[String]) { -json match { -case s: String => { -if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 2) -else s -} -case _ => null -} -} else { -containerType.toLowerCase match { -case "array" => { -val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) -val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] -response.asScala.toList -} -case "list" => { -val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) -val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] -response.asScala.toList -} -case _ => { -json match { -case e: String if ("\"\"" == e) => null -case _ => mapper.readValue(json, cls) -} -} -} -} -} + def deserialize(json: String, containerType: String, cls: Class[_]) = { + if (cls == classOf[String]) { + json match { + case s: String => { + if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 2) + else s + } + case _ => null + } + } else { + containerType.toLowerCase match { + case "array" => { + val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] + response.asScala.toList + } + case "list" => { + val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] + response.asScala.toList + } + case _ => { + json match { + case e: String if ("\"\"" == e) => null + case _ => mapper.readValue(json, cls) + } + } + } + } + } -def serialize(obj: AnyRef): String = { -if (obj != null) { -obj match { -case e: List[_] => mapper.writeValueAsString(obj.asInstanceOf[List[_]].asJava) -case _ => mapper.writeValueAsString(obj) -} -} else null -} + def serialize(obj: AnyRef): String = { + if (obj != null) { + obj match { + case e: List[_] => mapper.writeValueAsString(obj.asInstanceOf[List[_]].asJava) + case _ => mapper.writeValueAsString(obj) + } + } else null + } -def invokeApi(host: String, path: String, method: String, queryParams: Map[String, String], formParams: Map[String, String], body: AnyRef, headerParams: Map[String, String], contentType: String): String = { -val client = getClient(host) + def invokeApi(host: String, path: String, method: String, queryParams: Map[String, String], formParams: Map[String, String], body: AnyRef, headerParams: Map[String, String], contentType: String): String = { + val client = getClient(host) -val querystring = queryParams.filter(k => k._2 != null).map(k => (escape(k._1) + "=" + escape(k._2))).mkString("?", "&", "") -val builder = client.resource(host + path + querystring).accept(contentType) -headerParams.map(p => builder.header(p._1, p._2)) -defaultHeaders.map(p => { -headerParams.contains(p._1) match { -case true => // override default with supplied header -case false => if (p._2 != null) builder.header(p._1, p._2) -} -}) -var formData: MultivaluedMapImpl = null -if(contentType == "application/x-www-form-urlencoded") { -formData = new MultivaluedMapImpl() -formParams.map(p => formData.add(p._1, p._2)) -} + val querystring = queryParams.filter(k => k._2 != null).map(k => (escape(k._1) + "=" + escape(k._2))).mkString("?", "&", "") + val builder = client.resource(host + path + querystring).accept(contentType) + headerParams.map(p => builder.header(p._1, p._2)) + defaultHeaders.map(p => { + headerParams.contains(p._1) match { + case true => // override default with supplied header + case false => if (p._2 != null) builder.header(p._1, p._2) + } + }) + var formData: MultivaluedMapImpl = null + if(contentType == "application/x-www-form-urlencoded") { + formData = new MultivaluedMapImpl() + formParams.map(p => formData.add(p._1, p._2)) + } -val response: ClientResponse = method match { -case "GET" => { -builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] -} -case "POST" => { -if(formData != null) builder.post(classOf[ClientResponse], formData) -else if(body != null && body.isInstanceOf[File]) { -val file = body.asInstanceOf[File] -val form = new FormDataMultiPart() -form.field("filename", file.getName()) -form.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) -builder.post(classOf[ClientResponse], form) -} -else { -if(body == null) builder.post(classOf[ClientResponse], serialize(body)) -else builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) -} -} -case "PUT" => { -if(formData != null) builder.post(classOf[ClientResponse], formData) -else if(body == null) builder.put(classOf[ClientResponse], null) -else builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) -} -case "DELETE" => { -builder.delete(classOf[ClientResponse]) -} -case _ => null -} -response.getClientResponseStatus().getStatusCode() match { -case 204 => "" -case code: Int if (Range(200, 299).contains(code)) => { -response.hasEntity() match { -case true => response.getEntity(classOf[String]) -case false => "" -} -} -case _ => { -val entity = response.hasEntity() match { -case true => response.getEntity(classOf[String]) -case false => "no data" -} -throw new ApiException( -response.getClientResponseStatus().getStatusCode(), -entity) -} -} -} + val response: ClientResponse = method match { + case "GET" => { + builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] + } + case "POST" => { + if(formData != null) builder.post(classOf[ClientResponse], formData) + else if(body != null && body.isInstanceOf[File]) { + val file = body.asInstanceOf[File] + val form = new FormDataMultiPart() + form.field("filename", file.getName()) + form.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) + builder.post(classOf[ClientResponse], form) + } + else { + if(body == null) builder.post(classOf[ClientResponse], serialize(body)) + else builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } + } + case "PUT" => { + if(formData != null) builder.post(classOf[ClientResponse], formData) + else if(body == null) builder.put(classOf[ClientResponse], null) + else builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) + } + case "DELETE" => { + builder.delete(classOf[ClientResponse]) + } + case _ => null + } + response.getClientResponseStatus().getStatusCode() match { + case 204 => "" + case code: Int if (Range(200, 299).contains(code)) => { + response.hasEntity() match { + case true => response.getEntity(classOf[String]) + case false => "" + } + } + case _ => { + val entity = response.hasEntity() match { + case true => response.getEntity(classOf[String]) + case false => "no data" + } + throw new ApiException( + response.getClientResponseStatus().getStatusCode(), + entity) + } + } + } -def getClient(host: String): Client = { -hostMap.contains(host) match { -case true => hostMap(host) -case false => { -val client = newClient(host) -// client.addFilter(new LoggingFilter()) -hostMap += host -> client -client -} -} -} + def getClient(host: String): Client = { + hostMap.contains(host) match { + case true => hostMap(host) + case false => { + val client = newClient(host) + // client.addFilter(new LoggingFilter()) + hostMap += host -> client + client + } + } + } + + def newClient(host: String): Client = asyncHttpClient match { + case true => { + import org.sonatype.spice.jersey.client.ahc.config.DefaultAhcConfig + import org.sonatype.spice.jersey.client.ahc.AhcHttpClient + import com.ning.http.client.Realm -def newClient(host: String): Client = asyncHttpClient match { -case true => { -import org.sonatype.spice.jersey.client.ahc.config.DefaultAhcConfig -import org.sonatype.spice.jersey.client.ahc.AhcHttpClient -import com.ning.http.client.Realm - -val config: DefaultAhcConfig = new DefaultAhcConfig() -if (!authScheme.isEmpty) { -val authSchemeEnum = Realm.AuthScheme.valueOf(authScheme) -config.getAsyncHttpClientConfigBuilder -.setRealm(new Realm.RealmBuilder().setScheme(authSchemeEnum) -.setUsePreemptiveAuth(authPreemptive).build) -} -AhcHttpClient.create(config) -} -case _ => Client.create() -} + val config: DefaultAhcConfig = new DefaultAhcConfig() + if (!authScheme.isEmpty) { + val authSchemeEnum = Realm.AuthScheme.valueOf(authScheme) + config.getAsyncHttpClientConfigBuilder + .setRealm(new Realm.RealmBuilder().setScheme(authSchemeEnum) + .setUsePreemptiveAuth(authPreemptive).build) + } + AhcHttpClient.create(config) + } + case _ => Client.create() + } } object ApiInvoker extends ApiInvoker(mapper = ScalaJsonUtil.getJsonMapper, -httpHeaders = HashMap(), -hostMap = HashMap(), -asyncHttpClient = false, -authScheme = "", -authPreemptive = false) + httpHeaders = HashMap(), + hostMap = HashMap(), + asyncHttpClient = false, + authScheme = "", + authPreemptive = false) class ApiException(val code: Int, msg: String) extends RuntimeException(msg) diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala index 305a16c282e..0d0b3c83ed2 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala @@ -15,420 +15,420 @@ import java.util.Date import scala.collection.mutable.HashMap - class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", - defApiInvoker: ApiInvoker = ApiInvoker) { - var basePath = defBasePath - var apiInvoker = defApiInvoker +class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", + defApiInvoker: ApiInvoker = ApiInvoker) { + var basePath = defBasePath + var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + def updatePet (body: Pet) = { + // create path and map variables + val path = "/pet".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json", "application/xml", "application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - */ - def updatePet (body: Pet) = { - // create path and map variables - val path = "/pet".replaceAll("\\{format\\}","json") - val contentTypes = List("application/json", "application/xml", "application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = body - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - */ - def addPet (body: Pet) = { - // create path and map variables - val path = "/pet".replaceAll("\\{format\\}","json") - - val contentTypes = List("application/json", "application/xml", "application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = body - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Finds Pets by status - * Multiple status values can be provided with comma seperated strings - * @param status Status values that need to be considered for filter - * @return List[Pet] - */ - def findPetsByStatus (status: List[String] /* = available */) : Option[List[Pet]] = { - // create path and map variables - val path = "/pet/findByStatus".replaceAll("\\{format\\}","json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - if(String.valueOf(status) != "null") queryParams += "status" -> status.toString - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(ApiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]]) - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Finds Pets by tags - * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return List[Pet] - */ - def findPetsByTags (tags: List[String]) : Option[List[Pet]] = { - // create path and map variables - val path = "/pet/findByTags".replaceAll("\\{format\\}","json") - val contentTypes = List("application/json") - val contentType = contentTypes(0) + var postBody: AnyRef = body - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - if(String.valueOf(tags) != "null") queryParams += "tags" -> tags.toString - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(ApiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]]) - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - - /** - * Find pet by ID - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @param petId ID of pet that needs to be fetched - * @return Pet - */ - def getPetById (petId: Long) : Option[Pet] = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(ApiInvoker.deserialize(s, "", classOf[Pet]).asInstanceOf[Pet]) - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - * @return void - */ - def updatePetWithForm (petId: String, name: String, status: String) = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - - - val contentTypes = List("application/x-www-form-urlencoded", "application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - mp.field("name", name.toString(), MediaType.MULTIPART_FORM_DATA_TYPE) - - mp.field("status", status.toString(), MediaType.MULTIPART_FORM_DATA_TYPE) - - postBody = mp - } - else { - formParams += "name" -> name.toString() - formParams += "status" -> status.toString() - - } - - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - - /** - * Deletes a pet - * - * @param apiKey - * @param petId Pet id to delete - * @return void - */ - def deletePet (apiKey: String, petId: Long) = { - // create path and map variables - val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - headerParams += "api_key" -> apiKey - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - * @return void - */ - def uploadFile (petId: Long, additionalMetadata: String, file: File) = { - // create path and map variables - val path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) - - - - val contentTypes = List("multipart/form-data", "application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - mp.field("additionalMetadata", additionalMetadata.toString(), MediaType.MULTIPART_FORM_DATA_TYPE) - - mp.field("file", file.getName) - mp.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) - - postBody = mp - } - else { - formParams += "additionalMetadata" -> additionalMetadata.toString() - - - } - - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + def addPet (body: Pet) = { + // create path and map variables + val path = "/pet".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json", "application/xml", "application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = body + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma seperated strings + * @param status Status values that need to be considered for filter + * @return List[Pet] + */ + def findPetsByStatus (status: List[String] /* = available */) : Option[List[Pet]] = { + // create path and map variables + val path = "/pet/findByStatus".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + if(String.valueOf(status) != "null") queryParams += "status" -> status.toString + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + Some(ApiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]]) + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Finds Pets by tags + * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return List[Pet] + */ + def findPetsByTags (tags: List[String]) : Option[List[Pet]] = { + // create path and map variables + val path = "/pet/findByTags".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + if(String.valueOf(tags) != "null") queryParams += "tags" -> tags.toString + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + Some(ApiInvoker.deserialize(s, "array", classOf[Pet]).asInstanceOf[List[Pet]]) + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Find pet by ID + * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * @param petId ID of pet that needs to be fetched + * @return Pet + */ + def getPetById (petId: Long) : Option[Pet] = { + // create path and map variables + val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) + + + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + Some(ApiInvoker.deserialize(s, "", classOf[Pet]).asInstanceOf[Pet]) + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return void + */ + def updatePetWithForm (petId: String, name: String, status: String) = { + // create path and map variables + val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) + + + + val contentTypes = List("application/x-www-form-urlencoded", "application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + mp.field("name", name.toString(), MediaType.MULTIPART_FORM_DATA_TYPE) + + mp.field("status", status.toString(), MediaType.MULTIPART_FORM_DATA_TYPE) + + postBody = mp + } + else { + formParams += "name" -> name.toString() + formParams += "status" -> status.toString() + + } + + try { + apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Deletes a pet + * + * @param apiKey + * @param petId Pet id to delete + * @return void + */ + def deletePet (apiKey: String, petId: Long) = { + // create path and map variables + val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) + + + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + headerParams += "api_key" -> apiKey + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @return void + */ + def uploadFile (petId: Long, additionalMetadata: String, file: File) = { + // create path and map variables + val path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId)) + + + + val contentTypes = List("multipart/form-data", "application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + mp.field("additionalMetadata", additionalMetadata.toString(), MediaType.MULTIPART_FORM_DATA_TYPE) + + mp.field("file", file.getName) + mp.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) + + postBody = mp + } + else { + formParams += "additionalMetadata" -> additionalMetadata.toString() + + + } + + try { + apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + +} diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala index 084794af60d..9b3cc91d788 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala @@ -14,206 +14,206 @@ import java.util.Date import scala.collection.mutable.HashMap - class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", - defApiInvoker: ApiInvoker = ApiInvoker) { - var basePath = defBasePath - var apiInvoker = defApiInvoker +class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", + defApiInvoker: ApiInvoker = ApiInvoker) { + var basePath = defBasePath + var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map[String, Integer] + */ + def getInventory () : Option[Map[String, Integer]] = { + // create path and map variables + val path = "/store/inventory".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map[String, Integer] - */ - def getInventory () : Option[Map[String, Integer]] = { - // create path and map variables - val path = "/store/inventory".replaceAll("\\{format\\}","json") - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(ApiInvoker.deserialize(s, "map", classOf[Integer]).asInstanceOf[Map[String, Integer]]) - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - */ - def placeOrder (body: Order) : Option[Order] = { - // create path and map variables - val path = "/store/order".replaceAll("\\{format\\}","json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = body - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(ApiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order]) - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - def getOrderById (orderId: String) : Option[Order] = { - // create path and map variables - val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId)) - - - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(ApiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order]) - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - */ - def deleteOrder (orderId: String) = { - // create path and map variables - val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId)) - + var postBody: AnyRef = null - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + Some(ApiInvoker.deserialize(s, "map", classOf[Integer]).asInstanceOf[Map[String, Integer]]) + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + def placeOrder (body: Order) : Option[Order] = { + // create path and map variables + val path = "/store/order".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = body + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + Some(ApiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order]) + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + def getOrderById (orderId: String) : Option[Order] = { + // create path and map variables + val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId)) + + + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + Some(ApiInvoker.deserialize(s, "", classOf[Order]).asInstanceOf[Order]) + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + def deleteOrder (orderId: String) = { + // create path and map variables + val path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}",apiInvoker.escape(orderId)) + + + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + +} diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala index 98375741bbe..5a7b38f620a 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala @@ -14,399 +14,399 @@ import java.util.Date import scala.collection.mutable.HashMap - class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", - defApiInvoker: ApiInvoker = ApiInvoker) { - var basePath = defBasePath - var apiInvoker = defApiInvoker +class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", + defApiInvoker: ApiInvoker = ApiInvoker) { + var basePath = defBasePath + var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + def createUser (body: User) = { + // create path and map variables + val path = "/user".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - */ - def createUser (body: User) = { - // create path and map variables - val path = "/user".replaceAll("\\{format\\}","json") - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = body - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - def createUsersWithArrayInput (body: List[User]) = { - // create path and map variables - val path = "/user/createWithArray".replaceAll("\\{format\\}","json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = body - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - def createUsersWithListInput (body: List[User]) = { - // create path and map variables - val path = "/user/createWithList".replaceAll("\\{format\\}","json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = body - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return String - */ - def loginUser (username: String, password: String) : Option[String] = { - // create path and map variables - val path = "/user/login".replaceAll("\\{format\\}","json") - val contentTypes = List("application/json") - val contentType = contentTypes(0) + var postBody: AnyRef = body - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - if(String.valueOf(username) != "null") queryParams += "username" -> username.toString - if(String.valueOf(password) != "null") queryParams += "password" -> password.toString - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(ApiInvoker.deserialize(s, "", classOf[String]).asInstanceOf[String]) - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - - /** - * Logs out current logged in user session - * - * @return void - */ - def logoutUser () = { - // create path and map variables - val path = "/user/logout".replaceAll("\\{format\\}","json") - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - def getUserByName (username: String) : Option[User] = { - // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) - - - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - Some(ApiInvoker.deserialize(s, "", classOf[User]).asInstanceOf[User]) - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - */ - def updateUser (username: String, body: User) = { - // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) - - - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = body - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - */ - def deleteUser (username: String) = { - // create path and map variables - val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) - - - - val contentTypes = List("application/json") - val contentType = contentTypes(0) - - // query params - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - - - - - - - - var postBody: AnyRef = null - - if(contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart() - - postBody = mp - } - else { - - } - - try { - apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex - } - } - + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + def createUsersWithArrayInput (body: List[User]) = { + // create path and map variables + val path = "/user/createWithArray".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = body + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + def createUsersWithListInput (body: List[User]) = { + // create path and map variables + val path = "/user/createWithList".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = body + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return String + */ + def loginUser (username: String, password: String) : Option[String] = { + // create path and map variables + val path = "/user/login".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + if(String.valueOf(username) != "null") queryParams += "username" -> username.toString + if(String.valueOf(password) != "null") queryParams += "password" -> password.toString + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + Some(ApiInvoker.deserialize(s, "", classOf[String]).asInstanceOf[String]) + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Logs out current logged in user session + * + * @return void + */ + def logoutUser () = { + // create path and map variables + val path = "/user/logout".replaceAll("\\{format\\}","json") + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + def getUserByName (username: String) : Option[User] = { + // create path and map variables + val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) + + + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + Some(ApiInvoker.deserialize(s, "", classOf[User]).asInstanceOf[User]) + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + def updateUser (username: String, body: User) = { + // create path and map variables + val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) + + + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = body + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + def deleteUser (username: String) = { + // create path and map variables + val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username)) + + + + val contentTypes = List("application/json") + val contentType = contentTypes(0) + + // query params + val queryParams = new HashMap[String, String] + val headerParams = new HashMap[String, String] + val formParams = new HashMap[String, String] + + + + + + + + var postBody: AnyRef = null + + if(contentType.startsWith("multipart/form-data")) { + val mp = new FormDataMultiPart() + + postBody = mp + } + else { + + } + + try { + apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { + case s: String => + + case _ => None + } + } catch { + case ex: ApiException if ex.code == 404 => None + case ex: ApiException => throw ex + } + } + +} diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala index 0b4fdab4132..122411e3ff7 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala @@ -2,10 +2,8 @@ package io.swagger.client.model - - case class Category ( - id: Long, - name: String) - - +case class Category ( + id: Long, + name: String) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala index d2e4b77f90a..845fe32c973 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala @@ -3,15 +3,13 @@ package io.swagger.client.model import org.joda.time.DateTime - - case class Order ( - id: Long, - petId: Long, - quantity: Integer, - shipDate: DateTime, - /* Order Status */ - status: String, - complete: Boolean) - - +case class Order ( + id: Long, + petId: Long, + quantity: Integer, + shipDate: DateTime, + /* Order Status */ + status: String, + complete: Boolean) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala index e51a5f25a41..430f6a3659c 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala @@ -4,15 +4,13 @@ import io.swagger.client.model.Category import io.swagger.client.model.Tag - - case class Pet ( - id: Long, - category: Category, - name: String, - photoUrls: List[String], - tags: List[Tag], - /* pet status in the store */ - status: String) - - +case class Pet ( + id: Long, + category: Category, + name: String, + photoUrls: List[String], + tags: List[Tag], + /* pet status in the store */ + status: String) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala index d541ca315a0..b0b75d4a96c 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala @@ -2,10 +2,8 @@ package io.swagger.client.model - - case class Tag ( - id: Long, - name: String) - - +case class Tag ( + id: Long, + name: String) + diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala index f7b826ec0f2..125147c0ae0 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala @@ -2,17 +2,15 @@ package io.swagger.client.model - - case class User ( - id: Long, - username: String, - firstName: String, - lastName: String, - email: String, - password: String, - phone: String, - /* User Status */ - userStatus: Integer) - - +case class User ( + id: Long, + username: String, + firstName: String, + lastName: String, + email: String, + password: String, + phone: String, + /* User Status */ + userStatus: Integer) + diff --git a/samples/client/petstore/tizen/client/SamiApiClient.cpp b/samples/client/petstore/tizen/client/SamiApiClient.cpp index f3c988dea5a..35779307fa2 100644 --- a/samples/client/petstore/tizen/client/SamiApiClient.cpp +++ b/samples/client/petstore/tizen/client/SamiApiClient.cpp @@ -5,120 +5,120 @@ using namespace Tizen::Base::Utility; namespace Swagger { SamiApiClient::SamiApiClient() { -enc = new Utf8Encoding(); + enc = new Utf8Encoding(); } void SamiApiClient::success(void (*success) (HttpResponse*, void (*cb)(void*, SamiError*)), void (*cb)(void*, SamiError*)) { -this->successFunction = success; -this->cb = cb; + this->successFunction = success; + this->cb = cb; } SamiApiClient::~SamiApiClient() { -if(enc) -delete enc; + if(enc) + delete enc; } result SamiApiClient::execute(String host, String path, String method, IMap* queryParams, String* body, IMap* headerParams, IMap* formParams, String contentType) { -NetHttpMethod httpMethod; -if(method.Equals(L"GET", false)) { -httpMethod = NET_HTTP_METHOD_GET; -} -else if(method.Equals(L"PUT", false)) { -httpMethod = NET_HTTP_METHOD_PUT; -} -else if(method.Equals(L"POST", false)) { -httpMethod = NET_HTTP_METHOD_POST; -} -else if(method.Equals(L"DELETE", false)) { -httpMethod = NET_HTTP_METHOD_DELETE; -} -else if(method.Equals(L"OPTIONS", false)) { -httpMethod = NET_HTTP_METHOD_OPTIONS; -} -else if(method.Equals(L"HEAD", false)) { -httpMethod = NET_HTTP_METHOD_HEAD; -} -else if(method.Equals(L"TRACE", false)) { -httpMethod = NET_HTTP_METHOD_TRACE; -} + NetHttpMethod httpMethod; + if(method.Equals(L"GET", false)) { + httpMethod = NET_HTTP_METHOD_GET; + } + else if(method.Equals(L"PUT", false)) { + httpMethod = NET_HTTP_METHOD_PUT; + } + else if(method.Equals(L"POST", false)) { + httpMethod = NET_HTTP_METHOD_POST; + } + else if(method.Equals(L"DELETE", false)) { + httpMethod = NET_HTTP_METHOD_DELETE; + } + else if(method.Equals(L"OPTIONS", false)) { + httpMethod = NET_HTTP_METHOD_OPTIONS; + } + else if(method.Equals(L"HEAD", false)) { + httpMethod = NET_HTTP_METHOD_HEAD; + } + else if(method.Equals(L"TRACE", false)) { + httpMethod = NET_HTTP_METHOD_TRACE; + } -String uri = String(host); -uri.Append(path); + String uri = String(host); + uri.Append(path); -HttpSession* __pHttpSession = null; -HttpTransaction* pHttpTransaction = null; -HttpRequest* pHttpRequest = null; + HttpSession* __pHttpSession = null; + HttpTransaction* pHttpTransaction = null; + HttpRequest* pHttpRequest = null; -if (__pHttpSession == null) { -__pHttpSession = new (std::nothrow) HttpSession(); -__pHttpSession->Construct(NET_HTTP_SESSION_MODE_NORMAL, null, uri, null); -__pHttpSession->SetAutoRedirectionEnabled(true); -} -pHttpTransaction = __pHttpSession->OpenTransactionN(); -pHttpTransaction->AddHttpTransactionListener(*this); + if (__pHttpSession == null) { + __pHttpSession = new (std::nothrow) HttpSession(); + __pHttpSession->Construct(NET_HTTP_SESSION_MODE_NORMAL, null, uri, null); + __pHttpSession->SetAutoRedirectionEnabled(true); + } + pHttpTransaction = __pHttpSession->OpenTransactionN(); + pHttpTransaction->AddHttpTransactionListener(*this); -pHttpRequest = const_cast< HttpRequest* >(pHttpTransaction->GetRequest()); + pHttpRequest = const_cast< HttpRequest* >(pHttpTransaction->GetRequest()); -HttpHeader *pHeader = pHttpRequest->GetHeader(); -if(contentType != null && !contentType.Equals(L"", true)) { -pHeader->AddField(L"Accept", contentType); -} -if(queryParams != null) { -IMapEnumerator* pMapEnum = queryParams->GetMapEnumeratorN(); -String queryParam = L""; -while (pMapEnum->MoveNext() == E_SUCCESS) { -if(queryParam.GetLength() == 0) -queryParam.Append(L"?"); -else -queryParam.Append(L"&"); + HttpHeader *pHeader = pHttpRequest->GetHeader(); + if(contentType != null && !contentType.Equals(L"", true)) { + pHeader->AddField(L"Accept", contentType); + } + if(queryParams != null) { + IMapEnumerator* pMapEnum = queryParams->GetMapEnumeratorN(); + String queryParam = L""; + while (pMapEnum->MoveNext() == E_SUCCESS) { + if(queryParam.GetLength() == 0) + queryParam.Append(L"?"); + else + queryParam.Append(L"&"); -String* pKey = static_cast< String* > (pMapEnum->GetKey()); -String* pValue = static_cast< String* > (pMapEnum->GetValue()); -String encoded; -UrlEncoder::Encode(*pKey, L"UTF-8", encoded); + String* pKey = static_cast< String* > (pMapEnum->GetKey()); + String* pValue = static_cast< String* > (pMapEnum->GetValue()); + String encoded; + UrlEncoder::Encode(*pKey, L"UTF-8", encoded); -queryParam.Append(encoded); -queryParam.Append("="); -UrlEncoder::Encode(*pValue, L"UTF-8", encoded); -queryParam.Append(encoded); -} -uri.Append(queryParam); -delete queryParams; -} -if(headerParams != null) { -IMapEnumerator* pMapEnum = headerParams->GetMapEnumeratorN(); -while (pMapEnum->MoveNext() == E_SUCCESS) { -String* pKey = static_cast< String* > (pMapEnum->GetKey()); -String* pValue = static_cast< String* > (pMapEnum->GetValue()); -pHeader->AddField(*pKey, *pValue); -} -delete headerParams; -} -if(body != null) { -HttpStringEntity * pEntity = new HttpStringEntity(); -String* cp = new String(*body); -result res = pEntity->Construct(*body, L"application/json", "utf-8", *enc); -res = pHttpRequest->SetEntity(*pEntity); -} + queryParam.Append(encoded); + queryParam.Append("="); + UrlEncoder::Encode(*pValue, L"UTF-8", encoded); + queryParam.Append(encoded); + } + uri.Append(queryParam); + delete queryParams; + } + if(headerParams != null) { + IMapEnumerator* pMapEnum = headerParams->GetMapEnumeratorN(); + while (pMapEnum->MoveNext() == E_SUCCESS) { + String* pKey = static_cast< String* > (pMapEnum->GetKey()); + String* pValue = static_cast< String* > (pMapEnum->GetValue()); + pHeader->AddField(*pKey, *pValue); + } + delete headerParams; + } + if(body != null) { + HttpStringEntity * pEntity = new HttpStringEntity(); + String* cp = new String(*body); + result res = pEntity->Construct(*body, L"application/json", "utf-8", *enc); + res = pHttpRequest->SetEntity(*pEntity); + } -pHttpRequest->SetUri(uri); -pHttpRequest->SetMethod(httpMethod); + pHttpRequest->SetUri(uri); + pHttpRequest->SetMethod(httpMethod); -AppLog("%ls", uri.GetPointer()); -return pHttpTransaction->Submit(); + AppLog("%ls", uri.GetPointer()); + return pHttpTransaction->Submit(); } void SamiApiClient::OnTransactionCompleted(HttpSession& httpSession, HttpTransaction& pHttpTransaction) { -HttpResponse* pHttpResponse = pHttpTransaction.GetResponse(); + HttpResponse* pHttpResponse = pHttpTransaction.GetResponse(); -if(successFunction != null) { -successFunction(pHttpResponse, cb); -} -delete &httpSession; -delete &pHttpTransaction; + if(successFunction != null) { + successFunction(pHttpResponse, cb); + } + delete &httpSession; + delete &pHttpTransaction; } } /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiApiClient.h b/samples/client/petstore/tizen/client/SamiApiClient.h index d152af8b838..f20eb6e158b 100644 --- a/samples/client/petstore/tizen/client/SamiApiClient.h +++ b/samples/client/petstore/tizen/client/SamiApiClient.h @@ -1,75 +1,73 @@ -#include - +#include - #include "SamiHelpers.h" - #include "SamiError.h" +#include "SamiHelpers.h" +#include "SamiError.h" - using namespace Tizen::Net::Http; - using namespace Tizen::Base; - using namespace Tizen::Base::Collection; - using namespace Tizen::Text; +using namespace Tizen::Net::Http; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Text; - #ifndef APICLIENT_H_ - #define APICLIENT_H_ +#ifndef APICLIENT_H_ +#define APICLIENT_H_ - namespace Swagger { +namespace Swagger { - class SamiApiClient: public IHttpTransactionEventListener { - public: - SamiApiClient(); - virtual ~SamiApiClient(); +class SamiApiClient: public IHttpTransactionEventListener { +public: + SamiApiClient(); + virtual ~SamiApiClient(); - result - execute(String host, String path, String method, IMap* queryParams, String* body, IMap* headerParams, IMap* - formParams, String contentType); + result + execute(String host, String path, String method, IMap* queryParams, String* body, IMap* headerParams, IMap* formParams, String contentType); - void success(void (*res) (HttpResponse*, void (*cb)(void*, SamiError*)), void (*cb)(void*, SamiError*)); + void success(void (*res) (HttpResponse*, void (*cb)(void*, SamiError*)), void (*cb)(void*, SamiError*)); - virtual void - OnTransactionCompleted(HttpSession& httpSession, HttpTransaction& pHttpTransaction); + virtual void + OnTransactionCompleted(HttpSession& httpSession, HttpTransaction& pHttpTransaction); - virtual void - OnAudioInAudioFocusChanged(void) { + virtual void + OnAudioInAudioFocusChanged(void) { AppLog("OnAudioInAudioFocusChanged"); - } + } - virtual void - OnTransactionCertVerificationRequiredN(HttpSession& httpSession, HttpTransaction& httpTransaction, - Tizen::Base::String* pCert) { + virtual void + OnTransactionCertVerificationRequiredN(HttpSession& httpSession, HttpTransaction& httpTransaction, + Tizen::Base::String* pCert) { AppLog("OnTransactionCertVerificationRequiredN"); httpTransaction.Resume(); delete pCert; - } - - virtual void - OnTransactionReadyToWrite(HttpSession& httpSession, HttpTransaction& httpTransaction, int recommendedChunkSize) { + } + + virtual void + OnTransactionReadyToWrite(HttpSession& httpSession, HttpTransaction& httpTransaction, int recommendedChunkSize) { AppLog("OnTransactionReadyToWrite"); - } + } - virtual void - OnTransactionReadyToRead(HttpSession& httpSession, HttpTransaction& httpTransaction, int availableBodyLen) { + virtual void + OnTransactionReadyToRead(HttpSession& httpSession, HttpTransaction& httpTransaction, int availableBodyLen) { AppLog("OnTransactionReadyToRead"); - } - - virtual void - OnTransactionAborted(HttpSession& httpSession, HttpTransaction& httpTransaction, result r) { + } + + virtual void + OnTransactionAborted(HttpSession& httpSession, HttpTransaction& httpTransaction, result r) { AppLog("OnTransactionAborted: %ls", GetErrorMessage(r)); delete &httpTransaction; - } - - virtual void - OnTransactionHeaderCompleted(HttpSession& httpSession, HttpTransaction& httpTransaction, int headerLen, bool - bAuthRequired) { + } + + virtual void + OnTransactionHeaderCompleted(HttpSession& httpSession, HttpTransaction& httpTransaction, int headerLen, bool + bAuthRequired) { AppLog("OnTransactionHeaderCompleted"); - } +} - private: - void (*successFunction) (HttpResponse*, void (*success)(void*, SamiError*)); - void (*cb)(void*, SamiError*); - Utf8Encoding* enc; - }; +private: + void (*successFunction) (HttpResponse*, void (*success)(void*, SamiError*)); + void (*cb)(void*, SamiError*); + Utf8Encoding* enc; +}; - } /* namespace Swagger */ - #endif /* APICLIENT_H_ */ +} /* namespace Swagger */ +#endif /* APICLIENT_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiCategory.cpp b/samples/client/petstore/tizen/client/SamiCategory.cpp index 6b92fe64809..185b1f9d895 100644 --- a/samples/client/petstore/tizen/client/SamiCategory.cpp +++ b/samples/client/petstore/tizen/client/SamiCategory.cpp @@ -1,186 +1,182 @@ - #include "SamiCategory.h" - #include - +#include "SamiCategory.h" +#include - using namespace Tizen::Base; - using namespace Tizen::System; - using namespace Tizen::Base::Utility; - using namespace Tizen::Base::Collection; - using namespace Tizen::Web::Json; - using namespace Tizen::Locales; +using namespace Tizen::Base; +using namespace Tizen::System; +using namespace Tizen::Base::Utility; +using namespace Tizen::Base::Collection; +using namespace Tizen::Web::Json; +using namespace Tizen::Locales; - namespace Swagger { +namespace Swagger { - SamiCategory::SamiCategory() { - init(); - } +SamiCategory::SamiCategory() { + init(); +} - SamiCategory::~SamiCategory() { - this->cleanup(); - } +SamiCategory::~SamiCategory() { + this->cleanup(); +} - void - SamiCategory::init() { +void +SamiCategory::init() { pId = null; pName = null; - } +} - void - SamiCategory::cleanup() { +void +SamiCategory::cleanup() { if(pId != null) { - + delete pId; - pId = null; - } + pId = null; + } if(pName != null) { - + delete pName; - pName = null; - } + pName = null; + } - } +} - SamiCategory* - SamiCategory::fromJson(String* json) { - this->cleanup(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiCategory* +SamiCategory::fromJson(String* json) { + this->cleanup(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - return this; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; + return this; +} - void - SamiCategory::fromJsonObject(IJsonValue* pJson) { - JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); +void +SamiCategory::fromJsonObject(IJsonValue* pJson) { + JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); - if(pJsonObject != null) { - JsonString* pIdKey = new JsonString(L"id"); + if(pJsonObject != null) { + JsonString* pIdKey = new JsonString(L"id"); IJsonValue* pIdVal = null; pJsonObject->GetValue(pIdKey, pIdVal); if(pIdVal != null) { - - pId = new Long(); - jsonToValue(pId, pIdVal, L"Long", L"Long"); + + pId = new Long(); + jsonToValue(pId, pIdVal, L"Long", L"Long"); } delete pIdKey; - JsonString* pNameKey = new JsonString(L"name"); + JsonString* pNameKey = new JsonString(L"name"); IJsonValue* pNameVal = null; pJsonObject->GetValue(pNameKey, pNameVal); if(pNameVal != null) { - - pName = new String(); - jsonToValue(pName, pNameVal, L"String", L"String"); + + pName = new String(); + jsonToValue(pName, pNameVal, L"String", L"String"); } delete pNameKey; - - } - } + + } +} - SamiCategory::SamiCategory(String* json) { - init(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiCategory::SamiCategory(String* json) { + init(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; +} - String - SamiCategory::asJson () - { - JsonObject* pJsonObject = asJsonObject(); +String +SamiCategory::asJson () +{ + JsonObject* pJsonObject = asJsonObject(); - char *pComposeBuf = new char[256]; - JsonWriter::Compose(pJsonObject, pComposeBuf, 256); - String s = String(pComposeBuf); + char *pComposeBuf = new char[256]; + JsonWriter::Compose(pJsonObject, pComposeBuf, 256); + String s = String(pComposeBuf); - delete pComposeBuf; - pJsonObject->RemoveAll(true); - delete pJsonObject; + delete pComposeBuf; + pJsonObject->RemoveAll(true); + delete pJsonObject; - return s; - } + return s; +} - JsonObject* - SamiCategory::asJsonObject() { - JsonObject *pJsonObject = new JsonObject(); - pJsonObject->Construct(); +JsonObject* +SamiCategory::asJsonObject() { + JsonObject *pJsonObject = new JsonObject(); + pJsonObject->Construct(); - JsonString *pIdKey = new JsonString(L"id"); - pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); + JsonString *pIdKey = new JsonString(L"id"); + pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); - JsonString *pNameKey = new JsonString(L"name"); - pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); + JsonString *pNameKey = new JsonString(L"name"); + pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); - return pJsonObject; - } + return pJsonObject; +} - - Long* - SamiCategory::getPId() { - return pId; - } - void - SamiCategory::setPId(Long* pId) { - this->pId = pId; - } +Long* +SamiCategory::getPId() { + return pId; +} +void +SamiCategory::setPId(Long* pId) { + this->pId = pId; +} - - String* - SamiCategory::getPName() { - return pName; - } - void - SamiCategory::setPName(String* pName) { - this->pName = pName; - } - - +String* +SamiCategory::getPName() { + return pName; +} +void +SamiCategory::setPName(String* pName) { + this->pName = pName; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiCategory.h b/samples/client/petstore/tizen/client/SamiCategory.h index 0b35b7ac929..a361ea047fa 100644 --- a/samples/client/petstore/tizen/client/SamiCategory.h +++ b/samples/client/petstore/tizen/client/SamiCategory.h @@ -1,64 +1,60 @@ /* -* SamiCategory.h -* -* -*/ + * SamiCategory.h + * + * + */ #ifndef SamiCategory_H_ #define SamiCategory_H_ -#include - - #include - - #include - - #include - - #include "SamiHelpers.h" - #include "SamiObject.h" +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" - using namespace Tizen::Web::Json; +using namespace Tizen::Web::Json; using Tizen::Base::Long; using Tizen::Base::String; - namespace Swagger { +namespace Swagger { - class SamiCategory: public SamiObject { - public: +class SamiCategory: public SamiObject { +public: SamiCategory(); SamiCategory(String* json); - virtual ~SamiCategory(); + virtual ~SamiCategory(); - void init(); + void init(); - void cleanup(); + void cleanup(); - String asJson (); + String asJson (); - JsonObject* asJsonObject(); + JsonObject* asJsonObject(); - void fromJsonObject(IJsonValue* json); + void fromJsonObject(IJsonValue* json); SamiCategory* fromJson(String* obj); - Long* getPId(); - void setPId(Long* pId); + Long* getPId(); + void setPId(Long* pId); - String* getPName(); - void setPName(String* pName); + String* getPName(); + void setPName(String* pName); - private: +private: Long* pId; String* pName; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiCategory_H_ */ +#endif /* SamiCategory_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiError.cpp b/samples/client/petstore/tizen/client/SamiError.cpp index 9f0a82bf1a5..1aaaa9e726b 100644 --- a/samples/client/petstore/tizen/client/SamiError.cpp +++ b/samples/client/petstore/tizen/client/SamiError.cpp @@ -6,49 +6,49 @@ using namespace Tizen::System; namespace Swagger { SamiError::SamiError() { -init(); + init(); } SamiError::SamiError(int code, String* message) { -init(); -this->setCode(code); -this->setMessage(message); + init(); + this->setCode(code); + this->setMessage(message); } SamiError::~SamiError() { -this->cleanup(); + this->cleanup(); } void SamiError::init() { -pCode = 0; -pMessage = null; + pCode = 0; + pMessage = null; } void SamiError::cleanup() { -if(pMessage != null) { -delete pMessage; -pMessage = null; -} + if(pMessage != null) { + delete pMessage; + pMessage = null; + } } int SamiError::getCode() { -return pCode; + return pCode; } void SamiError::setCode(int pCode) { -this->pCode = pCode; + this->pCode = pCode; } String* SamiError::getMessage() { -return pMessage; + return pMessage; } void SamiError::setMessage(String* pMessage) { -this->pMessage = pMessage; + this->pMessage = pMessage; } } /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiError.h b/samples/client/petstore/tizen/client/SamiError.h index 7afaf929bcb..d3afe4596b2 100644 --- a/samples/client/petstore/tizen/client/SamiError.h +++ b/samples/client/petstore/tizen/client/SamiError.h @@ -1,15 +1,14 @@ #ifndef SamiError_H_ #define SamiError_H_ -#include - +#include - using namespace Tizen::Base; +using namespace Tizen::Base; - namespace Swagger { +namespace Swagger { - class SamiError { - public: +class SamiError { +public: SamiError(); SamiError(int code, String* message); virtual ~SamiError(); @@ -21,16 +20,16 @@ int getCode(); void setCode(int pCode); - + String* getMessage(); void setMessage(String* pMessage); + - - private: +private: int pCode; String* pMessage; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiError_H_ */ +#endif /* SamiError_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiHelpers.cpp b/samples/client/petstore/tizen/client/SamiHelpers.cpp index 32dbd5cc810..484be3246f7 100644 --- a/samples/client/petstore/tizen/client/SamiHelpers.cpp +++ b/samples/client/petstore/tizen/client/SamiHelpers.cpp @@ -9,265 +9,265 @@ using namespace Tizen::Locales; using namespace Tizen::System; namespace Swagger { -JsonObject* -toJson(void* ptr, String type, String containerType) { -if(ptr == null) -return null; -if(containerType != null && !type.Equals(L"", false)) { -if(containerType.Equals(L"array", false)) { -if(type != null) { -IList* list = static_cast< IList* >(ptr); -JsonArray* array = new JsonArray(); -int sz = list->GetCount(); -for(int i = 0; i < sz; i++) { -void* itemAt = list->GetAt(i); -JsonObject* item = toJson(itemAt, type, null); -if(item != null) -array->Add(item); -} -return (JsonObject*)array; -} -return null; -} -} -else if(type.Equals(L"Boolean", false)) { -Boolean* v = static_cast< Boolean* >(ptr); -return (JsonObject*) new JsonBool(*v); -} -else if(type.Equals(L"String", false)) { -String* v = static_cast< String* >(ptr); -return (JsonObject*) new JsonString(*v); -} -else if(type.Equals(L"Integer", false)) { -Integer* v = static_cast< Integer* >(ptr); -return (JsonObject*) new JsonNumber(v->ToInt()); -} -else if(type.Equals(L"Long", false)) { -Long* v = static_cast< Long* >(ptr); -return (JsonObject*) new JsonNumber(v->ToInt()); -} -else if(type.Equals(L"Float", false)) { -Float* v = static_cast< Float* >(ptr); -return (JsonObject*) new JsonNumber(v->ToFloat()); -} -else if(type.Equals(L"Double", false)) { -Double* v = static_cast< Double* >(ptr); -return (JsonObject*) new JsonNumber(v->ToDouble()); -} -else if(type.Equals(L"DateTime", false)) { -DateTime* v = static_cast< DateTime* >(ptr); -DateTimeFormatter* pFormatter = DateTimeFormatter::CreateDateTimeFormatterN(); -String date; -pFormatter->ApplyPattern(L"yyyy-MM-dd"); -pFormatter->Format(*v, date); + JsonObject* + toJson(void* ptr, String type, String containerType) { + if(ptr == null) + return null; + if(containerType != null && !type.Equals(L"", false)) { + if(containerType.Equals(L"array", false)) { + if(type != null) { + IList* list = static_cast< IList* >(ptr); + JsonArray* array = new JsonArray(); + int sz = list->GetCount(); + for(int i = 0; i < sz; i++) { + void* itemAt = list->GetAt(i); + JsonObject* item = toJson(itemAt, type, null); + if(item != null) + array->Add(item); + } + return (JsonObject*)array; + } + return null; + } + } + else if(type.Equals(L"Boolean", false)) { + Boolean* v = static_cast< Boolean* >(ptr); + return (JsonObject*) new JsonBool(*v); + } + else if(type.Equals(L"String", false)) { + String* v = static_cast< String* >(ptr); + return (JsonObject*) new JsonString(*v); + } + else if(type.Equals(L"Integer", false)) { + Integer* v = static_cast< Integer* >(ptr); + return (JsonObject*) new JsonNumber(v->ToInt()); + } + else if(type.Equals(L"Long", false)) { + Long* v = static_cast< Long* >(ptr); + return (JsonObject*) new JsonNumber(v->ToInt()); + } + else if(type.Equals(L"Float", false)) { + Float* v = static_cast< Float* >(ptr); + return (JsonObject*) new JsonNumber(v->ToFloat()); + } + else if(type.Equals(L"Double", false)) { + Double* v = static_cast< Double* >(ptr); + return (JsonObject*) new JsonNumber(v->ToDouble()); + } + else if(type.Equals(L"DateTime", false)) { + DateTime* v = static_cast< DateTime* >(ptr); + DateTimeFormatter* pFormatter = DateTimeFormatter::CreateDateTimeFormatterN(); + String date; + pFormatter->ApplyPattern(L"yyyy-MM-dd"); + pFormatter->Format(*v, date); -String time; -pFormatter->ApplyPattern(L"hh:mm:ss"); -pFormatter->Format(*v, time); -String formattedString = date + "T" + time; -delete pFormatter; -return (JsonObject*)new JsonString(formattedString); -} -else if(type.StartsWith(L"Sami", 0)) { -SamiObject* obj = static_cast< SamiObject* >(ptr); -return obj->asJsonObject(); -} -return null; -} + String time; + pFormatter->ApplyPattern(L"hh:mm:ss"); + pFormatter->Format(*v, time); + String formattedString = date + "T" + time; + delete pFormatter; + return (JsonObject*)new JsonString(formattedString); + } + else if(type.StartsWith(L"Sami", 0)) { + SamiObject* obj = static_cast< SamiObject* >(ptr); + return obj->asJsonObject(); + } + return null; + } -void -toISO8601(String str, DateTime* dt) { -int idx, start; -int year, month, day, hour, minute, second; + void + toISO8601(String str, DateTime* dt) { + int idx, start; + int year, month, day, hour, minute, second; -start = 0; -str.IndexOf(L"-", start, idx); -String yearString; -str.SubString(0, idx, yearString); -Integer::Parse(yearString, year); + start = 0; + str.IndexOf(L"-", start, idx); + String yearString; + str.SubString(0, idx, yearString); + Integer::Parse(yearString, year); -start = idx+1; -str.IndexOf(L"-", start, idx); -String monthString; -str.SubString(start, idx - start, monthString); -Integer::Parse(monthString, month); + start = idx+1; + str.IndexOf(L"-", start, idx); + String monthString; + str.SubString(start, idx - start, monthString); + Integer::Parse(monthString, month); -start = idx+1; -str.IndexOf(L"T", start, idx); -String dayString; -str.SubString(start, idx - start, dayString); -Integer::Parse(dayString, day); + start = idx+1; + str.IndexOf(L"T", start, idx); + String dayString; + str.SubString(start, idx - start, dayString); + Integer::Parse(dayString, day); -start = idx+1; -str.IndexOf(L":", start, idx); -if(idx > 0) { -String hourString; -str.SubString(start, idx - start, hourString); -Integer::Parse(hourString, hour); -} + start = idx+1; + str.IndexOf(L":", start, idx); + if(idx > 0) { + String hourString; + str.SubString(start, idx - start, hourString); + Integer::Parse(hourString, hour); + } -start = idx+1; -str.IndexOf(L":", start, idx); -if(idx > 0) { -String minuteString; -str.SubString(start, idx - start, minuteString); -Integer::Parse(minuteString, minute); -} + start = idx+1; + str.IndexOf(L":", start, idx); + if(idx > 0) { + String minuteString; + str.SubString(start, idx - start, minuteString); + Integer::Parse(minuteString, minute); + } -start = idx+1; -str.IndexOf(L"+", start, idx); -if(idx > 0) { -String secondString; -str.SubString(start, idx - start, secondString); -Integer::Parse(secondString, second); -} + start = idx+1; + str.IndexOf(L"+", start, idx); + if(idx > 0) { + String secondString; + str.SubString(start, idx - start, secondString); + Integer::Parse(secondString, second); + } -dt->SetValue(year, month, day, hour, minute, second); -} + dt->SetValue(year, month, day, hour, minute, second); + } -void -jsonToValue(void* target, IJsonValue* ptr, String type, String innerType) { -if(target == null || ptr == null) { -return; -} -if(type.StartsWith(L"Boolean", 0)) { -JsonBool* json = static_cast< JsonBool* >(ptr); -Boolean* val = static_cast< Boolean* > (target); -val->value = json->ToBool(); -} -else if(type.StartsWith(L"String", 0)) { -JsonString* json = static_cast< JsonString* >(ptr); -String* val = static_cast< String* > (target); -val->Clear(); -val->Append(json->GetPointer()); -} -else if(type.StartsWith(L"Integer", 0)) { -JsonNumber* json = static_cast< JsonNumber* >(ptr); -Integer* val = static_cast< Integer* > (target); -*val = json->ToInt(); -} -else if(type.StartsWith(L"Long", 0)) { -JsonNumber* json = static_cast< JsonNumber* >(ptr); -Long* val = static_cast< Long* > (target); -*val = json->ToLong(); -} -else if(type.StartsWith(L"DateTime", 0)) { -JsonString* json = static_cast< JsonString* >(ptr); -String str; -str.Append(json->GetPointer()); + void + jsonToValue(void* target, IJsonValue* ptr, String type, String innerType) { + if(target == null || ptr == null) { + return; + } + if(type.StartsWith(L"Boolean", 0)) { + JsonBool* json = static_cast< JsonBool* >(ptr); + Boolean* val = static_cast< Boolean* > (target); + val->value = json->ToBool(); + } + else if(type.StartsWith(L"String", 0)) { + JsonString* json = static_cast< JsonString* >(ptr); + String* val = static_cast< String* > (target); + val->Clear(); + val->Append(json->GetPointer()); + } + else if(type.StartsWith(L"Integer", 0)) { + JsonNumber* json = static_cast< JsonNumber* >(ptr); + Integer* val = static_cast< Integer* > (target); + *val = json->ToInt(); + } + else if(type.StartsWith(L"Long", 0)) { + JsonNumber* json = static_cast< JsonNumber* >(ptr); + Long* val = static_cast< Long* > (target); + *val = json->ToLong(); + } + else if(type.StartsWith(L"DateTime", 0)) { + JsonString* json = static_cast< JsonString* >(ptr); + String str; + str.Append(json->GetPointer()); -DateTime* val = static_cast< DateTime* > (target); -toISO8601(str, val); -} -else if(type.StartsWith(L"Sami", 0)) { -SamiObject* obj = static_cast< SamiObject* > (target); -obj->fromJsonObject(ptr); -} -else if(type.StartsWith(L"IList", 0)) { -IList* obj = static_cast< IList* >(target); -JsonArray* pJsonArray = static_cast< JsonArray* >(ptr); + DateTime* val = static_cast< DateTime* > (target); + toISO8601(str, val); + } + else if(type.StartsWith(L"Sami", 0)) { + SamiObject* obj = static_cast< SamiObject* > (target); + obj->fromJsonObject(ptr); + } + else if(type.StartsWith(L"IList", 0)) { + IList* obj = static_cast< IList* >(target); + JsonArray* pJsonArray = static_cast< JsonArray* >(ptr); -IEnumeratorT< IJsonValue* >* pEnum = pJsonArray->GetEnumeratorN(); -while (pEnum->MoveNext() == E_SUCCESS) { -IJsonValue* pJsonValue = null; -pEnum->GetCurrent(pJsonValue); -void* updatedTarget = null; -updatedTarget = create(innerType); + IEnumeratorT< IJsonValue* >* pEnum = pJsonArray->GetEnumeratorN(); + while (pEnum->MoveNext() == E_SUCCESS) { + IJsonValue* pJsonValue = null; + pEnum->GetCurrent(pJsonValue); + void* updatedTarget = null; + updatedTarget = create(innerType); -if(updatedTarget != null) { -jsonToValue(updatedTarget, pJsonValue, innerType, L""); -obj->Add((Object*)updatedTarget); -} -} -delete pEnum; -} -} + if(updatedTarget != null) { + jsonToValue(updatedTarget, pJsonValue, innerType, L""); + obj->Add((Object*)updatedTarget); + } + } + delete pEnum; + } + } -Integer* -jsonToInteger(IJsonValue* value) { -if(value == null) -return null; -switch(value->GetType()) { -case JSON_TYPE_STRING: -break; -case JSON_TYPE_NUMBER: { -JsonNumber* number = static_cast< JsonNumber* >(value); -int num = number->ToInt(); -return new Integer(num); -} -case JSON_TYPE_OBJECT: -break; -case JSON_TYPE_ARRAY: -break; -case JSON_TYPE_BOOL: -break; -case JSON_TYPE_NULL: -break; -} -return null; -} + Integer* + jsonToInteger(IJsonValue* value) { + if(value == null) + return null; + switch(value->GetType()) { + case JSON_TYPE_STRING: + break; + case JSON_TYPE_NUMBER: { + JsonNumber* number = static_cast< JsonNumber* >(value); + int num = number->ToInt(); + return new Integer(num); + } + case JSON_TYPE_OBJECT: + break; + case JSON_TYPE_ARRAY: + break; + case JSON_TYPE_BOOL: + break; + case JSON_TYPE_NULL: + break; + } + return null; + } -Long* -jsonToLong(IJsonValue* value) { -if(value == null) -return null; -switch(value->GetType()) { -case JSON_TYPE_STRING: -break; -case JSON_TYPE_NUMBER: { -JsonNumber* number = static_cast< JsonNumber* >(value); -long int num = number->ToLong(); -return new Long(num); -} -case JSON_TYPE_OBJECT: -break; -case JSON_TYPE_ARRAY: -break; -case JSON_TYPE_BOOL: -break; -case JSON_TYPE_NULL: -break; -} -return null; -} + Long* + jsonToLong(IJsonValue* value) { + if(value == null) + return null; + switch(value->GetType()) { + case JSON_TYPE_STRING: + break; + case JSON_TYPE_NUMBER: { + JsonNumber* number = static_cast< JsonNumber* >(value); + long int num = number->ToLong(); + return new Long(num); + } + case JSON_TYPE_OBJECT: + break; + case JSON_TYPE_ARRAY: + break; + case JSON_TYPE_BOOL: + break; + case JSON_TYPE_NULL: + break; + } + return null; + } -String* -jsonToString(IJsonValue* value) { -if(value == null) -return null; -switch(value->GetType()) { -case JSON_TYPE_STRING: { -JsonString* string = static_cast< JsonString* >(value); -return new String(string->GetPointer()); -} -case JSON_TYPE_NUMBER: -break; -case JSON_TYPE_OBJECT: -break; -case JSON_TYPE_ARRAY: -break; -case JSON_TYPE_BOOL: -break; -case JSON_TYPE_NULL: -break; -} -return null; -} + String* + jsonToString(IJsonValue* value) { + if(value == null) + return null; + switch(value->GetType()) { + case JSON_TYPE_STRING: { + JsonString* string = static_cast< JsonString* >(value); + return new String(string->GetPointer()); + } + case JSON_TYPE_NUMBER: + break; + case JSON_TYPE_OBJECT: + break; + case JSON_TYPE_ARRAY: + break; + case JSON_TYPE_BOOL: + break; + case JSON_TYPE_NULL: + break; + } + return null; + } -String -stringify(void* ptr, String type) { -if(type.StartsWith(L"String", 0)) { -String * str = static_cast< String* > (ptr); -return String(str->GetPointer()); -} -if(type.StartsWith(L"Integer", 0)) { -Integer* pInt = static_cast< Integer* > (ptr); -return pInt->ToString(); -} -if(type.StartsWith(L"Long", 0)) { -Long* pLong = static_cast< Long* > (ptr); -return pLong->ToString(); -} -return L""; -} + String + stringify(void* ptr, String type) { + if(type.StartsWith(L"String", 0)) { + String * str = static_cast< String* > (ptr); + return String(str->GetPointer()); + } + if(type.StartsWith(L"Integer", 0)) { + Integer* pInt = static_cast< Integer* > (ptr); + return pInt->ToString(); + } + if(type.StartsWith(L"Long", 0)) { + Long* pLong = static_cast< Long* > (ptr); + return pLong->ToString(); + } + return L""; + } } /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiHelpers.h b/samples/client/petstore/tizen/client/SamiHelpers.h index c7181c6432f..e29eb3cb34b 100644 --- a/samples/client/petstore/tizen/client/SamiHelpers.h +++ b/samples/client/petstore/tizen/client/SamiHelpers.h @@ -1,50 +1,45 @@ #ifndef HELPERS_H_ #define HELPERS_H_ -#include - - #include - - #include - - #include - - #include - - #include "SamiHelpers.h" - #include "SamiObject.h" +#include +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" - using Tizen::Base::String; - using Tizen::Base::DateTime; - using namespace Tizen::Web::Json; - using namespace Tizen::Base::Collection; +using Tizen::Base::String; +using Tizen::Base::DateTime; +using namespace Tizen::Web::Json; +using namespace Tizen::Base::Collection; - using Tizen::Base::Long; - using Tizen::Base::DateTime; - using Tizen::Base::String; - using Tizen::Base::Integer; +using Tizen::Base::Long; +using Tizen::Base::DateTime; +using Tizen::Base::String; +using Tizen::Base::Integer; - namespace Swagger { - JsonObject* - toJson(void* v, String type, String containerType); +namespace Swagger { +JsonObject* +toJson(void* v, String type, String containerType); - void - jsonToValue(void* target, IJsonValue* ptr, String type, String innerType); +void +jsonToValue(void* target, IJsonValue* ptr, String type, String innerType); - Integer* - jsonToInteger(IJsonValue* value); +Integer* +jsonToInteger(IJsonValue* value); - Long* - jsonToLong(IJsonValue* value); +Long* +jsonToLong(IJsonValue* value); - String* - jsonToString(IJsonValue* value); +String* +jsonToString(IJsonValue* value); - DateTime* - jsonToDateTime(IJsonValue* value); +DateTime* +jsonToDateTime(IJsonValue* value); - String - stringify(void* ptr, String type); +String +stringify(void* ptr, String type); - } /* namespace Swagger */ - #endif /* HELPERS_H_ */ +} /* namespace Swagger */ +#endif /* HELPERS_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiModelFactory.h b/samples/client/petstore/tizen/client/SamiModelFactory.h index 6331b2af5c6..a2e1ab0e0de 100644 --- a/samples/client/petstore/tizen/client/SamiModelFactory.h +++ b/samples/client/petstore/tizen/client/SamiModelFactory.h @@ -3,45 +3,45 @@ #include "SamiObject.h" - #include "SamiUser.h" - #include "SamiCategory.h" - #include "SamiPet.h" - #include "SamiTag.h" - #include "SamiOrder.h" +#include "SamiUser.h" +#include "SamiCategory.h" +#include "SamiPet.h" +#include "SamiTag.h" +#include "SamiOrder.h" namespace Swagger { -void* -create(String type) { -if(type.Equals(L"SamiUser", true)) { -return new SamiUser(); -} -if(type.Equals(L"SamiCategory", true)) { -return new SamiCategory(); -} -if(type.Equals(L"SamiPet", true)) { -return new SamiPet(); -} -if(type.Equals(L"SamiTag", true)) { -return new SamiTag(); -} -if(type.Equals(L"SamiOrder", true)) { -return new SamiOrder(); -} - -if(type.Equals(L"String", true)) { -return new String(); -} -if(type.Equals(L"Integer", true)) { -return new Integer(); -} -if(type.Equals(L"Long", true)) { -return new Long(); -} -if(type.Equals(L"DateTime", true)) { -return new DateTime(); -} -return null; -} + void* + create(String type) { + if(type.Equals(L"SamiUser", true)) { + return new SamiUser(); + } + if(type.Equals(L"SamiCategory", true)) { + return new SamiCategory(); + } + if(type.Equals(L"SamiPet", true)) { + return new SamiPet(); + } + if(type.Equals(L"SamiTag", true)) { + return new SamiTag(); + } + if(type.Equals(L"SamiOrder", true)) { + return new SamiOrder(); + } + + if(type.Equals(L"String", true)) { + return new String(); + } + if(type.Equals(L"Integer", true)) { + return new Integer(); + } + if(type.Equals(L"Long", true)) { + return new Long(); + } + if(type.Equals(L"DateTime", true)) { + return new DateTime(); + } + return null; + } } /* namespace Swagger */ #endif /* ModelFactory_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiObject.h b/samples/client/petstore/tizen/client/SamiObject.h index 8feefbe3552..b0f921205ad 100644 --- a/samples/client/petstore/tizen/client/SamiObject.h +++ b/samples/client/petstore/tizen/client/SamiObject.h @@ -1,30 +1,27 @@ #ifndef _Sami_OBJECT_H_ #define _Sami_OBJECT_H_ -#include - - #include - - #include - +#include +#include +#include - using Tizen::Base::String; +using Tizen::Base::String; - using namespace Tizen::Web::Json; +using namespace Tizen::Web::Json; - class SamiObject { - public: - virtual JsonObject* asJsonObject() { - return null; - } - virtual ~SamiObject() {} - virtual SamiObject* fromJson(String* obj) { - return null; - } - virtual void fromJsonObject(IJsonValue* obj) {} - virtual String asJson() { - return L""; - } - }; +class SamiObject { + public: + virtual JsonObject* asJsonObject() { + return null; + } + virtual ~SamiObject() {} + virtual SamiObject* fromJson(String* obj) { + return null; + } + virtual void fromJsonObject(IJsonValue* obj) {} + virtual String asJson() { + return L""; + } +}; - #endif /* _Sami_OBJECT_H_ */ +#endif /* _Sami_OBJECT_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiOrder.cpp b/samples/client/petstore/tizen/client/SamiOrder.cpp index f75cb93277d..a319e88e616 100644 --- a/samples/client/petstore/tizen/client/SamiOrder.cpp +++ b/samples/client/petstore/tizen/client/SamiOrder.cpp @@ -1,28 +1,27 @@ - #include "SamiOrder.h" - #include - +#include "SamiOrder.h" +#include - using namespace Tizen::Base; - using namespace Tizen::System; - using namespace Tizen::Base::Utility; - using namespace Tizen::Base::Collection; - using namespace Tizen::Web::Json; - using namespace Tizen::Locales; +using namespace Tizen::Base; +using namespace Tizen::System; +using namespace Tizen::Base::Utility; +using namespace Tizen::Base::Collection; +using namespace Tizen::Web::Json; +using namespace Tizen::Locales; - namespace Swagger { +namespace Swagger { - SamiOrder::SamiOrder() { - init(); - } +SamiOrder::SamiOrder() { + init(); +} - SamiOrder::~SamiOrder() { - this->cleanup(); - } +SamiOrder::~SamiOrder() { + this->cleanup(); +} - void - SamiOrder::init() { +void +SamiOrder::init() { pId = null; pPetId = null; pQuantity = null; @@ -30,273 +29,266 @@ pStatus = null; pComplete = null; - } +} - void - SamiOrder::cleanup() { +void +SamiOrder::cleanup() { if(pId != null) { - + delete pId; - pId = null; - } + pId = null; + } if(pPetId != null) { - + delete pPetId; - pPetId = null; - } + pPetId = null; + } if(pQuantity != null) { - + delete pQuantity; - pQuantity = null; - } + pQuantity = null; + } if(pShipDate != null) { - + delete pShipDate; - pShipDate = null; - } + pShipDate = null; + } if(pStatus != null) { - + delete pStatus; - pStatus = null; - } + pStatus = null; + } if(pComplete != null) { - + delete pComplete; - pComplete = null; - } + pComplete = null; + } - } +} - SamiOrder* - SamiOrder::fromJson(String* json) { - this->cleanup(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiOrder* +SamiOrder::fromJson(String* json) { + this->cleanup(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - return this; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; + return this; +} - void - SamiOrder::fromJsonObject(IJsonValue* pJson) { - JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); +void +SamiOrder::fromJsonObject(IJsonValue* pJson) { + JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); - if(pJsonObject != null) { - JsonString* pIdKey = new JsonString(L"id"); + if(pJsonObject != null) { + JsonString* pIdKey = new JsonString(L"id"); IJsonValue* pIdVal = null; pJsonObject->GetValue(pIdKey, pIdVal); if(pIdVal != null) { - - pId = new Long(); - jsonToValue(pId, pIdVal, L"Long", L"Long"); + + pId = new Long(); + jsonToValue(pId, pIdVal, L"Long", L"Long"); } delete pIdKey; - JsonString* pPetIdKey = new JsonString(L"petId"); + JsonString* pPetIdKey = new JsonString(L"petId"); IJsonValue* pPetIdVal = null; pJsonObject->GetValue(pPetIdKey, pPetIdVal); if(pPetIdVal != null) { - - pPetId = new Long(); - jsonToValue(pPetId, pPetIdVal, L"Long", L"Long"); + + pPetId = new Long(); + jsonToValue(pPetId, pPetIdVal, L"Long", L"Long"); } delete pPetIdKey; - JsonString* pQuantityKey = new JsonString(L"quantity"); + JsonString* pQuantityKey = new JsonString(L"quantity"); IJsonValue* pQuantityVal = null; pJsonObject->GetValue(pQuantityKey, pQuantityVal); if(pQuantityVal != null) { - - pQuantity = new Integer(); - jsonToValue(pQuantity, pQuantityVal, L"Integer", L"Integer"); + + pQuantity = new Integer(); + jsonToValue(pQuantity, pQuantityVal, L"Integer", L"Integer"); } delete pQuantityKey; - JsonString* pShipDateKey = new JsonString(L"shipDate"); + JsonString* pShipDateKey = new JsonString(L"shipDate"); IJsonValue* pShipDateVal = null; pJsonObject->GetValue(pShipDateKey, pShipDateVal); if(pShipDateVal != null) { - - pShipDate = new DateTime(); - jsonToValue(pShipDate, pShipDateVal, L"DateTime", L"DateTime"); + + pShipDate = new DateTime(); + jsonToValue(pShipDate, pShipDateVal, L"DateTime", L"DateTime"); } delete pShipDateKey; - JsonString* pStatusKey = new JsonString(L"status"); + JsonString* pStatusKey = new JsonString(L"status"); IJsonValue* pStatusVal = null; pJsonObject->GetValue(pStatusKey, pStatusVal); if(pStatusVal != null) { - - pStatus = new String(); - jsonToValue(pStatus, pStatusVal, L"String", L"String"); + + pStatus = new String(); + jsonToValue(pStatus, pStatusVal, L"String", L"String"); } delete pStatusKey; - JsonString* pCompleteKey = new JsonString(L"complete"); + JsonString* pCompleteKey = new JsonString(L"complete"); IJsonValue* pCompleteVal = null; pJsonObject->GetValue(pCompleteKey, pCompleteVal); if(pCompleteVal != null) { - - pComplete = new Boolean(false); - jsonToValue(pComplete, pCompleteVal, L"Boolean", L"Boolean"); + + pComplete = new Boolean(false); + jsonToValue(pComplete, pCompleteVal, L"Boolean", L"Boolean"); } delete pCompleteKey; - - } - } + + } +} - SamiOrder::SamiOrder(String* json) { - init(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiOrder::SamiOrder(String* json) { + init(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; +} - String - SamiOrder::asJson () - { - JsonObject* pJsonObject = asJsonObject(); +String +SamiOrder::asJson () +{ + JsonObject* pJsonObject = asJsonObject(); - char *pComposeBuf = new char[256]; - JsonWriter::Compose(pJsonObject, pComposeBuf, 256); - String s = String(pComposeBuf); + char *pComposeBuf = new char[256]; + JsonWriter::Compose(pJsonObject, pComposeBuf, 256); + String s = String(pComposeBuf); - delete pComposeBuf; - pJsonObject->RemoveAll(true); - delete pJsonObject; + delete pComposeBuf; + pJsonObject->RemoveAll(true); + delete pJsonObject; - return s; - } + return s; +} - JsonObject* - SamiOrder::asJsonObject() { - JsonObject *pJsonObject = new JsonObject(); - pJsonObject->Construct(); +JsonObject* +SamiOrder::asJsonObject() { + JsonObject *pJsonObject = new JsonObject(); + pJsonObject->Construct(); - JsonString *pIdKey = new JsonString(L"id"); - pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); + JsonString *pIdKey = new JsonString(L"id"); + pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); - JsonString *pPetIdKey = new JsonString(L"petId"); - pJsonObject->Add(pPetIdKey, toJson(getPPetId(), "Long", "")); + JsonString *pPetIdKey = new JsonString(L"petId"); + pJsonObject->Add(pPetIdKey, toJson(getPPetId(), "Long", "")); - JsonString *pQuantityKey = new JsonString(L"quantity"); - pJsonObject->Add(pQuantityKey, toJson(getPQuantity(), "Integer", "")); + JsonString *pQuantityKey = new JsonString(L"quantity"); + pJsonObject->Add(pQuantityKey, toJson(getPQuantity(), "Integer", "")); - JsonString *pShipDateKey = new JsonString(L"shipDate"); - pJsonObject->Add(pShipDateKey, toJson(getPShipDate(), "DateTime", "")); + JsonString *pShipDateKey = new JsonString(L"shipDate"); + pJsonObject->Add(pShipDateKey, toJson(getPShipDate(), "DateTime", "")); - JsonString *pStatusKey = new JsonString(L"status"); - pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", "")); + JsonString *pStatusKey = new JsonString(L"status"); + pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", "")); - JsonString *pCompleteKey = new JsonString(L"complete"); - pJsonObject->Add(pCompleteKey, toJson(getPComplete(), "Boolean", "")); + JsonString *pCompleteKey = new JsonString(L"complete"); + pJsonObject->Add(pCompleteKey, toJson(getPComplete(), "Boolean", "")); - return pJsonObject; - } + return pJsonObject; +} - - Long* - SamiOrder::getPId() { - return pId; - } - void - SamiOrder::setPId(Long* pId) { - this->pId = pId; - } +Long* +SamiOrder::getPId() { + return pId; +} +void +SamiOrder::setPId(Long* pId) { + this->pId = pId; +} - - Long* - SamiOrder::getPPetId() { - return pPetId; - } - void - SamiOrder::setPPetId(Long* pPetId) { - this->pPetId = pPetId; - } +Long* +SamiOrder::getPPetId() { + return pPetId; +} +void +SamiOrder::setPPetId(Long* pPetId) { + this->pPetId = pPetId; +} - - Integer* - SamiOrder::getPQuantity() { - return pQuantity; - } - void - SamiOrder::setPQuantity(Integer* pQuantity) { - this->pQuantity = pQuantity; - } +Integer* +SamiOrder::getPQuantity() { + return pQuantity; +} +void +SamiOrder::setPQuantity(Integer* pQuantity) { + this->pQuantity = pQuantity; +} - - DateTime* - SamiOrder::getPShipDate() { - return pShipDate; - } - void - SamiOrder::setPShipDate(DateTime* pShipDate) { - this->pShipDate = pShipDate; - } +DateTime* +SamiOrder::getPShipDate() { + return pShipDate; +} +void +SamiOrder::setPShipDate(DateTime* pShipDate) { + this->pShipDate = pShipDate; +} - - String* - SamiOrder::getPStatus() { - return pStatus; - } - void - SamiOrder::setPStatus(String* pStatus) { - this->pStatus = pStatus; - } +String* +SamiOrder::getPStatus() { + return pStatus; +} +void +SamiOrder::setPStatus(String* pStatus) { + this->pStatus = pStatus; +} - - Boolean* - SamiOrder::getPComplete() { - return pComplete; - } - void - SamiOrder::setPComplete(Boolean* pComplete) { - this->pComplete = pComplete; - } - - +Boolean* +SamiOrder::getPComplete() { + return pComplete; +} +void +SamiOrder::setPComplete(Boolean* pComplete) { + this->pComplete = pComplete; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiOrder.h b/samples/client/petstore/tizen/client/SamiOrder.h index 0b13f1723f7..357812da47c 100644 --- a/samples/client/petstore/tizen/client/SamiOrder.h +++ b/samples/client/petstore/tizen/client/SamiOrder.h @@ -1,74 +1,70 @@ /* -* SamiOrder.h -* -* -*/ + * SamiOrder.h + * + * + */ #ifndef SamiOrder_H_ #define SamiOrder_H_ -#include - - #include - - #include - - #include - - #include "SamiHelpers.h" - #include "SamiObject.h" +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" - using namespace Tizen::Web::Json; +using namespace Tizen::Web::Json; +using Tizen::Base::Integer; using Tizen::Base::Long; -using Tizen::Base::DateTime; using Tizen::Base::String; using Tizen::Base::Boolean; -using Tizen::Base::Integer; +using Tizen::Base::DateTime; - namespace Swagger { +namespace Swagger { - class SamiOrder: public SamiObject { - public: +class SamiOrder: public SamiObject { +public: SamiOrder(); SamiOrder(String* json); - virtual ~SamiOrder(); + virtual ~SamiOrder(); - void init(); + void init(); - void cleanup(); + void cleanup(); - String asJson (); + String asJson (); - JsonObject* asJsonObject(); + JsonObject* asJsonObject(); - void fromJsonObject(IJsonValue* json); + void fromJsonObject(IJsonValue* json); SamiOrder* fromJson(String* obj); - Long* getPId(); - void setPId(Long* pId); + Long* getPId(); + void setPId(Long* pId); - Long* getPPetId(); - void setPPetId(Long* pPetId); + Long* getPPetId(); + void setPPetId(Long* pPetId); - Integer* getPQuantity(); - void setPQuantity(Integer* pQuantity); + Integer* getPQuantity(); + void setPQuantity(Integer* pQuantity); - DateTime* getPShipDate(); - void setPShipDate(DateTime* pShipDate); + DateTime* getPShipDate(); + void setPShipDate(DateTime* pShipDate); - String* getPStatus(); - void setPStatus(String* pStatus); + String* getPStatus(); + void setPStatus(String* pStatus); - Boolean* getPComplete(); - void setPComplete(Boolean* pComplete); + Boolean* getPComplete(); + void setPComplete(Boolean* pComplete); - private: +private: Long* pId; Long* pPetId; Integer* pQuantity; @@ -76,8 +72,8 @@ using Tizen::Base::Integer; String* pStatus; Boolean* pComplete; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiOrder_H_ */ +#endif /* SamiOrder_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiPet.cpp b/samples/client/petstore/tizen/client/SamiPet.cpp index a24dca97441..ecf63f060a4 100644 --- a/samples/client/petstore/tizen/client/SamiPet.cpp +++ b/samples/client/petstore/tizen/client/SamiPet.cpp @@ -1,28 +1,27 @@ - #include "SamiPet.h" - #include - +#include "SamiPet.h" +#include - using namespace Tizen::Base; - using namespace Tizen::System; - using namespace Tizen::Base::Utility; - using namespace Tizen::Base::Collection; - using namespace Tizen::Web::Json; - using namespace Tizen::Locales; +using namespace Tizen::Base; +using namespace Tizen::System; +using namespace Tizen::Base::Utility; +using namespace Tizen::Base::Collection; +using namespace Tizen::Web::Json; +using namespace Tizen::Locales; - namespace Swagger { +namespace Swagger { - SamiPet::SamiPet() { - init(); - } +SamiPet::SamiPet() { + init(); +} - SamiPet::~SamiPet() { - this->cleanup(); - } +SamiPet::~SamiPet() { + this->cleanup(); +} - void - SamiPet::init() { +void +SamiPet::init() { pId = null; pCategory = null; pName = null; @@ -30,273 +29,266 @@ pTags = null; pStatus = null; - } +} - void - SamiPet::cleanup() { +void +SamiPet::cleanup() { if(pId != null) { - + delete pId; - pId = null; - } + pId = null; + } if(pCategory != null) { - + delete pCategory; - pCategory = null; - } + pCategory = null; + } if(pName != null) { - + delete pName; - pName = null; - } + pName = null; + } if(pPhotoUrls != null) { - pPhotoUrls->RemoveAll(true); + pPhotoUrls->RemoveAll(true); delete pPhotoUrls; - pPhotoUrls = null; - } + pPhotoUrls = null; + } if(pTags != null) { - pTags->RemoveAll(true); + pTags->RemoveAll(true); delete pTags; - pTags = null; - } + pTags = null; + } if(pStatus != null) { - + delete pStatus; - pStatus = null; - } + pStatus = null; + } - } +} - SamiPet* - SamiPet::fromJson(String* json) { - this->cleanup(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiPet* +SamiPet::fromJson(String* json) { + this->cleanup(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - return this; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; + return this; +} - void - SamiPet::fromJsonObject(IJsonValue* pJson) { - JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); +void +SamiPet::fromJsonObject(IJsonValue* pJson) { + JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); - if(pJsonObject != null) { - JsonString* pIdKey = new JsonString(L"id"); + if(pJsonObject != null) { + JsonString* pIdKey = new JsonString(L"id"); IJsonValue* pIdVal = null; pJsonObject->GetValue(pIdKey, pIdVal); if(pIdVal != null) { - - pId = new Long(); - jsonToValue(pId, pIdVal, L"Long", L"Long"); + + pId = new Long(); + jsonToValue(pId, pIdVal, L"Long", L"Long"); } delete pIdKey; - JsonString* pCategoryKey = new JsonString(L"category"); + JsonString* pCategoryKey = new JsonString(L"category"); IJsonValue* pCategoryVal = null; pJsonObject->GetValue(pCategoryKey, pCategoryVal); if(pCategoryVal != null) { - - pCategory = new SamiCategory(); - jsonToValue(pCategory, pCategoryVal, L"SamiCategory", L"SamiCategory"); + + pCategory = new SamiCategory(); + jsonToValue(pCategory, pCategoryVal, L"SamiCategory", L"SamiCategory"); } delete pCategoryKey; - JsonString* pNameKey = new JsonString(L"name"); + JsonString* pNameKey = new JsonString(L"name"); IJsonValue* pNameVal = null; pJsonObject->GetValue(pNameKey, pNameVal); if(pNameVal != null) { - - pName = new String(); - jsonToValue(pName, pNameVal, L"String", L"String"); + + pName = new String(); + jsonToValue(pName, pNameVal, L"String", L"String"); } delete pNameKey; - JsonString* pPhotoUrlsKey = new JsonString(L"photoUrls"); + JsonString* pPhotoUrlsKey = new JsonString(L"photoUrls"); IJsonValue* pPhotoUrlsVal = null; pJsonObject->GetValue(pPhotoUrlsKey, pPhotoUrlsVal); if(pPhotoUrlsVal != null) { - pPhotoUrls = new ArrayList(); - - jsonToValue(pPhotoUrls, pPhotoUrlsVal, L"IList", L"String"); + pPhotoUrls = new ArrayList(); + + jsonToValue(pPhotoUrls, pPhotoUrlsVal, L"IList", L"String"); } delete pPhotoUrlsKey; - JsonString* pTagsKey = new JsonString(L"tags"); + JsonString* pTagsKey = new JsonString(L"tags"); IJsonValue* pTagsVal = null; pJsonObject->GetValue(pTagsKey, pTagsVal); if(pTagsVal != null) { - pTags = new ArrayList(); - - jsonToValue(pTags, pTagsVal, L"IList", L"SamiTag"); + pTags = new ArrayList(); + + jsonToValue(pTags, pTagsVal, L"IList", L"SamiTag"); } delete pTagsKey; - JsonString* pStatusKey = new JsonString(L"status"); + JsonString* pStatusKey = new JsonString(L"status"); IJsonValue* pStatusVal = null; pJsonObject->GetValue(pStatusKey, pStatusVal); if(pStatusVal != null) { - - pStatus = new String(); - jsonToValue(pStatus, pStatusVal, L"String", L"String"); + + pStatus = new String(); + jsonToValue(pStatus, pStatusVal, L"String", L"String"); } delete pStatusKey; - - } - } + + } +} - SamiPet::SamiPet(String* json) { - init(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiPet::SamiPet(String* json) { + init(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; +} - String - SamiPet::asJson () - { - JsonObject* pJsonObject = asJsonObject(); +String +SamiPet::asJson () +{ + JsonObject* pJsonObject = asJsonObject(); - char *pComposeBuf = new char[256]; - JsonWriter::Compose(pJsonObject, pComposeBuf, 256); - String s = String(pComposeBuf); + char *pComposeBuf = new char[256]; + JsonWriter::Compose(pJsonObject, pComposeBuf, 256); + String s = String(pComposeBuf); - delete pComposeBuf; - pJsonObject->RemoveAll(true); - delete pJsonObject; + delete pComposeBuf; + pJsonObject->RemoveAll(true); + delete pJsonObject; - return s; - } + return s; +} - JsonObject* - SamiPet::asJsonObject() { - JsonObject *pJsonObject = new JsonObject(); - pJsonObject->Construct(); +JsonObject* +SamiPet::asJsonObject() { + JsonObject *pJsonObject = new JsonObject(); + pJsonObject->Construct(); - JsonString *pIdKey = new JsonString(L"id"); - pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); + JsonString *pIdKey = new JsonString(L"id"); + pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); - JsonString *pCategoryKey = new JsonString(L"category"); - pJsonObject->Add(pCategoryKey, toJson(getPCategory(), "SamiCategory", "")); + JsonString *pCategoryKey = new JsonString(L"category"); + pJsonObject->Add(pCategoryKey, toJson(getPCategory(), "SamiCategory", "")); - JsonString *pNameKey = new JsonString(L"name"); - pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); + JsonString *pNameKey = new JsonString(L"name"); + pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); - JsonString *pPhotoUrlsKey = new JsonString(L"photoUrls"); - pJsonObject->Add(pPhotoUrlsKey, toJson(getPPhotoUrls(), "String", "array")); + JsonString *pPhotoUrlsKey = new JsonString(L"photoUrls"); + pJsonObject->Add(pPhotoUrlsKey, toJson(getPPhotoUrls(), "String", "array")); - JsonString *pTagsKey = new JsonString(L"tags"); - pJsonObject->Add(pTagsKey, toJson(getPTags(), "SamiTag", "array")); + JsonString *pTagsKey = new JsonString(L"tags"); + pJsonObject->Add(pTagsKey, toJson(getPTags(), "SamiTag", "array")); - JsonString *pStatusKey = new JsonString(L"status"); - pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", "")); + JsonString *pStatusKey = new JsonString(L"status"); + pJsonObject->Add(pStatusKey, toJson(getPStatus(), "String", "")); - return pJsonObject; - } + return pJsonObject; +} - - Long* - SamiPet::getPId() { - return pId; - } - void - SamiPet::setPId(Long* pId) { - this->pId = pId; - } +Long* +SamiPet::getPId() { + return pId; +} +void +SamiPet::setPId(Long* pId) { + this->pId = pId; +} - - SamiCategory* - SamiPet::getPCategory() { - return pCategory; - } - void - SamiPet::setPCategory(SamiCategory* pCategory) { - this->pCategory = pCategory; - } +SamiCategory* +SamiPet::getPCategory() { + return pCategory; +} +void +SamiPet::setPCategory(SamiCategory* pCategory) { + this->pCategory = pCategory; +} - - String* - SamiPet::getPName() { - return pName; - } - void - SamiPet::setPName(String* pName) { - this->pName = pName; - } +String* +SamiPet::getPName() { + return pName; +} +void +SamiPet::setPName(String* pName) { + this->pName = pName; +} - - IList* - SamiPet::getPPhotoUrls() { - return pPhotoUrls; - } - void - SamiPet::setPPhotoUrls(IList* pPhotoUrls) { - this->pPhotoUrls = pPhotoUrls; - } +IList* +SamiPet::getPPhotoUrls() { + return pPhotoUrls; +} +void +SamiPet::setPPhotoUrls(IList* pPhotoUrls) { + this->pPhotoUrls = pPhotoUrls; +} - - IList* - SamiPet::getPTags() { - return pTags; - } - void - SamiPet::setPTags(IList* pTags) { - this->pTags = pTags; - } +IList* +SamiPet::getPTags() { + return pTags; +} +void +SamiPet::setPTags(IList* pTags) { + this->pTags = pTags; +} - - String* - SamiPet::getPStatus() { - return pStatus; - } - void - SamiPet::setPStatus(String* pStatus) { - this->pStatus = pStatus; - } - - +String* +SamiPet::getPStatus() { + return pStatus; +} +void +SamiPet::setPStatus(String* pStatus) { + this->pStatus = pStatus; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiPet.h b/samples/client/petstore/tizen/client/SamiPet.h index d50fcc1915e..5ec3194fb1b 100644 --- a/samples/client/petstore/tizen/client/SamiPet.h +++ b/samples/client/petstore/tizen/client/SamiPet.h @@ -1,74 +1,70 @@ /* -* SamiPet.h -* -* -*/ + * SamiPet.h + * + * + */ #ifndef SamiPet_H_ #define SamiPet_H_ -#include - - #include - - #include - - #include - - #include "SamiHelpers.h" - #include "SamiObject.h" +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" - using namespace Tizen::Web::Json; +using namespace Tizen::Web::Json; -#include "SamiCategory.h" using Tizen::Base::Long; using Tizen::Base::String; +#include "SamiCategory.h" #include "SamiTag.h" using Tizen::Base::Collection::IList; - namespace Swagger { +namespace Swagger { - class SamiPet: public SamiObject { - public: +class SamiPet: public SamiObject { +public: SamiPet(); SamiPet(String* json); - virtual ~SamiPet(); + virtual ~SamiPet(); - void init(); + void init(); - void cleanup(); + void cleanup(); - String asJson (); + String asJson (); - JsonObject* asJsonObject(); + JsonObject* asJsonObject(); - void fromJsonObject(IJsonValue* json); + void fromJsonObject(IJsonValue* json); SamiPet* fromJson(String* obj); - Long* getPId(); - void setPId(Long* pId); + Long* getPId(); + void setPId(Long* pId); - SamiCategory* getPCategory(); - void setPCategory(SamiCategory* pCategory); + SamiCategory* getPCategory(); + void setPCategory(SamiCategory* pCategory); - String* getPName(); - void setPName(String* pName); + String* getPName(); + void setPName(String* pName); - IList* getPPhotoUrls(); - void setPPhotoUrls(IList* pPhotoUrls); + IList* getPPhotoUrls(); + void setPPhotoUrls(IList* pPhotoUrls); - IList* getPTags(); - void setPTags(IList* pTags); + IList* getPTags(); + void setPTags(IList* pTags); - String* getPStatus(); - void setPStatus(String* pStatus); + String* getPStatus(); + void setPStatus(String* pStatus); - private: +private: Long* pId; SamiCategory* pCategory; String* pName; @@ -76,8 +72,8 @@ using Tizen::Base::Collection::IList; IList* pTags; String* pStatus; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiPet_H_ */ +#endif /* SamiPet_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiPetApi.cpp b/samples/client/petstore/tizen/client/SamiPetApi.cpp index 32a53aae42a..69997d3cee0 100644 --- a/samples/client/petstore/tizen/client/SamiPetApi.cpp +++ b/samples/client/petstore/tizen/client/SamiPetApi.cpp @@ -8,466 +8,457 @@ using namespace Tizen::Base; namespace Swagger { - SamiPetApi::SamiPetApi() { +SamiPetApi::SamiPetApi() { +} + +SamiPetApi::~SamiPetApi() { + +} + +void +updatePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + + handler(error, null); + } +} + +void +SamiPetApi::updatePetWithCompletion(SamiPet* body, void(*success)(SamiError*)) { + client = new SamiApiClient(); + + client->success(&updatePetProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + + if(body != null) { + mBody = new String(body->asJson()); + headerParams->Add(new String("Content-Type"), new String("application/json")); + } + + + + String url(L"/pet"); + + + + client->execute(SamiPetApi::getBasePath(), url, "PUT", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} + +void +addPetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + + handler(error, null); + } +} + +void +SamiPetApi::addPetWithCompletion(SamiPet* body, void(*success)(SamiError*)) { + client = new SamiApiClient(); + + client->success(&addPetProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + + if(body != null) { + mBody = new String(body->asJson()); + headerParams->Add(new String("Content-Type"), new String("application/json")); + } + + + + String url(L"/pet"); + + + + client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} + +void +findPetsByStatusProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); + + IList* out = new ArrayList(); + jsonToValue(out, pJson, L"IList*", L"SamiPet"); + + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); } - - SamiPetApi::~SamiPetApi() { - + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); } - - void - updatePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); - - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } - - void - SamiPetApi::updatePetWithCompletion(SamiPet* body, void(*success)(SamiError*)) { - client = new SamiApiClient(); - - client->success(&updatePetProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); - - - - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); - - - - String* mBody = null; - - - - - if(body != null) { - mBody = new String(body->asJson()); - headerParams->Add(new String("Content-Type"), new String("application/json")); - } - - - - String url(L"/pet"); - - - - client->execute(SamiPetApi::getBasePath(), url, "PUT", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } - + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); - void - addPetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +IList* +SamiPetApi::findPetsByStatusWithCompletion(IList* status, void (* success)(IList*, SamiError*)) { + client = new SamiApiClient(); - void - SamiPetApi::addPetWithCompletion(SamiPet* body, void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&findPetsByStatusProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&addPetProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + + int sz = status->GetCount(); + for(int i = 0; i < sz; i++) { + String itemAt = stringify(status->GetAt(i), "String*"); + queryParams->Add(new String("status"), new String(itemAt)); + } + + - + String* mBody = null; - String* mBody = null; + - - - - if(body != null) { - mBody = new String(body->asJson()); - headerParams->Add(new String("Content-Type"), new String("application/json")); - } - - + String url(L"/pet/findByStatus"); - String url(L"/pet"); + - + client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} - client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } +void +findPetsByTagsProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); + + IList* out = new ArrayList(); + jsonToValue(out, pJson, L"IList*", L"SamiPet"); + + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); + } + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); + } - void - findPetsByStatusProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); - - if(code >= 200 && code < 300) { - ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); - IJsonValue* pJson = JsonParser::ParseN(*pBuffer); - - IList* out = new ArrayList(); - jsonToValue(out, pJson, L"IList*", L"SamiPet"); - - if (pJson) { - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - handler(out, null); - } - else { - SamiError* error = new SamiError(0, new String(L"No parsable response received")); - handler(null, error); - } - - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - handler(null, error); - - } - } - - IList* - SamiPetApi::findPetsByStatusWithCompletion(IList* status, void (* success)(IList*, SamiError*)) { - client = new SamiApiClient(); - - client->success(&findPetsByStatusProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); - - - - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); - - - int sz = status->GetCount(); - for(int i = 0; i < sz; i++) { - String itemAt = stringify(status->GetAt(i), "String*"); - queryParams->Add(new String("status"), new String(itemAt)); - } - - - - String* mBody = null; - - - - String url(L"/pet/findByStatus"); - - - - client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - return null; - } - + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); - void - findPetsByTagsProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + } +} - if(code >= 200 && code < 300) { - ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); - IJsonValue* pJson = JsonParser::ParseN(*pBuffer); +IList* +SamiPetApi::findPetsByTagsWithCompletion(IList* tags, void (* success)(IList*, SamiError*)) { + client = new SamiApiClient(); - IList* out = new ArrayList(); - jsonToValue(out, pJson, L"IList*", L"SamiPet"); + client->success(&findPetsByTagsProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - if (pJson) { - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - handler(out, null); - } - else { - SamiError* error = new SamiError(0, new String(L"No parsable response received")); - handler(null, error); - } - - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - handler(null, error); - - } - } + - IList* - SamiPetApi::findPetsByTagsWithCompletion(IList* tags, void (* success)(IList*, SamiError*)) { - client = new SamiApiClient(); + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - client->success(&findPetsByTagsProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + + int sz = tags->GetCount(); + for(int i = 0; i < sz; i++) { + String itemAt = stringify(tags->GetAt(i), "String*"); + queryParams->Add(new String("tags"), new String(itemAt)); + } + + - + String* mBody = null; - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - - int sz = tags->GetCount(); - for(int i = 0; i < sz; i++) { - String itemAt = stringify(tags->GetAt(i), "String*"); - queryParams->Add(new String("tags"), new String(itemAt)); - } - - + String url(L"/pet/findByTags"); - String* mBody = null; + - + client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} - String url(L"/pet/findByTags"); +void +getPetByIdProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); - + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); - client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - return null; - } + SamiPet* out = new SamiPet(); + jsonToValue(out, pJson, L"SamiPet*", L"SamiPet"); + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); + } + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); + } - void - getPetByIdProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); - - if(code >= 200 && code < 300) { - ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); - IJsonValue* pJson = JsonParser::ParseN(*pBuffer); - - SamiPet* out = new SamiPet(); - jsonToValue(out, pJson, L"SamiPet*", L"SamiPet"); - - if (pJson) { - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - handler(out, null); - } - else { - SamiError* error = new SamiError(0, new String(L"No parsable response received")); - handler(null, error); - } - - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - handler(null, error); - - } - } - - SamiPet* - SamiPetApi::getPetByIdWithCompletion(Long* petId, void (* success)(SamiPet*, SamiError*)) { - client = new SamiApiClient(); - - client->success(&getPetByIdProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); - - - - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); - - - - String* mBody = null; - - - - String url(L"/pet/{petId}"); - - - String s_petId(L"{"); - s_petId.Append(L"petId"); - s_petId.Append(L"}"); - url.Replace(s_petId, stringify(petId, L"Long*")); - - - client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - return null; - } - + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); - void - updatePetWithFormProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +SamiPet* +SamiPetApi::getPetByIdWithCompletion(Long* petId, void (* success)(SamiPet*, SamiError*)) { + client = new SamiApiClient(); - void - SamiPetApi::updatePetWithFormWithCompletion(String* petId, String* name, String* status, void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&getPetByIdProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&updatePetWithFormProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - + String* mBody = null; - String* mBody = null; + - + String url(L"/pet/{petId}"); - String url(L"/pet/{petId}"); + + String s_petId(L"{"); + s_petId.Append(L"petId"); + s_petId.Append(L"}"); + url.Replace(s_petId, stringify(petId, L"Long*")); + - - String s_petId(L"{"); - s_petId.Append(L"petId"); - s_petId.Append(L"}"); - url.Replace(s_petId, stringify(petId, L"String*")); - + client->execute(SamiPetApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} - client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } +void +updatePetWithFormProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - void - deletePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + handler(error, null); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +void +SamiPetApi::updatePetWithFormWithCompletion(String* petId, String* name, String* status, void(*success)(SamiError*)) { + client = new SamiApiClient(); - void - SamiPetApi::deletePetWithCompletion(String* apiKey, Long* petId, void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&updatePetWithFormProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&deletePetProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - - headerParams->Add(new String("api_key"), apiKey); - - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - + String* mBody = null; - String* mBody = null; + - + String url(L"/pet/{petId}"); - String url(L"/pet/{petId}"); + + String s_petId(L"{"); + s_petId.Append(L"petId"); + s_petId.Append(L"}"); + url.Replace(s_petId, stringify(petId, L"String*")); + - - String s_petId(L"{"); - s_petId.Append(L"petId"); - s_petId.Append(L"}"); - url.Replace(s_petId, stringify(petId, L"Long*")); - + client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} - client->execute(SamiPetApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } +void +deletePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - void - uploadFileProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + handler(error, null); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +void +SamiPetApi::deletePetWithCompletion(String* apiKey, Long* petId, void(*success)(SamiError*)) { + client = new SamiApiClient(); - void - SamiPetApi::uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&deletePetProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&uploadFileProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + + headerParams->Add(new String("api_key"), apiKey); + + - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - + String* mBody = null; - String* mBody = null; + - + String url(L"/pet/{petId}"); - String url(L"/pet/{petId}/uploadImage"); + + String s_petId(L"{"); + s_petId.Append(L"petId"); + s_petId.Append(L"}"); + url.Replace(s_petId, stringify(petId, L"Long*")); + - - String s_petId(L"{"); - s_petId.Append(L"petId"); - s_petId.Append(L"}"); - url.Replace(s_petId, stringify(petId, L"Long*")); - + client->execute(SamiPetApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} - client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } +void +uploadFileProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(error, null); + } +} + +void +SamiPetApi::uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void(*success)(SamiError*)) { + client = new SamiApiClient(); + + client->success(&uploadFileProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + String url(L"/pet/{petId}/uploadImage"); + + + String s_petId(L"{"); + s_petId.Append(L"petId"); + s_petId.Append(L"}"); + url.Replace(s_petId, stringify(petId, L"Long*")); + + + client->execute(SamiPetApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} + } /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiPetApi.h b/samples/client/petstore/tizen/client/SamiPetApi.h index ac6d8d61762..05844bd88bd 100644 --- a/samples/client/petstore/tizen/client/SamiPetApi.h +++ b/samples/client/petstore/tizen/client/SamiPetApi.h @@ -1,70 +1,58 @@ #ifndef SamiPetApi_H_ #define SamiPetApi_H_ -#include - - #include "SamiApiClient.h" - #include "SamiError.h" +#include +#include "SamiApiClient.h" +#include "SamiError.h" - #include "SamiPet.h" - using Tizen::Base::String; - using Tizen::Base::Long; - #include "SamiFile.h" - +#include "SamiPet.h" +using Tizen::Base::String; +using Tizen::Base::Long; +#include "SamiFile.h" - using namespace Tizen::Net::Http; +using namespace Tizen::Net::Http; - namespace Swagger { +namespace Swagger { - - class SamiPetApi { - public: - SamiPetApi(); - virtual ~SamiPetApi(); +class SamiPetApi { +public: + SamiPetApi(); + virtual ~SamiPetApi(); - - void - updatePetWithCompletion(SamiPet* body, void(* handler)(SamiError*)); - - void - addPetWithCompletion(SamiPet* body, void(* handler)(SamiError*)); - - IList* - findPetsByStatusWithCompletion(IList* status, void (* handler)(IList* - , SamiError*)); - - IList* - findPetsByTagsWithCompletion(IList* tags, void (* handler)(IList* - , SamiError*)); - - SamiPet* - getPetByIdWithCompletion(Long* petId, void (* handler)(SamiPet* - , SamiError*)); - - void - updatePetWithFormWithCompletion(String* petId - , String* name - , String* status, void(* handler)(SamiError*)); - - void - deletePetWithCompletion(String* apiKey - , Long* petId, void(* handler)(SamiError*)); - - void - uploadFileWithCompletion(Long* petId - , String* additionalMetadata - , SamiFile* file, void(* handler)(SamiError*)); - - static String getBasePath() { - return L"http://petstore.swagger.io/v2"; - } + + void + updatePetWithCompletion(SamiPet* body, void(* handler)(SamiError*)); + + void + addPetWithCompletion(SamiPet* body, void(* handler)(SamiError*)); + + IList* + findPetsByStatusWithCompletion(IList* status, void (* handler)(IList*, SamiError*)); + + IList* + findPetsByTagsWithCompletion(IList* tags, void (* handler)(IList*, SamiError*)); + + SamiPet* + getPetByIdWithCompletion(Long* petId, void (* handler)(SamiPet*, SamiError*)); + + void + updatePetWithFormWithCompletion(String* petId, String* name, String* status, void(* handler)(SamiError*)); + + void + deletePetWithCompletion(String* apiKey, Long* petId, void(* handler)(SamiError*)); + + void + uploadFileWithCompletion(Long* petId, String* additionalMetadata, SamiFile* file, void(* handler)(SamiError*)); + + static String getBasePath() { + return L"http://petstore.swagger.io/v2"; + } - private: - SamiApiClient* client; - }; +private: + SamiApiClient* client; +}; - - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiPetApi_H_ */ +#endif /* SamiPetApi_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiStoreApi.cpp b/samples/client/petstore/tizen/client/SamiStoreApi.cpp index be4bc6e8782..c567896c48d 100644 --- a/samples/client/petstore/tizen/client/SamiStoreApi.cpp +++ b/samples/client/petstore/tizen/client/SamiStoreApi.cpp @@ -8,263 +8,258 @@ using namespace Tizen::Base; namespace Swagger { - SamiStoreApi::SamiStoreApi() { +SamiStoreApi::SamiStoreApi() { +} + +SamiStoreApi::~SamiStoreApi() { + +} + +void +getInventoryProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); + + HashMap* out = new HashMap(); + jsonToValue(out, pJson, L"HashMap*", L"Integer"); + + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); } - - SamiStoreApi::~SamiStoreApi() { - + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); } - - void - getInventoryProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); - - if(code >= 200 && code < 300) { - ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); - IJsonValue* pJson = JsonParser::ParseN(*pBuffer); - - HashMap* out = new HashMap(); - jsonToValue(out, pJson, L"HashMap*", L"Integer"); - - if (pJson) { - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - handler(out, null); - } - else { - SamiError* error = new SamiError(0, new String(L"No parsable response received")); - handler(null, error); - } - - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - handler(null, error); - - } - } - - HashMap* - SamiStoreApi::getInventoryWithCompletion( void (* success)(HashMap*, SamiError*)) { - client = new SamiApiClient(); - - client->success(&getInventoryProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); - - - - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); - - - - String* mBody = null; - - - - String url(L"/store/inventory"); - - - - client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - return null; - } - + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); - void - placeOrderProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + } +} - if(code >= 200 && code < 300) { - ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); - IJsonValue* pJson = JsonParser::ParseN(*pBuffer); +HashMap* +SamiStoreApi::getInventoryWithCompletion( void (* success)(HashMap*, SamiError*)) { + client = new SamiApiClient(); - SamiOrder* out = new SamiOrder(); - jsonToValue(out, pJson, L"SamiOrder*", L"SamiOrder"); + client->success(&getInventoryProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - if (pJson) { - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - handler(out, null); - } - else { - SamiError* error = new SamiError(0, new String(L"No parsable response received")); - handler(null, error); - } - - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - handler(null, error); - - } - } + - SamiOrder* - SamiStoreApi::placeOrderWithCompletion(SamiOrder* body, void (* success)(SamiOrder*, SamiError*)) { - client = new SamiApiClient(); + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - client->success(&placeOrderProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + String* mBody = null; - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - + String url(L"/store/inventory"); - String* mBody = null; + - - - - if(body != null) { - mBody = new String(body->asJson()); - headerParams->Add(new String("Content-Type"), new String("application/json")); - } - - + client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} - String url(L"/store/order"); +void +placeOrderProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); - + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); - client->execute(SamiStoreApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - return null; - } + SamiOrder* out = new SamiOrder(); + jsonToValue(out, pJson, L"SamiOrder*", L"SamiOrder"); + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); + } + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); + } - void - getOrderByIdProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); - - if(code >= 200 && code < 300) { - ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); - IJsonValue* pJson = JsonParser::ParseN(*pBuffer); - - SamiOrder* out = new SamiOrder(); - jsonToValue(out, pJson, L"SamiOrder*", L"SamiOrder"); - - if (pJson) { - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - handler(out, null); - } - else { - SamiError* error = new SamiError(0, new String(L"No parsable response received")); - handler(null, error); - } - - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - handler(null, error); - - } - } - - SamiOrder* - SamiStoreApi::getOrderByIdWithCompletion(String* orderId, void (* success)(SamiOrder*, SamiError*)) { - client = new SamiApiClient(); - - client->success(&getOrderByIdProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); - - - - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); - - - - String* mBody = null; - - - - String url(L"/store/order/{orderId}"); - - - String s_orderId(L"{"); - s_orderId.Append(L"orderId"); - s_orderId.Append(L"}"); - url.Replace(s_orderId, stringify(orderId, L"String*")); - - - client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - return null; - } - + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); - void - deleteOrderProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +SamiOrder* +SamiStoreApi::placeOrderWithCompletion(SamiOrder* body, void (* success)(SamiOrder*, SamiError*)) { + client = new SamiApiClient(); - void - SamiStoreApi::deleteOrderWithCompletion(String* orderId, void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&placeOrderProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&deleteOrderProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - + String* mBody = null; - String* mBody = null; + + + + if(body != null) { + mBody = new String(body->asJson()); + headerParams->Add(new String("Content-Type"), new String("application/json")); + } + + - + String url(L"/store/order"); - String url(L"/store/order/{orderId}"); + - - String s_orderId(L"{"); - s_orderId.Append(L"orderId"); - s_orderId.Append(L"}"); - url.Replace(s_orderId, stringify(orderId, L"String*")); - + client->execute(SamiStoreApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} - client->execute(SamiStoreApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } +void +getOrderByIdProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); + + SamiOrder* out = new SamiOrder(); + jsonToValue(out, pJson, L"SamiOrder*", L"SamiOrder"); + + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); + } + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); + } + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); + + } +} + +SamiOrder* +SamiStoreApi::getOrderByIdWithCompletion(String* orderId, void (* success)(SamiOrder*, SamiError*)) { + client = new SamiApiClient(); + + client->success(&getOrderByIdProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + String url(L"/store/order/{orderId}"); + + + String s_orderId(L"{"); + s_orderId.Append(L"orderId"); + s_orderId.Append(L"}"); + url.Replace(s_orderId, stringify(orderId, L"String*")); + + + client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} + +void +deleteOrderProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + + handler(error, null); + } +} + +void +SamiStoreApi::deleteOrderWithCompletion(String* orderId, void(*success)(SamiError*)) { + client = new SamiApiClient(); + + client->success(&deleteOrderProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + String url(L"/store/order/{orderId}"); + + + String s_orderId(L"{"); + s_orderId.Append(L"orderId"); + s_orderId.Append(L"}"); + url.Replace(s_orderId, stringify(orderId, L"String*")); + + + client->execute(SamiStoreApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} + } /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiStoreApi.h b/samples/client/petstore/tizen/client/SamiStoreApi.h index 3f93480d37b..a36f4ba6ee9 100644 --- a/samples/client/petstore/tizen/client/SamiStoreApi.h +++ b/samples/client/petstore/tizen/client/SamiStoreApi.h @@ -1,52 +1,45 @@ #ifndef SamiStoreApi_H_ #define SamiStoreApi_H_ -#include - - #include "SamiApiClient.h" - #include "SamiError.h" +#include +#include "SamiApiClient.h" +#include "SamiError.h" - using Tizen::Base::Integer; - #include "SamiOrder.h" - using Tizen::Base::String; - +using Tizen::Base::Integer; +#include "SamiOrder.h" +using Tizen::Base::String; - using namespace Tizen::Net::Http; +using namespace Tizen::Net::Http; - namespace Swagger { +namespace Swagger { - - class SamiStoreApi { - public: - SamiStoreApi(); - virtual ~SamiStoreApi(); +class SamiStoreApi { +public: + SamiStoreApi(); + virtual ~SamiStoreApi(); - - HashMap* - getInventoryWithCompletion( void (* handler)(HashMap* - , SamiError*)); - - SamiOrder* - placeOrderWithCompletion(SamiOrder* body, void (* handler)(SamiOrder* - , SamiError*)); - - SamiOrder* - getOrderByIdWithCompletion(String* orderId, void (* handler)(SamiOrder* - , SamiError*)); - - void - deleteOrderWithCompletion(String* orderId, void(* handler)(SamiError*)); - - static String getBasePath() { - return L"http://petstore.swagger.io/v2"; - } + + HashMap* + getInventoryWithCompletion( void (* handler)(HashMap*, SamiError*)); + + SamiOrder* + placeOrderWithCompletion(SamiOrder* body, void (* handler)(SamiOrder*, SamiError*)); + + SamiOrder* + getOrderByIdWithCompletion(String* orderId, void (* handler)(SamiOrder*, SamiError*)); + + void + deleteOrderWithCompletion(String* orderId, void(* handler)(SamiError*)); + + static String getBasePath() { + return L"http://petstore.swagger.io/v2"; + } - private: - SamiApiClient* client; - }; +private: + SamiApiClient* client; +}; - - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiStoreApi_H_ */ +#endif /* SamiStoreApi_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiTag.cpp b/samples/client/petstore/tizen/client/SamiTag.cpp index 0183a623ce9..d07b64a531d 100644 --- a/samples/client/petstore/tizen/client/SamiTag.cpp +++ b/samples/client/petstore/tizen/client/SamiTag.cpp @@ -1,186 +1,182 @@ - #include "SamiTag.h" - #include - +#include "SamiTag.h" +#include - using namespace Tizen::Base; - using namespace Tizen::System; - using namespace Tizen::Base::Utility; - using namespace Tizen::Base::Collection; - using namespace Tizen::Web::Json; - using namespace Tizen::Locales; +using namespace Tizen::Base; +using namespace Tizen::System; +using namespace Tizen::Base::Utility; +using namespace Tizen::Base::Collection; +using namespace Tizen::Web::Json; +using namespace Tizen::Locales; - namespace Swagger { +namespace Swagger { - SamiTag::SamiTag() { - init(); - } +SamiTag::SamiTag() { + init(); +} - SamiTag::~SamiTag() { - this->cleanup(); - } +SamiTag::~SamiTag() { + this->cleanup(); +} - void - SamiTag::init() { +void +SamiTag::init() { pId = null; pName = null; - } +} - void - SamiTag::cleanup() { +void +SamiTag::cleanup() { if(pId != null) { - + delete pId; - pId = null; - } + pId = null; + } if(pName != null) { - + delete pName; - pName = null; - } + pName = null; + } - } +} - SamiTag* - SamiTag::fromJson(String* json) { - this->cleanup(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiTag* +SamiTag::fromJson(String* json) { + this->cleanup(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - return this; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; + return this; +} - void - SamiTag::fromJsonObject(IJsonValue* pJson) { - JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); +void +SamiTag::fromJsonObject(IJsonValue* pJson) { + JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); - if(pJsonObject != null) { - JsonString* pIdKey = new JsonString(L"id"); + if(pJsonObject != null) { + JsonString* pIdKey = new JsonString(L"id"); IJsonValue* pIdVal = null; pJsonObject->GetValue(pIdKey, pIdVal); if(pIdVal != null) { - - pId = new Long(); - jsonToValue(pId, pIdVal, L"Long", L"Long"); + + pId = new Long(); + jsonToValue(pId, pIdVal, L"Long", L"Long"); } delete pIdKey; - JsonString* pNameKey = new JsonString(L"name"); + JsonString* pNameKey = new JsonString(L"name"); IJsonValue* pNameVal = null; pJsonObject->GetValue(pNameKey, pNameVal); if(pNameVal != null) { - - pName = new String(); - jsonToValue(pName, pNameVal, L"String", L"String"); + + pName = new String(); + jsonToValue(pName, pNameVal, L"String", L"String"); } delete pNameKey; - - } - } + + } +} - SamiTag::SamiTag(String* json) { - init(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiTag::SamiTag(String* json) { + init(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; +} - String - SamiTag::asJson () - { - JsonObject* pJsonObject = asJsonObject(); +String +SamiTag::asJson () +{ + JsonObject* pJsonObject = asJsonObject(); - char *pComposeBuf = new char[256]; - JsonWriter::Compose(pJsonObject, pComposeBuf, 256); - String s = String(pComposeBuf); + char *pComposeBuf = new char[256]; + JsonWriter::Compose(pJsonObject, pComposeBuf, 256); + String s = String(pComposeBuf); - delete pComposeBuf; - pJsonObject->RemoveAll(true); - delete pJsonObject; + delete pComposeBuf; + pJsonObject->RemoveAll(true); + delete pJsonObject; - return s; - } + return s; +} - JsonObject* - SamiTag::asJsonObject() { - JsonObject *pJsonObject = new JsonObject(); - pJsonObject->Construct(); +JsonObject* +SamiTag::asJsonObject() { + JsonObject *pJsonObject = new JsonObject(); + pJsonObject->Construct(); - JsonString *pIdKey = new JsonString(L"id"); - pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); + JsonString *pIdKey = new JsonString(L"id"); + pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); - JsonString *pNameKey = new JsonString(L"name"); - pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); + JsonString *pNameKey = new JsonString(L"name"); + pJsonObject->Add(pNameKey, toJson(getPName(), "String", "")); - return pJsonObject; - } + return pJsonObject; +} - - Long* - SamiTag::getPId() { - return pId; - } - void - SamiTag::setPId(Long* pId) { - this->pId = pId; - } +Long* +SamiTag::getPId() { + return pId; +} +void +SamiTag::setPId(Long* pId) { + this->pId = pId; +} - - String* - SamiTag::getPName() { - return pName; - } - void - SamiTag::setPName(String* pName) { - this->pName = pName; - } - - +String* +SamiTag::getPName() { + return pName; +} +void +SamiTag::setPName(String* pName) { + this->pName = pName; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiTag.h b/samples/client/petstore/tizen/client/SamiTag.h index caf113cc7fe..6521b0a6bed 100644 --- a/samples/client/petstore/tizen/client/SamiTag.h +++ b/samples/client/petstore/tizen/client/SamiTag.h @@ -1,64 +1,60 @@ /* -* SamiTag.h -* -* -*/ + * SamiTag.h + * + * + */ #ifndef SamiTag_H_ #define SamiTag_H_ -#include - - #include - - #include - - #include - - #include "SamiHelpers.h" - #include "SamiObject.h" +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" - using namespace Tizen::Web::Json; +using namespace Tizen::Web::Json; using Tizen::Base::Long; using Tizen::Base::String; - namespace Swagger { +namespace Swagger { - class SamiTag: public SamiObject { - public: +class SamiTag: public SamiObject { +public: SamiTag(); SamiTag(String* json); - virtual ~SamiTag(); + virtual ~SamiTag(); - void init(); + void init(); - void cleanup(); + void cleanup(); - String asJson (); + String asJson (); - JsonObject* asJsonObject(); + JsonObject* asJsonObject(); - void fromJsonObject(IJsonValue* json); + void fromJsonObject(IJsonValue* json); SamiTag* fromJson(String* obj); - Long* getPId(); - void setPId(Long* pId); + Long* getPId(); + void setPId(Long* pId); - String* getPName(); - void setPName(String* pName); + String* getPName(); + void setPName(String* pName); - private: +private: Long* pId; String* pName; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiTag_H_ */ +#endif /* SamiTag_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiUser.cpp b/samples/client/petstore/tizen/client/SamiUser.cpp index bf89570ffcc..916bec83d5a 100644 --- a/samples/client/petstore/tizen/client/SamiUser.cpp +++ b/samples/client/petstore/tizen/client/SamiUser.cpp @@ -1,28 +1,27 @@ - #include "SamiUser.h" - #include - +#include "SamiUser.h" +#include - using namespace Tizen::Base; - using namespace Tizen::System; - using namespace Tizen::Base::Utility; - using namespace Tizen::Base::Collection; - using namespace Tizen::Web::Json; - using namespace Tizen::Locales; +using namespace Tizen::Base; +using namespace Tizen::System; +using namespace Tizen::Base::Utility; +using namespace Tizen::Base::Collection; +using namespace Tizen::Web::Json; +using namespace Tizen::Locales; - namespace Swagger { +namespace Swagger { - SamiUser::SamiUser() { - init(); - } +SamiUser::SamiUser() { + init(); +} - SamiUser::~SamiUser() { - this->cleanup(); - } +SamiUser::~SamiUser() { + this->cleanup(); +} - void - SamiUser::init() { +void +SamiUser::init() { pId = null; pUsername = null; pFirstName = null; @@ -32,329 +31,320 @@ pPhone = null; pUserStatus = null; - } +} - void - SamiUser::cleanup() { +void +SamiUser::cleanup() { if(pId != null) { - + delete pId; - pId = null; - } + pId = null; + } if(pUsername != null) { - + delete pUsername; - pUsername = null; - } + pUsername = null; + } if(pFirstName != null) { - + delete pFirstName; - pFirstName = null; - } + pFirstName = null; + } if(pLastName != null) { - + delete pLastName; - pLastName = null; - } + pLastName = null; + } if(pEmail != null) { - + delete pEmail; - pEmail = null; - } + pEmail = null; + } if(pPassword != null) { - + delete pPassword; - pPassword = null; - } + pPassword = null; + } if(pPhone != null) { - + delete pPhone; - pPhone = null; - } + pPhone = null; + } if(pUserStatus != null) { - + delete pUserStatus; - pUserStatus = null; - } + pUserStatus = null; + } - } +} - SamiUser* - SamiUser::fromJson(String* json) { - this->cleanup(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiUser* +SamiUser::fromJson(String* json) { + this->cleanup(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - return this; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; + return this; +} - void - SamiUser::fromJsonObject(IJsonValue* pJson) { - JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); +void +SamiUser::fromJsonObject(IJsonValue* pJson) { + JsonObject* pJsonObject = static_cast< JsonObject* >(pJson); - if(pJsonObject != null) { - JsonString* pIdKey = new JsonString(L"id"); + if(pJsonObject != null) { + JsonString* pIdKey = new JsonString(L"id"); IJsonValue* pIdVal = null; pJsonObject->GetValue(pIdKey, pIdVal); if(pIdVal != null) { - - pId = new Long(); - jsonToValue(pId, pIdVal, L"Long", L"Long"); + + pId = new Long(); + jsonToValue(pId, pIdVal, L"Long", L"Long"); } delete pIdKey; - JsonString* pUsernameKey = new JsonString(L"username"); + JsonString* pUsernameKey = new JsonString(L"username"); IJsonValue* pUsernameVal = null; pJsonObject->GetValue(pUsernameKey, pUsernameVal); if(pUsernameVal != null) { - - pUsername = new String(); - jsonToValue(pUsername, pUsernameVal, L"String", L"String"); + + pUsername = new String(); + jsonToValue(pUsername, pUsernameVal, L"String", L"String"); } delete pUsernameKey; - JsonString* pFirstNameKey = new JsonString(L"firstName"); + JsonString* pFirstNameKey = new JsonString(L"firstName"); IJsonValue* pFirstNameVal = null; pJsonObject->GetValue(pFirstNameKey, pFirstNameVal); if(pFirstNameVal != null) { - - pFirstName = new String(); - jsonToValue(pFirstName, pFirstNameVal, L"String", L"String"); + + pFirstName = new String(); + jsonToValue(pFirstName, pFirstNameVal, L"String", L"String"); } delete pFirstNameKey; - JsonString* pLastNameKey = new JsonString(L"lastName"); + JsonString* pLastNameKey = new JsonString(L"lastName"); IJsonValue* pLastNameVal = null; pJsonObject->GetValue(pLastNameKey, pLastNameVal); if(pLastNameVal != null) { - - pLastName = new String(); - jsonToValue(pLastName, pLastNameVal, L"String", L"String"); + + pLastName = new String(); + jsonToValue(pLastName, pLastNameVal, L"String", L"String"); } delete pLastNameKey; - JsonString* pEmailKey = new JsonString(L"email"); + JsonString* pEmailKey = new JsonString(L"email"); IJsonValue* pEmailVal = null; pJsonObject->GetValue(pEmailKey, pEmailVal); if(pEmailVal != null) { - - pEmail = new String(); - jsonToValue(pEmail, pEmailVal, L"String", L"String"); + + pEmail = new String(); + jsonToValue(pEmail, pEmailVal, L"String", L"String"); } delete pEmailKey; - JsonString* pPasswordKey = new JsonString(L"password"); + JsonString* pPasswordKey = new JsonString(L"password"); IJsonValue* pPasswordVal = null; pJsonObject->GetValue(pPasswordKey, pPasswordVal); if(pPasswordVal != null) { - - pPassword = new String(); - jsonToValue(pPassword, pPasswordVal, L"String", L"String"); + + pPassword = new String(); + jsonToValue(pPassword, pPasswordVal, L"String", L"String"); } delete pPasswordKey; - JsonString* pPhoneKey = new JsonString(L"phone"); + JsonString* pPhoneKey = new JsonString(L"phone"); IJsonValue* pPhoneVal = null; pJsonObject->GetValue(pPhoneKey, pPhoneVal); if(pPhoneVal != null) { - - pPhone = new String(); - jsonToValue(pPhone, pPhoneVal, L"String", L"String"); + + pPhone = new String(); + jsonToValue(pPhone, pPhoneVal, L"String", L"String"); } delete pPhoneKey; - JsonString* pUserStatusKey = new JsonString(L"userStatus"); + JsonString* pUserStatusKey = new JsonString(L"userStatus"); IJsonValue* pUserStatusVal = null; pJsonObject->GetValue(pUserStatusKey, pUserStatusVal); if(pUserStatusVal != null) { - - pUserStatus = new Integer(); - jsonToValue(pUserStatus, pUserStatusVal, L"Integer", L"Integer"); + + pUserStatus = new Integer(); + jsonToValue(pUserStatus, pUserStatusVal, L"Integer", L"Integer"); } delete pUserStatusKey; - - } - } + + } +} - SamiUser::SamiUser(String* json) { - init(); - String str(json->GetPointer()); - int length = str.GetLength(); +SamiUser::SamiUser(String* json) { + init(); + String str(json->GetPointer()); + int length = str.GetLength(); - ByteBuffer buffer; - buffer.Construct(length); + ByteBuffer buffer; + buffer.Construct(length); - for (int i = 0; i < length; ++i) { - byte b = str[i]; - buffer.SetByte(b); - } + for (int i = 0; i < length; ++i) { + byte b = str[i]; + buffer.SetByte(b); + } - IJsonValue* pJson = JsonParser::ParseN(buffer); - fromJsonObject(pJson); - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - delete pJson; - } + IJsonValue* pJson = JsonParser::ParseN(buffer); + fromJsonObject(pJson); + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + delete pJson; +} - String - SamiUser::asJson () - { - JsonObject* pJsonObject = asJsonObject(); +String +SamiUser::asJson () +{ + JsonObject* pJsonObject = asJsonObject(); - char *pComposeBuf = new char[256]; - JsonWriter::Compose(pJsonObject, pComposeBuf, 256); - String s = String(pComposeBuf); + char *pComposeBuf = new char[256]; + JsonWriter::Compose(pJsonObject, pComposeBuf, 256); + String s = String(pComposeBuf); - delete pComposeBuf; - pJsonObject->RemoveAll(true); - delete pJsonObject; + delete pComposeBuf; + pJsonObject->RemoveAll(true); + delete pJsonObject; - return s; - } + return s; +} - JsonObject* - SamiUser::asJsonObject() { - JsonObject *pJsonObject = new JsonObject(); - pJsonObject->Construct(); +JsonObject* +SamiUser::asJsonObject() { + JsonObject *pJsonObject = new JsonObject(); + pJsonObject->Construct(); - JsonString *pIdKey = new JsonString(L"id"); - pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); + JsonString *pIdKey = new JsonString(L"id"); + pJsonObject->Add(pIdKey, toJson(getPId(), "Long", "")); - JsonString *pUsernameKey = new JsonString(L"username"); - pJsonObject->Add(pUsernameKey, toJson(getPUsername(), "String", "")); + JsonString *pUsernameKey = new JsonString(L"username"); + pJsonObject->Add(pUsernameKey, toJson(getPUsername(), "String", "")); - JsonString *pFirstNameKey = new JsonString(L"firstName"); - pJsonObject->Add(pFirstNameKey, toJson(getPFirstName(), "String", "")); + JsonString *pFirstNameKey = new JsonString(L"firstName"); + pJsonObject->Add(pFirstNameKey, toJson(getPFirstName(), "String", "")); - JsonString *pLastNameKey = new JsonString(L"lastName"); - pJsonObject->Add(pLastNameKey, toJson(getPLastName(), "String", "")); + JsonString *pLastNameKey = new JsonString(L"lastName"); + pJsonObject->Add(pLastNameKey, toJson(getPLastName(), "String", "")); - JsonString *pEmailKey = new JsonString(L"email"); - pJsonObject->Add(pEmailKey, toJson(getPEmail(), "String", "")); + JsonString *pEmailKey = new JsonString(L"email"); + pJsonObject->Add(pEmailKey, toJson(getPEmail(), "String", "")); - JsonString *pPasswordKey = new JsonString(L"password"); - pJsonObject->Add(pPasswordKey, toJson(getPPassword(), "String", "")); + JsonString *pPasswordKey = new JsonString(L"password"); + pJsonObject->Add(pPasswordKey, toJson(getPPassword(), "String", "")); - JsonString *pPhoneKey = new JsonString(L"phone"); - pJsonObject->Add(pPhoneKey, toJson(getPPhone(), "String", "")); + JsonString *pPhoneKey = new JsonString(L"phone"); + pJsonObject->Add(pPhoneKey, toJson(getPPhone(), "String", "")); - JsonString *pUserStatusKey = new JsonString(L"userStatus"); - pJsonObject->Add(pUserStatusKey, toJson(getPUserStatus(), "Integer", "")); + JsonString *pUserStatusKey = new JsonString(L"userStatus"); + pJsonObject->Add(pUserStatusKey, toJson(getPUserStatus(), "Integer", "")); - return pJsonObject; - } + return pJsonObject; +} - - Long* - SamiUser::getPId() { - return pId; - } - void - SamiUser::setPId(Long* pId) { - this->pId = pId; - } +Long* +SamiUser::getPId() { + return pId; +} +void +SamiUser::setPId(Long* pId) { + this->pId = pId; +} - - String* - SamiUser::getPUsername() { - return pUsername; - } - void - SamiUser::setPUsername(String* pUsername) { - this->pUsername = pUsername; - } +String* +SamiUser::getPUsername() { + return pUsername; +} +void +SamiUser::setPUsername(String* pUsername) { + this->pUsername = pUsername; +} - - String* - SamiUser::getPFirstName() { - return pFirstName; - } - void - SamiUser::setPFirstName(String* pFirstName) { - this->pFirstName = pFirstName; - } +String* +SamiUser::getPFirstName() { + return pFirstName; +} +void +SamiUser::setPFirstName(String* pFirstName) { + this->pFirstName = pFirstName; +} - - String* - SamiUser::getPLastName() { - return pLastName; - } - void - SamiUser::setPLastName(String* pLastName) { - this->pLastName = pLastName; - } +String* +SamiUser::getPLastName() { + return pLastName; +} +void +SamiUser::setPLastName(String* pLastName) { + this->pLastName = pLastName; +} - - String* - SamiUser::getPEmail() { - return pEmail; - } - void - SamiUser::setPEmail(String* pEmail) { - this->pEmail = pEmail; - } +String* +SamiUser::getPEmail() { + return pEmail; +} +void +SamiUser::setPEmail(String* pEmail) { + this->pEmail = pEmail; +} - - String* - SamiUser::getPPassword() { - return pPassword; - } - void - SamiUser::setPPassword(String* pPassword) { - this->pPassword = pPassword; - } +String* +SamiUser::getPPassword() { + return pPassword; +} +void +SamiUser::setPPassword(String* pPassword) { + this->pPassword = pPassword; +} - - String* - SamiUser::getPPhone() { - return pPhone; - } - void - SamiUser::setPPhone(String* pPhone) { - this->pPhone = pPhone; - } +String* +SamiUser::getPPhone() { + return pPhone; +} +void +SamiUser::setPPhone(String* pPhone) { + this->pPhone = pPhone; +} - - Integer* - SamiUser::getPUserStatus() { - return pUserStatus; - } - void - SamiUser::setPUserStatus(Integer* pUserStatus) { - this->pUserStatus = pUserStatus; - } - - +Integer* +SamiUser::getPUserStatus() { + return pUserStatus; +} +void +SamiUser::setPUserStatus(Integer* pUserStatus) { + this->pUserStatus = pUserStatus; +} - } /* namespace Swagger */ + +} /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiUser.h b/samples/client/petstore/tizen/client/SamiUser.h index d60b17dea72..90b0ede1064 100644 --- a/samples/client/petstore/tizen/client/SamiUser.h +++ b/samples/client/petstore/tizen/client/SamiUser.h @@ -1,78 +1,74 @@ /* -* SamiUser.h -* -* -*/ + * SamiUser.h + * + * + */ #ifndef SamiUser_H_ #define SamiUser_H_ -#include - - #include - - #include - - #include - - #include "SamiHelpers.h" - #include "SamiObject.h" +#include +#include +#include +#include +#include "SamiHelpers.h" +#include "SamiObject.h" - using namespace Tizen::Web::Json; +using namespace Tizen::Web::Json; +using Tizen::Base::Integer; using Tizen::Base::Long; using Tizen::Base::String; -using Tizen::Base::Integer; - namespace Swagger { +namespace Swagger { - class SamiUser: public SamiObject { - public: +class SamiUser: public SamiObject { +public: SamiUser(); SamiUser(String* json); - virtual ~SamiUser(); + virtual ~SamiUser(); - void init(); + void init(); - void cleanup(); + void cleanup(); - String asJson (); + String asJson (); - JsonObject* asJsonObject(); + JsonObject* asJsonObject(); - void fromJsonObject(IJsonValue* json); + void fromJsonObject(IJsonValue* json); SamiUser* fromJson(String* obj); - Long* getPId(); - void setPId(Long* pId); + Long* getPId(); + void setPId(Long* pId); - String* getPUsername(); - void setPUsername(String* pUsername); + String* getPUsername(); + void setPUsername(String* pUsername); - String* getPFirstName(); - void setPFirstName(String* pFirstName); + String* getPFirstName(); + void setPFirstName(String* pFirstName); - String* getPLastName(); - void setPLastName(String* pLastName); + String* getPLastName(); + void setPLastName(String* pLastName); - String* getPEmail(); - void setPEmail(String* pEmail); + String* getPEmail(); + void setPEmail(String* pEmail); - String* getPPassword(); - void setPPassword(String* pPassword); + String* getPPassword(); + void setPPassword(String* pPassword); - String* getPPhone(); - void setPPhone(String* pPhone); + String* getPPhone(); + void setPPhone(String* pPhone); - Integer* getPUserStatus(); - void setPUserStatus(Integer* pUserStatus); + Integer* getPUserStatus(); + void setPUserStatus(Integer* pUserStatus); - private: +private: Long* pId; String* pUsername; String* pFirstName; @@ -82,8 +78,8 @@ using Tizen::Base::Integer; String* pPhone; Integer* pUserStatus; - }; +}; - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiUser_H_ */ +#endif /* SamiUser_H_ */ diff --git a/samples/client/petstore/tizen/client/SamiUserApi.cpp b/samples/client/petstore/tizen/client/SamiUserApi.cpp index 2e277d4d8ba..7010ed6bac7 100644 --- a/samples/client/petstore/tizen/client/SamiUserApi.cpp +++ b/samples/client/petstore/tizen/client/SamiUserApi.cpp @@ -8,463 +8,454 @@ using namespace Tizen::Base; namespace Swagger { - SamiUserApi::SamiUserApi() { +SamiUserApi::SamiUserApi() { +} + +SamiUserApi::~SamiUserApi() { + +} + +void +createUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + + handler(error, null); + } +} + +void +SamiUserApi::createUserWithCompletion(SamiUser* body, void(*success)(SamiError*)) { + client = new SamiApiClient(); + + client->success(&createUserProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + + if(body != null) { + mBody = new String(body->asJson()); + headerParams->Add(new String("Content-Type"), new String("application/json")); + } + + + + String url(L"/user"); + + + + client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} + +void +createUsersWithArrayInputProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + + handler(error, null); + } +} + +void +SamiUserApi::createUsersWithArrayInputWithCompletion(IList* body, void(*success)(SamiError*)) { + client = new SamiApiClient(); + + client->success(&createUsersWithArrayInputProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + if(body != null) { + mBody = new String(""); + int sz = body->GetCount(); + for(int i = 0; i < sz; i++) { + SamiObject * obj = (SamiObject*)body->GetAt(i); + String json = obj->asJson(); + if(i > 0) + mBody->Append(","); + mBody->Append(json); } + mBody->Append("]"); + headerParams->Add(new String("Content-Type"), new String("application/json")); + } + + + - SamiUserApi::~SamiUserApi() { + String url(L"/user/createWithArray"); + + + client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} + +void +createUsersWithListInputProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + + handler(error, null); + } +} + +void +SamiUserApi::createUsersWithListInputWithCompletion(IList* body, void(*success)(SamiError*)) { + client = new SamiApiClient(); + + client->success(&createUsersWithListInputProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + if(body != null) { + mBody = new String(""); + int sz = body->GetCount(); + for(int i = 0; i < sz; i++) { + SamiObject * obj = (SamiObject*)body->GetAt(i); + String json = obj->asJson(); + if(i > 0) + mBody->Append(","); + mBody->Append(json); } + mBody->Append("]"); + headerParams->Add(new String("Content-Type"), new String("application/json")); + } + + + + String url(L"/user/createWithList"); + + + + client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} + +void +loginUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); + + String* out = new String(); + jsonToValue(out, pJson, L"String*", L"String"); + + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); + } + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); + } - void - createUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); - - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } - - void - SamiUserApi::createUserWithCompletion(SamiUser* body, void(*success)(SamiError*)) { - client = new SamiApiClient(); - - client->success(&createUserProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); - - - - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); - - - - String* mBody = null; - - - - - if(body != null) { - mBody = new String(body->asJson()); - headerParams->Add(new String("Content-Type"), new String("application/json")); - } - - - - String url(L"/user"); - - - - client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } - + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); - void - createUsersWithArrayInputProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +String* +SamiUserApi::loginUserWithCompletion(String* username, String* password, void (* success)(String*, SamiError*)) { + client = new SamiApiClient(); - void - SamiUserApi::createUsersWithArrayInputWithCompletion(IList* body, void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&loginUserProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&createUsersWithArrayInputProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + + queryParams->Add(new String("username"), username); + + + queryParams->Add(new String("password"), password); + + - + String* mBody = null; - String* mBody = null; + - - - if(body != null) { - mBody = new String(""); - int sz = body->GetCount(); - for(int i = 0; i < sz; i++) { - SamiObject * obj = (SamiObject*)body->GetAt(i); - String json = obj->asJson(); - if(i > 0) - mBody->Append(","); - mBody->Append(json); - } - mBody->Append("]"); - headerParams->Add(new String("Content-Type"), new String("application/json")); - } - - - + String url(L"/user/login"); - String url(L"/user/createWithArray"); + - + client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} - client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } +void +logoutUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - void - createUsersWithListInputProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + handler(error, null); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +void +SamiUserApi::logoutUserWithCompletion( void(*success)(SamiError*)) { + client = new SamiApiClient(); - void - SamiUserApi::createUsersWithListInputWithCompletion(IList* body, void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&logoutUserProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&createUsersWithListInputProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - + String* mBody = null; - String* mBody = null; + - - - if(body != null) { - mBody = new String(""); - int sz = body->GetCount(); - for(int i = 0; i < sz; i++) { - SamiObject * obj = (SamiObject*)body->GetAt(i); - String json = obj->asJson(); - if(i > 0) - mBody->Append(","); - mBody->Append(json); - } - mBody->Append("]"); - headerParams->Add(new String("Content-Type"), new String("application/json")); - } - - - + String url(L"/user/logout"); - String url(L"/user/createWithList"); + - + client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} - client->execute(SamiUserApi::getBasePath(), url, "POST", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } +void +getUserByNameProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); + + SamiUser* out = new SamiUser(); + jsonToValue(out, pJson, L"SamiUser*", L"SamiUser"); + + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); + } + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); + } - void - loginUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); - - if(code >= 200 && code < 300) { - ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); - IJsonValue* pJson = JsonParser::ParseN(*pBuffer); - - String* out = new String(); - jsonToValue(out, pJson, L"String*", L"String"); - - if (pJson) { - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - handler(out, null); - } - else { - SamiError* error = new SamiError(0, new String(L"No parsable response received")); - handler(null, error); - } - - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - handler(null, error); - - } - } - - String* - SamiUserApi::loginUserWithCompletion(String* username, String* password, void (* success)(String*, SamiError*)) { - client = new SamiApiClient(); - - client->success(&loginUserProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); - - - - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); - - - queryParams->Add(new String("username"), username); - - - queryParams->Add(new String("password"), password); - - - - String* mBody = null; - - - - String url(L"/user/login"); - - - - client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - return null; - } - + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); - void - logoutUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +SamiUser* +SamiUserApi::getUserByNameWithCompletion(String* username, void (* success)(SamiUser*, SamiError*)) { + client = new SamiApiClient(); - void - SamiUserApi::logoutUserWithCompletion( void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&getUserByNameProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&logoutUserProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - + String* mBody = null; - String* mBody = null; + - + String url(L"/user/{username}"); - String url(L"/user/logout"); + + String s_username(L"{"); + s_username.Append(L"username"); + s_username.Append(L"}"); + url.Replace(s_username, stringify(username, L"String*")); + - + client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} - client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } +void +updateUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - void - getUserByNameProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + handler(error, null); + } +} - if(code >= 200 && code < 300) { - ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); - IJsonValue* pJson = JsonParser::ParseN(*pBuffer); +void +SamiUserApi::updateUserWithCompletion(String* username, SamiUser* body, void(*success)(SamiError*)) { + client = new SamiApiClient(); - SamiUser* out = new SamiUser(); - jsonToValue(out, pJson, L"SamiUser*", L"SamiUser"); + client->success(&updateUserProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - if (pJson) { - if (pJson->GetType() == JSON_TYPE_OBJECT) { - JsonObject* pObject = static_cast< JsonObject* >(pJson); - pObject->RemoveAll(true); - } - else if (pJson->GetType() == JSON_TYPE_ARRAY) { - JsonArray* pArray = static_cast< JsonArray* >(pJson); - pArray->RemoveAll(true); - } - handler(out, null); - } - else { - SamiError* error = new SamiError(0, new String(L"No parsable response received")); - handler(null, error); - } - - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - handler(null, error); - - } - } + - SamiUser* - SamiUserApi::getUserByNameWithCompletion(String* username, void (* success)(SamiUser*, SamiError*)) { - client = new SamiApiClient(); + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - client->success(&getUserByNameProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + String* mBody = null; - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + + + + if(body != null) { + mBody = new String(body->asJson()); + headerParams->Add(new String("Content-Type"), new String("application/json")); + } + + - + String url(L"/user/{username}"); - String* mBody = null; + + String s_username(L"{"); + s_username.Append(L"username"); + s_username.Append(L"}"); + url.Replace(s_username, stringify(username, L"String*")); + - + client->execute(SamiUserApi::getBasePath(), url, "PUT", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} - String url(L"/user/{username}"); - - - String s_username(L"{"); - s_username.Append(L"username"); - s_username.Append(L"}"); - url.Replace(s_username, stringify(username, L"String*")); - - - client->execute(SamiUserApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - return null; - } +void +deleteUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + if(code >= 200 && code < 300) { + handler(null, null); + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - void - updateUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); + handler(error, null); + } +} - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } +void +SamiUserApi::deleteUserWithCompletion(String* username, void(*success)(SamiError*)) { + client = new SamiApiClient(); - void - SamiUserApi::updateUserWithCompletion(String* username, SamiUser* body, void(*success)(SamiError*)) { - client = new SamiApiClient(); + client->success(&deleteUserProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); - client->success(&updateUserProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); + - + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); + - + String* mBody = null; - String* mBody = null; + - - - - if(body != null) { - mBody = new String(body->asJson()); - headerParams->Add(new String("Content-Type"), new String("application/json")); - } - - + String url(L"/user/{username}"); - String url(L"/user/{username}"); + + String s_username(L"{"); + s_username.Append(L"username"); + s_username.Append(L"}"); + url.Replace(s_username, stringify(username, L"String*")); + - - String s_username(L"{"); - s_username.Append(L"username"); - s_username.Append(L"}"); - url.Replace(s_username, stringify(username, L"String*")); - + client->execute(SamiUserApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + +} - client->execute(SamiUserApi::getBasePath(), url, "PUT", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } - - - void - deleteUserProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { - int code = pHttpResponse->GetHttpStatusCode(); - - if(code >= 200 && code < 300) { - handler(null, null); - } - else { - SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); - - handler(error, null); - } - } - - void - SamiUserApi::deleteUserWithCompletion(String* username, void(*success)(SamiError*)) { - client = new SamiApiClient(); - - client->success(&deleteUserProcessor, (void(*)(void*, SamiError*))success); - HashMap* headerParams = new HashMap(SingleObjectDeleter); - headerParams->Construct(); - - - - HashMap* queryParams = new HashMap(SingleObjectDeleter); - queryParams->Construct(); - - - - String* mBody = null; - - - - String url(L"/user/{username}"); - - - String s_username(L"{"); - s_username.Append(L"username"); - s_username.Append(L"}"); - url.Replace(s_username, stringify(username, L"String*")); - - - client->execute(SamiUserApi::getBasePath(), url, "DELETE", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); - - } - - } /* namespace Swagger */ diff --git a/samples/client/petstore/tizen/client/SamiUserApi.h b/samples/client/petstore/tizen/client/SamiUserApi.h index 74f597d9f43..1b42e3bc3b1 100644 --- a/samples/client/petstore/tizen/client/SamiUserApi.h +++ b/samples/client/petstore/tizen/client/SamiUserApi.h @@ -1,65 +1,57 @@ #ifndef SamiUserApi_H_ #define SamiUserApi_H_ -#include - - #include "SamiApiClient.h" - #include "SamiError.h" +#include +#include "SamiApiClient.h" +#include "SamiError.h" - #include "SamiUser.h" - using Tizen::Base::Collection::IList; - using Tizen::Base::String; - +#include "SamiUser.h" +using Tizen::Base::Collection::IList; +using Tizen::Base::String; - using namespace Tizen::Net::Http; +using namespace Tizen::Net::Http; - namespace Swagger { +namespace Swagger { - - class SamiUserApi { - public: - SamiUserApi(); - virtual ~SamiUserApi(); +class SamiUserApi { +public: + SamiUserApi(); + virtual ~SamiUserApi(); - - void - createUserWithCompletion(SamiUser* body, void(* handler)(SamiError*)); - - void - createUsersWithArrayInputWithCompletion(IList* body, void(* handler)(SamiError*)); - - void - createUsersWithListInputWithCompletion(IList* body, void(* handler)(SamiError*)); - - String* - loginUserWithCompletion(String* username - , String* password, void (* handler)(String* - , SamiError*)); - - void - logoutUserWithCompletion( void(* handler)(SamiError*)); - - SamiUser* - getUserByNameWithCompletion(String* username, void (* handler)(SamiUser* - , SamiError*)); - - void - updateUserWithCompletion(String* username - , SamiUser* body, void(* handler)(SamiError*)); - - void - deleteUserWithCompletion(String* username, void(* handler)(SamiError*)); - - static String getBasePath() { - return L"http://petstore.swagger.io/v2"; - } + + void + createUserWithCompletion(SamiUser* body, void(* handler)(SamiError*)); + + void + createUsersWithArrayInputWithCompletion(IList* body, void(* handler)(SamiError*)); + + void + createUsersWithListInputWithCompletion(IList* body, void(* handler)(SamiError*)); + + String* + loginUserWithCompletion(String* username, String* password, void (* handler)(String*, SamiError*)); + + void + logoutUserWithCompletion( void(* handler)(SamiError*)); + + SamiUser* + getUserByNameWithCompletion(String* username, void (* handler)(SamiUser*, SamiError*)); + + void + updateUserWithCompletion(String* username, SamiUser* body, void(* handler)(SamiError*)); + + void + deleteUserWithCompletion(String* username, void(* handler)(SamiError*)); + + static String getBasePath() { + return L"http://petstore.swagger.io/v2"; + } - private: - SamiApiClient* client; - }; +private: + SamiApiClient* client; +}; - - } /* namespace Swagger */ +} /* namespace Swagger */ - #endif /* SamiUserApi_H_ */ +#endif /* SamiUserApi_H_ */ diff --git a/samples/dynamic-html/docs/assets/css/bootstrap-responsive.css b/samples/dynamic-html/docs/assets/css/bootstrap-responsive.css index 41580e0ea07..a3352d774ce 100644 --- a/samples/dynamic-html/docs/assets/css/bootstrap-responsive.css +++ b/samples/dynamic-html/docs/assets/css/bootstrap-responsive.css @@ -9,1319 +9,1084 @@ */ @-ms-viewport { - width: device-width; + width: device-width; } .clearfix { - *zoom: 1; + *zoom: 1; } .clearfix:before, .clearfix:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .clearfix:after { - clear: both; + clear: both; } .hide-text { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; } .input-block-level { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.hidden { + display: none; + visibility: hidden; +} + +.visible-phone { + display: none !important; +} + +.visible-tablet { + display: none !important; +} + +.hidden-desktop { + display: none !important; +} + +.visible-desktop { + display: inherit !important; +} + +@media (min-width: 768px) and (max-width: 979px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important ; + } + .visible-tablet { + display: inherit !important; + } + .hidden-tablet { + display: none !important; + } +} + +@media (max-width: 767px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important; + } + .visible-phone { + display: inherit !important; + } + .hidden-phone { + display: none !important; + } +} + +@media (min-width: 1200px) { + .row { + margin-left: -30px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 30px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 1170px; + } + .span12 { + width: 1170px; + } + .span11 { + width: 1070px; + } + .span10 { + width: 970px; + } + .span9 { + width: 870px; + } + .span8 { + width: 770px; + } + .span7 { + width: 670px; + } + .span6 { + width: 570px; + } + .span5 { + width: 470px; + } + .span4 { + width: 370px; + } + .span3 { + width: 270px; + } + .span2 { + width: 170px; + } + .span1 { + width: 70px; + } + .offset12 { + margin-left: 1230px; + } + .offset11 { + margin-left: 1130px; + } + .offset10 { + margin-left: 1030px; + } + .offset9 { + margin-left: 930px; + } + .offset8 { + margin-left: 830px; + } + .offset7 { + margin-left: 730px; + } + .offset6 { + margin-left: 630px; + } + .offset5 { + margin-left: 530px; + } + .offset4 { + margin-left: 430px; + } + .offset3 { + margin-left: 330px; + } + .offset2 { + margin-left: 230px; + } + .offset1 { + margin-left: 130px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.564102564102564%; + *margin-left: 2.5109110747408616%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.564102564102564%; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.45299145299145%; + *width: 91.39979996362975%; + } + .row-fluid .span10 { + width: 82.90598290598291%; + *width: 82.8527914166212%; + } + .row-fluid .span9 { + width: 74.35897435897436%; + *width: 74.30578286961266%; + } + .row-fluid .span8 { + width: 65.81196581196582%; + *width: 65.75877432260411%; + } + .row-fluid .span7 { + width: 57.26495726495726%; + *width: 57.21176577559556%; + } + .row-fluid .span6 { + width: 48.717948717948715%; + *width: 48.664757228587014%; + } + .row-fluid .span5 { + width: 40.17094017094017%; + *width: 40.11774868157847%; + } + .row-fluid .span4 { + width: 31.623931623931625%; + *width: 31.570740134569924%; + } + .row-fluid .span3 { + width: 23.076923076923077%; + *width: 23.023731587561375%; + } + .row-fluid .span2 { + width: 14.52991452991453%; + *width: 14.476723040552828%; + } + .row-fluid .span1 { + width: 5.982905982905983%; + *width: 5.929714493544281%; + } + .row-fluid .offset12 { + margin-left: 105.12820512820512%; + *margin-left: 105.02182214948171%; + } + .row-fluid .offset12:first-child { + margin-left: 102.56410256410257%; + *margin-left: 102.45771958537915%; + } + .row-fluid .offset11 { + margin-left: 96.58119658119658%; + *margin-left: 96.47481360247316%; + } + .row-fluid .offset11:first-child { + margin-left: 94.01709401709402%; + *margin-left: 93.91071103837061%; + } + .row-fluid .offset10 { + margin-left: 88.03418803418803%; + *margin-left: 87.92780505546462%; + } + .row-fluid .offset10:first-child { + margin-left: 85.47008547008548%; + *margin-left: 85.36370249136206%; + } + .row-fluid .offset9 { + margin-left: 79.48717948717949%; + *margin-left: 79.38079650845607%; + } + .row-fluid .offset9:first-child { + margin-left: 76.92307692307693%; + *margin-left: 76.81669394435352%; + } + .row-fluid .offset8 { + margin-left: 70.94017094017094%; + *margin-left: 70.83378796144753%; + } + .row-fluid .offset8:first-child { + margin-left: 68.37606837606839%; + *margin-left: 68.26968539734497%; + } + .row-fluid .offset7 { + margin-left: 62.393162393162385%; + *margin-left: 62.28677941443899%; + } + .row-fluid .offset7:first-child { + margin-left: 59.82905982905982%; + *margin-left: 59.72267685033642%; + } + .row-fluid .offset6 { + margin-left: 53.84615384615384%; + *margin-left: 53.739770867430444%; + } + .row-fluid .offset6:first-child { + margin-left: 51.28205128205128%; + *margin-left: 51.175668303327875%; + } + .row-fluid .offset5 { + margin-left: 45.299145299145295%; + *margin-left: 45.1927623204219%; + } + .row-fluid .offset5:first-child { + margin-left: 42.73504273504273%; + *margin-left: 42.62865975631933%; + } + .row-fluid .offset4 { + margin-left: 36.75213675213675%; + *margin-left: 36.645753773413354%; + } + .row-fluid .offset4:first-child { + margin-left: 34.18803418803419%; + *margin-left: 34.081651209310785%; + } + .row-fluid .offset3 { + margin-left: 28.205128205128204%; + *margin-left: 28.0987452264048%; + } + .row-fluid .offset3:first-child { + margin-left: 25.641025641025642%; + *margin-left: 25.53464266230224%; + } + .row-fluid .offset2 { + margin-left: 19.65811965811966%; + *margin-left: 19.551736679396257%; + } + .row-fluid .offset2:first-child { + margin-left: 17.094017094017094%; + *margin-left: 16.98763411529369%; + } + .row-fluid .offset1 { + margin-left: 11.11111111111111%; + *margin-left: 11.004728132387708%; + } + .row-fluid .offset1:first-child { + margin-left: 8.547008547008547%; + *margin-left: 8.440625568285142%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 30px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 1156px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 1056px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 956px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 856px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 756px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 656px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 556px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 456px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 356px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 256px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 156px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 56px; + } + .thumbnails { + margin-left: -30px; + } + .thumbnails > li { + margin-left: 30px; + } + .row-fluid .thumbnails { + margin-left: 0; + } +} + +@media (min-width: 768px) and (max-width: 979px) { + .row { + margin-left: -20px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 724px; + } + .span12 { + width: 724px; + } + .span11 { + width: 662px; + } + .span10 { + width: 600px; + } + .span9 { + width: 538px; + } + .span8 { + width: 476px; + } + .span7 { + width: 414px; + } + .span6 { + width: 352px; + } + .span5 { + width: 290px; + } + .span4 { + width: 228px; + } + .span3 { + width: 166px; + } + .span2 { + width: 104px; + } + .span1 { + width: 42px; + } + .offset12 { + margin-left: 764px; + } + .offset11 { + margin-left: 702px; + } + .offset10 { + margin-left: 640px; + } + .offset9 { + margin-left: 578px; + } + .offset8 { + margin-left: 516px; + } + .offset7 { + margin-left: 454px; + } + .offset6 { + margin-left: 392px; + } + .offset5 { + margin-left: 330px; + } + .offset4 { + margin-left: 268px; + } + .offset3 { + margin-left: 206px; + } + .offset2 { + margin-left: 144px; + } + .offset1 { + margin-left: 82px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.7624309392265194%; + *margin-left: 2.709239449864817%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.7624309392265194%; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.43646408839778%; + *width: 91.38327259903608%; + } + .row-fluid .span10 { + width: 82.87292817679558%; + *width: 82.81973668743387%; + } + .row-fluid .span9 { + width: 74.30939226519337%; + *width: 74.25620077583166%; + } + .row-fluid .span8 { + width: 65.74585635359117%; + *width: 65.69266486422946%; + } + .row-fluid .span7 { + width: 57.18232044198895%; + *width: 57.12912895262725%; + } + .row-fluid .span6 { + width: 48.61878453038674%; + *width: 48.56559304102504%; + } + .row-fluid .span5 { + width: 40.05524861878453%; + *width: 40.00205712942283%; + } + .row-fluid .span4 { + width: 31.491712707182323%; + *width: 31.43852121782062%; + } + .row-fluid .span3 { + width: 22.92817679558011%; + *width: 22.87498530621841%; + } + .row-fluid .span2 { + width: 14.3646408839779%; + *width: 14.311449394616199%; + } + .row-fluid .span1 { + width: 5.801104972375691%; + *width: 5.747913483013988%; + } + .row-fluid .offset12 { + margin-left: 105.52486187845304%; + *margin-left: 105.41847889972962%; + } + .row-fluid .offset12:first-child { + margin-left: 102.76243093922652%; + *margin-left: 102.6560479605031%; + } + .row-fluid .offset11 { + margin-left: 96.96132596685082%; + *margin-left: 96.8549429881274%; + } + .row-fluid .offset11:first-child { + margin-left: 94.1988950276243%; + *margin-left: 94.09251204890089%; + } + .row-fluid .offset10 { + margin-left: 88.39779005524862%; + *margin-left: 88.2914070765252%; + } + .row-fluid .offset10:first-child { + margin-left: 85.6353591160221%; + *margin-left: 85.52897613729868%; + } + .row-fluid .offset9 { + margin-left: 79.8342541436464%; + *margin-left: 79.72787116492299%; + } + .row-fluid .offset9:first-child { + margin-left: 77.07182320441989%; + *margin-left: 76.96544022569647%; + } + .row-fluid .offset8 { + margin-left: 71.2707182320442%; + *margin-left: 71.16433525332079%; + } + .row-fluid .offset8:first-child { + margin-left: 68.50828729281768%; + *margin-left: 68.40190431409427%; + } + .row-fluid .offset7 { + margin-left: 62.70718232044199%; + *margin-left: 62.600799341718584%; + } + .row-fluid .offset7:first-child { + margin-left: 59.94475138121547%; + *margin-left: 59.838368402492065%; + } + .row-fluid .offset6 { + margin-left: 54.14364640883978%; + *margin-left: 54.037263430116376%; + } + .row-fluid .offset6:first-child { + margin-left: 51.38121546961326%; + *margin-left: 51.27483249088986%; + } + .row-fluid .offset5 { + margin-left: 45.58011049723757%; + *margin-left: 45.47372751851417%; + } + .row-fluid .offset5:first-child { + margin-left: 42.81767955801105%; + *margin-left: 42.71129657928765%; + } + .row-fluid .offset4 { + margin-left: 37.01657458563536%; + *margin-left: 36.91019160691196%; + } + .row-fluid .offset4:first-child { + margin-left: 34.25414364640884%; + *margin-left: 34.14776066768544%; + } + .row-fluid .offset3 { + margin-left: 28.45303867403315%; + *margin-left: 28.346655695309746%; + } + .row-fluid .offset3:first-child { + margin-left: 25.69060773480663%; + *margin-left: 25.584224756083227%; + } + .row-fluid .offset2 { + margin-left: 19.88950276243094%; + *margin-left: 19.783119783707537%; + } + .row-fluid .offset2:first-child { + margin-left: 17.12707182320442%; + *margin-left: 17.02068884448102%; + } + .row-fluid .offset1 { + margin-left: 11.32596685082873%; + *margin-left: 11.219583872105325%; + } + .row-fluid .offset1:first-child { + margin-left: 8.56353591160221%; + *margin-left: 8.457152932878806%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 710px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 648px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 586px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 524px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 462px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 400px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 338px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 276px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 214px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 152px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 90px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 28px; + } +} + +@media (max-width: 767px) { + body { + padding-right: 20px; + padding-left: 20px; + } + .navbar-fixed-top, + .navbar-fixed-bottom, + .navbar-static-top { + margin-right: -20px; + margin-left: -20px; + } + .container-fluid { + padding: 0; + } + .dl-horizontal dt { + float: none; + width: auto; + clear: none; + text-align: left; + } + .dl-horizontal dd { + margin-left: 0; + } + .container { + width: auto; + } + .row-fluid { + width: 100%; + } + .row, + .thumbnails { + margin-left: 0; + } + .thumbnails > li { + float: none; + margin-left: 0; + } + [class*="span"], + .uneditable-input[class*="span"], + .row-fluid [class*="span"] { + display: block; + float: none; + width: 100%; + margin-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .span12, + .row-fluid .span12 { + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="offset"]:first-child { + margin-left: 0; + } + .input-large, + .input-xlarge, + .input-xxlarge, + input[class*="span"], + select[class*="span"], + textarea[class*="span"], + .uneditable-input { display: block; width: 100%; min-height: 30px; -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.hidden { - display: none; - visibility: hidden; -} - -.visible-phone { - display: none !important; -} - -.visible-tablet { - display: none !important; -} - -.hidden-desktop { - display: none !important; -} - -.visible-desktop { - display: inherit !important; -} - -@media (min-width: 768px) and (max-width: 979px) { - .hidden-desktop { - display: inherit !important; - } - - .visible-desktop { - display: none !important; - } - - .visible-tablet { - display: inherit !important; - } - - .hidden-tablet { - display: none !important; - } -} - -@media (max-width: 767px) { - .hidden-desktop { - display: inherit !important; - } - - .visible-desktop { - display: none !important; - } - - .visible-phone { - display: inherit !important; - } - - .hidden-phone { - display: none !important; - } -} - -@media (min-width: 1200px) { - .row { - margin-left: -30px; - *zoom: 1; - } - - .row:before, - .row:after { - display: table; - line-height: 0; - content: ""; - } - - .row:after { - clear: both; - } - - [class*="span"] { - float: left; - min-height: 1px; - margin-left: 30px; - } - - .container, - .navbar-static-top .container, - .navbar-fixed-top .container, - .navbar-fixed-bottom .container { - width: 1170px; - } - - .span12 { - width: 1170px; - } - - .span11 { - width: 1070px; - } - - .span10 { - width: 970px; - } - - .span9 { - width: 870px; - } - - .span8 { - width: 770px; - } - - .span7 { - width: 670px; - } - - .span6 { - width: 570px; - } - - .span5 { - width: 470px; - } - - .span4 { - width: 370px; - } - - .span3 { - width: 270px; - } - - .span2 { - width: 170px; - } - - .span1 { - width: 70px; - } - - .offset12 { - margin-left: 1230px; - } - - .offset11 { - margin-left: 1130px; - } - - .offset10 { - margin-left: 1030px; - } - - .offset9 { - margin-left: 930px; - } - - .offset8 { - margin-left: 830px; - } - - .offset7 { - margin-left: 730px; - } - - .offset6 { - margin-left: 630px; - } - - .offset5 { - margin-left: 530px; - } - - .offset4 { - margin-left: 430px; - } - - .offset3 { - margin-left: 330px; - } - - .offset2 { - margin-left: 230px; - } - - .offset1 { - margin-left: 130px; - } - - .row-fluid { - width: 100%; - *zoom: 1; - } - - .row-fluid:before, - .row-fluid:after { - display: table; - line-height: 0; - content: ""; - } - - .row-fluid:after { - clear: both; - } - - .row-fluid [class*="span"] { - display: block; - float: left; - width: 100%; - min-height: 30px; - margin-left: 2.564102564102564%; - *margin-left: 2.5109110747408616%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .row-fluid [class*="span"]:first-child { - margin-left: 0; - } - - .row-fluid .controls-row [class*="span"] + [class*="span"] { - margin-left: 2.564102564102564%; - } - - .row-fluid .span12 { - width: 100%; - *width: 99.94680851063829%; - } - - .row-fluid .span11 { - width: 91.45299145299145%; - *width: 91.39979996362975%; - } - - .row-fluid .span10 { - width: 82.90598290598291%; - *width: 82.8527914166212%; - } - - .row-fluid .span9 { - width: 74.35897435897436%; - *width: 74.30578286961266%; - } - - .row-fluid .span8 { - width: 65.81196581196582%; - *width: 65.75877432260411%; - } - - .row-fluid .span7 { - width: 57.26495726495726%; - *width: 57.21176577559556%; - } - - .row-fluid .span6 { - width: 48.717948717948715%; - *width: 48.664757228587014%; - } - - .row-fluid .span5 { - width: 40.17094017094017%; - *width: 40.11774868157847%; - } - - .row-fluid .span4 { - width: 31.623931623931625%; - *width: 31.570740134569924%; - } - - .row-fluid .span3 { - width: 23.076923076923077%; - *width: 23.023731587561375%; - } - - .row-fluid .span2 { - width: 14.52991452991453%; - *width: 14.476723040552828%; - } - - .row-fluid .span1 { - width: 5.982905982905983%; - *width: 5.929714493544281%; - } - - .row-fluid .offset12 { - margin-left: 105.12820512820512%; - *margin-left: 105.02182214948171%; - } - - .row-fluid .offset12:first-child { - margin-left: 102.56410256410257%; - *margin-left: 102.45771958537915%; - } - - .row-fluid .offset11 { - margin-left: 96.58119658119658%; - *margin-left: 96.47481360247316%; - } - - .row-fluid .offset11:first-child { - margin-left: 94.01709401709402%; - *margin-left: 93.91071103837061%; - } - - .row-fluid .offset10 { - margin-left: 88.03418803418803%; - *margin-left: 87.92780505546462%; - } - - .row-fluid .offset10:first-child { - margin-left: 85.47008547008548%; - *margin-left: 85.36370249136206%; - } - - .row-fluid .offset9 { - margin-left: 79.48717948717949%; - *margin-left: 79.38079650845607%; - } - - .row-fluid .offset9:first-child { - margin-left: 76.92307692307693%; - *margin-left: 76.81669394435352%; - } - - .row-fluid .offset8 { - margin-left: 70.94017094017094%; - *margin-left: 70.83378796144753%; - } - - .row-fluid .offset8:first-child { - margin-left: 68.37606837606839%; - *margin-left: 68.26968539734497%; - } - - .row-fluid .offset7 { - margin-left: 62.393162393162385%; - *margin-left: 62.28677941443899%; - } - - .row-fluid .offset7:first-child { - margin-left: 59.82905982905982%; - *margin-left: 59.72267685033642%; - } - - .row-fluid .offset6 { - margin-left: 53.84615384615384%; - *margin-left: 53.739770867430444%; - } - - .row-fluid .offset6:first-child { - margin-left: 51.28205128205128%; - *margin-left: 51.175668303327875%; - } - - .row-fluid .offset5 { - margin-left: 45.299145299145295%; - *margin-left: 45.1927623204219%; - } - - .row-fluid .offset5:first-child { - margin-left: 42.73504273504273%; - *margin-left: 42.62865975631933%; - } - - .row-fluid .offset4 { - margin-left: 36.75213675213675%; - *margin-left: 36.645753773413354%; - } - - .row-fluid .offset4:first-child { - margin-left: 34.18803418803419%; - *margin-left: 34.081651209310785%; - } - - .row-fluid .offset3 { - margin-left: 28.205128205128204%; - *margin-left: 28.0987452264048%; - } - - .row-fluid .offset3:first-child { - margin-left: 25.641025641025642%; - *margin-left: 25.53464266230224%; - } - - .row-fluid .offset2 { - margin-left: 19.65811965811966%; - *margin-left: 19.551736679396257%; - } - - .row-fluid .offset2:first-child { - margin-left: 17.094017094017094%; - *margin-left: 16.98763411529369%; - } - - .row-fluid .offset1 { - margin-left: 11.11111111111111%; - *margin-left: 11.004728132387708%; - } - - .row-fluid .offset1:first-child { - margin-left: 8.547008547008547%; - *margin-left: 8.440625568285142%; - } - - input, - textarea, - .uneditable-input { - margin-left: 0; - } - - .controls-row [class*="span"] + [class*="span"] { - margin-left: 30px; - } - - input.span12, - textarea.span12, - .uneditable-input.span12 { - width: 1156px; - } - - input.span11, - textarea.span11, - .uneditable-input.span11 { - width: 1056px; - } - - input.span10, - textarea.span10, - .uneditable-input.span10 { - width: 956px; - } - - input.span9, - textarea.span9, - .uneditable-input.span9 { - width: 856px; - } - - input.span8, - textarea.span8, - .uneditable-input.span8 { - width: 756px; - } - - input.span7, - textarea.span7, - .uneditable-input.span7 { - width: 656px; - } - - input.span6, - textarea.span6, - .uneditable-input.span6 { - width: 556px; - } - - input.span5, - textarea.span5, - .uneditable-input.span5 { - width: 456px; - } - - input.span4, - textarea.span4, - .uneditable-input.span4 { - width: 356px; - } - - input.span3, - textarea.span3, - .uneditable-input.span3 { - width: 256px; - } - - input.span2, - textarea.span2, - .uneditable-input.span2 { - width: 156px; - } - - input.span1, - textarea.span1, - .uneditable-input.span1 { - width: 56px; - } - - .thumbnails { - margin-left: -30px; - } - - .thumbnails > li { - margin-left: 30px; - } - - .row-fluid .thumbnails { - margin-left: 0; - } -} - -@media (min-width: 768px) and (max-width: 979px) { - .row { - margin-left: -20px; - *zoom: 1; - } - - .row:before, - .row:after { - display: table; - line-height: 0; - content: ""; - } - - .row:after { - clear: both; - } - - [class*="span"] { - float: left; - min-height: 1px; - margin-left: 20px; - } - - .container, - .navbar-static-top .container, - .navbar-fixed-top .container, - .navbar-fixed-bottom .container { - width: 724px; - } - - .span12 { - width: 724px; - } - - .span11 { - width: 662px; - } - - .span10 { - width: 600px; - } - - .span9 { - width: 538px; - } - - .span8 { - width: 476px; - } - - .span7 { - width: 414px; - } - - .span6 { - width: 352px; - } - - .span5 { - width: 290px; - } - - .span4 { - width: 228px; - } - - .span3 { - width: 166px; - } - - .span2 { - width: 104px; - } - - .span1 { - width: 42px; - } - - .offset12 { - margin-left: 764px; - } - - .offset11 { - margin-left: 702px; - } - - .offset10 { - margin-left: 640px; - } - - .offset9 { - margin-left: 578px; - } - - .offset8 { - margin-left: 516px; - } - - .offset7 { - margin-left: 454px; - } - - .offset6 { - margin-left: 392px; - } - - .offset5 { - margin-left: 330px; - } - - .offset4 { - margin-left: 268px; - } - - .offset3 { - margin-left: 206px; - } - - .offset2 { - margin-left: 144px; - } - - .offset1 { - margin-left: 82px; - } - - .row-fluid { - width: 100%; - *zoom: 1; - } - - .row-fluid:before, - .row-fluid:after { - display: table; - line-height: 0; - content: ""; - } - - .row-fluid:after { - clear: both; - } - - .row-fluid [class*="span"] { - display: block; - float: left; - width: 100%; - min-height: 30px; - margin-left: 2.7624309392265194%; - *margin-left: 2.709239449864817%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .row-fluid [class*="span"]:first-child { - margin-left: 0; - } - - .row-fluid .controls-row [class*="span"] + [class*="span"] { - margin-left: 2.7624309392265194%; - } - - .row-fluid .span12 { - width: 100%; - *width: 99.94680851063829%; - } - - .row-fluid .span11 { - width: 91.43646408839778%; - *width: 91.38327259903608%; - } - - .row-fluid .span10 { - width: 82.87292817679558%; - *width: 82.81973668743387%; - } - - .row-fluid .span9 { - width: 74.30939226519337%; - *width: 74.25620077583166%; - } - - .row-fluid .span8 { - width: 65.74585635359117%; - *width: 65.69266486422946%; - } - - .row-fluid .span7 { - width: 57.18232044198895%; - *width: 57.12912895262725%; - } - - .row-fluid .span6 { - width: 48.61878453038674%; - *width: 48.56559304102504%; - } - - .row-fluid .span5 { - width: 40.05524861878453%; - *width: 40.00205712942283%; - } - - .row-fluid .span4 { - width: 31.491712707182323%; - *width: 31.43852121782062%; - } - - .row-fluid .span3 { - width: 22.92817679558011%; - *width: 22.87498530621841%; - } - - .row-fluid .span2 { - width: 14.3646408839779%; - *width: 14.311449394616199%; - } - - .row-fluid .span1 { - width: 5.801104972375691%; - *width: 5.747913483013988%; - } - - .row-fluid .offset12 { - margin-left: 105.52486187845304%; - *margin-left: 105.41847889972962%; - } - - .row-fluid .offset12:first-child { - margin-left: 102.76243093922652%; - *margin-left: 102.6560479605031%; - } - - .row-fluid .offset11 { - margin-left: 96.96132596685082%; - *margin-left: 96.8549429881274%; - } - - .row-fluid .offset11:first-child { - margin-left: 94.1988950276243%; - *margin-left: 94.09251204890089%; - } - - .row-fluid .offset10 { - margin-left: 88.39779005524862%; - *margin-left: 88.2914070765252%; - } - - .row-fluid .offset10:first-child { - margin-left: 85.6353591160221%; - *margin-left: 85.52897613729868%; - } - - .row-fluid .offset9 { - margin-left: 79.8342541436464%; - *margin-left: 79.72787116492299%; - } - - .row-fluid .offset9:first-child { - margin-left: 77.07182320441989%; - *margin-left: 76.96544022569647%; - } - - .row-fluid .offset8 { - margin-left: 71.2707182320442%; - *margin-left: 71.16433525332079%; - } - - .row-fluid .offset8:first-child { - margin-left: 68.50828729281768%; - *margin-left: 68.40190431409427%; - } - - .row-fluid .offset7 { - margin-left: 62.70718232044199%; - *margin-left: 62.600799341718584%; - } - - .row-fluid .offset7:first-child { - margin-left: 59.94475138121547%; - *margin-left: 59.838368402492065%; - } - - .row-fluid .offset6 { - margin-left: 54.14364640883978%; - *margin-left: 54.037263430116376%; - } - - .row-fluid .offset6:first-child { - margin-left: 51.38121546961326%; - *margin-left: 51.27483249088986%; - } - - .row-fluid .offset5 { - margin-left: 45.58011049723757%; - *margin-left: 45.47372751851417%; - } - - .row-fluid .offset5:first-child { - margin-left: 42.81767955801105%; - *margin-left: 42.71129657928765%; - } - - .row-fluid .offset4 { - margin-left: 37.01657458563536%; - *margin-left: 36.91019160691196%; - } - - .row-fluid .offset4:first-child { - margin-left: 34.25414364640884%; - *margin-left: 34.14776066768544%; - } - - .row-fluid .offset3 { - margin-left: 28.45303867403315%; - *margin-left: 28.346655695309746%; - } - - .row-fluid .offset3:first-child { - margin-left: 25.69060773480663%; - *margin-left: 25.584224756083227%; - } - - .row-fluid .offset2 { - margin-left: 19.88950276243094%; - *margin-left: 19.783119783707537%; - } - - .row-fluid .offset2:first-child { - margin-left: 17.12707182320442%; - *margin-left: 17.02068884448102%; - } - - .row-fluid .offset1 { - margin-left: 11.32596685082873%; - *margin-left: 11.219583872105325%; - } - - .row-fluid .offset1:first-child { - margin-left: 8.56353591160221%; - *margin-left: 8.457152932878806%; - } - - input, - textarea, - .uneditable-input { - margin-left: 0; - } - - .controls-row [class*="span"] + [class*="span"] { - margin-left: 20px; - } - - input.span12, - textarea.span12, - .uneditable-input.span12 { - width: 710px; - } - - input.span11, - textarea.span11, - .uneditable-input.span11 { - width: 648px; - } - - input.span10, - textarea.span10, - .uneditable-input.span10 { - width: 586px; - } - - input.span9, - textarea.span9, - .uneditable-input.span9 { - width: 524px; - } - - input.span8, - textarea.span8, - .uneditable-input.span8 { - width: 462px; - } - - input.span7, - textarea.span7, - .uneditable-input.span7 { - width: 400px; - } - - input.span6, - textarea.span6, - .uneditable-input.span6 { - width: 338px; - } - - input.span5, - textarea.span5, - .uneditable-input.span5 { - width: 276px; - } - - input.span4, - textarea.span4, - .uneditable-input.span4 { - width: 214px; - } - - input.span3, - textarea.span3, - .uneditable-input.span3 { - width: 152px; - } - - input.span2, - textarea.span2, - .uneditable-input.span2 { - width: 90px; - } - - input.span1, - textarea.span1, - .uneditable-input.span1 { - width: 28px; - } -} - -@media (max-width: 767px) { - body { - padding-right: 20px; - padding-left: 20px; - } - - .navbar-fixed-top, - .navbar-fixed-bottom, - .navbar-static-top { - margin-right: -20px; - margin-left: -20px; - } - - .container-fluid { - padding: 0; - } - - .dl-horizontal dt { - float: none; - width: auto; - clear: none; - text-align: left; - } - - .dl-horizontal dd { - margin-left: 0; - } - - .container { - width: auto; - } - - .row-fluid { - width: 100%; - } - - .row, - .thumbnails { - margin-left: 0; - } - - .thumbnails > li { - float: none; - margin-left: 0; - } - - [class*="span"], - .uneditable-input[class*="span"], - .row-fluid [class*="span"] { - display: block; - float: none; - width: 100%; - margin-left: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .span12, - .row-fluid .span12 { - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .row-fluid [class*="offset"]:first-child { - margin-left: 0; - } - - .input-large, - .input-xlarge, - .input-xxlarge, - input[class*="span"], - select[class*="span"], - textarea[class*="span"], - .uneditable-input { - display: block; - width: 100%; - min-height: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - .input-prepend input, - .input-append input, - .input-prepend input[class*="span"], - .input-append input[class*="span"] { - display: inline-block; - width: auto; - } - - .controls-row [class*="span"] + [class*="span"] { - margin-left: 0; - } - - .modal { - position: fixed; - top: 20px; - right: 20px; - left: 20px; - width: auto; - margin: 0; - } - - .modal.fade { - top: -100px; - } - - .modal.fade.in { - top: 20px; - } + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .input-prepend input, + .input-append input, + .input-prepend input[class*="span"], + .input-append input[class*="span"] { + display: inline-block; + width: auto; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 0; + } + .modal { + position: fixed; + top: 20px; + right: 20px; + left: 20px; + width: auto; + margin: 0; + } + .modal.fade { + top: -100px; + } + .modal.fade.in { + top: 20px; + } } @media (max-width: 480px) { - .nav-collapse { - -webkit-transform: translate3d(0, 0, 0); - } - - .page-header h1 small { - display: block; - line-height: 20px; - } - - input[type="checkbox"], - input[type="radio"] { - border: 1px solid #ccc; - } - - .form-horizontal .control-label { - float: none; - width: auto; - padding-top: 0; - text-align: left; - } - - .form-horizontal .controls { - margin-left: 0; - } - - .form-horizontal .control-list { - padding-top: 0; - } - - .form-horizontal .form-actions { - padding-right: 10px; - padding-left: 10px; - } - - .media .pull-left, - .media .pull-right { - display: block; - float: none; - margin-bottom: 10px; - } - - .media-object { - margin-right: 0; - margin-left: 0; - } - - .modal { - top: 10px; - right: 10px; - left: 10px; - } - - .modal-header .close { - padding: 10px; - margin: -10px; - } - - .carousel-caption { - position: static; - } + .nav-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 20px; + } + input[type="checkbox"], + input[type="radio"] { + border: 1px solid #ccc; + } + .form-horizontal .control-label { + float: none; + width: auto; + padding-top: 0; + text-align: left; + } + .form-horizontal .controls { + margin-left: 0; + } + .form-horizontal .control-list { + padding-top: 0; + } + .form-horizontal .form-actions { + padding-right: 10px; + padding-left: 10px; + } + .media .pull-left, + .media .pull-right { + display: block; + float: none; + margin-bottom: 10px; + } + .media-object { + margin-right: 0; + margin-left: 0; + } + .modal { + top: 10px; + right: 10px; + left: 10px; + } + .modal-header .close { + padding: 10px; + margin: -10px; + } + .carousel-caption { + position: static; + } } @media (max-width: 979px) { - body { - padding-top: 0; - } - - .navbar-fixed-top, - .navbar-fixed-bottom { - position: static; - } - - .navbar-fixed-top { - margin-bottom: 20px; - } - - .navbar-fixed-bottom { - margin-top: 20px; - } - - .navbar-fixed-top .navbar-inner, - .navbar-fixed-bottom .navbar-inner { - padding: 5px; - } - - .navbar .container { - width: auto; - padding: 0; - } - - .navbar .brand { - padding-right: 10px; - padding-left: 10px; - margin: 0 0 0 -5px; - } - - .nav-collapse { - clear: both; - } - - .nav-collapse .nav { - float: none; - margin: 0 0 10px; - } - - .nav-collapse .nav > li { - float: none; - } - - .nav-collapse .nav > li > a { - margin-bottom: 2px; - } - - .nav-collapse .nav > .divider-vertical { - display: none; - } - - .nav-collapse .nav .nav-header { - color: #777777; - text-shadow: none; - } - - .nav-collapse .nav > li > a, - .nav-collapse .dropdown-menu a { - padding: 9px 15px; - font-weight: bold; - color: #777777; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - } - - .nav-collapse .btn { - padding: 4px 10px 4px; - font-weight: normal; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - } - - .nav-collapse .dropdown-menu li + li a { - margin-bottom: 2px; - } - - .nav-collapse .nav > li > a:hover, - .nav-collapse .dropdown-menu a:hover { - background-color: #f2f2f2; - } - - .navbar-inverse .nav-collapse .nav > li > a, - .navbar-inverse .nav-collapse .dropdown-menu a { - color: #999999; - } - - .navbar-inverse .nav-collapse .nav > li > a:hover, - .navbar-inverse .nav-collapse .dropdown-menu a:hover { - background-color: #111111; - } - - .nav-collapse.in .btn-group { - padding: 0; - margin-top: 5px; - } - - .nav-collapse .dropdown-menu { - position: static; - top: auto; - left: auto; - display: none; - float: none; - max-width: none; - padding: 0; - margin: 0 15px; - background-color: transparent; - border: none; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - } - - .nav-collapse .open > .dropdown-menu { - display: block; - } - - .nav-collapse .dropdown-menu:before, - .nav-collapse .dropdown-menu:after { - display: none; - } - - .nav-collapse .dropdown-menu .divider { - display: none; - } - - .nav-collapse .nav > li > .dropdown-menu:before, - .nav-collapse .nav > li > .dropdown-menu:after { - display: none; - } - - .nav-collapse .navbar-form, - .nav-collapse .navbar-search { - float: none; - padding: 10px 15px; - margin: 10px 0; - border-top: 1px solid #f2f2f2; - border-bottom: 1px solid #f2f2f2; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); - } - - .navbar-inverse .nav-collapse .navbar-form, - .navbar-inverse .nav-collapse .navbar-search { - border-top-color: #111111; - border-bottom-color: #111111; - } - - .navbar .nav-collapse .nav.pull-right { - float: none; - margin-left: 0; - } - - .nav-collapse, - .nav-collapse.collapse { - height: 0; - overflow: hidden; - } - - .navbar .btn-navbar { - display: block; - } - - .navbar-static .navbar-inner { - padding-right: 10px; - padding-left: 10px; - } + body { + padding-top: 0; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + position: static; + } + .navbar-fixed-top { + margin-bottom: 20px; + } + .navbar-fixed-bottom { + margin-top: 20px; + } + .navbar-fixed-top .navbar-inner, + .navbar-fixed-bottom .navbar-inner { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + .navbar .brand { + padding-right: 10px; + padding-left: 10px; + margin: 0 0 0 -5px; + } + .nav-collapse { + clear: both; + } + .nav-collapse .nav { + float: none; + margin: 0 0 10px; + } + .nav-collapse .nav > li { + float: none; + } + .nav-collapse .nav > li > a { + margin-bottom: 2px; + } + .nav-collapse .nav > .divider-vertical { + display: none; + } + .nav-collapse .nav .nav-header { + color: #777777; + text-shadow: none; + } + .nav-collapse .nav > li > a, + .nav-collapse .dropdown-menu a { + padding: 9px 15px; + font-weight: bold; + color: #777777; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + .nav-collapse .btn { + padding: 4px 10px 4px; + font-weight: normal; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + } + .nav-collapse .dropdown-menu li + li a { + margin-bottom: 2px; + } + .nav-collapse .nav > li > a:hover, + .nav-collapse .dropdown-menu a:hover { + background-color: #f2f2f2; + } + .navbar-inverse .nav-collapse .nav > li > a, + .navbar-inverse .nav-collapse .dropdown-menu a { + color: #999999; + } + .navbar-inverse .nav-collapse .nav > li > a:hover, + .navbar-inverse .nav-collapse .dropdown-menu a:hover { + background-color: #111111; + } + .nav-collapse.in .btn-group { + padding: 0; + margin-top: 5px; + } + .nav-collapse .dropdown-menu { + position: static; + top: auto; + left: auto; + display: none; + float: none; + max-width: none; + padding: 0; + margin: 0 15px; + background-color: transparent; + border: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + .nav-collapse .open > .dropdown-menu { + display: block; + } + .nav-collapse .dropdown-menu:before, + .nav-collapse .dropdown-menu:after { + display: none; + } + .nav-collapse .dropdown-menu .divider { + display: none; + } + .nav-collapse .nav > li > .dropdown-menu:before, + .nav-collapse .nav > li > .dropdown-menu:after { + display: none; + } + .nav-collapse .navbar-form, + .nav-collapse .navbar-search { + float: none; + padding: 10px 15px; + margin: 10px 0; + border-top: 1px solid #f2f2f2; + border-bottom: 1px solid #f2f2f2; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + } + .navbar-inverse .nav-collapse .navbar-form, + .navbar-inverse .nav-collapse .navbar-search { + border-top-color: #111111; + border-bottom-color: #111111; + } + .navbar .nav-collapse .nav.pull-right { + float: none; + margin-left: 0; + } + .nav-collapse, + .nav-collapse.collapse { + height: 0; + overflow: hidden; + } + .navbar .btn-navbar { + display: block; + } + .navbar-static .navbar-inner { + padding-right: 10px; + padding-left: 10px; + } } @media (min-width: 980px) { - .nav-collapse.collapse { - height: auto !important; - overflow: visible !important; - } + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } } diff --git a/samples/dynamic-html/docs/assets/css/bootstrap.css b/samples/dynamic-html/docs/assets/css/bootstrap.css index bbe32a8627b..db3b3bfd6a0 100644 --- a/samples/dynamic-html/docs/assets/css/bootstrap.css +++ b/samples/dynamic-html/docs/assets/css/bootstrap.css @@ -18,95 +18,95 @@ header, hgroup, nav, section { - display: block; + display: block; } audio, canvas, video { - display: inline-block; - *display: inline; - *zoom: 1; + display: inline-block; + *display: inline; + *zoom: 1; } audio:not([controls]) { - display: none; + display: none; } html { - font-size: 100%; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; } a:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } a:hover, a:active { - outline: 0; + outline: 0; } sub, sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; } sup { - top: -0.5em; + top: -0.5em; } sub { - bottom: -0.25em; + bottom: -0.25em; } img { - width: auto \9; - height: auto; - max-width: 100%; - vertical-align: middle; - border: 0; - -ms-interpolation-mode: bicubic; + width: auto\9; + height: auto; + max-width: 100%; + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; } #map_canvas img, .google-maps img { - max-width: none; + max-width: none; } button, input, select, textarea { - margin: 0; - font-size: 100%; - vertical-align: middle; + margin: 0; + font-size: 100%; + vertical-align: middle; } button, input { - *overflow: visible; - line-height: normal; + *overflow: visible; + line-height: normal; } button::-moz-focus-inner, input::-moz-focus-inner { - padding: 0; - border: 0; + padding: 0; + border: 0; } button, html input[type="button"], input[type="reset"], input[type="submit"] { - cursor: pointer; - -webkit-appearance: button; + cursor: pointer; + -webkit-appearance: button; } label, @@ -117,612 +117,601 @@ input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] { - cursor: pointer; + cursor: pointer; } input[type="search"] { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - -webkit-appearance: textfield; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; } input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { - -webkit-appearance: none; + -webkit-appearance: none; } textarea { - overflow: auto; - vertical-align: top; + overflow: auto; + vertical-align: top; } @media print { - * { - color: #000 !important; - text-shadow: none !important; - background: transparent !important; - box-shadow: none !important; - } - - a, - a:visited { - text-decoration: underline; - } - - a[href]:after { - content: " (" attr(href) ")"; - } - - abbr[title]:after { - content: " (" attr(title) ")"; - } - - .ir a:after, - a[href^="javascript:"]:after, - a[href^="#"]:after { - content: ""; - } - - pre, - blockquote { - border: 1px solid #999; - page-break-inside: avoid; - } - - thead { - display: table-header-group; - } - - tr, - img { - page-break-inside: avoid; - } - - img { - max-width: 100% !important; - } - - @page { - margin: 0.5cm; - } - - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - - h2, - h3 { - page-break-after: avoid; - } + * { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + @page { + margin: 0.5cm; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } } .clearfix { - *zoom: 1; + *zoom: 1; } .clearfix:before, .clearfix:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .clearfix:after { - clear: both; + clear: both; } .hide-text { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; } .input-block-level { - display: block; - width: 100%; - min-height: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } body { - margin: 0; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 20px; - color: #333333; - background-color: #ffffff; + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 20px; + color: #333333; + background-color: #ffffff; } a { - color: #0088cc; - text-decoration: none; + color: #0088cc; + text-decoration: none; } a:hover { - color: #005580; - text-decoration: underline; + color: #005580; + text-decoration: underline; } .img-rounded { - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .img-polaroid { - padding: 4px; - background-color: #fff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + padding: 4px; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } .img-circle { - -webkit-border-radius: 500px; - -moz-border-radius: 500px; - border-radius: 500px; + -webkit-border-radius: 500px; + -moz-border-radius: 500px; + border-radius: 500px; } .row { - margin-left: -20px; - *zoom: 1; + margin-left: -20px; + *zoom: 1; } .row:before, .row:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .row:after { - clear: both; + clear: both; } [class*="span"] { - float: left; - min-height: 1px; - margin-left: 20px; + float: left; + min-height: 1px; + margin-left: 20px; } .container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { - width: 940px; + width: 940px; } .span12 { - width: 940px; + width: 940px; } .span11 { - width: 860px; + width: 860px; } .span10 { - width: 780px; + width: 780px; } .span9 { - width: 700px; + width: 700px; } .span8 { - width: 620px; + width: 620px; } .span7 { - width: 540px; + width: 540px; } .span6 { - width: 460px; + width: 460px; } .span5 { - width: 380px; + width: 380px; } .span4 { - width: 300px; + width: 300px; } .span3 { - width: 220px; + width: 220px; } .span2 { - width: 140px; + width: 140px; } .span1 { - width: 60px; + width: 60px; } .offset12 { - margin-left: 980px; + margin-left: 980px; } .offset11 { - margin-left: 900px; + margin-left: 900px; } .offset10 { - margin-left: 820px; + margin-left: 820px; } .offset9 { - margin-left: 740px; + margin-left: 740px; } .offset8 { - margin-left: 660px; + margin-left: 660px; } .offset7 { - margin-left: 580px; + margin-left: 580px; } .offset6 { - margin-left: 500px; + margin-left: 500px; } .offset5 { - margin-left: 420px; + margin-left: 420px; } .offset4 { - margin-left: 340px; + margin-left: 340px; } .offset3 { - margin-left: 260px; + margin-left: 260px; } .offset2 { - margin-left: 180px; + margin-left: 180px; } .offset1 { - margin-left: 100px; + margin-left: 100px; } .row-fluid { - width: 100%; - *zoom: 1; + width: 100%; + *zoom: 1; } .row-fluid:before, .row-fluid:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .row-fluid:after { - clear: both; + clear: both; } .row-fluid [class*="span"] { - display: block; - float: left; - width: 100%; - min-height: 30px; - margin-left: 2.127659574468085%; - *margin-left: 2.074468085106383%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.127659574468085%; + *margin-left: 2.074468085106383%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } .row-fluid [class*="span"]:first-child { - margin-left: 0; + margin-left: 0; } .row-fluid .controls-row [class*="span"] + [class*="span"] { - margin-left: 2.127659574468085%; + margin-left: 2.127659574468085%; } .row-fluid .span12 { - width: 100%; - *width: 99.94680851063829%; + width: 100%; + *width: 99.94680851063829%; } .row-fluid .span11 { - width: 91.48936170212765%; - *width: 91.43617021276594%; + width: 91.48936170212765%; + *width: 91.43617021276594%; } .row-fluid .span10 { - width: 82.97872340425532%; - *width: 82.92553191489361%; + width: 82.97872340425532%; + *width: 82.92553191489361%; } .row-fluid .span9 { - width: 74.46808510638297%; - *width: 74.41489361702126%; + width: 74.46808510638297%; + *width: 74.41489361702126%; } .row-fluid .span8 { - width: 65.95744680851064%; - *width: 65.90425531914893%; + width: 65.95744680851064%; + *width: 65.90425531914893%; } .row-fluid .span7 { - width: 57.44680851063829%; - *width: 57.39361702127659%; + width: 57.44680851063829%; + *width: 57.39361702127659%; } .row-fluid .span6 { - width: 48.93617021276595%; - *width: 48.88297872340425%; + width: 48.93617021276595%; + *width: 48.88297872340425%; } .row-fluid .span5 { - width: 40.42553191489362%; - *width: 40.37234042553192%; + width: 40.42553191489362%; + *width: 40.37234042553192%; } .row-fluid .span4 { - width: 31.914893617021278%; - *width: 31.861702127659576%; + width: 31.914893617021278%; + *width: 31.861702127659576%; } .row-fluid .span3 { - width: 23.404255319148934%; - *width: 23.351063829787233%; + width: 23.404255319148934%; + *width: 23.351063829787233%; } .row-fluid .span2 { - width: 14.893617021276595%; - *width: 14.840425531914894%; + width: 14.893617021276595%; + *width: 14.840425531914894%; } .row-fluid .span1 { - width: 6.382978723404255%; - *width: 6.329787234042553%; + width: 6.382978723404255%; + *width: 6.329787234042553%; } .row-fluid .offset12 { - margin-left: 104.25531914893617%; - *margin-left: 104.14893617021275%; + margin-left: 104.25531914893617%; + *margin-left: 104.14893617021275%; } .row-fluid .offset12:first-child { - margin-left: 102.12765957446808%; - *margin-left: 102.02127659574467%; + margin-left: 102.12765957446808%; + *margin-left: 102.02127659574467%; } .row-fluid .offset11 { - margin-left: 95.74468085106382%; - *margin-left: 95.6382978723404%; + margin-left: 95.74468085106382%; + *margin-left: 95.6382978723404%; } .row-fluid .offset11:first-child { - margin-left: 93.61702127659574%; - *margin-left: 93.51063829787232%; + margin-left: 93.61702127659574%; + *margin-left: 93.51063829787232%; } .row-fluid .offset10 { - margin-left: 87.23404255319149%; - *margin-left: 87.12765957446807%; + margin-left: 87.23404255319149%; + *margin-left: 87.12765957446807%; } .row-fluid .offset10:first-child { - margin-left: 85.1063829787234%; - *margin-left: 84.99999999999999%; + margin-left: 85.1063829787234%; + *margin-left: 84.99999999999999%; } .row-fluid .offset9 { - margin-left: 78.72340425531914%; - *margin-left: 78.61702127659572%; + margin-left: 78.72340425531914%; + *margin-left: 78.61702127659572%; } .row-fluid .offset9:first-child { - margin-left: 76.59574468085106%; - *margin-left: 76.48936170212764%; + margin-left: 76.59574468085106%; + *margin-left: 76.48936170212764%; } .row-fluid .offset8 { - margin-left: 70.2127659574468%; - *margin-left: 70.10638297872339%; + margin-left: 70.2127659574468%; + *margin-left: 70.10638297872339%; } .row-fluid .offset8:first-child { - margin-left: 68.08510638297872%; - *margin-left: 67.9787234042553%; + margin-left: 68.08510638297872%; + *margin-left: 67.9787234042553%; } .row-fluid .offset7 { - margin-left: 61.70212765957446%; - *margin-left: 61.59574468085106%; + margin-left: 61.70212765957446%; + *margin-left: 61.59574468085106%; } .row-fluid .offset7:first-child { - margin-left: 59.574468085106375%; - *margin-left: 59.46808510638297%; + margin-left: 59.574468085106375%; + *margin-left: 59.46808510638297%; } .row-fluid .offset6 { - margin-left: 53.191489361702125%; - *margin-left: 53.085106382978715%; + margin-left: 53.191489361702125%; + *margin-left: 53.085106382978715%; } .row-fluid .offset6:first-child { - margin-left: 51.063829787234035%; - *margin-left: 50.95744680851063%; + margin-left: 51.063829787234035%; + *margin-left: 50.95744680851063%; } .row-fluid .offset5 { - margin-left: 44.68085106382979%; - *margin-left: 44.57446808510638%; + margin-left: 44.68085106382979%; + *margin-left: 44.57446808510638%; } .row-fluid .offset5:first-child { - margin-left: 42.5531914893617%; - *margin-left: 42.4468085106383%; + margin-left: 42.5531914893617%; + *margin-left: 42.4468085106383%; } .row-fluid .offset4 { - margin-left: 36.170212765957444%; - *margin-left: 36.06382978723405%; + margin-left: 36.170212765957444%; + *margin-left: 36.06382978723405%; } .row-fluid .offset4:first-child { - margin-left: 34.04255319148936%; - *margin-left: 33.93617021276596%; + margin-left: 34.04255319148936%; + *margin-left: 33.93617021276596%; } .row-fluid .offset3 { - margin-left: 27.659574468085104%; - *margin-left: 27.5531914893617%; + margin-left: 27.659574468085104%; + *margin-left: 27.5531914893617%; } .row-fluid .offset3:first-child { - margin-left: 25.53191489361702%; - *margin-left: 25.425531914893618%; + margin-left: 25.53191489361702%; + *margin-left: 25.425531914893618%; } .row-fluid .offset2 { - margin-left: 19.148936170212764%; - *margin-left: 19.04255319148936%; + margin-left: 19.148936170212764%; + *margin-left: 19.04255319148936%; } .row-fluid .offset2:first-child { - margin-left: 17.02127659574468%; - *margin-left: 16.914893617021278%; + margin-left: 17.02127659574468%; + *margin-left: 16.914893617021278%; } .row-fluid .offset1 { - margin-left: 10.638297872340425%; - *margin-left: 10.53191489361702%; + margin-left: 10.638297872340425%; + *margin-left: 10.53191489361702%; } .row-fluid .offset1:first-child { - margin-left: 8.51063829787234%; - *margin-left: 8.404255319148938%; + margin-left: 8.51063829787234%; + *margin-left: 8.404255319148938%; } [class*="span"].hide, .row-fluid [class*="span"].hide { - display: none; + display: none; } [class*="span"].pull-right, .row-fluid [class*="span"].pull-right { - float: right; + float: right; } .container { - margin-right: auto; - margin-left: auto; - *zoom: 1; + margin-right: auto; + margin-left: auto; + *zoom: 1; } .container:before, .container:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .container:after { - clear: both; + clear: both; } .container-fluid { - padding-right: 20px; - padding-left: 20px; - *zoom: 1; + padding-right: 20px; + padding-left: 20px; + *zoom: 1; } .container-fluid:before, .container-fluid:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .container-fluid:after { - clear: both; + clear: both; } p { - margin: 0 0 10px; + margin: 0 0 10px; } .lead { - margin-bottom: 20px; - font-size: 21px; - font-weight: 200; - line-height: 30px; + margin-bottom: 20px; + font-size: 21px; + font-weight: 200; + line-height: 30px; } small { - font-size: 85%; + font-size: 85%; } strong { - font-weight: bold; + font-weight: bold; } em { - font-style: italic; + font-style: italic; } cite { - font-style: normal; + font-style: normal; } .muted { - color: #999999; + color: #999999; } a.muted:hover { - color: #808080; + color: #808080; } .text-warning { - color: #c09853; + color: #c09853; } a.text-warning:hover { - color: #a47e3c; + color: #a47e3c; } .text-error { - color: #b94a48; + color: #b94a48; } a.text-error:hover { - color: #953b39; + color: #953b39; } .text-info { - color: #3a87ad; + color: #3a87ad; } a.text-info:hover { - color: #2d6987; + color: #2d6987; } .text-success { - color: #468847; + color: #468847; } a.text-success:hover { - color: #356635; + color: #356635; } h1, @@ -731,12 +720,12 @@ h3, h4, h5, h6 { - margin: 10px 0; - font-family: inherit; - font-weight: bold; - line-height: 20px; - color: inherit; - text-rendering: optimizelegibility; + margin: 10px 0; + font-family: inherit; + font-weight: bold; + line-height: 20px; + color: inherit; + text-rendering: optimizelegibility; } h1 small, @@ -745,301 +734,301 @@ h3 small, h4 small, h5 small, h6 small { - font-weight: normal; - line-height: 1; - color: #999999; + font-weight: normal; + line-height: 1; + color: #999999; } h1, h2, h3 { - line-height: 40px; + line-height: 40px; } h1 { - font-size: 38.5px; + font-size: 38.5px; } h2 { - font-size: 31.5px; + font-size: 31.5px; } h3 { - font-size: 24.5px; + font-size: 24.5px; } h4 { - font-size: 17.5px; + font-size: 17.5px; } h5 { - font-size: 14px; + font-size: 14px; } h6 { - font-size: 11.9px; + font-size: 11.9px; } h1 small { - font-size: 24.5px; + font-size: 24.5px; } h2 small { - font-size: 17.5px; + font-size: 17.5px; } h3 small { - font-size: 14px; + font-size: 14px; } h4 small { - font-size: 14px; + font-size: 14px; } .page-header { - padding-bottom: 9px; - margin: 20px 0 30px; - border-bottom: 1px solid #eeeeee; + padding-bottom: 9px; + margin: 20px 0 30px; + border-bottom: 1px solid #eeeeee; } ul, ol { - padding: 0; - margin: 0 0 10px 25px; + padding: 0; + margin: 0 0 10px 25px; } ul ul, ul ol, ol ol, ol ul { - margin-bottom: 0; + margin-bottom: 0; } li { - line-height: 20px; + line-height: 20px; } ul.unstyled, ol.unstyled { - margin-left: 0; - list-style: none; + margin-left: 0; + list-style: none; } ul.inline, ol.inline { - margin-left: 0; - list-style: none; + margin-left: 0; + list-style: none; } ul.inline > li, ol.inline > li { - display: inline-block; - padding-right: 5px; - padding-left: 5px; + display: inline-block; + padding-right: 5px; + padding-left: 5px; } dl { - margin-bottom: 20px; + margin-bottom: 20px; } dt, dd { - line-height: 20px; + line-height: 20px; } dt { - font-weight: bold; + font-weight: bold; } dd { - margin-left: 10px; + margin-left: 10px; } .dl-horizontal { - *zoom: 1; + *zoom: 1; } .dl-horizontal:before, .dl-horizontal:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .dl-horizontal:after { - clear: both; + clear: both; } .dl-horizontal dt { - float: left; - width: 160px; - overflow: hidden; - clear: left; - text-align: right; - text-overflow: ellipsis; - white-space: nowrap; + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; } .dl-horizontal dd { - margin-left: 180px; + margin-left: 180px; } hr { - margin: 20px 0; - border: 0; - border-top: 1px solid #eeeeee; - border-bottom: 1px solid #ffffff; + margin: 20px 0; + border: 0; + border-top: 1px solid #eeeeee; + border-bottom: 1px solid #ffffff; } abbr[title], abbr[data-original-title] { - cursor: help; - border-bottom: 1px dotted #999999; + cursor: help; + border-bottom: 1px dotted #999999; } abbr.initialism { - font-size: 90%; - text-transform: uppercase; + font-size: 90%; + text-transform: uppercase; } blockquote { - padding: 0 0 0 15px; - margin: 0 0 20px; - border-left: 5px solid #eeeeee; + padding: 0 0 0 15px; + margin: 0 0 20px; + border-left: 5px solid #eeeeee; } blockquote p { - margin-bottom: 0; - font-size: 16px; - font-weight: 300; - line-height: 25px; + margin-bottom: 0; + font-size: 16px; + font-weight: 300; + line-height: 25px; } blockquote small { - display: block; - line-height: 20px; - color: #999999; + display: block; + line-height: 20px; + color: #999999; } blockquote small:before { - content: '\2014 \00A0'; + content: '\2014 \00A0'; } blockquote.pull-right { - float: right; - padding-right: 15px; - padding-left: 0; - border-right: 5px solid #eeeeee; - border-left: 0; + float: right; + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; } blockquote.pull-right p, blockquote.pull-right small { - text-align: right; + text-align: right; } blockquote.pull-right small:before { - content: ''; + content: ''; } blockquote.pull-right small:after { - content: '\00A0 \2014'; + content: '\00A0 \2014'; } q:before, q:after, blockquote:before, blockquote:after { - content: ""; + content: ""; } address { - display: block; - margin-bottom: 20px; - font-style: normal; - line-height: 20px; + display: block; + margin-bottom: 20px; + font-style: normal; + line-height: 20px; } code, pre { - padding: 0 3px 2px; - font-family: Monaco, Menlo, Consolas, "Courier New", monospace; - font-size: 12px; - color: #333333; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + padding: 0 3px 2px; + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + font-size: 12px; + color: #333333; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } code { - padding: 2px 4px; - color: #d14; - white-space: nowrap; - background-color: #f7f7f9; - border: 1px solid #e1e1e8; + padding: 2px 4px; + color: #d14; + white-space: nowrap; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; } pre { - display: block; - padding: 9.5px; - margin: 0 0 10px; - font-size: 13px; - line-height: 20px; - word-break: break-all; - word-wrap: break-word; - white-space: pre; - white-space: pre-wrap; - background-color: #f5f5f5; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.15); - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 20px; + word-break: break-all; + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } pre.prettyprint { - margin-bottom: 20px; + margin-bottom: 20px; } pre code { - padding: 0; - color: inherit; - white-space: pre; - white-space: pre-wrap; - background-color: transparent; - border: 0; + padding: 0; + color: inherit; + white-space: pre; + white-space: pre-wrap; + background-color: transparent; + border: 0; } .pre-scrollable { - max-height: 340px; - overflow-y: scroll; + max-height: 340px; + overflow-y: scroll; } form { - margin: 0 0 20px; + margin: 0 0 20px; } fieldset { - padding: 0; - margin: 0; - border: 0; + padding: 0; + margin: 0; + border: 0; } legend { - display: block; - width: 100%; - padding: 0; - margin-bottom: 20px; - font-size: 21px; - line-height: 40px; - color: #333333; - border: 0; - border-bottom: 1px solid #e5e5e5; + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: 40px; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; } legend small { - font-size: 15px; - color: #999999; + font-size: 15px; + color: #999999; } label, @@ -1047,21 +1036,21 @@ input, button, select, textarea { - font-size: 14px; - font-weight: normal; - line-height: 20px; + font-size: 14px; + font-weight: normal; + line-height: 20px; } input, button, select, textarea { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } label { - display: block; - margin-bottom: 5px; + display: block; + margin-bottom: 5px; } select, @@ -1081,27 +1070,27 @@ input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { - display: inline-block; - height: 20px; - padding: 4px 6px; - margin-bottom: 10px; - font-size: 14px; - line-height: 20px; - color: #555555; - vertical-align: middle; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + display: inline-block; + height: 20px; + padding: 4px 6px; + margin-bottom: 10px; + font-size: 14px; + line-height: 20px; + color: #555555; + vertical-align: middle; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } input, textarea, .uneditable-input { - width: 206px; + width: 206px; } textarea { - height: auto; + height: auto; } textarea, @@ -1120,15 +1109,15 @@ input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { - background-color: #ffffff; - border: 1px solid #cccccc; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; - -moz-transition: border linear 0.2s, box-shadow linear 0.2s; - -o-transition: border linear 0.2s, box-shadow linear 0.2s; - transition: border linear 0.2s, box-shadow linear 0.2s; + background-color: #ffffff; + border: 1px solid #cccccc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; } textarea:focus, @@ -1147,22 +1136,22 @@ input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus, .uneditable-input:focus { - border-color: rgba(82, 168, 236, 0.8); - outline: 0; - outline: thin dotted \9; - /* IE6-9 */ + border-color: rgba(82, 168, 236, 0.8); + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); } input[type="radio"], input[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; - *margin-top: 0; - line-height: normal; + margin: 4px 0 0; + margin-top: 1px \9; + *margin-top: 0; + line-height: normal; } input[type="file"], @@ -1172,128 +1161,128 @@ input[type="reset"], input[type="button"], input[type="radio"], input[type="checkbox"] { - width: auto; + width: auto; } select, input[type="file"] { - height: 30px; - /* In IE7, the height of the select element cannot be changed by height, only font-size */ + height: 30px; + /* In IE7, the height of the select element cannot be changed by height, only font-size */ - *margin-top: 4px; - /* For IE7, add top margin to align select with labels */ + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ - line-height: 30px; + line-height: 30px; } select { - width: 220px; - background-color: #ffffff; - border: 1px solid #cccccc; + width: 220px; + background-color: #ffffff; + border: 1px solid #cccccc; } select[multiple], select[size] { - height: auto; + height: auto; } select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } .uneditable-input, .uneditable-textarea { - color: #999999; - cursor: not-allowed; - background-color: #fcfcfc; - border-color: #cccccc; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + color: #999999; + cursor: not-allowed; + background-color: #fcfcfc; + border-color: #cccccc; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); } .uneditable-input { - overflow: hidden; - white-space: nowrap; + overflow: hidden; + white-space: nowrap; } .uneditable-textarea { - width: auto; - height: auto; + width: auto; + height: auto; } input:-moz-placeholder, textarea:-moz-placeholder { - color: #999999; + color: #999999; } input:-ms-input-placeholder, textarea:-ms-input-placeholder { - color: #999999; + color: #999999; } input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { - color: #999999; + color: #999999; } .radio, .checkbox { - min-height: 20px; - padding-left: 20px; + min-height: 20px; + padding-left: 20px; } .radio input[type="radio"], .checkbox input[type="checkbox"] { - float: left; - margin-left: -20px; + float: left; + margin-left: -20px; } .controls > .radio:first-child, .controls > .checkbox:first-child { - padding-top: 5px; + padding-top: 5px; } .radio.inline, .checkbox.inline { - display: inline-block; - padding-top: 5px; - margin-bottom: 0; - vertical-align: middle; + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; } .radio.inline + .radio.inline, .checkbox.inline + .checkbox.inline { - margin-left: 10px; + margin-left: 10px; } .input-mini { - width: 60px; + width: 60px; } .input-small { - width: 90px; + width: 90px; } .input-medium { - width: 150px; + width: 150px; } .input-large { - width: 210px; + width: 210px; } .input-xlarge { - width: 270px; + width: 270px; } .input-xxlarge { - width: 530px; + width: 530px; } input[class*="span"], @@ -1304,8 +1293,8 @@ textarea[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"] { - float: none; - margin-left: 0; + float: none; + margin-left: 0; } .input-append input[class*="span"], @@ -1318,114 +1307,114 @@ textarea[class*="span"], .row-fluid .uneditable-input[class*="span"], .row-fluid .input-prepend [class*="span"], .row-fluid .input-append [class*="span"] { - display: inline-block; + display: inline-block; } input, textarea, .uneditable-input { - margin-left: 0; + margin-left: 0; } .controls-row [class*="span"] + [class*="span"] { - margin-left: 20px; + margin-left: 20px; } input.span12, textarea.span12, .uneditable-input.span12 { - width: 926px; + width: 926px; } input.span11, textarea.span11, .uneditable-input.span11 { - width: 846px; + width: 846px; } input.span10, textarea.span10, .uneditable-input.span10 { - width: 766px; + width: 766px; } input.span9, textarea.span9, .uneditable-input.span9 { - width: 686px; + width: 686px; } input.span8, textarea.span8, .uneditable-input.span8 { - width: 606px; + width: 606px; } input.span7, textarea.span7, .uneditable-input.span7 { - width: 526px; + width: 526px; } input.span6, textarea.span6, .uneditable-input.span6 { - width: 446px; + width: 446px; } input.span5, textarea.span5, .uneditable-input.span5 { - width: 366px; + width: 366px; } input.span4, textarea.span4, .uneditable-input.span4 { - width: 286px; + width: 286px; } input.span3, textarea.span3, .uneditable-input.span3 { - width: 206px; + width: 206px; } input.span2, textarea.span2, .uneditable-input.span2 { - width: 126px; + width: 126px; } input.span1, textarea.span1, .uneditable-input.span1 { - width: 46px; + width: 46px; } .controls-row { - *zoom: 1; + *zoom: 1; } .controls-row:before, .controls-row:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .controls-row:after { - clear: both; + clear: both; } .controls-row [class*="span"], .row-fluid .controls-row [class*="span"] { - float: left; + float: left; } .controls-row .checkbox[class*="span"], .controls-row .radio[class*="span"] { - padding-top: 5px; + padding-top: 5px; } input[disabled], @@ -1434,21 +1423,21 @@ textarea[disabled], input[readonly], select[readonly], textarea[readonly] { - cursor: not-allowed; - background-color: #eeeeee; + cursor: not-allowed; + background-color: #eeeeee; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"][readonly], input[type="checkbox"][readonly] { - background-color: transparent; + background-color: transparent; } .control-group.warning .control-label, .control-group.warning .help-block, .control-group.warning .help-inline { - color: #c09853; + color: #c09853; } .control-group.warning .checkbox, @@ -1456,38 +1445,38 @@ input[type="checkbox"][readonly] { .control-group.warning input, .control-group.warning select, .control-group.warning textarea { - color: #c09853; + color: #c09853; } .control-group.warning input, .control-group.warning select, .control-group.warning textarea { - border-color: #c09853; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + border-color: #c09853; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus { - border-color: #a47e3c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + border-color: #a47e3c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; } .control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on { - color: #c09853; - background-color: #fcf8e3; - border-color: #c09853; + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; } .control-group.error .control-label, .control-group.error .help-block, .control-group.error .help-inline { - color: #b94a48; + color: #b94a48; } .control-group.error .checkbox, @@ -1495,38 +1484,38 @@ input[type="checkbox"][readonly] { .control-group.error input, .control-group.error select, .control-group.error textarea { - color: #b94a48; + color: #b94a48; } .control-group.error input, .control-group.error select, .control-group.error textarea { - border-color: #b94a48; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + border-color: #b94a48; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus { - border-color: #953b39; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + border-color: #953b39; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; } .control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on { - color: #b94a48; - background-color: #f2dede; - border-color: #b94a48; + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; } .control-group.success .control-label, .control-group.success .help-block, .control-group.success .help-inline { - color: #468847; + color: #468847; } .control-group.success .checkbox, @@ -1534,38 +1523,38 @@ input[type="checkbox"][readonly] { .control-group.success input, .control-group.success select, .control-group.success textarea { - color: #468847; + color: #468847; } .control-group.success input, .control-group.success select, .control-group.success textarea { - border-color: #468847; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + border-color: #468847; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus { - border-color: #356635; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + border-color: #356635; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; } .control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on { - color: #468847; - background-color: #dff0d8; - border-color: #468847; + color: #468847; + background-color: #dff0d8; + border-color: #468847; } .control-group.info .control-label, .control-group.info .help-block, .control-group.info .help-inline { - color: #3a87ad; + color: #3a87ad; } .control-group.info .checkbox, @@ -1573,93 +1562,93 @@ input[type="checkbox"][readonly] { .control-group.info input, .control-group.info select, .control-group.info textarea { - color: #3a87ad; + color: #3a87ad; } .control-group.info input, .control-group.info select, .control-group.info textarea { - border-color: #3a87ad; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + border-color: #3a87ad; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.info input:focus, .control-group.info select:focus, .control-group.info textarea:focus { - border-color: #2d6987; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + border-color: #2d6987; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; } .control-group.info .input-prepend .add-on, .control-group.info .input-append .add-on { - color: #3a87ad; - background-color: #d9edf7; - border-color: #3a87ad; + color: #3a87ad; + background-color: #d9edf7; + border-color: #3a87ad; } input:focus:invalid, textarea:focus:invalid, select:focus:invalid { - color: #b94a48; - border-color: #ee5f5b; + color: #b94a48; + border-color: #ee5f5b; } input:focus:invalid:focus, textarea:focus:invalid:focus, select:focus:invalid:focus { - border-color: #e9322d; - -webkit-box-shadow: 0 0 6px #f8b9b7; - -moz-box-shadow: 0 0 6px #f8b9b7; - box-shadow: 0 0 6px #f8b9b7; + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; } .form-actions { - padding: 19px 20px 20px; - margin-top: 20px; - margin-bottom: 20px; - background-color: #f5f5f5; - border-top: 1px solid #e5e5e5; - *zoom: 1; + padding: 19px 20px 20px; + margin-top: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-top: 1px solid #e5e5e5; + *zoom: 1; } .form-actions:before, .form-actions:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .form-actions:after { - clear: both; + clear: both; } .help-block, .help-inline { - color: #595959; + color: #595959; } .help-block { - display: block; - margin-bottom: 10px; + display: block; + margin-bottom: 10px; } .help-inline { - display: inline-block; - *display: inline; - padding-left: 5px; - vertical-align: middle; - *zoom: 1; + display: inline-block; + *display: inline; + padding-left: 5px; + vertical-align: middle; + *zoom: 1; } .input-append, .input-prepend { - margin-bottom: 5px; - font-size: 0; - white-space: nowrap; + margin-bottom: 5px; + font-size: 0; + white-space: nowrap; } .input-append input, @@ -1670,7 +1659,7 @@ select:focus:invalid:focus { .input-prepend .uneditable-input, .input-append .dropdown-menu, .input-prepend .dropdown-menu { - font-size: 14px; + font-size: 14px; } .input-append input, @@ -1679,13 +1668,13 @@ select:focus:invalid:focus { .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input { - position: relative; - margin-bottom: 0; - *margin-left: 0; - vertical-align: top; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + position: relative; + margin-bottom: 0; + *margin-left: 0; + vertical-align: top; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-append input:focus, @@ -1694,23 +1683,23 @@ select:focus:invalid:focus { .input-prepend select:focus, .input-append .uneditable-input:focus, .input-prepend .uneditable-input:focus { - z-index: 2; + z-index: 2; } .input-append .add-on, .input-prepend .add-on { - display: inline-block; - width: auto; - height: 20px; - min-width: 16px; - padding: 4px 5px; - font-size: 14px; - font-weight: normal; - line-height: 20px; - text-align: center; - text-shadow: 0 1px 0 #ffffff; - background-color: #eeeeee; - border: 1px solid #ccc; + display: inline-block; + width: auto; + height: 20px; + min-width: 16px; + padding: 4px 5px; + font-size: 14px; + font-weight: normal; + line-height: 20px; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + background-color: #eeeeee; + border: 1px solid #ccc; } .input-append .add-on, @@ -1719,140 +1708,140 @@ select:focus:invalid:focus { .input-prepend .btn, .input-append .btn-group > .dropdown-toggle, .input-prepend .btn-group > .dropdown-toggle { - vertical-align: top; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + vertical-align: top; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .input-append .active, .input-prepend .active { - background-color: #a9dba9; - border-color: #46a546; + background-color: #a9dba9; + border-color: #46a546; } .input-prepend .add-on, .input-prepend .btn { - margin-right: -1px; + margin-right: -1px; } .input-prepend .add-on:first-child, .input-prepend .btn:first-child { - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } .input-append input, .input-append select, .input-append .uneditable-input { - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } .input-append input + .btn-group .btn:last-child, .input-append select + .btn-group .btn:last-child, .input-append .uneditable-input + .btn-group .btn:last-child { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-append .add-on, .input-append .btn, .input-append .btn-group { - margin-left: -1px; + margin-left: -1px; } .input-append .add-on:last-child, .input-append .btn:last-child, .input-append .btn-group:last-child > .dropdown-toggle { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-prepend.input-append input, .input-prepend.input-append select, .input-prepend.input-append .uneditable-input { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .input-prepend.input-append input + .btn-group .btn, .input-prepend.input-append select + .btn-group .btn, .input-prepend.input-append .uneditable-input + .btn-group .btn { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-prepend.input-append .add-on:first-child, .input-prepend.input-append .btn:first-child { - margin-right: -1px; - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } .input-prepend.input-append .add-on:last-child, .input-prepend.input-append .btn:last-child { - margin-left: -1px; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .input-prepend.input-append .btn-group:first-child { - margin-left: 0; + margin-left: 0; } input.search-query { - padding-right: 14px; - padding-right: 4px \9; - padding-left: 14px; - padding-left: 4px \9; - /* IE7-8 doesn't have border-radius, so don't indent the padding */ + padding-right: 14px; + padding-right: 4px \9; + padding-left: 14px; + padding-left: 4px \9; + /* IE7-8 doesn't have border-radius, so don't indent the padding */ - margin-bottom: 0; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; + margin-bottom: 0; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; } /* Allow for input prepend/append in search forms */ .form-search .input-append .search-query, .form-search .input-prepend .search-query { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .form-search .input-append .search-query { - -webkit-border-radius: 14px 0 0 14px; - -moz-border-radius: 14px 0 0 14px; - border-radius: 14px 0 0 14px; + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; } .form-search .input-append .btn { - -webkit-border-radius: 0 14px 14px 0; - -moz-border-radius: 0 14px 14px 0; - border-radius: 0 14px 14px 0; + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; } .form-search .input-prepend .search-query { - -webkit-border-radius: 0 14px 14px 0; - -moz-border-radius: 0 14px 14px 0; - border-radius: 0 14px 14px 0; + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; } .form-search .input-prepend .btn { - -webkit-border-radius: 14px 0 0 14px; - -moz-border-radius: 14px 0 0 14px; - border-radius: 14px 0 0 14px; + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; } .form-search input, @@ -1876,96 +1865,96 @@ input.search-query { .form-search .input-append, .form-inline .input-append, .form-horizontal .input-append { - display: inline-block; - *display: inline; - margin-bottom: 0; - vertical-align: middle; - *zoom: 1; + display: inline-block; + *display: inline; + margin-bottom: 0; + vertical-align: middle; + *zoom: 1; } .form-search .hide, .form-inline .hide, .form-horizontal .hide { - display: none; + display: none; } .form-search label, .form-inline label, .form-search .btn-group, .form-inline .btn-group { - display: inline-block; + display: inline-block; } .form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend { - margin-bottom: 0; + margin-bottom: 0; } .form-search .radio, .form-search .checkbox, .form-inline .radio, .form-inline .checkbox { - padding-left: 0; - margin-bottom: 0; - vertical-align: middle; + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; } .form-search .radio input[type="radio"], .form-search .checkbox input[type="checkbox"], .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { - float: left; - margin-right: 3px; - margin-left: 0; + float: left; + margin-right: 3px; + margin-left: 0; } .control-group { - margin-bottom: 10px; + margin-bottom: 10px; } legend + .control-group { - margin-top: 20px; - -webkit-margin-top-collapse: separate; + margin-top: 20px; + -webkit-margin-top-collapse: separate; } .form-horizontal .control-group { - margin-bottom: 20px; - *zoom: 1; + margin-bottom: 20px; + *zoom: 1; } .form-horizontal .control-group:before, .form-horizontal .control-group:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .form-horizontal .control-group:after { - clear: both; + clear: both; } .form-horizontal .control-label { - float: left; - width: 160px; - padding-top: 5px; - text-align: right; + float: left; + width: 160px; + padding-top: 5px; + text-align: right; } .form-horizontal .controls { - *display: inline-block; - *padding-left: 20px; - margin-left: 180px; - *margin-left: 0; + *display: inline-block; + *padding-left: 20px; + margin-left: 180px; + *margin-left: 0; } .form-horizontal .controls:first-child { - *padding-left: 180px; + *padding-left: 180px; } .form-horizontal .help-block { - margin-bottom: 0; + margin-bottom: 0; } .form-horizontal input + .help-block, @@ -1974,44 +1963,44 @@ legend + .control-group { .form-horizontal .uneditable-input + .help-block, .form-horizontal .input-prepend + .help-block, .form-horizontal .input-append + .help-block { - margin-top: 10px; + margin-top: 10px; } .form-horizontal .form-actions { - padding-left: 180px; + padding-left: 180px; } table { - max-width: 100%; - background-color: transparent; - border-collapse: collapse; - border-spacing: 0; + max-width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; } .table, table { - width: 100%; - margin-bottom: 20px; + width: 100%; + margin-bottom: 20px; } .table th, table th, .table td, table td { - padding: 8px; - line-height: 20px; - text-align: left; - vertical-align: top; - border-top: 1px solid #dddddd; + padding: 8px; + line-height: 20px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; } .table th, table th { - font-weight: bold; + font-weight: bold; } .table thead th, table thead th { - vertical-align: bottom; + vertical-align: bottom; } .table caption + thead tr:first-child th, @@ -2026,37 +2015,37 @@ table colgroup + thead tr:first-child th, table colgroup + thead tr:first-child td, table thead:first-child tr:first-child th, table thead:first-child tr:first-child td { - border-top: 0; + border-top: 0; } .table tbody + tbody, table tbody + tbody { - border-top: 2px solid #dddddd; + border-top: 2px solid #dddddd; } .table .table, table table { - background-color: #ffffff; + background-color: #ffffff; } .table-condensed th, .table-condensed td { - padding: 4px 5px; + padding: 4px 5px; } .table-bordered { - border: 1px solid #dddddd; - border-collapse: separate; - *border-collapse: collapse; - border-left: 0; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + border: 1px solid #dddddd; + border-collapse: separate; + *border-collapse: collapse; + border-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .table-bordered th, .table-bordered td { - border-left: 1px solid #dddddd; + border-left: 1px solid #dddddd; } .table-bordered caption + thead tr:first-child th, @@ -2068,222 +2057,222 @@ table table { .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td { - border-top: 0; + border-top: 0; } .table-bordered thead:first-child tr:first-child > th:first-child, .table-bordered tbody:first-child tr:first-child > td:first-child { - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; } .table-bordered thead:first-child tr:first-child > th:last-child, .table-bordered tbody:first-child tr:first-child > td:last-child { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; } .table-bordered thead:last-child tr:last-child > th:first-child, .table-bordered tbody:last-child tr:last-child > td:first-child, .table-bordered tfoot:last-child tr:last-child > td:first-child { - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; } .table-bordered thead:last-child tr:last-child > th:last-child, .table-bordered tbody:last-child tr:last-child > td:last-child, .table-bordered tfoot:last-child tr:last-child > td:last-child { - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; } .table-bordered tfoot + tbody:last-child tr:last-child td:first-child { - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomleft: 0; } .table-bordered tfoot + tbody:last-child tr:last-child td:last-child { - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomright: 0; } .table-bordered caption + thead tr:first-child th:first-child, .table-bordered caption + tbody tr:first-child td:first-child, .table-bordered colgroup + thead tr:first-child th:first-child, .table-bordered colgroup + tbody tr:first-child td:first-child { - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; } .table-bordered caption + thead tr:first-child th:last-child, .table-bordered caption + tbody tr:first-child td:last-child, .table-bordered colgroup + thead tr:first-child th:last-child, .table-bordered colgroup + tbody tr:first-child td:last-child { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; } .table-striped tbody > tr:nth-child(odd) > td, .table-striped tbody > tr:nth-child(odd) > th, table tbody > tr:nth-child(odd) > td, table tbody > tr:nth-child(odd) > th { - background-color: #f9f9f9; + background-color: #f9f9f9; } .table-hover tbody tr:hover td, .table-hover tbody tr:hover th { - background-color: #f5f5f5; + background-color: #f5f5f5; } table td[class*="span"], table th[class*="span"], .row-fluid table td[class*="span"], .row-fluid table th[class*="span"] { - display: table-cell; - float: none; - margin-left: 0; + display: table-cell; + float: none; + margin-left: 0; } .table td.span1, .table th.span1 { - float: none; - width: 44px; - margin-left: 0; + float: none; + width: 44px; + margin-left: 0; } .table td.span2, .table th.span2 { - float: none; - width: 124px; - margin-left: 0; + float: none; + width: 124px; + margin-left: 0; } .table td.span3, .table th.span3 { - float: none; - width: 204px; - margin-left: 0; + float: none; + width: 204px; + margin-left: 0; } .table td.span4, .table th.span4 { - float: none; - width: 284px; - margin-left: 0; + float: none; + width: 284px; + margin-left: 0; } .table td.span5, .table th.span5 { - float: none; - width: 364px; - margin-left: 0; + float: none; + width: 364px; + margin-left: 0; } .table td.span6, .table th.span6 { - float: none; - width: 444px; - margin-left: 0; + float: none; + width: 444px; + margin-left: 0; } .table td.span7, .table th.span7 { - float: none; - width: 524px; - margin-left: 0; + float: none; + width: 524px; + margin-left: 0; } .table td.span8, .table th.span8 { - float: none; - width: 604px; - margin-left: 0; + float: none; + width: 604px; + margin-left: 0; } .table td.span9, .table th.span9 { - float: none; - width: 684px; - margin-left: 0; + float: none; + width: 684px; + margin-left: 0; } .table td.span10, .table th.span10 { - float: none; - width: 764px; - margin-left: 0; + float: none; + width: 764px; + margin-left: 0; } .table td.span11, .table th.span11 { - float: none; - width: 844px; - margin-left: 0; + float: none; + width: 844px; + margin-left: 0; } .table td.span12, .table th.span12 { - float: none; - width: 924px; - margin-left: 0; + float: none; + width: 924px; + margin-left: 0; } .table tbody tr.success td, table tbody tr.success td { - background-color: #dff0d8; + background-color: #dff0d8; } .table tbody tr.error td, table tbody tr.error td { - background-color: #f2dede; + background-color: #f2dede; } .table tbody tr.warning td, table tbody tr.warning td { - background-color: #fcf8e3; + background-color: #fcf8e3; } .table tbody tr.info td, table tbody tr.info td { - background-color: #d9edf7; + background-color: #d9edf7; } .table-hover tbody tr.success:hover td { - background-color: #d0e9c6; + background-color: #d0e9c6; } .table-hover tbody tr.error:hover td { - background-color: #ebcccc; + background-color: #ebcccc; } .table-hover tbody tr.warning:hover td { - background-color: #faf2cc; + background-color: #faf2cc; } .table-hover tbody tr.info:hover td { - background-color: #c4e3f3; + background-color: #c4e3f3; } [class^="icon-"], [class*=" icon-"] { - display: inline-block; - width: 14px; - height: 14px; - margin-top: 1px; - *margin-right: .3em; - line-height: 14px; - vertical-align: text-top; - background-image: url("../img/glyphicons-halflings.png"); - background-position: 14px 14px; - background-repeat: no-repeat; + display: inline-block; + width: 14px; + height: 14px; + margin-top: 1px; + *margin-right: .3em; + line-height: 14px; + vertical-align: text-top; + background-image: url("../img/glyphicons-halflings.png"); + background-position: 14px 14px; + background-repeat: no-repeat; } /* White icons with optional class, or on hover/active states of certain elements */ @@ -2301,915 +2290,915 @@ table tbody tr.info td { .dropdown-menu > .active > a > [class*=" icon-"], .dropdown-submenu:hover > a > [class^="icon-"], .dropdown-submenu:hover > a > [class*=" icon-"] { - background-image: url("../img/glyphicons-halflings-white.png"); + background-image: url("../img/glyphicons-halflings-white.png"); } .icon-glass { - background-position: 0 0; + background-position: 0 0; } .icon-music { - background-position: -24px 0; + background-position: -24px 0; } .icon-search { - background-position: -48px 0; + background-position: -48px 0; } .icon-envelope { - background-position: -72px 0; + background-position: -72px 0; } .icon-heart { - background-position: -96px 0; + background-position: -96px 0; } .icon-star { - background-position: -120px 0; + background-position: -120px 0; } .icon-star-empty { - background-position: -144px 0; + background-position: -144px 0; } .icon-user { - background-position: -168px 0; + background-position: -168px 0; } .icon-film { - background-position: -192px 0; + background-position: -192px 0; } .icon-th-large { - background-position: -216px 0; + background-position: -216px 0; } .icon-th { - background-position: -240px 0; + background-position: -240px 0; } .icon-th-list { - background-position: -264px 0; + background-position: -264px 0; } .icon-ok { - background-position: -288px 0; + background-position: -288px 0; } .icon-remove { - background-position: -312px 0; + background-position: -312px 0; } .icon-zoom-in { - background-position: -336px 0; + background-position: -336px 0; } .icon-zoom-out { - background-position: -360px 0; + background-position: -360px 0; } .icon-off { - background-position: -384px 0; + background-position: -384px 0; } .icon-signal { - background-position: -408px 0; + background-position: -408px 0; } .icon-cog { - background-position: -432px 0; + background-position: -432px 0; } .icon-trash { - background-position: -456px 0; + background-position: -456px 0; } .icon-home { - background-position: 0 -24px; + background-position: 0 -24px; } .icon-file { - background-position: -24px -24px; + background-position: -24px -24px; } .icon-time { - background-position: -48px -24px; + background-position: -48px -24px; } .icon-road { - background-position: -72px -24px; + background-position: -72px -24px; } .icon-download-alt { - background-position: -96px -24px; + background-position: -96px -24px; } .icon-download { - background-position: -120px -24px; + background-position: -120px -24px; } .icon-upload { - background-position: -144px -24px; + background-position: -144px -24px; } .icon-inbox { - background-position: -168px -24px; + background-position: -168px -24px; } .icon-play-circle { - background-position: -192px -24px; + background-position: -192px -24px; } .icon-repeat { - background-position: -216px -24px; + background-position: -216px -24px; } .icon-refresh { - background-position: -240px -24px; + background-position: -240px -24px; } .icon-list-alt { - background-position: -264px -24px; + background-position: -264px -24px; } .icon-lock { - background-position: -287px -24px; + background-position: -287px -24px; } .icon-flag { - background-position: -312px -24px; + background-position: -312px -24px; } .icon-headphones { - background-position: -336px -24px; + background-position: -336px -24px; } .icon-volume-off { - background-position: -360px -24px; + background-position: -360px -24px; } .icon-volume-down { - background-position: -384px -24px; + background-position: -384px -24px; } .icon-volume-up { - background-position: -408px -24px; + background-position: -408px -24px; } .icon-qrcode { - background-position: -432px -24px; + background-position: -432px -24px; } .icon-barcode { - background-position: -456px -24px; + background-position: -456px -24px; } .icon-tag { - background-position: 0 -48px; + background-position: 0 -48px; } .icon-tags { - background-position: -25px -48px; + background-position: -25px -48px; } .icon-book { - background-position: -48px -48px; + background-position: -48px -48px; } .icon-bookmark { - background-position: -72px -48px; + background-position: -72px -48px; } .icon-print { - background-position: -96px -48px; + background-position: -96px -48px; } .icon-camera { - background-position: -120px -48px; + background-position: -120px -48px; } .icon-font { - background-position: -144px -48px; + background-position: -144px -48px; } .icon-bold { - background-position: -167px -48px; + background-position: -167px -48px; } .icon-italic { - background-position: -192px -48px; + background-position: -192px -48px; } .icon-text-height { - background-position: -216px -48px; + background-position: -216px -48px; } .icon-text-width { - background-position: -240px -48px; + background-position: -240px -48px; } .icon-align-left { - background-position: -264px -48px; + background-position: -264px -48px; } .icon-align-center { - background-position: -288px -48px; + background-position: -288px -48px; } .icon-align-right { - background-position: -312px -48px; + background-position: -312px -48px; } .icon-align-justify { - background-position: -336px -48px; + background-position: -336px -48px; } .icon-list { - background-position: -360px -48px; + background-position: -360px -48px; } .icon-indent-left { - background-position: -384px -48px; + background-position: -384px -48px; } .icon-indent-right { - background-position: -408px -48px; + background-position: -408px -48px; } .icon-facetime-video { - background-position: -432px -48px; + background-position: -432px -48px; } .icon-picture { - background-position: -456px -48px; + background-position: -456px -48px; } .icon-pencil { - background-position: 0 -72px; + background-position: 0 -72px; } .icon-map-marker { - background-position: -24px -72px; + background-position: -24px -72px; } .icon-adjust { - background-position: -48px -72px; + background-position: -48px -72px; } .icon-tint { - background-position: -72px -72px; + background-position: -72px -72px; } .icon-edit { - background-position: -96px -72px; + background-position: -96px -72px; } .icon-share { - background-position: -120px -72px; + background-position: -120px -72px; } .icon-check { - background-position: -144px -72px; + background-position: -144px -72px; } .icon-move { - background-position: -168px -72px; + background-position: -168px -72px; } .icon-step-backward { - background-position: -192px -72px; + background-position: -192px -72px; } .icon-fast-backward { - background-position: -216px -72px; + background-position: -216px -72px; } .icon-backward { - background-position: -240px -72px; + background-position: -240px -72px; } .icon-play { - background-position: -264px -72px; + background-position: -264px -72px; } .icon-pause { - background-position: -288px -72px; + background-position: -288px -72px; } .icon-stop { - background-position: -312px -72px; + background-position: -312px -72px; } .icon-forward { - background-position: -336px -72px; + background-position: -336px -72px; } .icon-fast-forward { - background-position: -360px -72px; + background-position: -360px -72px; } .icon-step-forward { - background-position: -384px -72px; + background-position: -384px -72px; } .icon-eject { - background-position: -408px -72px; + background-position: -408px -72px; } .icon-chevron-left { - background-position: -432px -72px; + background-position: -432px -72px; } .icon-chevron-right { - background-position: -456px -72px; + background-position: -456px -72px; } .icon-plus-sign { - background-position: 0 -96px; + background-position: 0 -96px; } .icon-minus-sign { - background-position: -24px -96px; + background-position: -24px -96px; } .icon-remove-sign { - background-position: -48px -96px; + background-position: -48px -96px; } .icon-ok-sign { - background-position: -72px -96px; + background-position: -72px -96px; } .icon-question-sign { - background-position: -96px -96px; + background-position: -96px -96px; } .icon-info-sign { - background-position: -120px -96px; + background-position: -120px -96px; } .icon-screenshot { - background-position: -144px -96px; + background-position: -144px -96px; } .icon-remove-circle { - background-position: -168px -96px; + background-position: -168px -96px; } .icon-ok-circle { - background-position: -192px -96px; + background-position: -192px -96px; } .icon-ban-circle { - background-position: -216px -96px; + background-position: -216px -96px; } .icon-arrow-left { - background-position: -240px -96px; + background-position: -240px -96px; } .icon-arrow-right { - background-position: -264px -96px; + background-position: -264px -96px; } .icon-arrow-up { - background-position: -289px -96px; + background-position: -289px -96px; } .icon-arrow-down { - background-position: -312px -96px; + background-position: -312px -96px; } .icon-share-alt { - background-position: -336px -96px; + background-position: -336px -96px; } .icon-resize-full { - background-position: -360px -96px; + background-position: -360px -96px; } .icon-resize-small { - background-position: -384px -96px; + background-position: -384px -96px; } .icon-plus { - background-position: -408px -96px; + background-position: -408px -96px; } .icon-minus { - background-position: -433px -96px; + background-position: -433px -96px; } .icon-asterisk { - background-position: -456px -96px; + background-position: -456px -96px; } .icon-exclamation-sign { - background-position: 0 -120px; + background-position: 0 -120px; } .icon-gift { - background-position: -24px -120px; + background-position: -24px -120px; } .icon-leaf { - background-position: -48px -120px; + background-position: -48px -120px; } .icon-fire { - background-position: -72px -120px; + background-position: -72px -120px; } .icon-eye-open { - background-position: -96px -120px; + background-position: -96px -120px; } .icon-eye-close { - background-position: -120px -120px; + background-position: -120px -120px; } .icon-warning-sign { - background-position: -144px -120px; + background-position: -144px -120px; } .icon-plane { - background-position: -168px -120px; + background-position: -168px -120px; } .icon-calendar { - background-position: -192px -120px; + background-position: -192px -120px; } .icon-random { - width: 16px; - background-position: -216px -120px; + width: 16px; + background-position: -216px -120px; } .icon-comment { - background-position: -240px -120px; + background-position: -240px -120px; } .icon-magnet { - background-position: -264px -120px; + background-position: -264px -120px; } .icon-chevron-up { - background-position: -288px -120px; + background-position: -288px -120px; } .icon-chevron-down { - background-position: -313px -119px; + background-position: -313px -119px; } .icon-retweet { - background-position: -336px -120px; + background-position: -336px -120px; } .icon-shopping-cart { - background-position: -360px -120px; + background-position: -360px -120px; } .icon-folder-close { - background-position: -384px -120px; + background-position: -384px -120px; } .icon-folder-open { - width: 16px; - background-position: -408px -120px; + width: 16px; + background-position: -408px -120px; } .icon-resize-vertical { - background-position: -432px -119px; + background-position: -432px -119px; } .icon-resize-horizontal { - background-position: -456px -118px; + background-position: -456px -118px; } .icon-hdd { - background-position: 0 -144px; + background-position: 0 -144px; } .icon-bullhorn { - background-position: -24px -144px; + background-position: -24px -144px; } .icon-bell { - background-position: -48px -144px; + background-position: -48px -144px; } .icon-certificate { - background-position: -72px -144px; + background-position: -72px -144px; } .icon-thumbs-up { - background-position: -96px -144px; + background-position: -96px -144px; } .icon-thumbs-down { - background-position: -120px -144px; + background-position: -120px -144px; } .icon-hand-right { - background-position: -144px -144px; + background-position: -144px -144px; } .icon-hand-left { - background-position: -168px -144px; + background-position: -168px -144px; } .icon-hand-up { - background-position: -192px -144px; + background-position: -192px -144px; } .icon-hand-down { - background-position: -216px -144px; + background-position: -216px -144px; } .icon-circle-arrow-right { - background-position: -240px -144px; + background-position: -240px -144px; } .icon-circle-arrow-left { - background-position: -264px -144px; + background-position: -264px -144px; } .icon-circle-arrow-up { - background-position: -288px -144px; + background-position: -288px -144px; } .icon-circle-arrow-down { - background-position: -312px -144px; + background-position: -312px -144px; } .icon-globe { - background-position: -336px -144px; + background-position: -336px -144px; } .icon-wrench { - background-position: -360px -144px; + background-position: -360px -144px; } .icon-tasks { - background-position: -384px -144px; + background-position: -384px -144px; } .icon-filter { - background-position: -408px -144px; + background-position: -408px -144px; } .icon-briefcase { - background-position: -432px -144px; + background-position: -432px -144px; } .icon-fullscreen { - background-position: -456px -144px; + background-position: -456px -144px; } .dropup, .dropdown { - position: relative; + position: relative; } .dropdown-toggle { - *margin-bottom: -3px; + *margin-bottom: -3px; } .dropdown-toggle:active, .open .dropdown-toggle { - outline: 0; + outline: 0; } .caret { - display: inline-block; - width: 0; - height: 0; - vertical-align: top; - border-top: 4px solid #000000; - border-right: 4px solid transparent; - border-left: 4px solid transparent; - content: ""; + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-top: 4px solid #000000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + content: ""; } .dropdown .caret { - margin-top: 8px; - margin-left: 2px; + margin-top: 8px; + margin-left: 2px; } .dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; - list-style: none; - background-color: #ffffff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - *border-right-width: 2px; - *border-bottom-width: 2px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; } .dropdown-menu.pull-right { - right: 0; - left: auto; + right: 0; + left: auto; } .dropdown-menu .divider { - *width: 100%; - height: 1px; - margin: 9px 1px; - *margin: -5px 0 5px; - overflow: hidden; - background-color: #e5e5e5; - border-bottom: 1px solid #ffffff; + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; } .dropdown-menu li > a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 20px; - color: #333333; - white-space: nowrap; + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; } .dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a { - color: #ffffff; - text-decoration: none; - background-color: #0081c2; - background-image: -moz-linear-gradient(top, #0088cc, #0077b3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); - background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); - background-image: -o-linear-gradient(top, #0088cc, #0077b3); - background-image: linear-gradient(to bottom, #0088cc, #0077b3); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); } .dropdown-menu .active > a, .dropdown-menu .active > a:hover { - color: #ffffff; - text-decoration: none; - background-color: #0081c2; - background-image: -moz-linear-gradient(top, #0088cc, #0077b3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); - background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); - background-image: -o-linear-gradient(top, #0088cc, #0077b3); - background-image: linear-gradient(to bottom, #0088cc, #0077b3); - background-repeat: repeat-x; - outline: 0; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); } .dropdown-menu .disabled > a, .dropdown-menu .disabled > a:hover { - color: #999999; + color: #999999; } .dropdown-menu .disabled > a:hover { - text-decoration: none; - cursor: default; - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + text-decoration: none; + cursor: default; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .open { - *z-index: 1000; + *z-index: 1000; } .open > .dropdown-menu { - display: block; + display: block; } .pull-right > .dropdown-menu { - right: 0; - left: auto; + right: 0; + left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { - border-top: 0; - border-bottom: 4px solid #000000; - content: ""; + border-top: 0; + border-bottom: 4px solid #000000; + content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { - top: auto; - bottom: 100%; - margin-bottom: 1px; + top: auto; + bottom: 100%; + margin-bottom: 1px; } .dropdown-submenu { - position: relative; + position: relative; } .dropdown-submenu > .dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - -webkit-border-radius: 0 6px 6px 6px; - -moz-border-radius: 0 6px 6px 6px; - border-radius: 0 6px 6px 6px; + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px 6px; + border-radius: 0 6px 6px 6px; } .dropdown-submenu:hover > .dropdown-menu { - display: block; + display: block; } .dropup .dropdown-submenu > .dropdown-menu { - top: auto; - bottom: 0; - margin-top: 0; - margin-bottom: -2px; - -webkit-border-radius: 5px 5px 5px 0; - -moz-border-radius: 5px 5px 5px 0; - border-radius: 5px 5px 5px 0; + top: auto; + bottom: 0; + margin-top: 0; + margin-bottom: -2px; + -webkit-border-radius: 5px 5px 5px 0; + -moz-border-radius: 5px 5px 5px 0; + border-radius: 5px 5px 5px 0; } .dropdown-submenu > a:after { - display: block; - float: right; - width: 0; - height: 0; - margin-top: 5px; - margin-right: -10px; - border-color: transparent; - border-left-color: #cccccc; - border-style: solid; - border-width: 5px 0 5px 5px; - content: " "; + display: block; + float: right; + width: 0; + height: 0; + margin-top: 5px; + margin-right: -10px; + border-color: transparent; + border-left-color: #cccccc; + border-style: solid; + border-width: 5px 0 5px 5px; + content: " "; } .dropdown-submenu:hover > a:after { - border-left-color: #ffffff; + border-left-color: #ffffff; } .dropdown-submenu.pull-left { - float: none; + float: none; } .dropdown-submenu.pull-left > .dropdown-menu { - left: -100%; - margin-left: 10px; - -webkit-border-radius: 6px 0 6px 6px; - -moz-border-radius: 6px 0 6px 6px; - border-radius: 6px 0 6px 6px; + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; } .dropdown .dropdown-menu .nav-header { - padding-right: 20px; - padding-left: 20px; + padding-right: 20px; + padding-left: 20px; } .typeahead { - z-index: 1051; - margin-top: 2px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + z-index: 1051; + margin-top: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .well { - min-height: 20px; - padding: 19px; - margin-bottom: 20px; - background-color: #f5f5f5; - border: 1px solid #e3e3e3; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { - border-color: #ddd; - border-color: rgba(0, 0, 0, 0.15); + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); } .well-large { - padding: 24px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + padding: 24px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .well-small { - padding: 9px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + padding: 9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .fade { - opacity: 0; - -webkit-transition: opacity 0.15s linear; - -moz-transition: opacity 0.15s linear; - -o-transition: opacity 0.15s linear; - transition: opacity 0.15s linear; + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; } .fade.in { - opacity: 1; + opacity: 1; } .collapse { - position: relative; - height: 0; - overflow: hidden; - -webkit-transition: height 0.35s ease; - -moz-transition: height 0.35s ease; - -o-transition: height 0.35s ease; - transition: height 0.35s ease; + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; } .collapse.in { - height: auto; + height: auto; } .close { - float: right; - font-size: 20px; - font-weight: bold; - line-height: 20px; - color: #000000; - text-shadow: 0 1px 0 #ffffff; - opacity: 0.2; - filter: alpha(opacity=20); + float: right; + font-size: 20px; + font-weight: bold; + line-height: 20px; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); } .close:hover { - color: #000000; - text-decoration: none; - cursor: pointer; - opacity: 0.4; - filter: alpha(opacity=40); + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; + filter: alpha(opacity=40); } button.close { - padding: 0; - cursor: pointer; - background: transparent; - border: 0; - -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; } .btn { - display: inline-block; - *display: inline; - padding: 4px 12px; - margin-bottom: 0; - *margin-left: .3em; - font-size: 14px; - line-height: 20px; - color: #333333; - text-align: center; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - vertical-align: middle; - cursor: pointer; - background-color: #f5f5f5; - *background-color: #e6e6e6; - background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); - background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); - background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); - background-repeat: repeat-x; - border: 1px solid #bbbbbb; - *border: 0; - border-color: #e6e6e6 #e6e6e6 #bfbfbf; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - border-bottom-color: #a2a2a2; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - *zoom: 1; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + display: inline-block; + *display: inline; + padding: 4px 12px; + margin-bottom: 0; + *margin-left: .3em; + font-size: 14px; + line-height: 20px; + color: #333333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; + cursor: pointer; + background-color: #f5f5f5; + *background-color: #e6e6e6; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + border: 1px solid #bbbbbb; + *border: 0; + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + border-bottom-color: #a2a2a2; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn:hover, @@ -3217,113 +3206,113 @@ button.close { .btn.active, .btn.disabled, .btn[disabled] { - color: #333333; - background-color: #e6e6e6; - *background-color: #d9d9d9; + color: #333333; + background-color: #e6e6e6; + *background-color: #d9d9d9; } .btn:active, .btn.active { - background-color: #cccccc \9; + background-color: #cccccc \9; } .btn:first-child { - *margin-left: 0; + *margin-left: 0; } .btn:hover { - color: #333333; - text-decoration: none; - background-position: 0 -15px; - -webkit-transition: background-position 0.1s linear; - -moz-transition: background-position 0.1s linear; - -o-transition: background-position 0.1s linear; - transition: background-position 0.1s linear; + color: #333333; + text-decoration: none; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; } .btn:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } .btn.active, .btn:active { - background-image: none; - outline: 0; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn.disabled, .btn[disabled] { - cursor: default; - background-image: none; - opacity: 0.65; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; + cursor: default; + background-image: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; } .btn-large { - padding: 11px 19px; - font-size: 17.5px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + padding: 11px 19px; + font-size: 17.5px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .btn-large [class^="icon-"], .btn-large [class*=" icon-"] { - margin-top: 4px; + margin-top: 4px; } .btn-small { - padding: 2px 10px; - font-size: 11.9px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + padding: 2px 10px; + font-size: 11.9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .btn-small [class^="icon-"], .btn-small [class*=" icon-"] { - margin-top: 0; + margin-top: 0; } .btn-mini [class^="icon-"], .btn-mini [class*=" icon-"] { - margin-top: -1px; + margin-top: -1px; } .btn-mini { - padding: 0 6px; - font-size: 10.5px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + padding: 0 6px; + font-size: 10.5px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .btn-block { - display: block; - width: 100%; - padding-right: 0; - padding-left: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + display: block; + width: 100%; + padding-right: 0; + padding-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } .btn-block + .btn-block { - margin-top: 5px; + margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { - width: 100%; + width: 100%; } .btn-primary.active, @@ -3332,29 +3321,29 @@ input[type="button"].btn-block { .btn-success.active, .btn-info.active, .btn-inverse.active { - color: rgba(255, 255, 255, 0.75); + color: rgba(255, 255, 255, 0.75); } .btn { - border-color: #c5c5c5; - border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); + border-color: #c5c5c5; + border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); } .btn-primary { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #006dcc; - *background-color: #0044cc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(to bottom, #0088cc, #0044cc); - background-repeat: repeat-x; - border-color: #0044cc #0044cc #002a80; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #006dcc; + *background-color: #0044cc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(to bottom, #0088cc, #0044cc); + background-repeat: repeat-x; + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-primary:hover, @@ -3362,31 +3351,31 @@ input[type="button"].btn-block { .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { - color: #ffffff; - background-color: #0044cc; - *background-color: #003bb3; + color: #ffffff; + background-color: #0044cc; + *background-color: #003bb3; } .btn-primary:active, .btn-primary.active { - background-color: #003399 \9; + background-color: #003399 \9; } .btn-warning { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #faa732; - *background-color: #f89406; - background-image: -moz-linear-gradient(top, #fbb450, #f89406); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); - background-image: -webkit-linear-gradient(top, #fbb450, #f89406); - background-image: -o-linear-gradient(top, #fbb450, #f89406); - background-image: linear-gradient(to bottom, #fbb450, #f89406); - background-repeat: repeat-x; - border-color: #f89406 #f89406 #ad6704; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #faa732; + *background-color: #f89406; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + border-color: #f89406 #f89406 #ad6704; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-warning:hover, @@ -3394,31 +3383,31 @@ input[type="button"].btn-block { .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] { - color: #ffffff; - background-color: #f89406; - *background-color: #df8505; + color: #ffffff; + background-color: #f89406; + *background-color: #df8505; } .btn-warning:active, .btn-warning.active { - background-color: #c67605 \9; + background-color: #c67605 \9; } .btn-danger { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #da4f49; - *background-color: #bd362f; - background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); - background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); - background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); - background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); - background-repeat: repeat-x; - border-color: #bd362f #bd362f #802420; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #da4f49; + *background-color: #bd362f; + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); + background-repeat: repeat-x; + border-color: #bd362f #bd362f #802420; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-danger:hover, @@ -3426,31 +3415,31 @@ input[type="button"].btn-block { .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] { - color: #ffffff; - background-color: #bd362f; - *background-color: #a9302a; + color: #ffffff; + background-color: #bd362f; + *background-color: #a9302a; } .btn-danger:active, .btn-danger.active { - background-color: #942a25 \9; + background-color: #942a25 \9; } .btn-success { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #5bb75b; - *background-color: #51a351; - background-image: -moz-linear-gradient(top, #62c462, #51a351); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); - background-image: -webkit-linear-gradient(top, #62c462, #51a351); - background-image: -o-linear-gradient(top, #62c462, #51a351); - background-image: linear-gradient(to bottom, #62c462, #51a351); - background-repeat: repeat-x; - border-color: #51a351 #51a351 #387038; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #5bb75b; + *background-color: #51a351; + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(to bottom, #62c462, #51a351); + background-repeat: repeat-x; + border-color: #51a351 #51a351 #387038; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-success:hover, @@ -3458,31 +3447,31 @@ input[type="button"].btn-block { .btn-success.active, .btn-success.disabled, .btn-success[disabled] { - color: #ffffff; - background-color: #51a351; - *background-color: #499249; + color: #ffffff; + background-color: #51a351; + *background-color: #499249; } .btn-success:active, .btn-success.active { - background-color: #408140 \9; + background-color: #408140 \9; } .btn-info { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #49afcd; - *background-color: #2f96b4; - background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); - background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); - background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); - background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); - background-repeat: repeat-x; - border-color: #2f96b4 #2f96b4 #1f6377; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #49afcd; + *background-color: #2f96b4; + background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); + background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); + background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); + background-repeat: repeat-x; + border-color: #2f96b4 #2f96b4 #1f6377; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-info:hover, @@ -3490,31 +3479,31 @@ input[type="button"].btn-block { .btn-info.active, .btn-info.disabled, .btn-info[disabled] { - color: #ffffff; - background-color: #2f96b4; - *background-color: #2a85a0; + color: #ffffff; + background-color: #2f96b4; + *background-color: #2a85a0; } .btn-info:active, .btn-info.active { - background-color: #24748c \9; + background-color: #24748c \9; } .btn-inverse { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #363636; - *background-color: #222222; - background-image: -moz-linear-gradient(top, #444444, #222222); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); - background-image: -webkit-linear-gradient(top, #444444, #222222); - background-image: -o-linear-gradient(top, #444444, #222222); - background-image: linear-gradient(to bottom, #444444, #222222); - background-repeat: repeat-x; - border-color: #222222 #222222 #000000; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #363636; + *background-color: #222222; + background-image: -moz-linear-gradient(top, #444444, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); + background-image: -webkit-linear-gradient(top, #444444, #222222); + background-image: -o-linear-gradient(top, #444444, #222222); + background-image: linear-gradient(to bottom, #444444, #222222); + background-repeat: repeat-x; + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .btn-inverse:hover, @@ -3522,271 +3511,271 @@ input[type="button"].btn-block { .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] { - color: #ffffff; - background-color: #222222; - *background-color: #151515; + color: #ffffff; + background-color: #222222; + *background-color: #151515; } .btn-inverse:active, .btn-inverse.active { - background-color: #080808 \9; + background-color: #080808 \9; } button.btn, input[type="submit"].btn { - *padding-top: 3px; - *padding-bottom: 3px; + *padding-top: 3px; + *padding-bottom: 3px; } button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { - padding: 0; - border: 0; + padding: 0; + border: 0; } button.btn.btn-large, input[type="submit"].btn.btn-large { - *padding-top: 7px; - *padding-bottom: 7px; + *padding-top: 7px; + *padding-bottom: 7px; } button.btn.btn-small, input[type="submit"].btn.btn-small { - *padding-top: 3px; - *padding-bottom: 3px; + *padding-top: 3px; + *padding-bottom: 3px; } button.btn.btn-mini, input[type="submit"].btn.btn-mini { - *padding-top: 1px; - *padding-bottom: 1px; + *padding-top: 1px; + *padding-bottom: 1px; } .btn-link, .btn-link:active, .btn-link[disabled] { - background-color: transparent; - background-image: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; + background-color: transparent; + background-image: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; } .btn-link { - color: #0088cc; - cursor: pointer; - border-color: transparent; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + color: #0088cc; + cursor: pointer; + border-color: transparent; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .btn-link:hover { - color: #005580; - text-decoration: underline; - background-color: transparent; + color: #005580; + text-decoration: underline; + background-color: transparent; } .btn-link[disabled]:hover { - color: #333333; - text-decoration: none; + color: #333333; + text-decoration: none; } .btn-group { - position: relative; - display: inline-block; - *display: inline; - *margin-left: .3em; - font-size: 0; - white-space: nowrap; - vertical-align: middle; - *zoom: 1; + position: relative; + display: inline-block; + *display: inline; + *margin-left: .3em; + font-size: 0; + white-space: nowrap; + vertical-align: middle; + *zoom: 1; } .btn-group:first-child { - *margin-left: 0; + *margin-left: 0; } .btn-group + .btn-group { - margin-left: 5px; + margin-left: 5px; } .btn-toolbar { - margin-top: 10px; - margin-bottom: 10px; - font-size: 0; + margin-top: 10px; + margin-bottom: 10px; + font-size: 0; } .btn-toolbar > .btn + .btn, .btn-toolbar > .btn-group + .btn, .btn-toolbar > .btn + .btn-group { - margin-left: 5px; + margin-left: 5px; } .btn-group > .btn { - position: relative; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + position: relative; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .btn-group > .btn + .btn { - margin-left: -1px; + margin-left: -1px; } .btn-group > .btn, .btn-group > .dropdown-menu, .btn-group > .popover { - font-size: 14px; + font-size: 14px; } .btn-group > .btn-mini { - font-size: 10.5px; + font-size: 10.5px; } .btn-group > .btn-small { - font-size: 11.9px; + font-size: 11.9px; } .btn-group > .btn-large { - font-size: 17.5px; + font-size: 17.5px; } .btn-group > .btn:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-topleft: 4px; + margin-left: 0; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; } .btn-group > .btn:last-child, .btn-group > .dropdown-toggle { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-bottomright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; } .btn-group > .btn.large:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -webkit-border-top-left-radius: 6px; - border-top-left-radius: 6px; - -moz-border-radius-bottomleft: 6px; - -moz-border-radius-topleft: 6px; + margin-left: 0; + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; } .btn-group > .btn.large:last-child, .btn-group > .large.dropdown-toggle { - -webkit-border-top-right-radius: 6px; - border-top-right-radius: 6px; - -webkit-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - -moz-border-radius-topright: 6px; - -moz-border-radius-bottomright: 6px; + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; } .btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active { - z-index: 2; + z-index: 2; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { - outline: 0; + outline: 0; } .btn-group > .btn + .dropdown-toggle { - *padding-top: 5px; - padding-right: 8px; - *padding-bottom: 5px; - padding-left: 8px; - -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + *padding-top: 5px; + padding-right: 8px; + *padding-bottom: 5px; + padding-left: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn-group > .btn-mini + .dropdown-toggle { - *padding-top: 2px; - padding-right: 5px; - *padding-bottom: 2px; - padding-left: 5px; + *padding-top: 2px; + padding-right: 5px; + *padding-bottom: 2px; + padding-left: 5px; } .btn-group > .btn-small + .dropdown-toggle { - *padding-top: 5px; - *padding-bottom: 4px; + *padding-top: 5px; + *padding-bottom: 4px; } .btn-group > .btn-large + .dropdown-toggle { - *padding-top: 7px; - padding-right: 12px; - *padding-bottom: 7px; - padding-left: 12px; + *padding-top: 7px; + padding-right: 12px; + *padding-bottom: 7px; + padding-left: 12px; } .btn-group.open .dropdown-toggle { - background-image: none; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); } .btn-group.open .btn.dropdown-toggle { - background-color: #e6e6e6; + background-color: #e6e6e6; } .btn-group.open .btn-primary.dropdown-toggle { - background-color: #0044cc; + background-color: #0044cc; } .btn-group.open .btn-warning.dropdown-toggle { - background-color: #f89406; + background-color: #f89406; } .btn-group.open .btn-danger.dropdown-toggle { - background-color: #bd362f; + background-color: #bd362f; } .btn-group.open .btn-success.dropdown-toggle { - background-color: #51a351; + background-color: #51a351; } .btn-group.open .btn-info.dropdown-toggle { - background-color: #2f96b4; + background-color: #2f96b4; } .btn-group.open .btn-inverse.dropdown-toggle { - background-color: #222222; + background-color: #222222; } .btn .caret { - margin-top: 8px; - margin-left: 0; + margin-top: 8px; + margin-left: 0; } .btn-mini .caret, .btn-small .caret, .btn-large .caret { - margin-top: 6px; + margin-top: 6px; } .btn-large .caret { - border-top-width: 5px; - border-right-width: 5px; - border-left-width: 5px; + border-top-width: 5px; + border-right-width: 5px; + border-left-width: 5px; } .dropup .btn-large .caret { - border-bottom-width: 5px; + border-bottom-width: 5px; } .btn-primary .caret, @@ -3795,824 +3784,824 @@ input[type="submit"].btn.btn-mini { .btn-info .caret, .btn-success .caret, .btn-inverse .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; + border-top-color: #ffffff; + border-bottom-color: #ffffff; } .btn-group-vertical { - display: inline-block; - *display: inline; - /* IE7 inline-block hack */ + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ - *zoom: 1; + *zoom: 1; } .btn-group-vertical > .btn { - display: block; - float: none; - max-width: 100%; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + display: block; + float: none; + max-width: 100%; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .btn-group-vertical > .btn + .btn { - margin-top: -1px; - margin-left: 0; + margin-top: -1px; + margin-left: 0; } .btn-group-vertical > .btn:first-child { - -webkit-border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - border-radius: 4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; } .btn-group-vertical > .btn:last-child { - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius: 0 0 4px 4px; - border-radius: 0 0 4px 4px; + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; } .btn-group-vertical > .btn-large:first-child { - -webkit-border-radius: 6px 6px 0 0; - -moz-border-radius: 6px 6px 0 0; - border-radius: 6px 6px 0 0; + -webkit-border-radius: 6px 6px 0 0; + -moz-border-radius: 6px 6px 0 0; + border-radius: 6px 6px 0 0; } .btn-group-vertical > .btn-large:last-child { - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; } .alert { - padding: 8px 35px 8px 14px; - margin-bottom: 20px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - background-color: #fcf8e3; - border: 1px solid #fbeed5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + padding: 8px 35px 8px 14px; + margin-bottom: 20px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #fcf8e3; + border: 1px solid #fbeed5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .alert, .alert h4 { - color: #c09853; + color: #c09853; } .alert h4 { - margin: 0; + margin: 0; } .alert .close { - position: relative; - top: -2px; - right: -21px; - line-height: 20px; + position: relative; + top: -2px; + right: -21px; + line-height: 20px; } .alert-success { - color: #468847; - background-color: #dff0d8; - border-color: #d6e9c6; + color: #468847; + background-color: #dff0d8; + border-color: #d6e9c6; } .alert-success h4 { - color: #468847; + color: #468847; } .alert-danger, .alert-error { - color: #b94a48; - background-color: #f2dede; - border-color: #eed3d7; + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; } .alert-danger h4, .alert-error h4 { - color: #b94a48; + color: #b94a48; } .alert-info { - color: #3a87ad; - background-color: #d9edf7; - border-color: #bce8f1; + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1; } .alert-info h4 { - color: #3a87ad; + color: #3a87ad; } .alert-block { - padding-top: 14px; - padding-bottom: 14px; + padding-top: 14px; + padding-bottom: 14px; } .alert-block > p, .alert-block > ul { - margin-bottom: 0; + margin-bottom: 0; } .alert-block p + p { - margin-top: 5px; + margin-top: 5px; } .nav { - margin-bottom: 20px; - margin-left: 0; - list-style: none; + margin-bottom: 20px; + margin-left: 0; + list-style: none; } .nav > li > a { - display: block; + display: block; } .nav > li > a:hover { - text-decoration: none; - background-color: #eeeeee; + text-decoration: none; + background-color: #eeeeee; } .nav > li > a > img { - max-width: none; + max-width: none; } .nav > .pull-right { - float: right; + float: right; } .nav-header { - display: block; - padding: 3px 15px; - font-size: 11px; - font-weight: bold; - line-height: 20px; - color: #999999; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - text-transform: uppercase; + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 20px; + color: #999999; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-transform: uppercase; } .nav li + .nav-header { - margin-top: 9px; + margin-top: 9px; } .nav-list { - padding-right: 15px; - padding-left: 15px; - margin-bottom: 0; + padding-right: 15px; + padding-left: 15px; + margin-bottom: 0; } .nav-list > li > a, .nav-list .nav-header { - margin-right: -15px; - margin-left: -15px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + margin-right: -15px; + margin-left: -15px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } .nav-list > li > a { - padding: 3px 15px; + padding: 3px 15px; } .nav-list > .active > a, .nav-list > .active > a:hover { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); - background-color: #0088cc; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + background-color: #0088cc; } .nav-list [class^="icon-"], .nav-list [class*=" icon-"] { - margin-right: 2px; + margin-right: 2px; } .nav-list .divider { - *width: 100%; - height: 1px; - margin: 9px 1px; - *margin: -5px 0 5px; - overflow: hidden; - background-color: #e5e5e5; - border-bottom: 1px solid #ffffff; + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; } .nav-tabs, .nav-pills { - *zoom: 1; + *zoom: 1; } .nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .nav-tabs:after, .nav-pills:after { - clear: both; + clear: both; } .nav-tabs > li, .nav-pills > li { - float: left; + float: left; } .nav-tabs > li > a, .nav-pills > li > a { - padding-right: 12px; - padding-left: 12px; - margin-right: 2px; - line-height: 14px; + padding-right: 12px; + padding-left: 12px; + margin-right: 2px; + line-height: 14px; } .nav-tabs { - border-bottom: 1px solid #ddd; + border-bottom: 1px solid #ddd; } .nav-tabs > li { - margin-bottom: -1px; + margin-bottom: -1px; } .nav-tabs > li > a { - padding-top: 8px; - padding-bottom: 8px; - line-height: 20px; - border: 1px solid transparent; - -webkit-border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - border-radius: 4px 4px 0 0; + padding-top: 8px; + padding-bottom: 8px; + line-height: 20px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { - border-color: #eeeeee #eeeeee #dddddd; + border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > .active > a, .nav-tabs > .active > a:hover { - color: #555555; - cursor: default; - background-color: #ffffff; - border: 1px solid #ddd; - border-bottom-color: transparent; + color: #555555; + cursor: default; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; } .nav-pills > li > a { - padding-top: 8px; - padding-bottom: 8px; - margin-top: 2px; - margin-bottom: 2px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; + padding-top: 8px; + padding-bottom: 8px; + margin-top: 2px; + margin-bottom: 2px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; } .nav-pills > .active > a, .nav-pills > .active > a:hover { - color: #ffffff; - background-color: #0088cc; + color: #ffffff; + background-color: #0088cc; } .nav-stacked > li { - float: none; + float: none; } .nav-stacked > li > a { - margin-right: 0; + margin-right: 0; } .nav-tabs.nav-stacked { - border-bottom: 0; + border-bottom: 0; } .nav-tabs.nav-stacked > li > a { - border: 1px solid #ddd; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + border: 1px solid #ddd; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .nav-tabs.nav-stacked > li:first-child > a { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-topleft: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; } .nav-tabs.nav-stacked > li:last-child > a { - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -moz-border-radius-bottomright: 4px; - -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; } .nav-tabs.nav-stacked > li > a:hover { - z-index: 2; - border-color: #ddd; + z-index: 2; + border-color: #ddd; } .nav-pills.nav-stacked > li > a { - margin-bottom: 3px; + margin-bottom: 3px; } .nav-pills.nav-stacked > li:last-child > a { - margin-bottom: 1px; + margin-bottom: 1px; } .nav-tabs .dropdown-menu { - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; } .nav-pills .dropdown-menu { - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .nav .dropdown-toggle .caret { - margin-top: 6px; - border-top-color: #0088cc; - border-bottom-color: #0088cc; + margin-top: 6px; + border-top-color: #0088cc; + border-bottom-color: #0088cc; } .nav .dropdown-toggle:hover .caret { - border-top-color: #005580; - border-bottom-color: #005580; + border-top-color: #005580; + border-bottom-color: #005580; } /* move down carets for tabs */ .nav-tabs .dropdown-toggle .caret { - margin-top: 8px; + margin-top: 8px; } .nav .active .dropdown-toggle .caret { - border-top-color: #fff; - border-bottom-color: #fff; + border-top-color: #fff; + border-bottom-color: #fff; } .nav-tabs .active .dropdown-toggle .caret { - border-top-color: #555555; - border-bottom-color: #555555; + border-top-color: #555555; + border-bottom-color: #555555; } .nav > .dropdown.active > a:hover { - cursor: pointer; + cursor: pointer; } .nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > li.dropdown.open.active > a:hover { - color: #ffffff; - background-color: #999999; - border-color: #999999; + color: #ffffff; + background-color: #999999; + border-color: #999999; } .nav li.dropdown.open .caret, .nav li.dropdown.open.active .caret, .nav li.dropdown.open a:hover .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; - opacity: 1; - filter: alpha(opacity=100); + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 1; + filter: alpha(opacity=100); } .tabs-stacked .open > a:hover { - border-color: #999999; + border-color: #999999; } .tabbable { - *zoom: 1; + *zoom: 1; } .tabbable:before, .tabbable:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .tabbable:after { - clear: both; + clear: both; } .tab-content { - overflow: auto; + overflow: auto; } .tabs-below > .nav-tabs, .tabs-right > .nav-tabs, .tabs-left > .nav-tabs { - border-bottom: 0; + border-bottom: 0; } .tab-content > .tab-pane, .pill-content > .pill-pane { - display: none; + display: none; } .tab-content > .active, .pill-content > .active { - display: block; + display: block; } .tabs-below > .nav-tabs { - border-top: 1px solid #ddd; + border-top: 1px solid #ddd; } .tabs-below > .nav-tabs > li { - margin-top: -1px; - margin-bottom: 0; + margin-top: -1px; + margin-bottom: 0; } .tabs-below > .nav-tabs > li > a { - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius: 0 0 4px 4px; - border-radius: 0 0 4px 4px; + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; } .tabs-below > .nav-tabs > li > a:hover { - border-top-color: #ddd; - border-bottom-color: transparent; + border-top-color: #ddd; + border-bottom-color: transparent; } .tabs-below > .nav-tabs > .active > a, .tabs-below > .nav-tabs > .active > a:hover { - border-color: transparent #ddd #ddd #ddd; + border-color: transparent #ddd #ddd #ddd; } .tabs-left > .nav-tabs > li, .tabs-right > .nav-tabs > li { - float: none; + float: none; } .tabs-left > .nav-tabs > li > a, .tabs-right > .nav-tabs > li > a { - min-width: 74px; - margin-right: 0; - margin-bottom: 3px; + min-width: 74px; + margin-right: 0; + margin-bottom: 3px; } .tabs-left > .nav-tabs { - float: left; - margin-right: 19px; - border-right: 1px solid #ddd; + float: left; + margin-right: 19px; + border-right: 1px solid #ddd; } .tabs-left > .nav-tabs > li > a { - margin-right: -1px; - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } .tabs-left > .nav-tabs > li > a:hover { - border-color: #eeeeee #dddddd #eeeeee #eeeeee; + border-color: #eeeeee #dddddd #eeeeee #eeeeee; } .tabs-left > .nav-tabs .active > a, .tabs-left > .nav-tabs .active > a:hover { - border-color: #ddd transparent #ddd #ddd; - *border-right-color: #ffffff; + border-color: #ddd transparent #ddd #ddd; + *border-right-color: #ffffff; } .tabs-right > .nav-tabs { - float: right; - margin-left: 19px; - border-left: 1px solid #ddd; + float: right; + margin-left: 19px; + border-left: 1px solid #ddd; } .tabs-right > .nav-tabs > li > a { - margin-left: -1px; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; } .tabs-right > .nav-tabs > li > a:hover { - border-color: #eeeeee #eeeeee #eeeeee #dddddd; + border-color: #eeeeee #eeeeee #eeeeee #dddddd; } .tabs-right > .nav-tabs .active > a, .tabs-right > .nav-tabs .active > a:hover { - border-color: #ddd #ddd #ddd transparent; - *border-left-color: #ffffff; + border-color: #ddd #ddd #ddd transparent; + *border-left-color: #ffffff; } .nav > .disabled > a { - color: #999999; + color: #999999; } .nav > .disabled > a:hover { - text-decoration: none; - cursor: default; - background-color: transparent; + text-decoration: none; + cursor: default; + background-color: transparent; } .navbar { - *position: relative; - *z-index: 2; - margin-bottom: 20px; - overflow: visible; + *position: relative; + *z-index: 2; + margin-bottom: 20px; + overflow: visible; } .navbar-inner { - min-height: 40px; - padding-right: 20px; - padding-left: 20px; - background-color: #fafafa; - background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); - background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); - background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); - background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); - background-repeat: repeat-x; - border: 1px solid #d4d4d4; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); - *zoom: 1; - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + min-height: 40px; + padding-right: 20px; + padding-left: 20px; + background-color: #fafafa; + background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); + background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); + background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); + background-repeat: repeat-x; + border: 1px solid #d4d4d4; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); + *zoom: 1; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); } .navbar-inner:before, .navbar-inner:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .navbar-inner:after { - clear: both; + clear: both; } .navbar .container { - width: auto; + width: auto; } .nav-collapse.collapse { - height: auto; - overflow: visible; + height: auto; + overflow: visible; } .navbar .brand { - display: block; - float: left; - padding: 10px 20px 10px; - margin-left: -20px; - font-size: 20px; - font-weight: 200; - color: #777777; - text-shadow: 0 1px 0 #ffffff; + display: block; + float: left; + padding: 10px 20px 10px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + color: #777777; + text-shadow: 0 1px 0 #ffffff; } .navbar .brand:hover { - text-decoration: none; + text-decoration: none; } .navbar-text { - margin-bottom: 0; - line-height: 40px; - color: #777777; + margin-bottom: 0; + line-height: 40px; + color: #777777; } .navbar-link { - color: #777777; + color: #777777; } .navbar-link:hover { - color: #333333; + color: #333333; } .navbar .divider-vertical { - height: 40px; - margin: 0 9px; - border-right: 1px solid #ffffff; - border-left: 1px solid #f2f2f2; + height: 40px; + margin: 0 9px; + border-right: 1px solid #ffffff; + border-left: 1px solid #f2f2f2; } .navbar .btn, .navbar .btn-group { - margin-top: 5px; + margin-top: 5px; } .navbar .btn-group .btn, .navbar .input-prepend .btn, .navbar .input-append .btn { - margin-top: 0; + margin-top: 0; } .navbar-form { - margin-bottom: 0; - *zoom: 1; + margin-bottom: 0; + *zoom: 1; } .navbar-form:before, .navbar-form:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .navbar-form:after { - clear: both; + clear: both; } .navbar-form input, .navbar-form select, .navbar-form .radio, .navbar-form .checkbox { - margin-top: 5px; + margin-top: 5px; } .navbar-form input, .navbar-form select, .navbar-form .btn { - display: inline-block; - margin-bottom: 0; + display: inline-block; + margin-bottom: 0; } .navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] { - margin-top: 3px; + margin-top: 3px; } .navbar-form .input-append, .navbar-form .input-prepend { - margin-top: 5px; - white-space: nowrap; + margin-top: 5px; + white-space: nowrap; } .navbar-form .input-append input, .navbar-form .input-prepend input { - margin-top: 0; + margin-top: 0; } .navbar-search { - position: relative; - float: left; - margin-top: 5px; - margin-bottom: 0; + position: relative; + float: left; + margin-top: 5px; + margin-bottom: 0; } .navbar-search .search-query { - padding: 4px 14px; - margin-bottom: 0; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 13px; - font-weight: normal; - line-height: 1; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; + padding: 4px 14px; + margin-bottom: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; } .navbar-static-top { - position: static; - margin-bottom: 0; + position: static; + margin-bottom: 0; } .navbar-static-top .navbar-inner { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .navbar-fixed-top, .navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: 1030; - margin-bottom: 0; + position: fixed; + right: 0; + left: 0; + z-index: 1030; + margin-bottom: 0; } .navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner { - border-width: 0 0 1px; + border-width: 0 0 1px; } .navbar-fixed-bottom .navbar-inner { - border-width: 1px 0 0; + border-width: 1px 0 0; } .navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner { - padding-right: 0; - padding-left: 0; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + padding-right: 0; + padding-left: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; } .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { - width: 940px; + width: 940px; } .navbar-fixed-top { - top: 0; + top: 0; } .navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner { - -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); - box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); } .navbar-fixed-bottom { - bottom: 0; + bottom: 0; } .navbar-fixed-bottom .navbar-inner { - -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); - box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); } .navbar .nav { - position: relative; - left: 0; - display: block; - float: left; - margin: 0 10px 0 0; + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; } .navbar .nav.pull-right { - float: right; - margin-right: 0; + float: right; + margin-right: 0; } .navbar .nav > li { - float: left; + float: left; } .navbar .nav > li > a { - float: none; - padding: 10px 15px 10px; - color: #777777; - text-decoration: none; - text-shadow: 0 1px 0 #ffffff; + float: none; + padding: 10px 15px 10px; + color: #777777; + text-decoration: none; + text-shadow: 0 1px 0 #ffffff; } .navbar .nav .dropdown-toggle .caret { - margin-top: 8px; + margin-top: 8px; } .navbar .nav > li > a:focus, .navbar .nav > li > a:hover { - color: #333333; - text-decoration: none; - background-color: transparent; + color: #333333; + text-decoration: none; + background-color: transparent; } .navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus { - color: #555555; - text-decoration: none; - background-color: #e5e5e5; - -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); - -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + color: #555555; + text-decoration: none; + background-color: #e5e5e5; + -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); } .navbar .btn-navbar { - display: none; - float: right; - padding: 7px 10px; - margin-right: 5px; - margin-left: 5px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #ededed; - *background-color: #e5e5e5; - background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); - background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); - background-repeat: repeat-x; - border-color: #e5e5e5 #e5e5e5 #bfbfbf; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + display: none; + float: right; + padding: 7px 10px; + margin-right: 5px; + margin-left: 5px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #ededed; + *background-color: #e5e5e5; + background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); + background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); + background-repeat: repeat-x; + border-color: #e5e5e5 #e5e5e5 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); } .navbar .btn-navbar:hover, @@ -4620,258 +4609,258 @@ input[type="submit"].btn.btn-mini { .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled] { - color: #ffffff; - background-color: #e5e5e5; - *background-color: #d9d9d9; + color: #ffffff; + background-color: #e5e5e5; + *background-color: #d9d9d9; } .navbar .btn-navbar:active, .navbar .btn-navbar.active { - background-color: #cccccc \9; + background-color: #cccccc \9; } .navbar .btn-navbar .icon-bar { - display: block; - width: 18px; - height: 2px; - background-color: #f5f5f5; - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; - -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); - -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + display: block; + width: 18px; + height: 2px; + background-color: #f5f5f5; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); } .btn-navbar .icon-bar + .icon-bar { - margin-top: 3px; + margin-top: 3px; } .navbar .nav > li > .dropdown-menu:before { - position: absolute; - top: -7px; - left: 9px; - display: inline-block; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-left: 7px solid transparent; - border-bottom-color: rgba(0, 0, 0, 0.2); - content: ''; + position: absolute; + top: -7px; + left: 9px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; } .navbar .nav > li > .dropdown-menu:after { - position: absolute; - top: -6px; - left: 10px; - display: inline-block; - border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; - border-left: 6px solid transparent; - content: ''; + position: absolute; + top: -6px; + left: 10px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; } .navbar-fixed-bottom .nav > li > .dropdown-menu:before { - top: auto; - bottom: -7px; - border-top: 7px solid #ccc; - border-bottom: 0; - border-top-color: rgba(0, 0, 0, 0.2); + top: auto; + bottom: -7px; + border-top: 7px solid #ccc; + border-bottom: 0; + border-top-color: rgba(0, 0, 0, 0.2); } .navbar-fixed-bottom .nav > li > .dropdown-menu:after { - top: auto; - bottom: -6px; - border-top: 6px solid #ffffff; - border-bottom: 0; + top: auto; + bottom: -6px; + border-top: 6px solid #ffffff; + border-bottom: 0; } .navbar .nav li.dropdown > a:hover .caret { - border-top-color: #555555; - border-bottom-color: #555555; + border-top-color: #555555; + border-bottom-color: #555555; } .navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.active > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle { - color: #555555; - background-color: #e5e5e5; + color: #555555; + background-color: #e5e5e5; } .navbar .nav li.dropdown > .dropdown-toggle .caret { - border-top-color: #777777; - border-bottom-color: #777777; + border-top-color: #777777; + border-bottom-color: #777777; } .navbar .nav li.dropdown.open > .dropdown-toggle .caret, .navbar .nav li.dropdown.active > .dropdown-toggle .caret, .navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { - border-top-color: #555555; - border-bottom-color: #555555; + border-top-color: #555555; + border-bottom-color: #555555; } .navbar .pull-right > li > .dropdown-menu, .navbar .nav > li > .dropdown-menu.pull-right { - right: 0; - left: auto; + right: 0; + left: auto; } .navbar .pull-right > li > .dropdown-menu:before, .navbar .nav > li > .dropdown-menu.pull-right:before { - right: 12px; - left: auto; + right: 12px; + left: auto; } .navbar .pull-right > li > .dropdown-menu:after, .navbar .nav > li > .dropdown-menu.pull-right:after { - right: 13px; - left: auto; + right: 13px; + left: auto; } .navbar .pull-right > li > .dropdown-menu .dropdown-menu, .navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { - right: 100%; - left: auto; - margin-right: -1px; - margin-left: 0; - -webkit-border-radius: 6px 0 6px 6px; - -moz-border-radius: 6px 0 6px 6px; - border-radius: 6px 0 6px 6px; + right: 100%; + left: auto; + margin-right: -1px; + margin-left: 0; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; } .navbar-inverse .navbar-inner { - background-color: #1b1b1b; - background-image: -moz-linear-gradient(top, #222222, #111111); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); - background-image: -webkit-linear-gradient(top, #222222, #111111); - background-image: -o-linear-gradient(top, #222222, #111111); - background-image: linear-gradient(to bottom, #222222, #111111); - background-repeat: repeat-x; - border-color: #252525; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); + background-color: #1b1b1b; + background-image: -moz-linear-gradient(top, #222222, #111111); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); + background-image: -webkit-linear-gradient(top, #222222, #111111); + background-image: -o-linear-gradient(top, #222222, #111111); + background-image: linear-gradient(to bottom, #222222, #111111); + background-repeat: repeat-x; + border-color: #252525; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); } .navbar-inverse .brand, .navbar-inverse .nav > li > a { - color: #999999; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + color: #999999; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .navbar-inverse .brand:hover, .navbar-inverse .nav > li > a:hover { - color: #ffffff; + color: #ffffff; } .navbar-inverse .brand { - color: #999999; + color: #999999; } .navbar-inverse .navbar-text { - color: #999999; + color: #999999; } .navbar-inverse .nav > li > a:focus, .navbar-inverse .nav > li > a:hover { - color: #ffffff; - background-color: transparent; + color: #ffffff; + background-color: transparent; } .navbar-inverse .nav .active > a, .navbar-inverse .nav .active > a:hover, .navbar-inverse .nav .active > a:focus { - color: #ffffff; - background-color: #111111; + color: #ffffff; + background-color: #111111; } .navbar-inverse .navbar-link { - color: #999999; + color: #999999; } .navbar-inverse .navbar-link:hover { - color: #ffffff; + color: #ffffff; } .navbar-inverse .divider-vertical { - border-right-color: #222222; - border-left-color: #111111; + border-right-color: #222222; + border-left-color: #111111; } .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { - color: #ffffff; - background-color: #111111; + color: #ffffff; + background-color: #111111; } .navbar-inverse .nav li.dropdown > a:hover .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; + border-top-color: #ffffff; + border-bottom-color: #ffffff; } .navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { - border-top-color: #999999; - border-bottom-color: #999999; + border-top-color: #999999; + border-bottom-color: #999999; } .navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; + border-top-color: #ffffff; + border-bottom-color: #ffffff; } .navbar-inverse .navbar-search .search-query { - color: #ffffff; - background-color: #515151; - border-color: #111111; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - transition: none; + color: #ffffff; + background-color: #515151; + border-color: #111111; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; } .navbar-inverse .navbar-search .search-query:-moz-placeholder { - color: #cccccc; + color: #cccccc; } .navbar-inverse .navbar-search .search-query:-ms-input-placeholder { - color: #cccccc; + color: #cccccc; } .navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { - color: #cccccc; + color: #cccccc; } .navbar-inverse .navbar-search .search-query:focus, .navbar-inverse .navbar-search .search-query.focused { - padding: 5px 15px; - color: #333333; - text-shadow: 0 1px 0 #ffffff; - background-color: #ffffff; - border: 0; - outline: 0; - -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); - -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); - box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + padding: 5px 15px; + color: #333333; + text-shadow: 0 1px 0 #ffffff; + background-color: #ffffff; + border: 0; + outline: 0; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); } .navbar-inverse .btn-navbar { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #0e0e0e; - *background-color: #040404; - background-image: -moz-linear-gradient(top, #151515, #040404); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); - background-image: -webkit-linear-gradient(top, #151515, #040404); - background-image: -o-linear-gradient(top, #151515, #040404); - background-image: linear-gradient(to bottom, #151515, #040404); - background-repeat: repeat-x; - border-color: #040404 #040404 #000000; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e0e0e; + *background-color: #040404; + background-image: -moz-linear-gradient(top, #151515, #040404); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); + background-image: -webkit-linear-gradient(top, #151515, #040404); + background-image: -o-linear-gradient(top, #151515, #040404); + background-image: linear-gradient(to bottom, #151515, #040404); + background-repeat: repeat-x; + border-color: #040404 #040404 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .navbar-inverse .btn-navbar:hover, @@ -4879,1190 +4868,1190 @@ input[type="submit"].btn.btn-mini { .navbar-inverse .btn-navbar.active, .navbar-inverse .btn-navbar.disabled, .navbar-inverse .btn-navbar[disabled] { - color: #ffffff; - background-color: #040404; - *background-color: #000000; + color: #ffffff; + background-color: #040404; + *background-color: #000000; } .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active { - background-color: #000000 \9; + background-color: #000000 \9; } .breadcrumb { - padding: 8px 15px; - margin: 0 0 20px; - list-style: none; - background-color: #f5f5f5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + padding: 8px 15px; + margin: 0 0 20px; + list-style: none; + background-color: #f5f5f5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .breadcrumb > li { - display: inline-block; - *display: inline; - text-shadow: 0 1px 0 #ffffff; - *zoom: 1; + display: inline-block; + *display: inline; + text-shadow: 0 1px 0 #ffffff; + *zoom: 1; } .breadcrumb > li > .divider { - padding: 0 5px; - color: #ccc; + padding: 0 5px; + color: #ccc; } .breadcrumb > .active { - color: #999999; + color: #999999; } .pagination { - margin: 20px 0; + margin: 20px 0; } .pagination ul { - display: inline-block; - *display: inline; - margin-bottom: 0; - margin-left: 0; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - *zoom: 1; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + display: inline-block; + *display: inline; + margin-bottom: 0; + margin-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + *zoom: 1; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .pagination ul > li { - display: inline; + display: inline; } .pagination ul > li > a, .pagination ul > li > span { - float: left; - padding: 4px 12px; - line-height: 20px; - text-decoration: none; - background-color: #ffffff; - border: 1px solid #dddddd; - border-left-width: 0; + float: left; + padding: 4px 12px; + line-height: 20px; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #dddddd; + border-left-width: 0; } .pagination ul > li > a:hover, .pagination ul > .active > a, .pagination ul > .active > span { - background-color: #f5f5f5; + background-color: #f5f5f5; } .pagination ul > .active > a, .pagination ul > .active > span { - color: #999999; - cursor: default; + color: #999999; + cursor: default; } .pagination ul > .disabled > span, .pagination ul > .disabled > a, .pagination ul > .disabled > a:hover { - color: #999999; - cursor: default; - background-color: transparent; + color: #999999; + cursor: default; + background-color: transparent; } .pagination ul > li:first-child > a, .pagination ul > li:first-child > span { - border-left-width: 1px; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-topleft: 4px; + border-left-width: 1px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; } .pagination ul > li:last-child > a, .pagination ul > li:last-child > span { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-bottomright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; } .pagination-centered { - text-align: center; + text-align: center; } .pagination-right { - text-align: right; + text-align: right; } .pagination-large ul > li > a, .pagination-large ul > li > span { - padding: 11px 19px; - font-size: 17.5px; + padding: 11px 19px; + font-size: 17.5px; } .pagination-large ul > li:first-child > a, .pagination-large ul > li:first-child > span { - -webkit-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -webkit-border-top-left-radius: 6px; - border-top-left-radius: 6px; - -moz-border-radius-bottomleft: 6px; - -moz-border-radius-topleft: 6px; + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; } .pagination-large ul > li:last-child > a, .pagination-large ul > li:last-child > span { - -webkit-border-top-right-radius: 6px; - border-top-right-radius: 6px; - -webkit-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - -moz-border-radius-topright: 6px; - -moz-border-radius-bottomright: 6px; + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; } .pagination-mini ul > li:first-child > a, .pagination-small ul > li:first-child > a, .pagination-mini ul > li:first-child > span, .pagination-small ul > li:first-child > span { - -webkit-border-bottom-left-radius: 3px; - border-bottom-left-radius: 3px; - -webkit-border-top-left-radius: 3px; - border-top-left-radius: 3px; - -moz-border-radius-bottomleft: 3px; - -moz-border-radius-topleft: 3px; + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -moz-border-radius-bottomleft: 3px; + -moz-border-radius-topleft: 3px; } .pagination-mini ul > li:last-child > a, .pagination-small ul > li:last-child > a, .pagination-mini ul > li:last-child > span, .pagination-small ul > li:last-child > span { - -webkit-border-top-right-radius: 3px; - border-top-right-radius: 3px; - -webkit-border-bottom-right-radius: 3px; - border-bottom-right-radius: 3px; - -moz-border-radius-topright: 3px; - -moz-border-radius-bottomright: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; + -moz-border-radius-topright: 3px; + -moz-border-radius-bottomright: 3px; } .pagination-small ul > li > a, .pagination-small ul > li > span { - padding: 2px 10px; - font-size: 11.9px; + padding: 2px 10px; + font-size: 11.9px; } .pagination-mini ul > li > a, .pagination-mini ul > li > span { - padding: 0 6px; - font-size: 10.5px; + padding: 0 6px; + font-size: 10.5px; } .pager { - margin: 20px 0; - text-align: center; - list-style: none; - *zoom: 1; + margin: 20px 0; + text-align: center; + list-style: none; + *zoom: 1; } .pager:before, .pager:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .pager:after { - clear: both; + clear: both; } .pager li { - display: inline; + display: inline; } .pager li > a, .pager li > span { - display: inline-block; - padding: 5px 14px; - background-color: #fff; - border: 1px solid #ddd; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; } .pager li > a:hover { - text-decoration: none; - background-color: #f5f5f5; + text-decoration: none; + background-color: #f5f5f5; } .pager .next > a, .pager .next > span { - float: right; + float: right; } .pager .previous > a, .pager .previous > span { - float: left; + float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > span { - color: #999999; - cursor: default; - background-color: #fff; + color: #999999; + cursor: default; + background-color: #fff; } .modal-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1040; - background-color: #000000; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; } .modal-backdrop.fade { - opacity: 0; + opacity: 0; } .modal-backdrop, .modal-backdrop.fade.in { - opacity: 0.8; - filter: alpha(opacity=80); + opacity: 0.8; + filter: alpha(opacity=80); } .modal { - position: fixed; - top: 10%; - left: 50%; - z-index: 1050; - width: 560px; - margin-left: -280px; - background-color: #ffffff; - border: 1px solid #999; - border: 1px solid rgba(0, 0, 0, 0.3); - *border: 1px solid #999; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - outline: none; - -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - -webkit-background-clip: padding-box; - -moz-background-clip: padding-box; - background-clip: padding-box; + position: fixed; + top: 10%; + left: 50%; + z-index: 1050; + width: 560px; + margin-left: -280px; + background-color: #ffffff; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.3); + *border: 1px solid #999; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + outline: none; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; } .modal.fade { - top: -25%; - -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; - -moz-transition: opacity 0.3s linear, top 0.3s ease-out; - -o-transition: opacity 0.3s linear, top 0.3s ease-out; - transition: opacity 0.3s linear, top 0.3s ease-out; + top: -25%; + -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; + -moz-transition: opacity 0.3s linear, top 0.3s ease-out; + -o-transition: opacity 0.3s linear, top 0.3s ease-out; + transition: opacity 0.3s linear, top 0.3s ease-out; } .modal.fade.in { - top: 10%; + top: 10%; } .modal-header { - padding: 9px 15px; - border-bottom: 1px solid #eee; + padding: 9px 15px; + border-bottom: 1px solid #eee; } .modal-header .close { - margin-top: 2px; + margin-top: 2px; } .modal-header h3 { - margin: 0; - line-height: 30px; + margin: 0; + line-height: 30px; } .modal-body { - position: relative; - max-height: 400px; - padding: 15px; - overflow-y: auto; + position: relative; + max-height: 400px; + padding: 15px; + overflow-y: auto; } .modal-form { - margin-bottom: 0; + margin-bottom: 0; } .modal-footer { - padding: 14px 15px 15px; - margin-bottom: 0; - text-align: right; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; - *zoom: 1; - -webkit-box-shadow: inset 0 1px 0 #ffffff; - -moz-box-shadow: inset 0 1px 0 #ffffff; - box-shadow: inset 0 1px 0 #ffffff; + padding: 14px 15px 15px; + margin-bottom: 0; + text-align: right; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; } .modal-footer:before, .modal-footer:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .modal-footer:after { - clear: both; + clear: both; } .modal-footer .btn + .btn { - margin-bottom: 0; - margin-left: 5px; + margin-bottom: 0; + margin-left: 5px; } .modal-footer .btn-group .btn + .btn { - margin-left: -1px; + margin-left: -1px; } .modal-footer .btn-block + .btn-block { - margin-left: 0; + margin-left: 0; } .tooltip { - position: absolute; - z-index: 1030; - display: block; - padding: 5px; - font-size: 11px; - opacity: 0; - filter: alpha(opacity=0); - visibility: visible; + position: absolute; + z-index: 1030; + display: block; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); + visibility: visible; } .tooltip.in { - opacity: 0.8; - filter: alpha(opacity=80); + opacity: 0.8; + filter: alpha(opacity=80); } .tooltip.top { - margin-top: -3px; + margin-top: -3px; } .tooltip.right { - margin-left: 3px; + margin-left: 3px; } .tooltip.bottom { - margin-top: 3px; + margin-top: 3px; } .tooltip.left { - margin-left: -3px; + margin-left: -3px; } .tooltip-inner { - max-width: 200px; - padding: 3px 8px; - color: #ffffff; - text-align: center; - text-decoration: none; - background-color: #000000; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; } .tooltip.top .tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-top-color: #000000; - border-width: 5px 5px 0; + bottom: 0; + left: 50%; + margin-left: -5px; + border-top-color: #000000; + border-width: 5px 5px 0; } .tooltip.right .tooltip-arrow { - top: 50%; - left: 0; - margin-top: -5px; - border-right-color: #000000; - border-width: 5px 5px 5px 0; + top: 50%; + left: 0; + margin-top: -5px; + border-right-color: #000000; + border-width: 5px 5px 5px 0; } .tooltip.left .tooltip-arrow { - top: 50%; - right: 0; - margin-top: -5px; - border-left-color: #000000; - border-width: 5px 0 5px 5px; + top: 50%; + right: 0; + margin-top: -5px; + border-left-color: #000000; + border-width: 5px 0 5px 5px; } .tooltip.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-bottom-color: #000000; - border-width: 0 5px 5px; + top: 0; + left: 50%; + margin-left: -5px; + border-bottom-color: #000000; + border-width: 0 5px 5px; } .popover { - position: absolute; - top: 0; - left: 0; - z-index: 1010; - display: none; - width: 236px; - padding: 1px; - text-align: left; - white-space: normal; - background-color: #ffffff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + width: 236px; + padding: 1px; + text-align: left; + white-space: normal; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; } .popover.top { - margin-top: -10px; + margin-top: -10px; } .popover.right { - margin-left: 10px; + margin-left: 10px; } .popover.bottom { - margin-top: 10px; + margin-top: 10px; } .popover.left { - margin-left: -10px; + margin-left: -10px; } .popover-title { - padding: 8px 14px; - margin: 0; - font-size: 14px; - font-weight: normal; - line-height: 18px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; + padding: 8px 14px; + margin: 0; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; } .popover-content { - padding: 9px 14px; + padding: 9px 14px; } .popover .arrow, .popover .arrow:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; } .popover .arrow { - border-width: 11px; + border-width: 11px; } .popover .arrow:after { - border-width: 10px; - content: ""; + border-width: 10px; + content: ""; } .popover.top .arrow { - bottom: -11px; - left: 50%; - margin-left: -11px; - border-top-color: #999; - border-top-color: rgba(0, 0, 0, 0.25); - border-bottom-width: 0; + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, 0.25); + border-bottom-width: 0; } .popover.top .arrow:after { - bottom: 1px; - margin-left: -10px; - border-top-color: #ffffff; - border-bottom-width: 0; + bottom: 1px; + margin-left: -10px; + border-top-color: #ffffff; + border-bottom-width: 0; } .popover.right .arrow { - top: 50%; - left: -11px; - margin-top: -11px; - border-right-color: #999; - border-right-color: rgba(0, 0, 0, 0.25); - border-left-width: 0; + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, 0.25); + border-left-width: 0; } .popover.right .arrow:after { - bottom: -10px; - left: 1px; - border-right-color: #ffffff; - border-left-width: 0; + bottom: -10px; + left: 1px; + border-right-color: #ffffff; + border-left-width: 0; } .popover.bottom .arrow { - top: -11px; - left: 50%; - margin-left: -11px; - border-bottom-color: #999; - border-bottom-color: rgba(0, 0, 0, 0.25); - border-top-width: 0; + top: -11px; + left: 50%; + margin-left: -11px; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, 0.25); + border-top-width: 0; } .popover.bottom .arrow:after { - top: 1px; - margin-left: -10px; - border-bottom-color: #ffffff; - border-top-width: 0; + top: 1px; + margin-left: -10px; + border-bottom-color: #ffffff; + border-top-width: 0; } .popover.left .arrow { - top: 50%; - right: -11px; - margin-top: -11px; - border-left-color: #999; - border-left-color: rgba(0, 0, 0, 0.25); - border-right-width: 0; + top: 50%; + right: -11px; + margin-top: -11px; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, 0.25); + border-right-width: 0; } .popover.left .arrow:after { - right: 1px; - bottom: -10px; - border-left-color: #ffffff; - border-right-width: 0; + right: 1px; + bottom: -10px; + border-left-color: #ffffff; + border-right-width: 0; } .thumbnails { - margin-left: -20px; - list-style: none; - *zoom: 1; + margin-left: -20px; + list-style: none; + *zoom: 1; } .thumbnails:before, .thumbnails:after { - display: table; - line-height: 0; - content: ""; + display: table; + line-height: 0; + content: ""; } .thumbnails:after { - clear: both; + clear: both; } .row-fluid .thumbnails { - margin-left: 0; + margin-left: 0; } .thumbnails > li { - float: left; - margin-bottom: 20px; - margin-left: 20px; + float: left; + margin-bottom: 20px; + margin-left: 20px; } .thumbnail { - display: block; - padding: 4px; - line-height: 20px; - border: 1px solid #ddd; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; + display: block; + padding: 4px; + line-height: 20px; + border: 1px solid #ddd; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; } a.thumbnail:hover { - border-color: #0088cc; - -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); - -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); - box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + border-color: #0088cc; + -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); } .thumbnail > img { - display: block; - max-width: 100%; - margin-right: auto; - margin-left: auto; + display: block; + max-width: 100%; + margin-right: auto; + margin-left: auto; } .thumbnail .caption { - padding: 9px; - color: #555555; + padding: 9px; + color: #555555; } .media, .media-body { - overflow: hidden; - *overflow: visible; - zoom: 1; + overflow: hidden; + *overflow: visible; + zoom: 1; } .media, .media .media { - margin-top: 15px; + margin-top: 15px; } .media:first-child { - margin-top: 0; + margin-top: 0; } .media-object { - display: block; + display: block; } .media-heading { - margin: 0 0 5px; + margin: 0 0 5px; } .media .pull-left { - margin-right: 10px; + margin-right: 10px; } .media .pull-right { - margin-left: 10px; + margin-left: 10px; } .media-list { - margin-left: 0; - list-style: none; + margin-left: 0; + list-style: none; } .label, .badge { - display: inline-block; - padding: 2px 4px; - font-size: 11.844px; - font-weight: bold; - line-height: 14px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - white-space: nowrap; - vertical-align: baseline; - background-color: #999999; + display: inline-block; + padding: 2px 4px; + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + white-space: nowrap; + vertical-align: baseline; + background-color: #999999; } .label { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; } .badge { - padding-right: 9px; - padding-left: 9px; - -webkit-border-radius: 9px; - -moz-border-radius: 9px; - border-radius: 9px; + padding-right: 9px; + padding-left: 9px; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + border-radius: 9px; } .label:empty, .badge:empty { - display: none; + display: none; } a.label:hover, a.badge:hover { - color: #ffffff; - text-decoration: none; - cursor: pointer; + color: #ffffff; + text-decoration: none; + cursor: pointer; } .label-important, .badge-important { - background-color: #b94a48; + background-color: #b94a48; } .label-important[href], .badge-important[href] { - background-color: #953b39; + background-color: #953b39; } .label-warning, .badge-warning { - background-color: #f89406; + background-color: #f89406; } .label-warning[href], .badge-warning[href] { - background-color: #c67605; + background-color: #c67605; } .label-success, .badge-success { - background-color: #468847; + background-color: #468847; } .label-success[href], .badge-success[href] { - background-color: #356635; + background-color: #356635; } .label-info, .badge-info { - background-color: #3a87ad; + background-color: #3a87ad; } .label-info[href], .badge-info[href] { - background-color: #2d6987; + background-color: #2d6987; } .label-inverse, .badge-inverse { - background-color: #333333; + background-color: #333333; } .label-inverse[href], .badge-inverse[href] { - background-color: #1a1a1a; + background-color: #1a1a1a; } .btn .label, .btn .badge { - position: relative; - top: -1px; + position: relative; + top: -1px; } .btn-mini .label, .btn-mini .badge { - top: 0; + top: 0; } @-webkit-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } } @-moz-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } } @-ms-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } } @-o-keyframes progress-bar-stripes { - from { - background-position: 0 0; - } - to { - background-position: 40px 0; - } + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } } @keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } } .progress { - height: 20px; - margin-bottom: 20px; - overflow: hidden; - background-color: #f7f7f7; - background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); - background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); - background-repeat: repeat-x; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); + background-repeat: repeat-x; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress .bar { - float: left; - width: 0; - height: 100%; - font-size: 12px; - color: #ffffff; - text-align: center; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #0e90d2; - background-image: -moz-linear-gradient(top, #149bdf, #0480be); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); - background-image: -webkit-linear-gradient(top, #149bdf, #0480be); - background-image: -o-linear-gradient(top, #149bdf, #0480be); - background-image: linear-gradient(to bottom, #149bdf, #0480be); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); - -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - -webkit-transition: width 0.6s ease; - -moz-transition: width 0.6s ease; - -o-transition: width 0.6s ease; - transition: width 0.6s ease; + float: left; + width: 0; + height: 100%; + font-size: 12px; + color: #ffffff; + text-align: center; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e90d2; + background-image: -moz-linear-gradient(top, #149bdf, #0480be); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); + background-image: -webkit-linear-gradient(top, #149bdf, #0480be); + background-image: -o-linear-gradient(top, #149bdf, #0480be); + background-image: linear-gradient(to bottom, #149bdf, #0480be); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: width 0.6s ease; + -moz-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; } .progress .bar + .bar { - -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); - box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); } .progress-striped .bar { - background-color: #149bdf; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - -webkit-background-size: 40px 40px; - -moz-background-size: 40px 40px; - -o-background-size: 40px 40px; - background-size: 40px 40px; + background-color: #149bdf; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + -moz-background-size: 40px 40px; + -o-background-size: 40px 40px; + background-size: 40px 40px; } .progress.active .bar { - -webkit-animation: progress-bar-stripes 2s linear infinite; - -moz-animation: progress-bar-stripes 2s linear infinite; - -ms-animation: progress-bar-stripes 2s linear infinite; - -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; + -webkit-animation: progress-bar-stripes 2s linear infinite; + -moz-animation: progress-bar-stripes 2s linear infinite; + -ms-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; } .progress-danger .bar, .progress .bar-danger { - background-color: #dd514c; - background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); - background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); - background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); - background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); + background-color: #dd514c; + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); } .progress-danger.progress-striped .bar, .progress-striped .bar-danger { - background-color: #ee5f5b; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-color: #ee5f5b; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-success .bar, .progress .bar-success { - background-color: #5eb95e; - background-image: -moz-linear-gradient(top, #62c462, #57a957); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); - background-image: -webkit-linear-gradient(top, #62c462, #57a957); - background-image: -o-linear-gradient(top, #62c462, #57a957); - background-image: linear-gradient(to bottom, #62c462, #57a957); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); + background-color: #5eb95e; + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(to bottom, #62c462, #57a957); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); } .progress-success.progress-striped .bar, .progress-striped .bar-success { - background-color: #62c462; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-info .bar, .progress .bar-info { - background-color: #4bb1cf; - background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); - background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); - background-image: -o-linear-gradient(top, #5bc0de, #339bb9); - background-image: linear-gradient(to bottom, #5bc0de, #339bb9); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); + background-color: #4bb1cf; + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(to bottom, #5bc0de, #339bb9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); } .progress-info.progress-striped .bar, .progress-striped .bar-info { - background-color: #5bc0de; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-color: #5bc0de; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-warning .bar, .progress .bar-warning { - background-color: #faa732; - background-image: -moz-linear-gradient(top, #fbb450, #f89406); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); - background-image: -webkit-linear-gradient(top, #fbb450, #f89406); - background-image: -o-linear-gradient(top, #fbb450, #f89406); - background-image: linear-gradient(to bottom, #fbb450, #f89406); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); + background-color: #faa732; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); } .progress-warning.progress-striped .bar, .progress-striped .bar-warning { - background-color: #fbb450; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-color: #fbb450; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .accordion { - margin-bottom: 20px; + margin-bottom: 20px; } .accordion-group { - margin-bottom: 2px; - border: 1px solid #e5e5e5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + margin-bottom: 2px; + border: 1px solid #e5e5e5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .accordion-heading { - border-bottom: 0; + border-bottom: 0; } .accordion-heading .accordion-toggle { - display: block; - padding: 8px 15px; + display: block; + padding: 8px 15px; } .accordion-toggle { - cursor: pointer; + cursor: pointer; } .accordion-inner { - padding: 9px 15px; - border-top: 1px solid #e5e5e5; + padding: 9px 15px; + border-top: 1px solid #e5e5e5; } .carousel { - position: relative; - margin-bottom: 20px; - line-height: 1; + position: relative; + margin-bottom: 20px; + line-height: 1; } .carousel-inner { - position: relative; - width: 100%; - overflow: hidden; + position: relative; + width: 100%; + overflow: hidden; } .carousel-inner > .item { - position: relative; - display: none; - -webkit-transition: 0.6s ease-in-out left; - -moz-transition: 0.6s ease-in-out left; - -o-transition: 0.6s ease-in-out left; - transition: 0.6s ease-in-out left; + position: relative; + display: none; + -webkit-transition: 0.6s ease-in-out left; + -moz-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; } .carousel-inner > .item > img { - display: block; - line-height: 1; + display: block; + line-height: 1; } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { - display: block; + display: block; } .carousel-inner > .active { - left: 0; + left: 0; } .carousel-inner > .next, .carousel-inner > .prev { - position: absolute; - top: 0; - width: 100%; + position: absolute; + top: 0; + width: 100%; } .carousel-inner > .next { - left: 100%; + left: 100%; } .carousel-inner > .prev { - left: -100%; + left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { - left: 0; + left: 0; } .carousel-inner > .active.left { - left: -100%; + left: -100%; } .carousel-inner > .active.right { - left: 100%; + left: 100%; } .carousel-control { - position: absolute; - top: 40%; - left: 15px; - width: 40px; - height: 40px; - margin-top: -20px; - font-size: 60px; - font-weight: 100; - line-height: 30px; - color: #ffffff; - text-align: center; - background: #222222; - border: 3px solid #ffffff; - -webkit-border-radius: 23px; - -moz-border-radius: 23px; - border-radius: 23px; - opacity: 0.5; - filter: alpha(opacity=50); + position: absolute; + top: 40%; + left: 15px; + width: 40px; + height: 40px; + margin-top: -20px; + font-size: 60px; + font-weight: 100; + line-height: 30px; + color: #ffffff; + text-align: center; + background: #222222; + border: 3px solid #ffffff; + -webkit-border-radius: 23px; + -moz-border-radius: 23px; + border-radius: 23px; + opacity: 0.5; + filter: alpha(opacity=50); } .carousel-control.right { - right: 15px; - left: auto; + right: 15px; + left: auto; } .carousel-control:hover { - color: #ffffff; - text-decoration: none; - opacity: 0.9; - filter: alpha(opacity=90); + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); } .carousel-caption { - position: absolute; - right: 0; - bottom: 0; - left: 0; - padding: 15px; - background: #333333; - background: rgba(0, 0, 0, 0.75); + position: absolute; + right: 0; + bottom: 0; + left: 0; + padding: 15px; + background: #333333; + background: rgba(0, 0, 0, 0.75); } .carousel-caption h4, .carousel-caption p { - line-height: 20px; - color: #ffffff; + line-height: 20px; + color: #ffffff; } .carousel-caption h4 { - margin: 0 0 5px; + margin: 0 0 5px; } .carousel-caption p { - margin-bottom: 0; + margin-bottom: 0; } .hero-unit { - padding: 60px; - margin-bottom: 30px; - font-size: 18px; - font-weight: 200; - line-height: 30px; - color: inherit; - background-color: #eeeeee; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; + padding: 60px; + margin-bottom: 30px; + font-size: 18px; + font-weight: 200; + line-height: 30px; + color: inherit; + background-color: #eeeeee; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; } .hero-unit h1 { - margin-bottom: 0; - font-size: 60px; - line-height: 1; - letter-spacing: -1px; - color: inherit; + margin-bottom: 0; + font-size: 60px; + line-height: 1; + letter-spacing: -1px; + color: inherit; } .hero-unit li { - line-height: 30px; + line-height: 30px; } .pull-right { - float: right; + float: right; } .pull-left { - float: left; + float: left; } .hide { - display: none; + display: none; } .show { - display: block; + display: block; } .invisible { - visibility: hidden; + visibility: hidden; } .affix { - position: fixed; + position: fixed; } \ No newline at end of file diff --git a/samples/dynamic-html/docs/assets/css/style.css b/samples/dynamic-html/docs/assets/css/style.css index 59a05ee958a..f14f6bdb62c 100644 --- a/samples/dynamic-html/docs/assets/css/style.css +++ b/samples/dynamic-html/docs/assets/css/style.css @@ -1,309 +1,308 @@ .line-numbers { - margin-right: 1.0em; + margin-right: 1.0em; } .content { - padding-bottom: 100px; + padding-bottom: 100px; } .column_header_name { - width: 150px; + width: 150px; } .column_header_path { - width: 350px; + width: 350px; } .column_header_name .column_header_param_type .column_header_data_type .column_header_return_type { - width: 200px; + width: 200px; } .expandable { - display: none; + display: none; } .main_content { - margin-top: 80px; - margin-left: 25px; - margin-right: 25px; + margin-top: 80px; + margin-left: 25px; + margin-right: 25px; } .model { - float: left; + float: left; } .model-container { - float: left; - width: 500px; - padding: 0px; + float: left; + width: 500px; + padding: 0px; } .model-detail-container { - clear: left; - float: left; - width: 500px; - margin-left: 40px; + clear: left; + float: left; + width: 500px; + margin-left: 40px; } .model-detail-popup { - box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; - border-style: solid; - border-width: 1px; - border-color: black; - padding-left: 10px; - padding-right: 10px; - padding-top: 10px; - padding-bottom: 10px; - background-color: white; - opacity: 0.99; - z-index: 1; - overflow: scroll; - width: 400px; + box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; + border-style: solid; + border-width: 1px; + border-color: black; + padding-left: 10px; + padding-right: 10px; + padding-top: 10px; + padding-bottom: 10px; + background-color: white; + opacity: 0.99; + z-index: 1; + overflow: scroll; + width: 400px; } .model-detail-popup .code { - background-color: #E4F5FF; - font-family: monospace; - white-space: pre; - margin: 10px; - overflow: auto; + background-color: #E4F5FF; + font-family: monospace; + white-space: pre; + margin: 10px; + overflow: auto; } .model-detail-popup h2 { - margin-top: 0px; - padding-top: 0px; + margin-top: 0px; + padding-top: 0px; } .model-detail-popup li { - padding-bottom: 5px; + padding-bottom: 5px; } .model-detail-popup .param-reqiured-true { - font-family: monospace; - font-weight: bold; - clear: left; - display: block; - float: left; - width: 100%; + font-family: monospace; + font-weight: bold; + clear: left; + display: block; + float: left; + width: 100%; } .model-detail-popup .param-required-false { - font-family: monospace; - clear: left; - display: block; - float: left; - width: 100%; + font-family: monospace; + clear: left; + display: block; + float: left; + width: 100%; } .model-detail-popup .param-description { - margin-left: 50px; - float: left; + margin-left: 50px; + float: left; } .section-header { - border-bottom: 2px; - font-weight: bold; - font-size: 15px; - padding: 6px 0; - color: rgb(57, 57, 57); + border-bottom: 2px; + font-weight: bold; + font-size: 15px; + padding: 6px 0; + color: rgb(57,57,57); } .content { - padding-top: 100px; + padding-top: 100px; } .content h1 { - font-size: 43px; - text-align: center; - margin-top: 40px; - margin-bottom: 40px; + font-size: 43px; + text-align: center; + margin-top: 40px; + margin-bottom: 40px; } .sidebar { - box-sizing: border-box; - float: left; - display: block; - width: 240px; - overflow: scroll; - position: fixed; + box-sizing: border-box; + float: left; + display: block; + width: 240px; + overflow: scroll; + position: fixed; } .section-box { - border-bottom-style: solid; - border-bottom: 10px; + border-bottom-style: solid; + border-bottom: 10px; } .section-box ul li { - list-style: none; - margin-left: 0px; + list-style: none; + margin-left: 0px; } .non-sidebar { - box-sizing: border-box; - display: block; - margin-left: 240px; - margin-right: 0px; - width: 638px; + box-sizing: border-box; + display: block; + margin-left: 240px; + margin-right: 0px; + width: 638px; } .non-sidebar h2 { - clear: left; - padding-top: 20px; + clear: left; + padding-top: 20px; } li.parameter { - list-style: none; - display: block; - padding-left: 1em; + list-style: none; + display: block; + padding-left: 1em; } -.param { - display: block; +.param{ + display: block; } .param-name { - margin-left: 1em; + margin-left: 1em; } .param-in { - font-weight: bold; - font-size: 1.1em; + font-weight: bold; + font-size: 1.1em; } - .param-type { - margin-left: 1em; - font-style: italic; + margin-left: 1em; + font-style: italic; } .param-description { - display: block; - font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif; + display: block; + font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif; } .param-optional-flag { - font-style: italic; + font-style: italic; } .section { - font-weight: normal; - clear: left; + font-weight: normal; + clear: left; } .section a { - text-decoration: underline; + text-decoration: underline; } .code { - background-color: #E4F5FF; - font-family: monospace; - white-space: pre; - margin: 10px; - overflow: auto; - width: 600px; + background-color: #E4F5FF; + font-family: monospace; + white-space: pre; + margin: 10px; + overflow: auto; + width: 600px; } .header { - position: fixed; - text-align: left; - background-color: black; - float: left; - top: 0; - width: 100%; - height: 70px auto; - padding-bottom: 20px; - box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; + position: fixed; + text-align: left; + background-color: black; + float: left; + top: 0; + width: 100%; + height: 70px auto; + padding-bottom: 20px; + box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; } .top-bar h1 a { - width: auto; + width: auto; } .top-bar h1#logo a { - width: auto; - display: block; - clear: none; - float: left; - background-position: left;; - color: white; - text-decoration: none; + width: auto; + display: block; + clear: none; + float: left; + background-position: left;; + color: white; + text-decoration: none; } .top-bar ul li { - list-style: none; + list-style: none; } .top-bar h1#logo span { - display: block; - clear: none; - float: left; - padding-top: 10px; - padding-left: 10px; - margin: 0px; + display: block; + clear: none; + float: left; + padding-top: 10px; + padding-left: 10px; + margin: 0px; } .top-bar h1#logo a span.light { - color: #ffc97a; - color: #666666; - padding-left: 0px; + color: #ffc97a; + color: #666666; + padding-left: 0px; } .top-bar ul#nav { - float: none; - clear: both; - overflow: hidden; - margin: 0; - padding: 0; - display: block; - float: right; - clear: none; + float: none; + clear: both; + overflow: hidden; + margin: 0; + padding: 0; + display: block; + float: right; + clear: none; } .top-bar ul#nav li { - float: left; - clear: none; - margin: 0; - padding: 2px 10px; - border-right: 1px solid #dddddd; + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; } .top-bar ul#nav li:first-child, .top-bar ul#nav li.first { - padding-left: 0; + padding-left: 0; } .top-bar ul#nav li:last-child, .top-bar ul#nav li.last { - padding-right: 0; - border-right: none; + padding-right: 0; + border-right: none; } .top-bar ul#nav li { - border: none; - padding: 0 5px; + border: none; + padding: 0 5px; } .top-bar ul#nav li a { - display: block; - padding: 8px 10px 8px 10px; - color: #999999; - text-decoration: none; + display: block; + padding: 8px 10px 8px 10px; + color: #999999; + text-decoration: none; } .top-bar ul#nav li a.strong { - color: white; + color: white; } .top-bar ul#nav li a:active, .top-bar ul#nav li a.active, .top-bar ul#nav li a:hover { - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - -o-border-radius: 4px; - -ms-border-radius: 4px; - -khtml-border-radius: 4px; - border-radius: 4px; - background-image: -webkit-gradient(linear, 0% 100%, 0% 0%, color-stop(0%, #ff5401), color-stop(100%, #ffa014)); - background-image: -moz-linear-gradient(bottom, #ff5401 0%, #ffa014 100%); - background-image: linear-gradient(bottom, #ff5401 0%, #ffa014 100%); - color: white; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; + background-image: -webkit-gradient(linear, 0% 100%, 0% 0%, color-stop(0%, #ff5401), color-stop(100%, #ffa014)); + background-image: -moz-linear-gradient(bottom, #ff5401 0%, #ffa014 100%); + background-image: linear-gradient(bottom, #ff5401 0%, #ffa014 100%); + color: white; } .top-bar ul#nav:hover li { - border-color: #222222; + border-color: #222222; } diff --git a/samples/dynamic-html/docs/assets/js/bootstrap.js b/samples/dynamic-html/docs/assets/js/bootstrap.js index 96bc4e8c103..6c15a583296 100644 --- a/samples/dynamic-html/docs/assets/js/bootstrap.js +++ b/samples/dynamic-html/docs/assets/js/bootstrap.js @@ -20,45 +20,44 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) - * ======================================================= */ + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) + * ======================================================= */ - $(function () { + $(function () { - $.support.transition = (function () { + $.support.transition = (function () { - var transitionEnd = (function () { + var transitionEnd = (function () { - var el = document.createElement('bootstrap') - , transEndEventNames = { - 'WebkitTransition': 'webkitTransitionEnd' - , 'MozTransition': 'transitionend' - , 'OTransition': 'oTransitionEnd otransitionend' - , 'transition': 'transitionend' - } - , name + var el = document.createElement('bootstrap') + , transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + , name - for (name in transEndEventNames) { - if (el.style[name] !== undefined) { - return transEndEventNames[name] - } - } + for (name in transEndEventNames){ + if (el.style[name] !== undefined) { + return transEndEventNames[name] + } + } - }()) + }()) - return transitionEnd && { - end: transitionEnd - } + return transitionEnd && { + end: transitionEnd + } - })() + })() - }) + }) -}(window.jQuery); -/* ========================================================== +}(window.jQuery);/* ========================================================== * bootstrap-alert.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#alerts * ========================================================== @@ -80,84 +79,83 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* ALERT CLASS DEFINITION - * ====================== */ + /* ALERT CLASS DEFINITION + * ====================== */ - var dismiss = '[data-dismiss="alert"]' - , Alert = function (el) { - $(el).on('click', dismiss, this.close) - } + var dismiss = '[data-dismiss="alert"]' + , Alert = function (el) { + $(el).on('click', dismiss, this.close) + } - Alert.prototype.close = function (e) { - var $this = $(this) - , selector = $this.attr('data-target') - , $parent + Alert.prototype.close = function (e) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - $parent = $(selector) - - e && e.preventDefault() - - $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) - - $parent.trigger(e = $.Event('close')) - - if (e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - $parent - .trigger('closed') - .remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent.on($.support.transition.end, removeElement) : - removeElement() + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } + $parent = $(selector) - /* ALERT PLUGIN DEFINITION - * ======================= */ + e && e.preventDefault() - var old = $.fn.alert + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) - $.fn.alert = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('alert') - if (!data) $this.data('alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) + $parent.trigger(e = $.Event('close')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent + .trigger('closed') + .remove() } - $.fn.alert.Constructor = Alert + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } - /* ALERT NO CONFLICT - * ================= */ + /* ALERT PLUGIN DEFINITION + * ======================= */ - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert - /* ALERT DATA-API - * ============== */ + /* ALERT NO CONFLICT + * ================= */ - $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } -}(window.jQuery); -/* ============================================================ + + /* ALERT DATA-API + * ============== */ + + $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + +}(window.jQuery);/* ============================================================ * bootstrap-button.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#buttons * ============================================================ @@ -179,90 +177,89 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* BUTTON PUBLIC CLASS DEFINITION - * ============================== */ + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.button.defaults, options) - } + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } - Button.prototype.setState = function (state) { - var d = 'disabled' - , $el = this.$element - , data = $el.data() - , val = $el.is('input') ? 'val' : 'html' + Button.prototype.setState = function (state) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' - state = state + 'Text' - data.resetText || $el.data('resetText', $el[val]()) + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) - $el[val](data[state] || this.options[state]) + $el[val](data[state] || this.options[state]) - // push to event loop to allow forms to submit - setTimeout(function () { - state == 'loadingText' ? - $el.addClass(d).attr(d, d) : - $el.removeClass(d).removeAttr(d) - }, 0) - } + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } - Button.prototype.toggle = function () { - var $parent = this.$element.closest('[data-toggle="buttons-radio"]') + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons-radio"]') - $parent && $parent - .find('.active') - .removeClass('active') + $parent && $parent + .find('.active') + .removeClass('active') - this.$element.toggleClass('active') - } + this.$element.toggleClass('active') + } - /* BUTTON PLUGIN DEFINITION - * ======================== */ + /* BUTTON PLUGIN DEFINITION + * ======================== */ - var old = $.fn.button + var old = $.fn.button - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('button') - , options = typeof option == 'object' && option - if (!data) $this.data('button', (data = new Button(this, options))) - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.defaults = { - loadingText: 'loading...' - } - - $.fn.button.Constructor = Button - - - /* BUTTON NO CONFLICT - * ================== */ - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - /* BUTTON DATA-API - * =============== */ - - $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) }) + } -}(window.jQuery); -/* ========================================================== + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON NO CONFLICT + * ================== */ + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + /* BUTTON DATA-API + * =============== */ + + $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + }) + +}(window.jQuery);/* ========================================================== * bootstrap-carousel.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#carousel * ========================================================== @@ -284,172 +281,169 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* CAROUSEL CLASS DEFINITION - * ========================= */ + /* CAROUSEL CLASS DEFINITION + * ========================= */ - var Carousel = function (element, options) { - this.$element = $(element) - this.options = options - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) + var Carousel = function (element, options) { + this.$element = $(element) + this.options = options + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.prototype = { + + cycle: function (e) { + if (!e) this.paused = false + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + return this } - Carousel.prototype = { + , to: function (pos) { + var $active = this.$element.find('.item.active') + , children = $active.parent().children() + , activePos = children.index($active) + , that = this - cycle: function (e) { - if (!e) this.paused = false - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - return this - } + if (pos > (children.length - 1) || pos < 0) return - , to: function (pos) { - var $active = this.$element.find('.item.active') - , children = $active.parent().children() - , activePos = children.index($active) - , that = this - - if (pos > (children.length - 1) || pos < 0) return - - if (this.sliding) { - return this.$element.one('slid', function () { - that.to(pos) - }) - } - - if (activePos == pos) { - return this.pause().cycle() - } - - return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) - } - - , pause: function (e) { - if (!e) this.paused = true - if (this.$element.find('.next, .prev').length && $.support.transition.end) { - this.$element.trigger($.support.transition.end) - this.cycle() - } - clearInterval(this.interval) - this.interval = null - return this - } - - , next: function () { - if (this.sliding) return - return this.slide('next') - } - - , prev: function () { - if (this.sliding) return - return this.slide('prev') - } - - , slide: function (type, next) { - var $active = this.$element.find('.item.active') - , $next = next || $active[type]() - , isCycling = this.interval - , direction = type == 'next' ? 'left' : 'right' - , fallback = type == 'next' ? 'first' : 'last' - , that = this - , e - - this.sliding = true - - isCycling && this.pause() - - $next = $next.length ? $next : this.$element.find('.item')[fallback]() - - e = $.Event('slide', { - relatedTarget: $next[0] - }) - - if ($next.hasClass('active')) return - - if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - this.$element.one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { - that.$element.trigger('slid') - }, 0) - }) - } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid') - } - - isCycling && this.cycle() - - return this - } - - } - - - /* CAROUSEL PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.carousel - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('carousel') - , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) - , action = typeof option == 'string' ? option : options.slide - if (!data) $this.data('carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.cycle() + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) }) + } + + if (activePos == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) } - $.fn.carousel.defaults = { - interval: 5000 - , pause: 'hover' + , pause: function (e) { + if (!e) this.paused = true + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle() + } + clearInterval(this.interval) + this.interval = null + return this } - $.fn.carousel.Constructor = Carousel - - - /* CAROUSEL NO CONFLICT - * ==================== */ - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this + , next: function () { + if (this.sliding) return + return this.slide('next') } - /* CAROUSEL DATA-API - * ================= */ + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } - $(document).on('click.carousel.data-api', '[data-slide]', function (e) { - var $this = $(this), href - , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - , options = $.extend({}, $target.data(), $this.data()) - $target.carousel(options) - e.preventDefault() + , slide: function (type, next) { + var $active = this.$element.find('.item.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + , e + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + e = $.Event('slide', { + relatedTarget: $next[0] + }) + + if ($next.hasClass('active')) return + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + , action = typeof option == 'string' ? option : options.slide + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.cycle() }) + } -}(window.jQuery); -/* ============================================================= + $.fn.carousel.defaults = { + interval: 5000 + , pause: 'hover' + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL NO CONFLICT + * ==================== */ + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + /* CAROUSEL DATA-API + * ================= */ + + $(document).on('click.carousel.data-api', '[data-slide]', function (e) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = $.extend({}, $target.data(), $this.data()) + $target.carousel(options) + e.preventDefault() + }) + +}(window.jQuery);/* ============================================================= * bootstrap-collapse.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#collapse * ============================================================= @@ -471,152 +465,151 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* COLLAPSE PUBLIC CLASS DEFINITION - * ================================ */ + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.collapse.defaults, options) + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) - if (this.options.parent) { - this.$parent = $(this.options.parent) - } - - this.options.toggle && this.toggle() + if (this.options.parent) { + this.$parent = $(this.options.parent) } - Collapse.prototype = { + this.options.toggle && this.toggle() + } - constructor: Collapse + Collapse.prototype = { - , dimension: function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - , show: function () { - var dimension - , scroll - , actives - , hasData - - if (this.transitioning) return - - dimension = this.dimension() - scroll = $.camelCase(['scroll', dimension].join('-')) - actives = this.$parent && this.$parent.find('> .accordion-group > .in') - - if (actives && actives.length) { - hasData = actives.data('collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('collapse', null) - } - - this.$element[dimension](0) - this.transition('addClass', $.Event('show'), 'shown') - $.support.transition && this.$element[dimension](this.$element[0][scroll]) - } - - , hide: function () { - var dimension - if (this.transitioning) return - dimension = this.dimension() - this.reset(this.$element[dimension]()) - this.transition('removeClass', $.Event('hide'), 'hidden') - this.$element[dimension](0) - } - - , reset: function (size) { - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - [dimension](size || 'auto') - [0].offsetWidth - - this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') - - return this - } - - , transition: function (method, startEvent, completeEvent) { - var that = this - , complete = function () { - if (startEvent.type == 'show') that.reset() - that.transitioning = 0 - that.$element.trigger(completeEvent) - } - - this.$element.trigger(startEvent) - - if (startEvent.isDefaultPrevented()) return - - this.transitioning = 1 - - this.$element[method]('in') - - $.support.transition && this.$element.hasClass('collapse') ? - this.$element.one($.support.transition.end, complete) : - complete() - } - - , toggle: function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } + constructor: Collapse + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' } + , show: function () { + var dimension + , scroll + , actives + , hasData - /* COLLAPSE PLUGIN DEFINITION - * ========================== */ + if (this.transitioning) return - var old = $.fn.collapse + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('collapse') - , options = typeof option == 'object' && option - if (!data) $this.data('collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) } - $.fn.collapse.defaults = { - toggle: true + , hide: function () { + var dimension + if (this.transitioning) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) } - $.fn.collapse.Constructor = Collapse + , reset: function (size) { + var dimension = this.dimension() + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth - /* COLLAPSE NO CONFLICT - * ==================== */ + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this + return this } + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } - /* COLLAPSE DATA-API - * ================= */ + this.$element.trigger(startEvent) - $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - , target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - , option = $(target).data('collapse') ? 'toggle' : $this.data() - $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - $(target).collapse(option) + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = typeof option == 'object' && option + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() }) + } -}(window.jQuery); -/* ============================================================ + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSE NO CONFLICT + * ==================== */ + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(window.jQuery);/* ============================================================ * bootstrap-dropdown.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#dropdowns * ============================================================ @@ -638,150 +631,145 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* DROPDOWN CLASS DEFINITION - * ========================= */ + /* DROPDOWN CLASS DEFINITION + * ========================= */ - var toggle = '[data-toggle=dropdown]' - , Dropdown = function (element) { - var $el = $(element).on('click.dropdown.data-api', this.toggle) - $('html').on('click.dropdown.data-api', function () { - $el.parent().removeClass('open') - }) - } - - Dropdown.prototype = { - - constructor: Dropdown - - , toggle: function (e) { - var $this = $(this) - , $parent - , isActive - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - $parent.toggleClass('open') - } - - $this.focus() - - return false - } - - , keydown: function (e) { - var $this - , $items - , $active - , $parent - , isActive - , index - - if (!/(38|40|27)/.test(e.keyCode)) return - - $this = $(this) - - e.preventDefault() - e.stopPropagation() - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - if (!isActive || (isActive && e.keyCode == 27)) return $this.click() - - $items = $('[role=menu] li:not(.divider):visible a', $parent) - - if (!$items.length) return - - index = $items.index($items.filter(':focus')) - - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 - - $items - .eq(index) - .focus() - } - - } - - function clearMenus() { - $(toggle).each(function () { - getParent($(this)).removeClass('open') + var toggle = '[data-toggle=dropdown]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , isActive + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + $parent.toggleClass('open') + } + + $this.focus() + + return false } - function getParent($this) { - var selector = $this.attr('data-target') - , $parent + , keydown: function (e) { + var $this + , $items + , $active + , $parent + , isActive + , index - if (!selector) { - selector = $this.attr('href') - selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } + if (!/(38|40|27)/.test(e.keyCode)) return - $parent = $(selector) - $parent.length || ($parent = $this.parent()) + $this = $(this) - return $parent + e.preventDefault() + e.stopPropagation() + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + if (!isActive || (isActive && e.keyCode == 27)) return $this.click() + + $items = $('[role=menu] li:not(.divider):visible a', $parent) + + if (!$items.length) return + + index = $items.index($items.filter(':focus')) + + if (e.keyCode == 38 && index > 0) index-- // up + if (e.keyCode == 40 && index < $items.length - 1) index++ // down + if (!~index) index = 0 + + $items + .eq(index) + .focus() } + } - /* DROPDOWN PLUGIN DEFINITION - * ========================== */ + function clearMenus() { + $(toggle).each(function () { + getParent($(this)).removeClass('open') + }) + } - var old = $.fn.dropdown + function getParent($this) { + var selector = $this.attr('data-target') + , $parent - $.fn.dropdown = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('dropdown') - if (!data) $this.data('dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) + if (!selector) { + selector = $this.attr('href') + selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } - $.fn.dropdown.Constructor = Dropdown + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + return $parent + } - /* DROPDOWN NO CONFLICT - * ==================== */ + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ - $.fn.dropdown.noConflict = function () { - $.fn.dropdown = old - return this - } + var old = $.fn.dropdown + + $.fn.dropdown = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown - /* APPLY TO STANDARD DROPDOWN ELEMENTS - * =================================== */ + /* DROPDOWN NO CONFLICT + * ==================== */ - $(document) - .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) - .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { - e.stopPropagation() - }) - .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { - e.stopPropagation() - }) - .on('click.dropdown.data-api touchstart.dropdown.data-api', toggle, Dropdown.prototype.toggle) - .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]', Dropdown.prototype.keydown) + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } -}(window.jQuery); -/* ========================================================= + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + $(document) + .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) + .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) + .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) + .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) + .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) + +}(window.jQuery);/* ========================================================= * bootstrap-modal.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= @@ -803,229 +791,227 @@ !function ($) { - "use strict"; // jshint ;_; + "use strict"; // jshint ;_; - /* MODAL CLASS DEFINITION - * ====================== */ + /* MODAL CLASS DEFINITION + * ====================== */ - var Modal = function (element, options) { - this.options = options - this.$element = $(element) - .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) - this.options.remote && this.$element.find('.modal-body').load(this.options.remote) - } + var Modal = function (element, options) { + this.options = options + this.$element = $(element) + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) + this.options.remote && this.$element.find('.modal-body').load(this.options.remote) + } - Modal.prototype = { + Modal.prototype = { - constructor: Modal + constructor: Modal - , toggle: function () { - return this[!this.isShown ? 'show' : 'hide']() - } + , toggle: function () { + return this[!this.isShown ? 'show' : 'hide']() + } - , show: function () { - var that = this - , e = $.Event('show') + , show: function () { + var that = this + , e = $.Event('show') - this.$element.trigger(e) + this.$element.trigger(e) - if (this.isShown || e.isDefaultPrevented()) return + if (this.isShown || e.isDefaultPrevented()) return - this.isShown = true + this.isShown = true - this.escape() + this.escape() - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') + this.backdrop(function () { + var transition = $.support.transition && that.$element.hasClass('fade') - if (!that.$element.parent().length) { - that.$element.appendTo(document.body) //don't move modals dom position - } + if (!that.$element.parent().length) { + that.$element.appendTo(document.body) //don't move modals dom position + } - that.$element - .show() + that.$element + .show() - if (transition) { - that.$element[0].offsetWidth // force reflow - } + if (transition) { + that.$element[0].offsetWidth // force reflow + } - that.$element - .addClass('in') - .attr('aria-hidden', false) + that.$element + .addClass('in') + .attr('aria-hidden', false) - that.enforceFocus() + that.enforceFocus() - transition ? - that.$element.one($.support.transition.end, function () { - that.$element.focus().trigger('shown') - }) : - that.$element.focus().trigger('shown') + transition ? + that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : + that.$element.focus().trigger('shown') - }) - } - - , hide: function (e) { - e && e.preventDefault() - - var that = this - - e = $.Event('hide') - - this.$element.trigger(e) - - if (!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.escape() - - $(document).off('focusin.modal') - - this.$element - .removeClass('in') - .attr('aria-hidden', true) - - $.support.transition && this.$element.hasClass('fade') ? - this.hideWithTransition() : - this.hideModal() - } - - , enforceFocus: function () { - var that = this - $(document).on('focusin.modal', function (e) { - if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { - that.$element.focus() - } - }) - } - - , escape: function () { - var that = this - if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.modal', function (e) { - e.which == 27 && that.hide() - }) - } else if (!this.isShown) { - this.$element.off('keyup.dismiss.modal') - } - } - - , hideWithTransition: function () { - var that = this - , timeout = setTimeout(function () { - that.$element.off($.support.transition.end) - that.hideModal() - }, 500) - - this.$element.one($.support.transition.end, function () { - clearTimeout(timeout) - that.hideModal() - }) - } - - , hideModal: function (that) { - this.$element - .hide() - .trigger('hidden') - - this.backdrop() - } - - , removeBackdrop: function () { - this.$backdrop.remove() - this.$backdrop = null - } - - , backdrop: function (callback) { - var that = this - , animate = this.$element.hasClass('fade') ? 'fade' : '' - - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $('