forked from loafle/openapi-generator-original
Compare commits
44 Commits
swagger-co
...
swagger-co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
828cc5d1bf | ||
|
|
59328ae65a | ||
|
|
6d76738427 | ||
|
|
0f3087cbd6 | ||
|
|
4c19ff30ed | ||
|
|
a38fbe8d21 | ||
|
|
8c1539ab24 | ||
|
|
af3b3eb323 | ||
|
|
c8f6d8a7f2 | ||
|
|
cf52e7d788 | ||
|
|
8eb34c5141 | ||
|
|
2a9cf7c06d | ||
|
|
f4cd02283b | ||
|
|
99cca5d249 | ||
|
|
5d8877a679 | ||
|
|
d18cc2d3e4 | ||
|
|
0ae00dc79c | ||
|
|
e1bfdfbc5e | ||
|
|
c2d332ce20 | ||
|
|
35a4039955 | ||
|
|
b7368654f1 | ||
|
|
87bad7b36d | ||
|
|
25837e3367 | ||
|
|
61a9cc6e6a | ||
|
|
8b5e638409 | ||
|
|
69fe17380c | ||
|
|
98ca711e44 | ||
|
|
b9ec912698 | ||
|
|
bc0fd47522 | ||
|
|
3e527e3141 | ||
|
|
ed423a4a8e | ||
|
|
f88b500ee8 | ||
|
|
32d645572c | ||
|
|
4a6ab18b73 | ||
|
|
8ec999089a | ||
|
|
1a07c0796f | ||
|
|
d4baff8d90 | ||
|
|
8aa414360e | ||
|
|
3b7de86b99 | ||
|
|
feb6c5928f | ||
|
|
d9c3277f9e | ||
|
|
1d33b33f28 | ||
|
|
e51179ed0f | ||
|
|
3a8db77200 |
10
README.md
10
README.md
@@ -1,4 +1,4 @@
|
||||
# Swagger Client Code-Generator
|
||||
# Swagger Code Generator
|
||||
|
||||
## Overview
|
||||
This is the swagger codegen project, which allows generation of client libraries automatically from a
|
||||
@@ -16,6 +16,12 @@ You need the following installed and available in your $PATH:
|
||||
|
||||
You also need to add the scala binary to your PATH.
|
||||
|
||||
After cloning the project, you need to build it from source with this command:
|
||||
|
||||
```
|
||||
mvn package
|
||||
```
|
||||
|
||||
### To generate a sample client library
|
||||
You can build a client against Wordnik's [petstore](http://petstore.swagger.wordnik.com) API as follows:
|
||||
|
||||
@@ -153,7 +159,7 @@ You can also use the codegen to generate a server for a couple different framewo
|
||||
|
||||
* [ruby sinatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/sinatra)
|
||||
|
||||
* [scala sinatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/scalatra)
|
||||
* [scala scalatra generator](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/scalatra)
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/flash/FlashPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/flash/FlashPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=src/test/resources/petstore "
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/java/JavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/wordnik-api/java/JavaWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/wordnik-api/java/JavaWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/*:$DIR/../target/lib/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/objc/ObjcPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/objc/ObjcPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/wordnik-api/objc/ObjcWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/wordnik-api/objc/ObjcWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/php/PHPPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/php/PHPPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/python/PythonPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/python/PythonPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/python3/Python3PetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/python3/Python3PetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
echo "" > classpath.txt
|
||||
for file in `ls target/lib`;
|
||||
do echo -n 'target/lib/' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
|
||||
for file in `ls target/*.jar`;
|
||||
do echo -n '' >> classpath.txt;
|
||||
echo -n $file >> classpath.txt;
|
||||
echo -n ':' >> classpath.txt;
|
||||
done
|
||||
export CLASSPATH=$(cat classpath.txt)
|
||||
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/ruby/RubyPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/ruby/RubyPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -DXmx4096M"
|
||||
scala $WORDNIK_OPTS -cp $CLASSPATH "$@"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@"
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/petstore/scala/ScalaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/resources.json special-key
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/petstore/scala/ScalaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs.json special-key
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH "$@" samples/client/wordnik-api/scala/ScalaWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DfileMap=samples/client/wordnik-api/spec-files"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH "$@" samples/client/wordnik-api/scala/ScalaWordnikApiCodegen.scala http://api.wordnik.com/v4/resources.json
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export CLASSPATH="$DIR/../target/lib/*:$DIR/../target/*"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
scala $WORDNIK_OPTS $JAVA_CONFIG_OPTIONS -cp $CLASSPATH com.wordnik.swagger.codegen.spec.Validator "$@"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
JAVA_OPTS=$JAVA_OPTS scala -cp $CLASSPATH com.wordnik.swagger.codegen.spec.Validator "$@"
|
||||
|
||||
68
pom.xml
68
pom.xml
@@ -9,7 +9,7 @@
|
||||
<artifactId>swagger-codegen_2.9.1</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>swagger-codegen</name>
|
||||
<version>2.0.0</version>
|
||||
<version>2.0.1</version>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:wordnik/swagger-codegen.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:wordnik/swagger-codegen.git</developerConnection>
|
||||
@@ -161,6 +161,46 @@
|
||||
<recompileMode>incremental</recompileMode>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>doc-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.0</version>
|
||||
<configuration>
|
||||
<reportPlugins>
|
||||
<plugin>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<jvmArgs>
|
||||
<jvmArg>-Xms64m</jvmArg>
|
||||
<jvmArg>-Xmx1024m</jvmArg>
|
||||
</jvmArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</reportPlugins>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
<reporting>
|
||||
@@ -175,12 +215,6 @@
|
||||
</plugins>
|
||||
</reporting>
|
||||
<dependencies>
|
||||
<!--dependency>
|
||||
<groupId>com.wordnik</groupId>
|
||||
<artifactId>swagger-core_2.9.1</artifactId>
|
||||
<version>${swagger-core-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency-->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
@@ -215,30 +249,24 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-scala</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<groupId>org.json4s</groupId>
|
||||
<artifactId>json4s-jackson_2.9.1</artifactId>
|
||||
<version>${json4s-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<groupId>org.json4s</groupId>
|
||||
<artifactId>json4s-native_2.9.1</artifactId>
|
||||
<version>${json4s-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<jackson-version>2.0.4</jackson-version>
|
||||
<swagger-core-version>1.1.1-SNAPSHOT</swagger-core-version>
|
||||
<scala-version>2.9.1-1</scala-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<maven-plugin.version>1.0.0</maven-plugin.version>
|
||||
<scala-test-version>1.6.1</scala-test-version>
|
||||
<json4s-version>3.0.0</json4s-version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -4,15 +4,15 @@ import com.wordnik.client.model.Category;
|
||||
import com.wordnik.client.model.Tag;
|
||||
[XmlRootNode(name="Pet")]
|
||||
public class Pet {
|
||||
[XmlElement(name="id")]
|
||||
public var id: Number = 0.0;
|
||||
|
||||
// This declaration below of _tags_obj_class is to force flash compiler to include this class
|
||||
private var _tags_obj_class: com.wordnik.client.model.Tag = null;
|
||||
[XmlElementWrapper(name="tags")]
|
||||
[XmlElements(name="tag", type="com.wordnik.client.model.Tag")]
|
||||
public var tags: Array = new Array();
|
||||
|
||||
[XmlElement(name="id")]
|
||||
public var id: Number = 0.0;
|
||||
|
||||
[XmlElement(name="category")]
|
||||
public var category: Category = null;
|
||||
|
||||
@@ -31,8 +31,8 @@ import com.wordnik.client.model.Tag;
|
||||
|
||||
public function toString(): String {
|
||||
var str: String = "Pet: ";
|
||||
str += " (id: " + id + ")";
|
||||
str += " (tags: " + tags + ")";
|
||||
str += " (id: " + id + ")";
|
||||
str += " (category: " + category + ")";
|
||||
str += " (status: " + status + ")";
|
||||
str += " (name: " + name + ")";
|
||||
|
||||
@@ -8,12 +8,12 @@ package com.wordnik.client.model {
|
||||
[XmlElement(name="lastName")]
|
||||
public var lastName: String = null;
|
||||
|
||||
[XmlElement(name="username")]
|
||||
public var username: String = null;
|
||||
|
||||
[XmlElement(name="phone")]
|
||||
public var phone: String = null;
|
||||
|
||||
[XmlElement(name="username")]
|
||||
public var username: String = null;
|
||||
|
||||
[XmlElement(name="email")]
|
||||
public var email: String = null;
|
||||
|
||||
@@ -31,8 +31,8 @@ package com.wordnik.client.model {
|
||||
var str: String = "User: ";
|
||||
str += " (id: " + id + ")";
|
||||
str += " (lastName: " + lastName + ")";
|
||||
str += " (username: " + username + ")";
|
||||
str += " (phone: " + phone + ")";
|
||||
str += " (username: " + username + ")";
|
||||
str += " (email: " + email + ")";
|
||||
str += " (userStatus: " + userStatus + ")";
|
||||
str += " (firstName: " + firstName + ")";
|
||||
|
||||
@@ -4,20 +4,13 @@ import java.util.*;
|
||||
import com.wordnik.petstore.model.Category;
|
||||
import com.wordnik.petstore.model.Tag;
|
||||
public class Pet {
|
||||
private Long id = null;
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
private Long id = null;
|
||||
private Category category = null;
|
||||
/* pet status in the store */
|
||||
private String status = null;
|
||||
private String name = null;
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@@ -25,6 +18,13 @@ public class Pet {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@@ -57,8 +57,8 @@ public class Pet {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Pet {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" tags: ").append(tags).append("\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" category: ").append(category).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append(" name: ").append(name).append("\n");
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.wordnik.petstore.model;
|
||||
public class User {
|
||||
private Long id = null;
|
||||
private String lastName = null;
|
||||
private String username = null;
|
||||
private String phone = null;
|
||||
private String username = null;
|
||||
private String email = null;
|
||||
/* User Status */
|
||||
private Integer userStatus = null;
|
||||
@@ -24,13 +24,6 @@ public class User {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@@ -38,6 +31,13 @@ public class User {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@@ -72,8 +72,8 @@ public class User {
|
||||
sb.append("class User {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" lastName: ").append(lastName).append("\n");
|
||||
sb.append(" username: ").append(username).append("\n");
|
||||
sb.append(" phone: ").append(phone).append("\n");
|
||||
sb.append(" username: ").append(username).append("\n");
|
||||
sb.append(" email: ").append(email).append("\n");
|
||||
sb.append(" userStatus: ").append(userStatus).append("\n");
|
||||
sb.append(" firstName: ").append(firstName).append("\n");
|
||||
|
||||
Binary file not shown.
@@ -2,253 +2,4 @@
|
||||
<Bucket
|
||||
type = "1"
|
||||
version = "1.0">
|
||||
<FileBreakpoints>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370372827.107591"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "74"
|
||||
endingLineNumber = "74"
|
||||
landmarkName = "-testAddPet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370372859.750877"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "91"
|
||||
endingLineNumber = "91"
|
||||
landmarkName = "-testAddPet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370372874.536795"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "94"
|
||||
endingLineNumber = "94"
|
||||
landmarkName = "-testAddPet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370372989.134842"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "105"
|
||||
endingLineNumber = "105"
|
||||
landmarkName = "-testAddPet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370372945.467097"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "101"
|
||||
endingLineNumber = "101"
|
||||
landmarkName = "-testAddPet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370372989.134842"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "108"
|
||||
endingLineNumber = "108"
|
||||
landmarkName = "-testAddPet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370372989.134842"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "113"
|
||||
endingLineNumber = "113"
|
||||
landmarkName = "-testAddPet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370372989.134842"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "109"
|
||||
endingLineNumber = "109"
|
||||
landmarkName = "-testAddPet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373828.881393"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "172"
|
||||
endingLineNumber = "172"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373828.881393"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "185"
|
||||
endingLineNumber = "185"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373872.596558"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "213"
|
||||
endingLineNumber = "213"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373826.764943"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "169"
|
||||
endingLineNumber = "169"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373872.596558"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "211"
|
||||
endingLineNumber = "211"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373913.88636"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "239"
|
||||
endingLineNumber = "239"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373915.25218"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "240"
|
||||
endingLineNumber = "240"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373916.607639"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "244"
|
||||
endingLineNumber = "244"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370373999.668679"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "201"
|
||||
endingLineNumber = "201"
|
||||
landmarkName = "-testUpdatePet"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/PetApiTest.m"
|
||||
timestampString = "370374817.753901"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "290"
|
||||
endingLineNumber = "290"
|
||||
landmarkName = "-testGetPetByTags"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "../tests/UserApiTest.m"
|
||||
timestampString = "370414932.195391"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "44"
|
||||
endingLineNumber = "44"
|
||||
landmarkName = "-testLoginUser"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
</FileBreakpoints>
|
||||
</Bucket>
|
||||
|
||||
@@ -8,25 +8,31 @@
|
||||
}
|
||||
@property(nonatomic, readonly) NSOperationQueue* queue;
|
||||
@property(nonatomic, readonly) NSMutableDictionary * defaultHeaders;
|
||||
@property(nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
|
||||
|
||||
+ (NIKApiInvoker*)sharedInstance;
|
||||
|
||||
- (void)updateLoadCountWithDelta:(NSInteger)countDelta;
|
||||
- (void)startLoad;
|
||||
- (void)stopLoad;
|
||||
|
||||
|
||||
-(void) addHeader:(NSString*) value
|
||||
forKey:(NSString*)key;
|
||||
-(void) addHeader:(NSString*)value forKey:(NSString*)key;
|
||||
|
||||
-(NSString*) escapeString:(NSString*) string;
|
||||
|
||||
-(id) dictionaryWithCompletionBlock:(NSString*) path
|
||||
method:(NSString*) method
|
||||
queryParams:(NSDictionary*) queryParams
|
||||
body:(id)body
|
||||
headerParams:(NSDictionary*) headerParams
|
||||
completionHandler:(void (^)(NSDictionary*, NSError *))completionBlock;
|
||||
-(void) dictionary:(NSString*) path
|
||||
method:(NSString*) method
|
||||
queryParams:(NSDictionary*) queryParams
|
||||
body:(id)body
|
||||
headerParams:(NSDictionary*) headerParams
|
||||
completionBlock:(void (^)(NSDictionary*, NSError *))completionBlock;
|
||||
|
||||
-(id) stringWithCompletionBlock:(NSString*) path
|
||||
method:(NSString*) method
|
||||
queryParams:(NSDictionary*) queryParams
|
||||
body:(id)body
|
||||
headerParams:(NSDictionary*) headerParams
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock;
|
||||
-(void) stringWithCompletionBlock:(NSString*) path
|
||||
method:(NSString*) method
|
||||
queryParams:(NSDictionary*) queryParams
|
||||
body:(id)body
|
||||
headerParams:(NSDictionary*) headerParams
|
||||
completionBlock:(void (^)(NSString*, NSError *))completionBlock;
|
||||
|
||||
@end
|
||||
|
||||
@@ -5,10 +5,42 @@
|
||||
@synthesize queue = _queue;
|
||||
@synthesize defaultHeaders = _defaultHeaders;
|
||||
|
||||
|
||||
static NSInteger __LoadingObjectsCount = 0;
|
||||
|
||||
+ (NIKApiInvoker*)sharedInstance {
|
||||
static NIKApiInvoker *_sharedInstance = nil;
|
||||
if (!_sharedInstance) {
|
||||
_sharedInstance = [[NIKApiInvoker alloc] init];
|
||||
}
|
||||
return _sharedInstance;
|
||||
}
|
||||
|
||||
- (void)updateLoadCountWithDelta:(NSInteger)countDelta {
|
||||
@synchronized(self) {
|
||||
__LoadingObjectsCount += countDelta;
|
||||
__LoadingObjectsCount = (__LoadingObjectsCount < 0) ? 0 : __LoadingObjectsCount ;
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = __LoadingObjectsCount > 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
- (void)startLoad {
|
||||
[self updateLoadCountWithDelta:1];
|
||||
}
|
||||
|
||||
- (void)stopLoad {
|
||||
[self updateLoadCountWithDelta:-1];
|
||||
}
|
||||
|
||||
|
||||
- (id) init {
|
||||
self = [super init];
|
||||
_queue = [[NSOperationQueue alloc] init];
|
||||
_defaultHeaders = [[NSMutableDictionary alloc] init];
|
||||
_cachePolicy = NSURLRequestUseProtocolCachePolicy;
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -19,19 +51,19 @@
|
||||
|
||||
-(NSString*) escapeString:(NSString *)unescaped {
|
||||
return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(
|
||||
NULL,
|
||||
(__bridge CFStringRef) unescaped,
|
||||
NULL,
|
||||
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
|
||||
kCFStringEncodingUTF8));
|
||||
NULL,
|
||||
(__bridge CFStringRef) unescaped,
|
||||
NULL,
|
||||
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
|
||||
kCFStringEncodingUTF8));
|
||||
}
|
||||
|
||||
-(id) dictionaryWithCompletionBlock:(NSString*) path
|
||||
method:(NSString*) method
|
||||
queryParams:(NSDictionary*) queryParams
|
||||
body:(id) body
|
||||
headerParams:(NSDictionary*) headerParams
|
||||
completionHandler:(void (^)(NSDictionary*, NSError *))completionBlock
|
||||
-(void) dictionary:(NSString*) path
|
||||
method:(NSString*) method
|
||||
queryParams:(NSDictionary*) queryParams
|
||||
body:(id) body
|
||||
headerParams:(NSDictionary*) headerParams
|
||||
completionBlock:(void (^)(NSDictionary*, NSError *))completionBlock
|
||||
{
|
||||
NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path];
|
||||
NSString * separator = nil;
|
||||
@@ -52,108 +84,15 @@
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
NSLog(@"request url: %@", requestUrl);
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"RVBLogging"]) {
|
||||
NSLog(@"request url: %@", requestUrl);
|
||||
}
|
||||
|
||||
NSURL* URL = [NSURL URLWithString:requestUrl];
|
||||
|
||||
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] init];
|
||||
[request setURL:URL];
|
||||
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
|
||||
[request setTimeoutInterval:30];
|
||||
|
||||
for(NSString * key in [_defaultHeaders keyEnumerator]){
|
||||
[request setValue:[_defaultHeaders valueForKey:key] forHTTPHeaderField:key];
|
||||
}
|
||||
if(headerParams != nil){
|
||||
for(NSString * key in [headerParams keyEnumerator]){
|
||||
[request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key];
|
||||
}
|
||||
}
|
||||
[request setHTTPMethod:method];
|
||||
if(body != nil) {
|
||||
NSError * error = [NSError new];
|
||||
NSData * data = nil;
|
||||
if([body isKindOfClass:[NSDictionary class]]){
|
||||
data = [NSJSONSerialization dataWithJSONObject:body
|
||||
options:kNilOptions error:&error];
|
||||
}
|
||||
else if ([body isKindOfClass:[NSArray class]]){
|
||||
data = [NSJSONSerialization dataWithJSONObject:body
|
||||
options:kNilOptions error:&error];
|
||||
}
|
||||
else {
|
||||
data = [body dataUsingEncoding:NSUTF8StringEncoding];
|
||||
}
|
||||
NSString *postLength = [NSString stringWithFormat:@"%ld", [data length]];
|
||||
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
|
||||
[request setHTTPBody:data];
|
||||
|
||||
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
|
||||
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
|
||||
|
||||
NSLog(@"request: %@", request);
|
||||
}
|
||||
|
||||
[NSURLConnection sendAsynchronousRequest:request queue:_queue completionHandler:
|
||||
^(NSURLResponse *response, NSData *data, NSError *error) {
|
||||
long statusCode = [(NSHTTPURLResponse*)response statusCode];
|
||||
|
||||
if (error) {
|
||||
completionBlock(nil, error);
|
||||
return;
|
||||
}
|
||||
else if (!NSLocationInRange(statusCode, NSMakeRange(200, 99))){
|
||||
error = [NSError errorWithDomain:@"swagger"
|
||||
code:statusCode
|
||||
userInfo:[NSJSONSerialization JSONObjectWithData:data
|
||||
options:kNilOptions
|
||||
error:&error]];
|
||||
completionBlock(nil, error);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
NSDictionary* results = [NSJSONSerialization JSONObjectWithData:data
|
||||
options:kNilOptions
|
||||
error:&error];
|
||||
completionBlock(results, nil);
|
||||
}
|
||||
}];
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(id) stringWithCompletionBlock:(NSString*) path
|
||||
method:(NSString*) method
|
||||
queryParams:(NSDictionary*) queryParams
|
||||
body:(id) body
|
||||
headerParams:(NSDictionary*) headerParams
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock
|
||||
{
|
||||
NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path];
|
||||
NSString * separator = nil;
|
||||
int counter = 0;
|
||||
if(queryParams != nil){
|
||||
for(NSString * key in [queryParams keyEnumerator]){
|
||||
if(counter == 0) separator = @"?";
|
||||
else separator = @"&";
|
||||
NSString * value;
|
||||
if([[queryParams valueForKey:key] isKindOfClass:[NSString class]]){
|
||||
value = [self escapeString:[queryParams valueForKey:key]];
|
||||
}
|
||||
else {
|
||||
value = [NSString stringWithFormat:@"%@", [queryParams valueForKey:key]];
|
||||
}
|
||||
[requestUrl appendFormat:[NSString stringWithFormat:@"%@%@=%@", separator,
|
||||
[self escapeString:key], value]];
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
NSLog(@"request url: %@", requestUrl);
|
||||
|
||||
NSURL* URL = [NSURL URLWithString:requestUrl];
|
||||
|
||||
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] init];
|
||||
[request setURL:URL];
|
||||
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
|
||||
[request setCachePolicy:self.cachePolicy];
|
||||
[request setTimeoutInterval:30];
|
||||
|
||||
for(NSString * key in [_defaultHeaders keyEnumerator]){
|
||||
@@ -184,14 +123,29 @@
|
||||
[request setHTTPBody:data];
|
||||
|
||||
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
|
||||
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
|
||||
|
||||
NSLog(@"request: %@", request);
|
||||
}
|
||||
|
||||
// Handle caching on GET requests
|
||||
if ((_cachePolicy == NSURLRequestReturnCacheDataElseLoad || _cachePolicy == NSURLRequestReturnCacheDataDontLoad) && [method isEqualToString:@"GET"]) {
|
||||
NSCachedURLResponse *cacheResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
|
||||
NSData *data = [cacheResponse data];
|
||||
if (data) {
|
||||
NSError *error = nil;
|
||||
NSDictionary* results = [NSJSONSerialization JSONObjectWithData:data
|
||||
options:kNilOptions
|
||||
error:&error];
|
||||
completionBlock(results, nil);
|
||||
}
|
||||
}
|
||||
|
||||
if (_cachePolicy == NSURLRequestReturnCacheDataDontLoad)
|
||||
return;
|
||||
|
||||
[self startLoad];
|
||||
NSDate *date = [NSDate date];
|
||||
[NSURLConnection sendAsynchronousRequest:request queue:_queue completionHandler:
|
||||
^(NSURLResponse *response, NSData *data, NSError *error) {
|
||||
int statusCode = [(NSHTTPURLResponse*)response statusCode];
|
||||
long statusCode = [(NSHTTPURLResponse*)response statusCode];
|
||||
|
||||
if (error) {
|
||||
completionBlock(nil, error);
|
||||
@@ -207,16 +161,143 @@
|
||||
return;
|
||||
}
|
||||
else {
|
||||
NSString* results = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||
NSDictionary* results = [NSJSONSerialization JSONObjectWithData:data
|
||||
options:kNilOptions
|
||||
error:&error];
|
||||
completionBlock(results, nil);
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"RVBLogging"]) {
|
||||
NSLog(@"fetched results (%f seconds): %@", [[NSDate date] timeIntervalSinceDate:date], results);
|
||||
}
|
||||
}
|
||||
|
||||
[self stopLoad];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void) stringWithCompletionBlock:(NSString*) path
|
||||
method:(NSString*) method
|
||||
queryParams:(NSDictionary*) queryParams
|
||||
body:(id) body
|
||||
headerParams:(NSDictionary*) headerParams
|
||||
completionBlock:(void (^)(NSString*, NSError *))completionBlock
|
||||
{
|
||||
NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path];
|
||||
NSString * separator = nil;
|
||||
int counter = 0;
|
||||
if(queryParams != nil){
|
||||
for(NSString * key in [queryParams keyEnumerator]){
|
||||
if(counter == 0) separator = @"?";
|
||||
else separator = @"&";
|
||||
NSString * value;
|
||||
if([[queryParams valueForKey:key] isKindOfClass:[NSString class]]){
|
||||
value = [self escapeString:[queryParams valueForKey:key]];
|
||||
}
|
||||
else {
|
||||
value = [NSString stringWithFormat:@"%@", [queryParams valueForKey:key]];
|
||||
}
|
||||
[requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator,
|
||||
[self escapeString:key], value]];
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"RVBLogging"]) {
|
||||
NSLog(@"request url: %@", requestUrl);
|
||||
}
|
||||
|
||||
NSURL* URL = [NSURL URLWithString:requestUrl];
|
||||
|
||||
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] init];
|
||||
[request setURL:URL];
|
||||
[request setCachePolicy:self.cachePolicy];
|
||||
[request setTimeoutInterval:30];
|
||||
|
||||
for(NSString * key in [_defaultHeaders keyEnumerator]){
|
||||
[request setValue:[_defaultHeaders valueForKey:key] forHTTPHeaderField:key];
|
||||
}
|
||||
if(headerParams != nil){
|
||||
for(NSString * key in [headerParams keyEnumerator]){
|
||||
[request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key];
|
||||
}
|
||||
}
|
||||
[request setHTTPMethod:method];
|
||||
if(body != nil) {
|
||||
NSError * error = [NSError new];
|
||||
NSData * data = nil;
|
||||
if([body isKindOfClass:[NSDictionary class]]){
|
||||
data = [NSJSONSerialization dataWithJSONObject:body
|
||||
options:kNilOptions error:&error];
|
||||
}
|
||||
else if ([body isKindOfClass:[NSArray class]]){
|
||||
data = [NSJSONSerialization dataWithJSONObject:body
|
||||
options:kNilOptions error:&error];
|
||||
}
|
||||
else {
|
||||
data = [body dataUsingEncoding:NSUTF8StringEncoding];
|
||||
}
|
||||
NSString *postLength = [NSString stringWithFormat:@"%d", [data length]];
|
||||
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
|
||||
[request setHTTPBody:data];
|
||||
|
||||
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
|
||||
}
|
||||
|
||||
|
||||
// Handle caching on GET requests
|
||||
if ((_cachePolicy == NSURLRequestReturnCacheDataElseLoad || _cachePolicy == NSURLRequestReturnCacheDataDontLoad) && [method isEqualToString:@"GET"]) {
|
||||
NSCachedURLResponse *cacheResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
|
||||
NSData *data = [cacheResponse data];
|
||||
if (data) {
|
||||
NSString* results = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||
|
||||
if(results && [results length] >= 2) {
|
||||
if(([results characterAtIndex:0] == '\"') && ([results characterAtIndex:([results length] - 1) == '\"'])){
|
||||
results = [results substringWithRange:NSMakeRange(1, [results length] -2)];
|
||||
}
|
||||
}
|
||||
completionBlock(results, nil);
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"RVBLogging"]) {
|
||||
// NSLog(@"cached results: %@", results);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (_cachePolicy == NSURLRequestReturnCacheDataDontLoad)
|
||||
return;
|
||||
|
||||
[self startLoad];
|
||||
NSDate *date = [NSDate date];
|
||||
[NSURLConnection sendAsynchronousRequest:request queue:_queue completionHandler:
|
||||
^(NSURLResponse *response, NSData *data, NSError *error) {
|
||||
int statusCode = [(NSHTTPURLResponse*)response statusCode];
|
||||
if (error) {
|
||||
completionBlock(nil, error);
|
||||
return;
|
||||
}
|
||||
else if (!NSLocationInRange(statusCode, NSMakeRange(200, 99))){
|
||||
error = [NSError errorWithDomain:@"swagger"
|
||||
code:statusCode
|
||||
userInfo:[NSJSONSerialization JSONObjectWithData:data
|
||||
options:kNilOptions
|
||||
error:&error]];
|
||||
completionBlock(nil, error);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
NSString* results = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||
|
||||
if(results && [results length] >= 2) {
|
||||
if(([results characterAtIndex:0] == '\"') && ([results characterAtIndex:([results length] - 1) == '\"'])){
|
||||
results = [results substringWithRange:NSMakeRange(1, [results length] -2)];
|
||||
}
|
||||
|
||||
}
|
||||
completionBlock(results, nil);
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"RVBLogging"]) {
|
||||
NSLog(@"fetched results (%f seconds): %@", [[NSDate date] timeIntervalSinceDate:date], results);
|
||||
}
|
||||
}
|
||||
[self stopLoad];
|
||||
}];
|
||||
return nil;
|
||||
}
|
||||
@end
|
||||
@@ -1,13 +1,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIKSwaggerObject.h"
|
||||
|
||||
@interface NIKCategory : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSString* _name; //NSString
|
||||
}
|
||||
|
||||
|
||||
@interface NIKCategory : NIKSwaggerObject
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSString* name;
|
||||
|
||||
@@ -3,27 +3,30 @@
|
||||
|
||||
@implementation NIKCategory
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize name = _name;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
name: (NSString*) name
|
||||
{
|
||||
__id = _id;
|
||||
_name = name;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
-(id)_id: (NSNumber*) _id
|
||||
name: (NSString*) name
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_name = [dict objectForKey:@"name"];
|
||||
__id = _id;
|
||||
_name = name;
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id) initWithValues:(NSDictionary*)dict
|
||||
{
|
||||
self = [super init];
|
||||
if(self) {
|
||||
__id = dict[@"id"];
|
||||
_name = dict[@"name"];
|
||||
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_name != nil) [dict setObject:_name forKey:@"name"];
|
||||
if(__id != nil) dict[@"id"] = __id ;
|
||||
if(_name != nil) dict[@"name"] = _name ;
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -2,16 +2,7 @@
|
||||
#import "NIKSwaggerObject.h"
|
||||
#import "NIKDate.h"
|
||||
|
||||
@interface NIKOrder : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSNumber* _petId; //NSNumber
|
||||
NSString* _status; //NSString
|
||||
NSNumber* _quantity; //NSNumber
|
||||
NIKDate* _shipDate; //NIKDate
|
||||
}
|
||||
|
||||
|
||||
@interface NIKOrder : NIKSwaggerObject
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSNumber* petId;
|
||||
|
||||
@@ -3,59 +3,59 @@
|
||||
|
||||
@implementation NIKOrder
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize petId = _petId;
|
||||
@synthesize status = _status;
|
||||
@synthesize quantity = _quantity;
|
||||
@synthesize shipDate = _shipDate;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
petId: (NSNumber*) petId
|
||||
status: (NSString*) status
|
||||
quantity: (NSNumber*) quantity
|
||||
shipDate: (NIKDate*) shipDate
|
||||
{
|
||||
__id = _id;
|
||||
_petId = petId;
|
||||
_status = status;
|
||||
_quantity = quantity;
|
||||
_shipDate = shipDate;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
-(id)_id: (NSNumber*) _id
|
||||
petId: (NSNumber*) petId
|
||||
status: (NSString*) status
|
||||
quantity: (NSNumber*) quantity
|
||||
shipDate: (NIKDate*) shipDate
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_petId = [dict objectForKey:@"petId"];
|
||||
_status = [dict objectForKey:@"status"];
|
||||
_quantity = [dict objectForKey:@"quantity"];
|
||||
id shipDate_dict = [dict objectForKey:@"shipDate"];
|
||||
_shipDate = [[NIKDate alloc]initWithValues:shipDate_dict];
|
||||
__id = _id;
|
||||
_petId = petId;
|
||||
_status = status;
|
||||
_quantity = quantity;
|
||||
_shipDate = shipDate;
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id) initWithValues:(NSDictionary*)dict
|
||||
{
|
||||
self = [super init];
|
||||
if(self) {
|
||||
__id = dict[@"id"];
|
||||
_petId = dict[@"petId"];
|
||||
_status = dict[@"status"];
|
||||
_quantity = dict[@"quantity"];
|
||||
id shipDate_dict = dict[@"shipDate"];
|
||||
_shipDate = [[NIKDate alloc]initWithValues:shipDate_dict];
|
||||
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_petId != nil) [dict setObject:_petId forKey:@"petId"];
|
||||
if(_status != nil) [dict setObject:_status forKey:@"status"];
|
||||
if(_quantity != nil) [dict setObject:_quantity forKey:@"quantity"];
|
||||
if(__id != nil) dict[@"id"] = __id ;
|
||||
if(_petId != nil) dict[@"petId"] = _petId ;
|
||||
if(_status != nil) dict[@"status"] = _status ;
|
||||
if(_quantity != nil) dict[@"quantity"] = _quantity ;
|
||||
if(_shipDate != nil){
|
||||
if([_shipDate isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
for( NIKDate * shipDate in (NSArray*)_shipDate) {
|
||||
for( NIKDate *shipDate in (NSArray*)_shipDate) {
|
||||
[array addObject:[(NIKSwaggerObject*)shipDate asDictionary]];
|
||||
}
|
||||
[dict setObject:array forKey:@"shipDate"];
|
||||
dict[@"shipDate"] = array;
|
||||
}
|
||||
else if(_shipDate && [_shipDate isKindOfClass:[NIKDate class]]) {
|
||||
NSString * dateString = [(NIKDate*)_shipDate toString];
|
||||
if(dateString){
|
||||
[dict setObject:dateString forKey:@"shipDate"];
|
||||
dict[@"shipDate"] = dateString;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(_shipDate != nil) [dict setObject:[(NIKSwaggerObject*)_shipDate asDictionary]forKey:@"shipDate"];
|
||||
if(_shipDate != nil) dict[@"shipDate"] = [(NIKSwaggerObject*)_shipDate asDictionary];
|
||||
}
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
|
||||
@@ -3,26 +3,16 @@
|
||||
#import "NIKCategory.h"
|
||||
#import "NIKTag.h"
|
||||
|
||||
@interface NIKPet : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSArray* _tags; //Tag
|
||||
NIKCategory* _category; //Category
|
||||
NSString* _status; //NSString
|
||||
NSString* _name; //NSString
|
||||
NSArray* _photoUrls; //NSString
|
||||
}
|
||||
@interface NIKPet : NIKSwaggerObject
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSArray* tags;
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NIKCategory* category;
|
||||
@property(nonatomic) NSString* status;
|
||||
@property(nonatomic) NSString* name;
|
||||
@property(nonatomic) NSArray* photoUrls;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
tags: (NSArray*) tags
|
||||
- (id) tags: (NSArray*) tags
|
||||
_id: (NSNumber*) _id
|
||||
category: (NIKCategory*) category
|
||||
status: (NSString*) status
|
||||
name: (NSString*) name
|
||||
|
||||
@@ -3,92 +3,100 @@
|
||||
|
||||
@implementation NIKPet
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize tags = _tags;
|
||||
@synthesize category = _category;
|
||||
@synthesize status = _status;
|
||||
@synthesize name = _name;
|
||||
@synthesize photoUrls = _photoUrls;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
tags: (NSArray*) tags
|
||||
category: (NIKCategory*) category
|
||||
status: (NSString*) status
|
||||
name: (NSString*) name
|
||||
photoUrls: (NSArray*) photoUrls
|
||||
{
|
||||
__id = _id;
|
||||
_tags = tags;
|
||||
_category = category;
|
||||
_status = status;
|
||||
_name = name;
|
||||
_photoUrls = photoUrls;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
-(id)tags: (NSArray*) tags
|
||||
_id: (NSNumber*) _id
|
||||
category: (NIKCategory*) category
|
||||
status: (NSString*) status
|
||||
name: (NSString*) name
|
||||
photoUrls: (NSArray*) photoUrls
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
id tags_dict = [dict objectForKey:@"tags"];
|
||||
if([tags_dict isKindOfClass:[NSArray class]]) {
|
||||
if([(NSArray*)tags_dict count] > 0) {
|
||||
_tags = tags;
|
||||
__id = _id;
|
||||
_category = category;
|
||||
_status = status;
|
||||
_name = name;
|
||||
_photoUrls = photoUrls;
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id) initWithValues:(NSDictionary*)dict
|
||||
{
|
||||
self = [super init];
|
||||
if(self) {
|
||||
id tags_dict = dict[@"tags"];
|
||||
if([tags_dict isKindOfClass:[NSArray class]]) {
|
||||
|
||||
NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[(NSArray*)tags_dict count]];
|
||||
for (NSDictionary* dict in (NSArray*)tags_dict) {
|
||||
NIKTag* d = [[NIKTag alloc]initWithValues:dict];
|
||||
[objs addObject:d];
|
||||
|
||||
if([(NSArray*)tags_dict count] > 0) {
|
||||
for (NSDictionary* dict in (NSArray*)tags_dict) {
|
||||
NIKTag* d = [[NIKTag alloc] initWithValues:dict];
|
||||
[objs addObject:d];
|
||||
}
|
||||
|
||||
_tags = [[NSArray alloc] initWithArray:objs];
|
||||
}
|
||||
else {
|
||||
_tags = [[NSArray alloc] init];
|
||||
}
|
||||
_tags = [[NSArray alloc] initWithArray:objs];
|
||||
}
|
||||
else {
|
||||
_tags = [[NSArray alloc] init];
|
||||
}
|
||||
__id = dict[@"id"];
|
||||
id category_dict = dict[@"category"];
|
||||
_category = [[NIKCategory alloc]initWithValues:category_dict];
|
||||
_status = dict[@"status"];
|
||||
_name = dict[@"name"];
|
||||
_photoUrls = dict[@"photoUrls"];
|
||||
|
||||
|
||||
}
|
||||
id category_dict = [dict objectForKey:@"category"];
|
||||
_category = [[NIKCategory alloc]initWithValues:category_dict];
|
||||
_status = [dict objectForKey:@"status"];
|
||||
_name = [dict objectForKey:@"name"];
|
||||
_photoUrls = [dict objectForKey:@"photoUrls"];
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_tags != nil){
|
||||
if([_tags isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
for( NIKTag * tags in (NSArray*)_tags) {
|
||||
for( NIKTag *tags in (NSArray*)_tags) {
|
||||
[array addObject:[(NIKSwaggerObject*)tags asDictionary]];
|
||||
}
|
||||
[dict setObject:array forKey:@"tags"];
|
||||
dict[@"tags"] = array;
|
||||
}
|
||||
else if(_tags && [_tags isKindOfClass:[NIKDate class]]) {
|
||||
NSString * dateString = [(NIKDate*)_tags toString];
|
||||
if(dateString){
|
||||
[dict setObject:dateString forKey:@"tags"];
|
||||
dict[@"tags"] = dateString;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(_tags != nil) [dict setObject:[(NIKSwaggerObject*)_tags asDictionary]forKey:@"tags"];
|
||||
if(_tags != nil) dict[@"tags"] = [(NIKSwaggerObject*)_tags asDictionary];
|
||||
}
|
||||
if(__id != nil) dict[@"id"] = __id ;
|
||||
if(_category != nil){
|
||||
if([_category isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
for( NIKCategory * category in (NSArray*)_category) {
|
||||
for( NIKCategory *category in (NSArray*)_category) {
|
||||
[array addObject:[(NIKSwaggerObject*)category asDictionary]];
|
||||
}
|
||||
[dict setObject:array forKey:@"category"];
|
||||
dict[@"category"] = array;
|
||||
}
|
||||
else if(_category && [_category isKindOfClass:[NIKDate class]]) {
|
||||
NSString * dateString = [(NIKDate*)_category toString];
|
||||
if(dateString){
|
||||
[dict setObject:dateString forKey:@"category"];
|
||||
dict[@"category"] = dateString;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(_category != nil) [dict setObject:[(NIKSwaggerObject*)_category asDictionary]forKey:@"category"];
|
||||
if(_category != nil) dict[@"category"] = [(NIKSwaggerObject*)_category asDictionary];
|
||||
}
|
||||
if(_status != nil) [dict setObject:_status forKey:@"status"];
|
||||
if(_name != nil) [dict setObject:_name forKey:@"name"];
|
||||
if(_photoUrls != nil) [dict setObject:_photoUrls forKey:@"photoUrls"];
|
||||
if(_status != nil) dict[@"status"] = _status ;
|
||||
if(_name != nil) dict[@"name"] = _name ;
|
||||
if(_photoUrls != nil) dict[@"photoUrls"] = _photoUrls ;
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -12,17 +12,51 @@
|
||||
@property(nonatomic, readonly) NSOperationQueue* queue;
|
||||
@property(nonatomic, readonly) NIKApiInvoker* api;
|
||||
|
||||
-(void) addHeader:(NSString*) value
|
||||
forKey:(NSString*)key;
|
||||
-(void) addHeader:(NSString*)value forKey:(NSString*)key;
|
||||
|
||||
/**
|
||||
|
||||
Find pet by ID
|
||||
Returns a pet based on ID
|
||||
@param petId ID of pet that needs to be fetched
|
||||
*/
|
||||
-(void) getPetByIdWithCompletionBlock :(NSString*) petId
|
||||
completionHandler:(void (^)(NIKPet*, NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NIKPet* output, NSError* error))completionBlock;
|
||||
|
||||
/**
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
@param body Pet object that needs to be added to the store
|
||||
*/
|
||||
-(void) addPetWithCompletionBlock :(NIKPet*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
/**
|
||||
|
||||
Update an existing pet
|
||||
|
||||
@param body Pet object that needs to be updated in the store
|
||||
*/
|
||||
-(void) updatePetWithCompletionBlock :(NIKPet*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(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
|
||||
*/
|
||||
-(void) findPetsByStatusWithCompletionBlock :(NSString*) status
|
||||
completionHandler:(void (^)(NSArray*, NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NSArray* output, 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
|
||||
*/
|
||||
-(void) findPetsByTagsWithCompletionBlock :(NSString*) tags
|
||||
completionHandler:(void (^)(NSArray*, NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock;
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,10 +9,20 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
@synthesize queue = _queue;
|
||||
@synthesize api = _api;
|
||||
|
||||
- (id) init {
|
||||
+(NIKPetApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key {
|
||||
static NIKPetApi* singletonAPI = nil;
|
||||
|
||||
if (singletonAPI == nil) {
|
||||
singletonAPI = [[NIKPetApi alloc] init];
|
||||
[singletonAPI addHeader:headerValue forKey:key];
|
||||
}
|
||||
return singletonAPI;
|
||||
}
|
||||
|
||||
-(id) init {
|
||||
self = [super init];
|
||||
_queue = [[NSOperationQueue alloc] init];
|
||||
_api = [[NIKApiInvoker alloc] init];
|
||||
_api = [NIKApiInvoker sharedInstance];
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -22,15 +32,8 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
[_api addHeader:value forKey:key];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive:
|
||||
* returnBaseType: NIKPet
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) getPetByIdWithCompletionBlock :(NSString*) petId
|
||||
completionHandler:(void (^)(NIKPet*, NSError *))completionBlock{
|
||||
-(void) getPetByIdWithCompletionBlock:(NSString*) petId
|
||||
completionHandler: (void (^)(NIKPet* output, NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}/{petId}", basePath];
|
||||
|
||||
@@ -45,29 +48,23 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(petId == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
|
||||
|
||||
completionBlock( [[NIKPet alloc]initWithValues: data], nil);}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) addPetWithCompletionBlock :(NIKPet*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) addPetWithCompletionBlock:(NIKPet*) body
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}", basePath];
|
||||
|
||||
@@ -103,12 +100,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -116,17 +113,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) updatePetWithCompletionBlock :(NIKPet*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) updatePetWithCompletionBlock:(NIKPet*) body
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}", basePath];
|
||||
|
||||
@@ -162,12 +153,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"PUT"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"PUT"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -175,17 +166,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive:
|
||||
* returnBaseType: NIKPet
|
||||
* returnContainer: List
|
||||
*
|
||||
**/
|
||||
-(void) findPetsByStatusWithCompletionBlock :(NSString*) status
|
||||
completionHandler:(void (^)(NSArray*, NSError *))completionBlock{
|
||||
-(void) findPetsByStatusWithCompletionBlock:(NSString*) status
|
||||
completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}/findByStatus", basePath];
|
||||
|
||||
@@ -195,18 +180,18 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
if(status != nil)
|
||||
[queryParams setValue:status forKey:@"status"];
|
||||
queryParams[@"status"] = status;
|
||||
NSMutableDictionary* headerParams = [[NSMutableDictionary alloc] init];
|
||||
id bodyDictionary = nil;
|
||||
if(status == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionBlock: ^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
@@ -221,17 +206,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive:
|
||||
* returnBaseType: NIKPet
|
||||
* returnContainer: List
|
||||
*
|
||||
**/
|
||||
-(void) findPetsByTagsWithCompletionBlock :(NSString*) tags
|
||||
completionHandler:(void (^)(NSArray*, NSError *))completionBlock{
|
||||
-(void) findPetsByTagsWithCompletionBlock:(NSString*) tags
|
||||
completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}/findByTags", basePath];
|
||||
|
||||
@@ -241,18 +220,18 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
if(tags != nil)
|
||||
[queryParams setValue:tags forKey:@"tags"];
|
||||
queryParams[@"tags"] = tags;
|
||||
NSMutableDictionary* headerParams = [[NSMutableDictionary alloc] init];
|
||||
id bodyDictionary = nil;
|
||||
if(tags == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionBlock: ^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
@@ -267,9 +246,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) getPetByIdAsJsonWithCompletionBlock :(NSString*) petId
|
||||
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}/{petId}", basePath];
|
||||
@@ -285,12 +266,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(petId == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
@@ -307,11 +288,14 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
NSString * json = [[NSString alloc]initWithData:responseData encoding:NSUTF8StringEncoding];
|
||||
completionBlock(json, nil);
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) addPetAsJsonWithCompletionBlock :(NIKPet*) body
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}", basePath];
|
||||
@@ -348,22 +332,25 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) updatePetAsJsonWithCompletionBlock :(NIKPet*) body
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}", basePath];
|
||||
@@ -400,22 +387,25 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"PUT"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"PUT"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) findPetsByStatusAsJsonWithCompletionBlock :(NSString*) status
|
||||
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}/findByStatus", basePath];
|
||||
@@ -426,18 +416,18 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
if(status != nil)
|
||||
[queryParams setValue:status forKey:@"status"];
|
||||
queryParams[@"status"] = status;
|
||||
NSMutableDictionary* headerParams = [[NSMutableDictionary alloc] init];
|
||||
id bodyDictionary = nil;
|
||||
if(status == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
@@ -454,11 +444,14 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
NSString * json = [[NSString alloc]initWithData:responseData encoding:NSUTF8StringEncoding];
|
||||
completionBlock(json, nil);
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) findPetsByTagsAsJsonWithCompletionBlock :(NSString*) tags
|
||||
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/pet.{format}/findByTags", basePath];
|
||||
@@ -469,18 +462,18 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
if(tags != nil)
|
||||
[queryParams setValue:tags forKey:@"tags"];
|
||||
queryParams[@"tags"] = tags;
|
||||
NSMutableDictionary* headerParams = [[NSMutableDictionary alloc] init];
|
||||
id bodyDictionary = nil;
|
||||
if(tags == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
@@ -497,8 +490,10 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
NSString * json = [[NSString alloc]initWithData:responseData encoding:NSUTF8StringEncoding];
|
||||
completionBlock(json, nil);
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,13 +12,33 @@
|
||||
@property(nonatomic, readonly) NSOperationQueue* queue;
|
||||
@property(nonatomic, readonly) NIKApiInvoker* api;
|
||||
|
||||
-(void) addHeader:(NSString*) value
|
||||
forKey:(NSString*)key;
|
||||
-(void) addHeader:(NSString*)value forKey:(NSString*)key;
|
||||
|
||||
/**
|
||||
|
||||
Find purchase order by ID
|
||||
For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors
|
||||
@param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
-(void) getOrderByIdWithCompletionBlock :(NSString*) orderId
|
||||
completionHandler:(void (^)(NIKOrder*, NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NIKOrder* 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
|
||||
*/
|
||||
-(void) deleteOrderWithCompletionBlock :(NSString*) orderId
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
/**
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
@param body order placed for purchasing the pet
|
||||
*/
|
||||
-(void) placeOrderWithCompletionBlock :(NIKOrder*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,10 +9,20 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
@synthesize queue = _queue;
|
||||
@synthesize api = _api;
|
||||
|
||||
- (id) init {
|
||||
+(NIKStoreApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key {
|
||||
static NIKStoreApi* singletonAPI = nil;
|
||||
|
||||
if (singletonAPI == nil) {
|
||||
singletonAPI = [[NIKStoreApi alloc] init];
|
||||
[singletonAPI addHeader:headerValue forKey:key];
|
||||
}
|
||||
return singletonAPI;
|
||||
}
|
||||
|
||||
-(id) init {
|
||||
self = [super init];
|
||||
_queue = [[NSOperationQueue alloc] init];
|
||||
_api = [[NIKApiInvoker alloc] init];
|
||||
_api = [NIKApiInvoker sharedInstance];
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -22,15 +32,8 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
[_api addHeader:value forKey:key];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive:
|
||||
* returnBaseType: NIKOrder
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) getOrderByIdWithCompletionBlock :(NSString*) orderId
|
||||
completionHandler:(void (^)(NIKOrder*, NSError *))completionBlock{
|
||||
-(void) getOrderByIdWithCompletionBlock:(NSString*) orderId
|
||||
completionHandler: (void (^)(NIKOrder* output, NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store.{format}/order/{orderId}", basePath];
|
||||
|
||||
@@ -45,29 +48,23 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(orderId == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
|
||||
|
||||
completionBlock( [[NIKOrder alloc]initWithValues: data], nil);}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) deleteOrderWithCompletionBlock :(NSString*) orderId
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) deleteOrderWithCompletionBlock:(NSString*) orderId
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store.{format}/order/{orderId}", basePath];
|
||||
|
||||
@@ -82,12 +79,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(orderId == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"DELETE"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"DELETE"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -95,17 +92,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) placeOrderWithCompletionBlock :(NIKOrder*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) placeOrderWithCompletionBlock:(NIKOrder*) body
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store.{format}/order", basePath];
|
||||
|
||||
@@ -141,12 +132,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -154,9 +145,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) getOrderByIdAsJsonWithCompletionBlock :(NSString*) orderId
|
||||
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store.{format}/order/{orderId}", basePath];
|
||||
@@ -172,12 +165,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(orderId == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
@@ -194,11 +187,14 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
NSString * json = [[NSString alloc]initWithData:responseData encoding:NSUTF8StringEncoding];
|
||||
completionBlock(json, nil);
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) deleteOrderAsJsonWithCompletionBlock :(NSString*) orderId
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store.{format}/order/{orderId}", basePath];
|
||||
@@ -214,22 +210,25 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(orderId == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"DELETE"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"DELETE"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) placeOrderAsJsonWithCompletionBlock :(NIKOrder*) body
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/store.{format}/order", basePath];
|
||||
@@ -266,19 +265,21 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIKSwaggerObject.h"
|
||||
|
||||
@interface NIKTag : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSString* _name; //NSString
|
||||
}
|
||||
|
||||
|
||||
@interface NIKTag : NIKSwaggerObject
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSString* name;
|
||||
|
||||
@@ -3,27 +3,30 @@
|
||||
|
||||
@implementation NIKTag
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize name = _name;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
name: (NSString*) name
|
||||
{
|
||||
__id = _id;
|
||||
_name = name;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
-(id)_id: (NSNumber*) _id
|
||||
name: (NSString*) name
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_name = [dict objectForKey:@"name"];
|
||||
__id = _id;
|
||||
_name = name;
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id) initWithValues:(NSDictionary*)dict
|
||||
{
|
||||
self = [super init];
|
||||
if(self) {
|
||||
__id = dict[@"id"];
|
||||
_name = dict[@"name"];
|
||||
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_name != nil) [dict setObject:_name forKey:@"name"];
|
||||
if(__id != nil) dict[@"id"] = __id ;
|
||||
if(_name != nil) dict[@"name"] = _name ;
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -1,32 +1,20 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIKSwaggerObject.h"
|
||||
|
||||
@interface NIKUser : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSString* _lastName; //NSString
|
||||
NSString* _username; //NSString
|
||||
NSString* _phone; //NSString
|
||||
NSString* _email; //NSString
|
||||
NSNumber* _userStatus; //NSNumber
|
||||
NSString* _firstName; //NSString
|
||||
NSString* _password; //NSString
|
||||
}
|
||||
|
||||
|
||||
@interface NIKUser : NIKSwaggerObject
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSString* lastName;
|
||||
@property(nonatomic) NSString* username;
|
||||
@property(nonatomic) NSString* phone;
|
||||
@property(nonatomic) NSString* username;
|
||||
@property(nonatomic) NSString* email;
|
||||
@property(nonatomic) NSNumber* userStatus;
|
||||
@property(nonatomic) NSString* firstName;
|
||||
@property(nonatomic) NSString* password;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
lastName: (NSString*) lastName
|
||||
username: (NSString*) username
|
||||
phone: (NSString*) phone
|
||||
username: (NSString*) username
|
||||
email: (NSString*) email
|
||||
userStatus: (NSNumber*) userStatus
|
||||
firstName: (NSString*) firstName
|
||||
|
||||
@@ -3,57 +3,54 @@
|
||||
|
||||
@implementation NIKUser
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize lastName = _lastName;
|
||||
@synthesize username = _username;
|
||||
@synthesize phone = _phone;
|
||||
@synthesize email = _email;
|
||||
@synthesize userStatus = _userStatus;
|
||||
@synthesize firstName = _firstName;
|
||||
@synthesize password = _password;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
lastName: (NSString*) lastName
|
||||
username: (NSString*) username
|
||||
phone: (NSString*) phone
|
||||
email: (NSString*) email
|
||||
userStatus: (NSNumber*) userStatus
|
||||
firstName: (NSString*) firstName
|
||||
password: (NSString*) password
|
||||
{
|
||||
__id = _id;
|
||||
_lastName = lastName;
|
||||
_username = username;
|
||||
_phone = phone;
|
||||
_email = email;
|
||||
_userStatus = userStatus;
|
||||
_firstName = firstName;
|
||||
_password = password;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
-(id)_id: (NSNumber*) _id
|
||||
lastName: (NSString*) lastName
|
||||
phone: (NSString*) phone
|
||||
username: (NSString*) username
|
||||
email: (NSString*) email
|
||||
userStatus: (NSNumber*) userStatus
|
||||
firstName: (NSString*) firstName
|
||||
password: (NSString*) password
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_lastName = [dict objectForKey:@"lastName"];
|
||||
_username = [dict objectForKey:@"username"];
|
||||
_phone = [dict objectForKey:@"phone"];
|
||||
_email = [dict objectForKey:@"email"];
|
||||
_userStatus = [dict objectForKey:@"userStatus"];
|
||||
_firstName = [dict objectForKey:@"firstName"];
|
||||
_password = [dict objectForKey:@"password"];
|
||||
__id = _id;
|
||||
_lastName = lastName;
|
||||
_phone = phone;
|
||||
_username = username;
|
||||
_email = email;
|
||||
_userStatus = userStatus;
|
||||
_firstName = firstName;
|
||||
_password = password;
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id) initWithValues:(NSDictionary*)dict
|
||||
{
|
||||
self = [super init];
|
||||
if(self) {
|
||||
__id = dict[@"id"];
|
||||
_lastName = dict[@"lastName"];
|
||||
_phone = dict[@"phone"];
|
||||
_username = dict[@"username"];
|
||||
_email = dict[@"email"];
|
||||
_userStatus = dict[@"userStatus"];
|
||||
_firstName = dict[@"firstName"];
|
||||
_password = dict[@"password"];
|
||||
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_lastName != nil) [dict setObject:_lastName forKey:@"lastName"];
|
||||
if(_username != nil) [dict setObject:_username forKey:@"username"];
|
||||
if(_phone != nil) [dict setObject:_phone forKey:@"phone"];
|
||||
if(_email != nil) [dict setObject:_email forKey:@"email"];
|
||||
if(_userStatus != nil) [dict setObject:_userStatus forKey:@"userStatus"];
|
||||
if(_firstName != nil) [dict setObject:_firstName forKey:@"firstName"];
|
||||
if(_password != nil) [dict setObject:_password forKey:@"password"];
|
||||
if(__id != nil) dict[@"id"] = __id ;
|
||||
if(_lastName != nil) dict[@"lastName"] = _lastName ;
|
||||
if(_phone != nil) dict[@"phone"] = _phone ;
|
||||
if(_username != nil) dict[@"username"] = _username ;
|
||||
if(_email != nil) dict[@"email"] = _email ;
|
||||
if(_userStatus != nil) dict[@"userStatus"] = _userStatus ;
|
||||
if(_firstName != nil) dict[@"firstName"] = _firstName ;
|
||||
if(_password != nil) dict[@"password"] = _password ;
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -12,23 +12,80 @@
|
||||
@property(nonatomic, readonly) NSOperationQueue* queue;
|
||||
@property(nonatomic, readonly) NIKApiInvoker* api;
|
||||
|
||||
-(void) addHeader:(NSString*) value
|
||||
forKey:(NSString*)key;
|
||||
-(void) addHeader:(NSString*)value forKey:(NSString*)key;
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
@param body List of user object
|
||||
*/
|
||||
-(void) createUsersWithArrayInputWithCompletionBlock :(NSArray*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
/**
|
||||
|
||||
Create user
|
||||
This can only be done by the logged in user.
|
||||
@param body Created user object
|
||||
*/
|
||||
-(void) createUserWithCompletionBlock :(NIKUser*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given list input
|
||||
|
||||
@param body List of user object
|
||||
*/
|
||||
-(void) createUsersWithListInputWithCompletionBlock :(NSArray*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
-(void) updateUserWithCompletionBlock :(NSString*) username body:(NIKUser*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(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
|
||||
*/
|
||||
-(void) updateUserWithCompletionBlock :(NSString*) username
|
||||
body:(NIKUser*) 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
|
||||
*/
|
||||
-(void) deleteUserWithCompletionBlock :(NSString*) username
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
/**
|
||||
|
||||
Get user by user name
|
||||
|
||||
@param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
-(void) getUserByNameWithCompletionBlock :(NSString*) username
|
||||
completionHandler:(void (^)(NIKUser*, NSError *))completionBlock;
|
||||
-(void) loginUserWithCompletionBlock :(NSString*) username password:(NSString*) password
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock;
|
||||
-(void) logoutUserWithCompletionBlock :
|
||||
completionHandler:(void (^)(NSError *))completionBlock;
|
||||
completionHandler: (void (^)(NIKUser* 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
|
||||
*/
|
||||
-(void) loginUserWithCompletionBlock :(NSString*) username
|
||||
password:(NSString*) password
|
||||
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock;
|
||||
|
||||
/**
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
*/
|
||||
-(void) logoutUserWithCompletionBlock :(void (^)(NSError* error))completionBlock;
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,10 +9,20 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
@synthesize queue = _queue;
|
||||
@synthesize api = _api;
|
||||
|
||||
- (id) init {
|
||||
+(NIKUserApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key {
|
||||
static NIKUserApi* singletonAPI = nil;
|
||||
|
||||
if (singletonAPI == nil) {
|
||||
singletonAPI = [[NIKUserApi alloc] init];
|
||||
[singletonAPI addHeader:headerValue forKey:key];
|
||||
}
|
||||
return singletonAPI;
|
||||
}
|
||||
|
||||
-(id) init {
|
||||
self = [super init];
|
||||
_queue = [[NSOperationQueue alloc] init];
|
||||
_api = [[NIKApiInvoker alloc] init];
|
||||
_api = [NIKApiInvoker sharedInstance];
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -22,15 +32,8 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
[_api addHeader:value forKey:key];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) createUsersWithArrayInputWithCompletionBlock :(NSArray*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) createUsersWithArrayInputWithCompletionBlock:(NSArray*) body
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/createWithArray", basePath];
|
||||
|
||||
@@ -66,12 +69,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -79,17 +82,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) createUserWithCompletionBlock :(NIKUser*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) createUserWithCompletionBlock:(NIKUser*) body
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}", basePath];
|
||||
|
||||
@@ -125,12 +122,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -138,17 +135,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) createUsersWithListInputWithCompletionBlock :(NSArray*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) createUsersWithListInputWithCompletionBlock:(NSArray*) body
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/createWithList", basePath];
|
||||
|
||||
@@ -184,12 +175,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -197,17 +188,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) updateUserWithCompletionBlock :(NSString*) username body:(NIKUser*) body
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) updateUserWithCompletionBlock:(NSString*) username
|
||||
body:(NIKUser*) body
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/{username}", basePath];
|
||||
|
||||
@@ -247,12 +233,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"PUT"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"PUT"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -260,17 +246,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) deleteUserWithCompletionBlock :(NSString*) username
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) deleteUserWithCompletionBlock:(NSString*) username
|
||||
completionHandler: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/{username}", basePath];
|
||||
|
||||
@@ -285,12 +265,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(username == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"DELETE"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"DELETE"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -298,17 +278,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive:
|
||||
* returnBaseType: NIKUser
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) getUserByNameWithCompletionBlock :(NSString*) username
|
||||
completionHandler:(void (^)(NIKUser*, NSError *))completionBlock{
|
||||
-(void) getUserByNameWithCompletionBlock:(NSString*) username
|
||||
completionHandler: (void (^)(NIKUser* output, NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/{username}", basePath];
|
||||
|
||||
@@ -323,29 +297,24 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(username == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
|
||||
|
||||
completionBlock( [[NIKUser alloc]initWithValues: data], nil);}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType: NSString
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) loginUserWithCompletionBlock :(NSString*) username password:(NSString*) password
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock{
|
||||
-(void) loginUserWithCompletionBlock:(NSString*) username
|
||||
password:(NSString*) password
|
||||
completionHandler: (void (^)(NSString* output, NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/login", basePath];
|
||||
|
||||
@@ -355,9 +324,9 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
if(username != nil)
|
||||
[queryParams setValue:username forKey:@"username"];
|
||||
queryParams[@"username"] = username;
|
||||
if(password != nil)
|
||||
[queryParams setValue:password forKey:@"password"];
|
||||
queryParams[@"password"] = password;
|
||||
NSMutableDictionary* headerParams = [[NSMutableDictionary alloc] init];
|
||||
id bodyDictionary = nil;
|
||||
if(username == nil) {
|
||||
@@ -366,12 +335,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(password == nil) {
|
||||
// error
|
||||
}
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);
|
||||
return;
|
||||
@@ -379,29 +348,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
|
||||
completionBlock( [[NSString alloc]initWithString: data], nil);
|
||||
}];
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
|
||||
completionBlock( [[NSString alloc]initWithString: data], nil);}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* returnTypeIsPrimitive: true
|
||||
* returnBaseType:
|
||||
* returnContainer:
|
||||
*
|
||||
**/
|
||||
-(void) logoutUserWithCompletionBlock :
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
-(void) logoutUserWithCompletionBlock: (void (^)(NSError* error))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/logout", basePath];
|
||||
|
||||
@@ -412,12 +363,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary* headerParams = [[NSMutableDictionary alloc] init];
|
||||
id bodyDictionary = nil;
|
||||
[_api stringWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSString *data, NSError *error) {
|
||||
[_api stringWithCompletionBlock:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSString *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);
|
||||
return;
|
||||
@@ -425,9 +376,11 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
completionBlock(nil);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) createUsersWithArrayInputAsJsonWithCompletionBlock :(NSArray*) body
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/createWithArray", basePath];
|
||||
@@ -464,22 +417,25 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) createUserAsJsonWithCompletionBlock :(NIKUser*) body
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}", basePath];
|
||||
@@ -516,22 +472,25 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) createUsersWithListInputAsJsonWithCompletionBlock :(NSArray*) body
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/createWithList", basePath];
|
||||
@@ -568,22 +527,26 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"POST"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"POST"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) updateUserAsJsonWithCompletionBlock :(NSString*) username body:(NIKUser*) body
|
||||
-(void) updateUserAsJsonWithCompletionBlock :(NSString*) username
|
||||
body:(NIKUser*) body
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/{username}", basePath];
|
||||
@@ -624,22 +587,25 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(body == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"PUT"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"PUT"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) deleteUserAsJsonWithCompletionBlock :(NSString*) username
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/{username}", basePath];
|
||||
@@ -655,22 +621,25 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(username == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"DELETE"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"DELETE"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) getUserByNameAsJsonWithCompletionBlock :(NSString*) username
|
||||
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/{username}", basePath];
|
||||
@@ -686,12 +655,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(username == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
@@ -708,11 +677,15 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
NSString * json = [[NSString alloc]initWithData:responseData encoding:NSUTF8StringEncoding];
|
||||
completionBlock(json, nil);
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) loginUserAsJsonWithCompletionBlock :(NSString*) username password:(NSString*) password
|
||||
-(void) loginUserAsJsonWithCompletionBlock :(NSString*) username
|
||||
password:(NSString*) password
|
||||
|
||||
completionHandler:(void (^)(NSString*, NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/login", basePath];
|
||||
@@ -723,9 +696,9 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
if(username != nil)
|
||||
[queryParams setValue:username forKey:@"username"];
|
||||
queryParams[@"username"] = username;
|
||||
if(password != nil)
|
||||
[queryParams setValue:password forKey:@"password"];
|
||||
queryParams[@"password"] = password;
|
||||
NSMutableDictionary* headerParams = [[NSMutableDictionary alloc] init];
|
||||
id bodyDictionary = nil;
|
||||
if(username == nil) {
|
||||
@@ -734,12 +707,12 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
if(password == nil) {
|
||||
// error
|
||||
}
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(nil, error);return;
|
||||
}
|
||||
@@ -756,11 +729,14 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
NSString * json = [[NSString alloc]initWithData:responseData encoding:NSUTF8StringEncoding];
|
||||
completionBlock(json, nil);
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void) logoutUserAsJsonWithCompletionBlock :
|
||||
|
||||
completionHandler:(void (^)(NSError *))completionBlock{
|
||||
|
||||
NSMutableString* requestUrl = [NSMutableString stringWithFormat:@"%@/user.{format}/logout", basePath];
|
||||
@@ -772,19 +748,21 @@ static NSString * basePath = @"http://petstore.swagger.wordnik.com/api";
|
||||
NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init];
|
||||
NSMutableDictionary* headerParams = [[NSMutableDictionary alloc] init];
|
||||
id bodyDictionary = nil;
|
||||
[_api dictionaryWithCompletionBlock: requestUrl
|
||||
method: @"GET"
|
||||
queryParams: queryParams
|
||||
body: bodyDictionary
|
||||
headerParams: headerParams
|
||||
completionHandler: ^(NSDictionary *data, NSError *error) {
|
||||
[_api dictionary:requestUrl
|
||||
method:@"GET"
|
||||
queryParams:queryParams
|
||||
body:bodyDictionary
|
||||
headerParams:headerParams
|
||||
completionBlock:^(NSDictionary *data, NSError *error) {
|
||||
if (error) {
|
||||
completionBlock(error);return;
|
||||
}
|
||||
|
||||
completionBlock(nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
if([[tag name] isEqualToString:@"tag1"] || [[tag name] isEqualToString:@"tag2"])
|
||||
hasTag = true;
|
||||
}
|
||||
STAssertEquals(hasTag, true, @"didn't find tag in pet");
|
||||
if(!hasTag) STFail(@"failed to find tag in pet");
|
||||
}
|
||||
done = true;
|
||||
}
|
||||
|
||||
@@ -24,23 +24,23 @@
|
||||
class Pet {
|
||||
|
||||
static $swaggerTypes = array(
|
||||
'tags' => 'array[Some(Tag)]',
|
||||
'id' => 'int',
|
||||
'tags' => 'array[Tag]',
|
||||
'category' => 'Category',
|
||||
'status' => 'string',
|
||||
'name' => 'string',
|
||||
'photoUrls' => 'array[string]'
|
||||
'photoUrls' => 'array[None]'
|
||||
|
||||
);
|
||||
|
||||
public $tags; // array[Some(Tag)]
|
||||
public $id; // int
|
||||
public $tags; // array[Tag]
|
||||
public $category; // Category
|
||||
/**
|
||||
* pet status in the store
|
||||
*/
|
||||
public $status; // string
|
||||
public $name; // string
|
||||
public $photoUrls; // array[string]
|
||||
public $photoUrls; // array[None]
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ class User {
|
||||
static $swaggerTypes = array(
|
||||
'id' => 'int',
|
||||
'lastName' => 'string',
|
||||
'username' => 'string',
|
||||
'phone' => 'string',
|
||||
'username' => 'string',
|
||||
'email' => 'string',
|
||||
'userStatus' => 'int',
|
||||
'firstName' => 'string',
|
||||
@@ -37,8 +37,8 @@ class User {
|
||||
|
||||
public $id; // int
|
||||
public $lastName; // string
|
||||
public $username; // string
|
||||
public $phone; // string
|
||||
public $username; // string
|
||||
public $email; // string
|
||||
/**
|
||||
* User Status
|
||||
|
||||
@@ -21,8 +21,8 @@ class Pet:
|
||||
|
||||
def __init__(self):
|
||||
self.swaggerTypes = {
|
||||
'id': 'long',
|
||||
'tags': 'list[Tag]',
|
||||
'id': 'long',
|
||||
'category': 'Category',
|
||||
'status': 'str',
|
||||
'name': 'str',
|
||||
@@ -31,8 +31,8 @@ class Pet:
|
||||
}
|
||||
|
||||
|
||||
self.id = None # long
|
||||
self.tags = None # list[Tag]
|
||||
self.id = None # long
|
||||
self.category = None # Category
|
||||
#pet status in the store
|
||||
self.status = None # str
|
||||
|
||||
@@ -23,8 +23,8 @@ class User:
|
||||
self.swaggerTypes = {
|
||||
'id': 'long',
|
||||
'lastName': 'str',
|
||||
'username': 'str',
|
||||
'phone': 'str',
|
||||
'username': 'str',
|
||||
'email': 'str',
|
||||
'userStatus': 'int',
|
||||
'firstName': 'str',
|
||||
@@ -35,8 +35,8 @@ class User:
|
||||
|
||||
self.id = None # long
|
||||
self.lastName = None # str
|
||||
self.username = None # str
|
||||
self.phone = None # str
|
||||
self.username = None # str
|
||||
self.email = None # str
|
||||
#User Status
|
||||
self.userStatus = None # int
|
||||
|
||||
@@ -21,8 +21,8 @@ class Pet:
|
||||
|
||||
def __init__(self):
|
||||
self.swaggerTypes = {
|
||||
'id': 'int',
|
||||
'tags': 'list[Tag]',
|
||||
'id': 'int',
|
||||
'category': 'Category',
|
||||
'status': 'str',
|
||||
'name': 'str',
|
||||
@@ -31,8 +31,8 @@ class Pet:
|
||||
}
|
||||
|
||||
|
||||
self.id = None # int
|
||||
self.tags = None # list[Tag]
|
||||
self.id = None # int
|
||||
self.category = None # Category
|
||||
#pet status in the store
|
||||
self.status = None # str
|
||||
|
||||
@@ -23,8 +23,8 @@ class User:
|
||||
self.swaggerTypes = {
|
||||
'id': 'int',
|
||||
'lastName': 'str',
|
||||
'username': 'str',
|
||||
'phone': 'str',
|
||||
'username': 'str',
|
||||
'email': 'str',
|
||||
'userStatus': 'int',
|
||||
'firstName': 'str',
|
||||
@@ -35,8 +35,8 @@ class User:
|
||||
|
||||
self.id = None # int
|
||||
self.lastName = None # str
|
||||
self.username = None # str
|
||||
self.phone = None # str
|
||||
self.username = None # str
|
||||
self.email = None # str
|
||||
#User Status
|
||||
self.userStatus = None # int
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
import com.wordnik.swagger.codegen.BasicRubyGenerator
|
||||
|
||||
import com.wordnik.swagger.codegen.util.ScalaJsonUtil
|
||||
|
||||
object RubyPetstoreCodegen extends BasicRubyGenerator {
|
||||
def main(args: Array[String]) = generateClient(args)
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
class Pet
|
||||
attr_accessor :id, :tags, :category, :status, :name, :photo_urls
|
||||
attr_accessor :tags, :id, :category, :status, :name, :photo_urls
|
||||
|
||||
# :internal => :external
|
||||
def self.attribute_map
|
||||
{
|
||||
:id => :id, :tags => :tags, :category => :category, :status => :status, :name => :name, :photo_urls => :photoUrls
|
||||
:tags => :tags, :id => :id, :category => :category, :status => :status, :name => :name, :photo_urls => :photoUrls
|
||||
|
||||
}
|
||||
end
|
||||
@@ -13,11 +13,6 @@ class Pet
|
||||
# Morph attribute keys into undescored rubyish style
|
||||
if attributes.to_s != ""
|
||||
|
||||
if Pet.attribute_map["id".to_sym] != nil
|
||||
name = "id".to_sym
|
||||
value = attributes["id"]
|
||||
send("#{name}=", value) if self.respond_to?(name)
|
||||
end
|
||||
if Pet.attribute_map["tags".to_sym] != nil
|
||||
name = "tags".to_sym
|
||||
value = attributes["tags"]
|
||||
@@ -29,6 +24,11 @@ class Pet
|
||||
send("#{name}=", array) if self.respond_to?(name)
|
||||
end
|
||||
end
|
||||
if Pet.attribute_map["id".to_sym] != nil
|
||||
name = "id".to_sym
|
||||
value = attributes["id"]
|
||||
send("#{name}=", value) if self.respond_to?(name)
|
||||
end
|
||||
if Pet.attribute_map["category".to_sym] != nil
|
||||
name = "category".to_sym
|
||||
value = attributes["category"]
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
class User
|
||||
attr_accessor :id, :last_name, :username, :phone, :email, :user_status, :first_name, :password
|
||||
attr_accessor :id, :last_name, :phone, :username, :email, :user_status, :first_name, :password
|
||||
|
||||
# :internal => :external
|
||||
def self.attribute_map
|
||||
{
|
||||
:id => :id, :last_name => :lastName, :username => :username, :phone => :phone, :email => :email, :user_status => :userStatus, :first_name => :firstName, :password => :password
|
||||
:id => :id, :last_name => :lastName, :phone => :phone, :username => :username, :email => :email, :user_status => :userStatus, :first_name => :firstName, :password => :password
|
||||
|
||||
}
|
||||
end
|
||||
@@ -23,16 +23,16 @@ class User
|
||||
value = attributes["lastName"]
|
||||
send("#{name}=", value) if self.respond_to?(name)
|
||||
end
|
||||
if User.attribute_map["username".to_sym] != nil
|
||||
name = "username".to_sym
|
||||
value = attributes["username"]
|
||||
send("#{name}=", value) if self.respond_to?(name)
|
||||
end
|
||||
if User.attribute_map["phone".to_sym] != nil
|
||||
name = "phone".to_sym
|
||||
value = attributes["phone"]
|
||||
send("#{name}=", value) if self.respond_to?(name)
|
||||
end
|
||||
if User.attribute_map["username".to_sym] != nil
|
||||
name = "username".to_sym
|
||||
value = attributes["username"]
|
||||
send("#{name}=", value) if self.respond_to?(name)
|
||||
end
|
||||
if User.attribute_map["email".to_sym] != nil
|
||||
name = "email".to_sym
|
||||
value = attributes["email"]
|
||||
|
||||
@@ -45,6 +45,7 @@ describe "Pet" do
|
||||
|
||||
it "should create a pet" do
|
||||
pet = Pet.new({:id => 100, :name => "Gorilla"})
|
||||
raise pet.inspect
|
||||
Pet_api.add_pet(pet)
|
||||
|
||||
pet = Pet_api.get_pet_by_id(100)
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.wordnik.petstore.model
|
||||
import com.wordnik.petstore.model.Category
|
||||
import com.wordnik.petstore.model.Tag
|
||||
case class Pet (
|
||||
id: Long,
|
||||
tags: List[Tag],
|
||||
id: Long,
|
||||
category: Category,
|
||||
/* pet status in the store */
|
||||
status: String,
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.wordnik.petstore.model
|
||||
case class User (
|
||||
id: Long,
|
||||
lastName: String,
|
||||
username: String,
|
||||
phone: String,
|
||||
username: String,
|
||||
email: String,
|
||||
/* User Status */
|
||||
userStatus: Int,
|
||||
|
||||
@@ -27,8 +27,8 @@ class PetApiTest extends FlatSpec with ShouldMatchers {
|
||||
|
||||
it should "add a new pet" in {
|
||||
val pet = Pet(
|
||||
1000,
|
||||
(for (i <- (1 to 5)) yield Tag(i, "tag-" + i)).toList,
|
||||
1000,
|
||||
Category(1, "sold"),
|
||||
"lost",
|
||||
"dragon",
|
||||
@@ -51,8 +51,8 @@ class PetApiTest extends FlatSpec with ShouldMatchers {
|
||||
|
||||
it should "update a pet" in {
|
||||
val pet = Pet(
|
||||
1000,
|
||||
(for (i <- (1 to 5)) yield Tag(i, "tag-" + i)).toList,
|
||||
1000,
|
||||
Category(1, "sold"),
|
||||
"confused",
|
||||
"programmer",
|
||||
|
||||
@@ -50,8 +50,8 @@ class UserApiTest extends FlatSpec with ShouldMatchers {
|
||||
val user = User(
|
||||
1002,
|
||||
"Rocket",
|
||||
"johnny",
|
||||
"408-867-5309",
|
||||
"johnny",
|
||||
"johnny@fail.com",
|
||||
1,
|
||||
"Johnny",
|
||||
@@ -73,8 +73,8 @@ class UserApiTest extends FlatSpec with ShouldMatchers {
|
||||
User(
|
||||
2000 + i,
|
||||
"Rocket-" + i,
|
||||
"johnny-" + i,
|
||||
"408-867-5309",
|
||||
"johnny-" + i,
|
||||
"johnny-" + i + "@fail.com",
|
||||
1,
|
||||
"Johnny",
|
||||
@@ -98,8 +98,8 @@ class UserApiTest extends FlatSpec with ShouldMatchers {
|
||||
User(
|
||||
3000 + i,
|
||||
"Rocket-" + i,
|
||||
"fred-" + i,
|
||||
"408-867-5309",
|
||||
"fred-" + i,
|
||||
"fred-" + i + "@fail.com",
|
||||
1,
|
||||
"Johnny",
|
||||
@@ -122,8 +122,8 @@ class UserApiTest extends FlatSpec with ShouldMatchers {
|
||||
val user = User(
|
||||
4000,
|
||||
"Tiger",
|
||||
"tony",
|
||||
"408-867-5309",
|
||||
"tony",
|
||||
"tony@fail.com",
|
||||
1,
|
||||
"Tony",
|
||||
|
||||
@@ -21,8 +21,8 @@ public class Definition {
|
||||
private List<Related> relatedWords = new ArrayList<Related>();
|
||||
private String sequence = null;
|
||||
private String word = null;
|
||||
private List<TextPron> textProns = new ArrayList<TextPron>();
|
||||
private List<Note> notes = new ArrayList<Note>();
|
||||
private List<TextPron> textProns = new ArrayList<TextPron>();
|
||||
private String partOfSpeech = null;
|
||||
public String getExtendedText() {
|
||||
return extendedText;
|
||||
@@ -115,13 +115,6 @@ public class Definition {
|
||||
this.word = word;
|
||||
}
|
||||
|
||||
public List<TextPron> getTextProns() {
|
||||
return textProns;
|
||||
}
|
||||
public void setTextProns(List<TextPron> textProns) {
|
||||
this.textProns = textProns;
|
||||
}
|
||||
|
||||
public List<Note> getNotes() {
|
||||
return notes;
|
||||
}
|
||||
@@ -129,6 +122,13 @@ public class Definition {
|
||||
this.notes = notes;
|
||||
}
|
||||
|
||||
public List<TextPron> getTextProns() {
|
||||
return textProns;
|
||||
}
|
||||
public void setTextProns(List<TextPron> textProns) {
|
||||
this.textProns = textProns;
|
||||
}
|
||||
|
||||
public String getPartOfSpeech() {
|
||||
return partOfSpeech;
|
||||
}
|
||||
@@ -153,8 +153,8 @@ public class Definition {
|
||||
sb.append(" relatedWords: ").append(relatedWords).append("\n");
|
||||
sb.append(" sequence: ").append(sequence).append("\n");
|
||||
sb.append(" word: ").append(word).append("\n");
|
||||
sb.append(" textProns: ").append(textProns).append("\n");
|
||||
sb.append(" notes: ").append(notes).append("\n");
|
||||
sb.append(" textProns: ").append(textProns).append("\n");
|
||||
sb.append(" partOfSpeech: ").append(partOfSpeech).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
|
||||
@@ -5,17 +5,17 @@ import com.wordnik.client.model.ScoredWord;
|
||||
import com.wordnik.client.model.ContentProvider;
|
||||
public class Example {
|
||||
private Long id = null;
|
||||
private String text = null;
|
||||
private String title = null;
|
||||
private Long exampleId = null;
|
||||
private String title = null;
|
||||
private String text = null;
|
||||
private ScoredWord score = null;
|
||||
private Sentence sentence = null;
|
||||
private Integer year = null;
|
||||
private ContentProvider provider = null;
|
||||
private String word = null;
|
||||
private ContentProvider provider = null;
|
||||
private Integer year = null;
|
||||
private Float rating = null;
|
||||
private String url = null;
|
||||
private Long documentId = null;
|
||||
private String url = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -23,11 +23,11 @@ public class Example {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
public Long getExampleId() {
|
||||
return exampleId;
|
||||
}
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
public void setExampleId(Long exampleId) {
|
||||
this.exampleId = exampleId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
@@ -37,11 +37,11 @@ public class Example {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Long getExampleId() {
|
||||
return exampleId;
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
public void setExampleId(Long exampleId) {
|
||||
this.exampleId = exampleId;
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public ScoredWord getScore() {
|
||||
@@ -58,11 +58,11 @@ public class Example {
|
||||
this.sentence = sentence;
|
||||
}
|
||||
|
||||
public Integer getYear() {
|
||||
return year;
|
||||
public String getWord() {
|
||||
return word;
|
||||
}
|
||||
public void setYear(Integer year) {
|
||||
this.year = year;
|
||||
public void setWord(String word) {
|
||||
this.word = word;
|
||||
}
|
||||
|
||||
public ContentProvider getProvider() {
|
||||
@@ -72,11 +72,11 @@ public class Example {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
public Integer getYear() {
|
||||
return year;
|
||||
}
|
||||
public void setWord(String word) {
|
||||
this.word = word;
|
||||
public void setYear(Integer year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public Float getRating() {
|
||||
@@ -86,13 +86,6 @@ public class Example {
|
||||
this.rating = rating;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public Long getDocumentId() {
|
||||
return documentId;
|
||||
}
|
||||
@@ -100,22 +93,29 @@ public class Example {
|
||||
this.documentId = documentId;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Example {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" text: ").append(text).append("\n");
|
||||
sb.append(" title: ").append(title).append("\n");
|
||||
sb.append(" exampleId: ").append(exampleId).append("\n");
|
||||
sb.append(" title: ").append(title).append("\n");
|
||||
sb.append(" text: ").append(text).append("\n");
|
||||
sb.append(" score: ").append(score).append("\n");
|
||||
sb.append(" sentence: ").append(sentence).append("\n");
|
||||
sb.append(" year: ").append(year).append("\n");
|
||||
sb.append(" provider: ").append(provider).append("\n");
|
||||
sb.append(" word: ").append(word).append("\n");
|
||||
sb.append(" provider: ").append(provider).append("\n");
|
||||
sb.append(" year: ").append(year).append("\n");
|
||||
sb.append(" rating: ").append(rating).append("\n");
|
||||
sb.append(" url: ").append(url).append("\n");
|
||||
sb.append(" documentId: ").append(documentId).append("\n");
|
||||
sb.append(" url: ").append(url).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@ package com.wordnik.client.model;
|
||||
import java.util.*;
|
||||
public class Related {
|
||||
private String label1 = null;
|
||||
private String label2 = null;
|
||||
private String relationshipType = null;
|
||||
private String label2 = null;
|
||||
private String label3 = null;
|
||||
private List<String> words = new ArrayList<String>();
|
||||
private String label4 = null;
|
||||
private String gram = null;
|
||||
private String label4 = null;
|
||||
public String getLabel1() {
|
||||
return label1;
|
||||
}
|
||||
@@ -16,13 +16,6 @@ public class Related {
|
||||
this.label1 = label1;
|
||||
}
|
||||
|
||||
public String getLabel2() {
|
||||
return label2;
|
||||
}
|
||||
public void setLabel2(String label2) {
|
||||
this.label2 = label2;
|
||||
}
|
||||
|
||||
public String getRelationshipType() {
|
||||
return relationshipType;
|
||||
}
|
||||
@@ -30,6 +23,13 @@ public class Related {
|
||||
this.relationshipType = relationshipType;
|
||||
}
|
||||
|
||||
public String getLabel2() {
|
||||
return label2;
|
||||
}
|
||||
public void setLabel2(String label2) {
|
||||
this.label2 = label2;
|
||||
}
|
||||
|
||||
public String getLabel3() {
|
||||
return label3;
|
||||
}
|
||||
@@ -44,13 +44,6 @@ public class Related {
|
||||
this.words = words;
|
||||
}
|
||||
|
||||
public String getLabel4() {
|
||||
return label4;
|
||||
}
|
||||
public void setLabel4(String label4) {
|
||||
this.label4 = label4;
|
||||
}
|
||||
|
||||
public String getGram() {
|
||||
return gram;
|
||||
}
|
||||
@@ -58,17 +51,24 @@ public class Related {
|
||||
this.gram = gram;
|
||||
}
|
||||
|
||||
public String getLabel4() {
|
||||
return label4;
|
||||
}
|
||||
public void setLabel4(String label4) {
|
||||
this.label4 = label4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Related {\n");
|
||||
sb.append(" label1: ").append(label1).append("\n");
|
||||
sb.append(" label2: ").append(label2).append("\n");
|
||||
sb.append(" relationshipType: ").append(relationshipType).append("\n");
|
||||
sb.append(" label2: ").append(label2).append("\n");
|
||||
sb.append(" label3: ").append(label3).append("\n");
|
||||
sb.append(" words: ").append(words).append("\n");
|
||||
sb.append(" label4: ").append(label4).append("\n");
|
||||
sb.append(" gram: ").append(gram).append("\n");
|
||||
sb.append(" label4: ").append(label4).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -1,24 +1,17 @@
|
||||
package com.wordnik.client.model;
|
||||
|
||||
public class ScoredWord {
|
||||
private Long id = null;
|
||||
private Integer position = null;
|
||||
private String lemma = null;
|
||||
private Long id = null;
|
||||
private Integer docTermCount = null;
|
||||
private String lemma = null;
|
||||
private String wordType = null;
|
||||
private Float score = null;
|
||||
private String word = null;
|
||||
private Long sentenceId = null;
|
||||
private String word = null;
|
||||
private Boolean stopword = null;
|
||||
private Double baseWordScore = null;
|
||||
private String partOfSpeech = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getPosition() {
|
||||
return position;
|
||||
}
|
||||
@@ -26,11 +19,11 @@ public class ScoredWord {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getLemma() {
|
||||
return lemma;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setLemma(String lemma) {
|
||||
this.lemma = lemma;
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getDocTermCount() {
|
||||
@@ -40,6 +33,13 @@ public class ScoredWord {
|
||||
this.docTermCount = docTermCount;
|
||||
}
|
||||
|
||||
public String getLemma() {
|
||||
return lemma;
|
||||
}
|
||||
public void setLemma(String lemma) {
|
||||
this.lemma = lemma;
|
||||
}
|
||||
|
||||
public String getWordType() {
|
||||
return wordType;
|
||||
}
|
||||
@@ -54,13 +54,6 @@ public class ScoredWord {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
}
|
||||
public void setWord(String word) {
|
||||
this.word = word;
|
||||
}
|
||||
|
||||
public Long getSentenceId() {
|
||||
return sentenceId;
|
||||
}
|
||||
@@ -68,6 +61,13 @@ public class ScoredWord {
|
||||
this.sentenceId = sentenceId;
|
||||
}
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
}
|
||||
public void setWord(String word) {
|
||||
this.word = word;
|
||||
}
|
||||
|
||||
public Boolean getStopword() {
|
||||
return stopword;
|
||||
}
|
||||
@@ -93,14 +93,14 @@ public class ScoredWord {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ScoredWord {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" position: ").append(position).append("\n");
|
||||
sb.append(" lemma: ").append(lemma).append("\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" docTermCount: ").append(docTermCount).append("\n");
|
||||
sb.append(" lemma: ").append(lemma).append("\n");
|
||||
sb.append(" wordType: ").append(wordType).append("\n");
|
||||
sb.append(" score: ").append(score).append("\n");
|
||||
sb.append(" word: ").append(word).append("\n");
|
||||
sb.append(" sentenceId: ").append(sentenceId).append("\n");
|
||||
sb.append(" word: ").append(word).append("\n");
|
||||
sb.append(" stopword: ").append(stopword).append("\n");
|
||||
sb.append(" baseWordScore: ").append(baseWordScore).append("\n");
|
||||
sb.append(" partOfSpeech: ").append(partOfSpeech).append("\n");
|
||||
|
||||
@@ -3,19 +3,12 @@ package com.wordnik.client.model;
|
||||
import java.util.*;
|
||||
import com.wordnik.client.model.ScoredWord;
|
||||
public class Sentence {
|
||||
private Long id = null;
|
||||
private Boolean hasScoredWords = null;
|
||||
private Long id = null;
|
||||
private List<ScoredWord> scoredWords = new ArrayList<ScoredWord>();
|
||||
private String display = null;
|
||||
private Integer rating = null;
|
||||
private Long documentMetadataId = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Boolean getHasScoredWords() {
|
||||
return hasScoredWords;
|
||||
}
|
||||
@@ -23,6 +16,13 @@ public class Sentence {
|
||||
this.hasScoredWords = hasScoredWords;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public List<ScoredWord> getScoredWords() {
|
||||
return scoredWords;
|
||||
}
|
||||
@@ -55,8 +55,8 @@ public class Sentence {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Sentence {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" hasScoredWords: ").append(hasScoredWords).append("\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" scoredWords: ").append(scoredWords).append("\n");
|
||||
sb.append(" display: ").append(display).append("\n");
|
||||
sb.append(" rating: ").append(rating).append("\n");
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.wordnik.client.model;
|
||||
|
||||
public class SimpleExample {
|
||||
private Long id = null;
|
||||
private String text = null;
|
||||
private String title = null;
|
||||
private String text = null;
|
||||
private String url = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -12,13 +12,6 @@ public class SimpleExample {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
@@ -26,6 +19,13 @@ public class SimpleExample {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
@@ -38,8 +38,8 @@ public class SimpleExample {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SimpleExample {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" text: ").append(text).append("\n");
|
||||
sb.append(" title: ").append(title).append("\n");
|
||||
sb.append(" text: ").append(text).append("\n");
|
||||
sb.append(" url: ").append(url).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.wordnik.client.model;
|
||||
public class User {
|
||||
private Long id = null;
|
||||
private String username = null;
|
||||
private Integer status = null;
|
||||
private String email = null;
|
||||
private Integer status = null;
|
||||
private String faceBookId = null;
|
||||
private String userName = null;
|
||||
private String displayName = null;
|
||||
@@ -23,13 +23,6 @@ public class User {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@@ -37,6 +30,13 @@ public class User {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getFaceBookId() {
|
||||
return faceBookId;
|
||||
}
|
||||
@@ -71,8 +71,8 @@ public class User {
|
||||
sb.append("class User {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" username: ").append(username).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append(" email: ").append(email).append("\n");
|
||||
sb.append(" status: ").append(status).append("\n");
|
||||
sb.append(" faceBookId: ").append(faceBookId).append("\n");
|
||||
sb.append(" userName: ").append(userName).append("\n");
|
||||
sb.append(" displayName: ").append(displayName).append("\n");
|
||||
|
||||
@@ -2,24 +2,17 @@ package com.wordnik.client.model;
|
||||
|
||||
import java.util.Date;
|
||||
public class WordList {
|
||||
private Long id = null;
|
||||
private Date updatedAt = null;
|
||||
private Long id = null;
|
||||
private String username = null;
|
||||
private String permalink = null;
|
||||
private String description = null;
|
||||
private Date createdAt = null;
|
||||
private Date lastActivityAt = null;
|
||||
private String name = null;
|
||||
private Date createdAt = null;
|
||||
private String description = null;
|
||||
private Long userId = null;
|
||||
private String name = null;
|
||||
private Long numberWordsInList = null;
|
||||
private String type = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
@@ -27,6 +20,13 @@ public class WordList {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@@ -41,11 +41,11 @@ public class WordList {
|
||||
this.permalink = permalink;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
public Date getLastActivityAt() {
|
||||
return lastActivityAt;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
public void setLastActivityAt(Date lastActivityAt) {
|
||||
this.lastActivityAt = lastActivityAt;
|
||||
}
|
||||
|
||||
public Date getCreatedAt() {
|
||||
@@ -55,18 +55,11 @@ public class WordList {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Date getLastActivityAt() {
|
||||
return lastActivityAt;
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setLastActivityAt(Date lastActivityAt) {
|
||||
this.lastActivityAt = lastActivityAt;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
@@ -76,6 +69,13 @@ public class WordList {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getNumberWordsInList() {
|
||||
return numberWordsInList;
|
||||
}
|
||||
@@ -94,15 +94,15 @@ public class WordList {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class WordList {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" updatedAt: ").append(updatedAt).append("\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" username: ").append(username).append("\n");
|
||||
sb.append(" permalink: ").append(permalink).append("\n");
|
||||
sb.append(" description: ").append(description).append("\n");
|
||||
sb.append(" createdAt: ").append(createdAt).append("\n");
|
||||
sb.append(" lastActivityAt: ").append(lastActivityAt).append("\n");
|
||||
sb.append(" name: ").append(name).append("\n");
|
||||
sb.append(" createdAt: ").append(createdAt).append("\n");
|
||||
sb.append(" description: ").append(description).append("\n");
|
||||
sb.append(" userId: ").append(userId).append("\n");
|
||||
sb.append(" name: ").append(name).append("\n");
|
||||
sb.append(" numberWordsInList: ").append(numberWordsInList).append("\n");
|
||||
sb.append(" type: ").append(type).append("\n");
|
||||
sb.append("}\n");
|
||||
|
||||
@@ -5,8 +5,8 @@ public class WordListWord {
|
||||
private Long id = null;
|
||||
private String username = null;
|
||||
private Date createdAt = null;
|
||||
private Long userId = null;
|
||||
private Long numberCommentsOnWord = null;
|
||||
private Long userId = null;
|
||||
private String word = null;
|
||||
private Long numberLists = null;
|
||||
public Long getId() {
|
||||
@@ -30,13 +30,6 @@ public class WordListWord {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getNumberCommentsOnWord() {
|
||||
return numberCommentsOnWord;
|
||||
}
|
||||
@@ -44,6 +37,13 @@ public class WordListWord {
|
||||
this.numberCommentsOnWord = numberCommentsOnWord;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
}
|
||||
@@ -65,8 +65,8 @@ public class WordListWord {
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" username: ").append(username).append("\n");
|
||||
sb.append(" createdAt: ").append(createdAt).append("\n");
|
||||
sb.append(" userId: ").append(userId).append("\n");
|
||||
sb.append(" numberCommentsOnWord: ").append(numberCommentsOnWord).append("\n");
|
||||
sb.append(" userId: ").append(userId).append("\n");
|
||||
sb.append(" word: ").append(word).append("\n");
|
||||
sb.append(" numberLists: ").append(numberLists).append("\n");
|
||||
sb.append("}\n");
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.wordnik.client.model;
|
||||
import java.util.*;
|
||||
public class WordObject {
|
||||
private Long id = null;
|
||||
private String originalWord = null;
|
||||
private String word = null;
|
||||
private String originalWord = null;
|
||||
private List<String> suggestions = new ArrayList<String>();
|
||||
private String canonicalForm = null;
|
||||
private String vulgar = null;
|
||||
@@ -15,13 +15,6 @@ public class WordObject {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOriginalWord() {
|
||||
return originalWord;
|
||||
}
|
||||
public void setOriginalWord(String originalWord) {
|
||||
this.originalWord = originalWord;
|
||||
}
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
}
|
||||
@@ -29,6 +22,13 @@ public class WordObject {
|
||||
this.word = word;
|
||||
}
|
||||
|
||||
public String getOriginalWord() {
|
||||
return originalWord;
|
||||
}
|
||||
public void setOriginalWord(String originalWord) {
|
||||
this.originalWord = originalWord;
|
||||
}
|
||||
|
||||
public List<String> getSuggestions() {
|
||||
return suggestions;
|
||||
}
|
||||
@@ -55,8 +55,8 @@ public class WordObject {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class WordObject {\n");
|
||||
sb.append(" id: ").append(id).append("\n");
|
||||
sb.append(" originalWord: ").append(originalWord).append("\n");
|
||||
sb.append(" word: ").append(word).append("\n");
|
||||
sb.append(" originalWord: ").append(originalWord).append("\n");
|
||||
sb.append(" suggestions: ").append(suggestions).append("\n");
|
||||
sb.append(" canonicalForm: ").append(canonicalForm).append("\n");
|
||||
sb.append(" vulgar: ").append(vulgar).append("\n");
|
||||
|
||||
@@ -12,12 +12,12 @@ public class WordOfTheDay {
|
||||
private String createdBy = null;
|
||||
private Date createdAt = null;
|
||||
private ContentProvider contentProvider = null;
|
||||
private String word = null;
|
||||
private String htmlExtra = null;
|
||||
private String word = null;
|
||||
private List<SimpleDefinition> definitions = new ArrayList<SimpleDefinition>();
|
||||
private List<SimpleExample> examples = new ArrayList<SimpleExample>();
|
||||
private Date publishDate = null;
|
||||
private String note = null;
|
||||
private Date publishDate = null;
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -60,13 +60,6 @@ public class WordOfTheDay {
|
||||
this.contentProvider = contentProvider;
|
||||
}
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
}
|
||||
public void setWord(String word) {
|
||||
this.word = word;
|
||||
}
|
||||
|
||||
public String getHtmlExtra() {
|
||||
return htmlExtra;
|
||||
}
|
||||
@@ -74,6 +67,13 @@ public class WordOfTheDay {
|
||||
this.htmlExtra = htmlExtra;
|
||||
}
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
}
|
||||
public void setWord(String word) {
|
||||
this.word = word;
|
||||
}
|
||||
|
||||
public List<SimpleDefinition> getDefinitions() {
|
||||
return definitions;
|
||||
}
|
||||
@@ -88,13 +88,6 @@ public class WordOfTheDay {
|
||||
this.examples = examples;
|
||||
}
|
||||
|
||||
public Date getPublishDate() {
|
||||
return publishDate;
|
||||
}
|
||||
public void setPublishDate(Date publishDate) {
|
||||
this.publishDate = publishDate;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
@@ -102,6 +95,13 @@ public class WordOfTheDay {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public Date getPublishDate() {
|
||||
return publishDate;
|
||||
}
|
||||
public void setPublishDate(Date publishDate) {
|
||||
this.publishDate = publishDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -112,12 +112,12 @@ public class WordOfTheDay {
|
||||
sb.append(" createdBy: ").append(createdBy).append("\n");
|
||||
sb.append(" createdAt: ").append(createdAt).append("\n");
|
||||
sb.append(" contentProvider: ").append(contentProvider).append("\n");
|
||||
sb.append(" word: ").append(word).append("\n");
|
||||
sb.append(" htmlExtra: ").append(htmlExtra).append("\n");
|
||||
sb.append(" word: ").append(word).append("\n");
|
||||
sb.append(" definitions: ").append(definitions).append("\n");
|
||||
sb.append(" examples: ").append(examples).append("\n");
|
||||
sb.append(" publishDate: ").append(publishDate).append("\n");
|
||||
sb.append(" note: ").append(note).append("\n");
|
||||
sb.append(" publishDate: ").append(publishDate).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -3,15 +3,8 @@ package com.wordnik.client.model;
|
||||
import java.util.*;
|
||||
import com.wordnik.client.model.WordSearchResult;
|
||||
public class WordSearchResults {
|
||||
private Integer totalResults = null;
|
||||
private List<WordSearchResult> searchResults = new ArrayList<WordSearchResult>();
|
||||
public Integer getTotalResults() {
|
||||
return totalResults;
|
||||
}
|
||||
public void setTotalResults(Integer totalResults) {
|
||||
this.totalResults = totalResults;
|
||||
}
|
||||
|
||||
private Integer totalResults = null;
|
||||
public List<WordSearchResult> getSearchResults() {
|
||||
return searchResults;
|
||||
}
|
||||
@@ -19,12 +12,19 @@ public class WordSearchResults {
|
||||
this.searchResults = searchResults;
|
||||
}
|
||||
|
||||
public Integer getTotalResults() {
|
||||
return totalResults;
|
||||
}
|
||||
public void setTotalResults(Integer totalResults) {
|
||||
this.totalResults = totalResults;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class WordSearchResults {\n");
|
||||
sb.append(" totalResults: ").append(totalResults).append("\n");
|
||||
sb.append(" searchResults: ").append(searchResults).append("\n");
|
||||
sb.append(" totalResults: ").append(totalResults).append("\n");
|
||||
sb.append("}\n");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -33,12 +33,6 @@
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<CommandLineArguments>
|
||||
<CommandLineArgument
|
||||
argument = ""
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
</CommandLineArguments>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKApiTokenStatus.h"
|
||||
|
||||
@implementation NIKApiTokenStatus
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKAudioFile.h"
|
||||
|
||||
@implementation NIKAudioFile
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKAuthenticationToken.h"
|
||||
|
||||
@implementation NIKAuthenticationToken
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKBigram.h"
|
||||
|
||||
@implementation NIKBigram
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKCitation.h"
|
||||
|
||||
@implementation NIKCitation
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKContentProvider.h"
|
||||
|
||||
@implementation NIKContentProvider
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
NSArray* _relatedWords; //Related
|
||||
NSString* _sequence; //NSString
|
||||
NSString* _word; //NSString
|
||||
NSArray* _textProns; //TextPron
|
||||
NSArray* _notes; //Note
|
||||
NSArray* _textProns; //TextPron
|
||||
NSString* _partOfSpeech; //NSString
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
@property(nonatomic) NSArray* relatedWords;
|
||||
@property(nonatomic) NSString* sequence;
|
||||
@property(nonatomic) NSString* word;
|
||||
@property(nonatomic) NSArray* textProns;
|
||||
@property(nonatomic) NSArray* notes;
|
||||
@property(nonatomic) NSArray* textProns;
|
||||
@property(nonatomic) NSString* partOfSpeech;
|
||||
- (id) extendedText: (NSString*) extendedText
|
||||
text: (NSString*) text
|
||||
@@ -58,8 +58,8 @@
|
||||
relatedWords: (NSArray*) relatedWords
|
||||
sequence: (NSString*) sequence
|
||||
word: (NSString*) word
|
||||
textProns: (NSArray*) textProns
|
||||
notes: (NSArray*) notes
|
||||
textProns: (NSArray*) textProns
|
||||
partOfSpeech: (NSString*) partOfSpeech;
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKDefinition.h"
|
||||
|
||||
@implementation NIKDefinition
|
||||
@@ -15,8 +16,8 @@
|
||||
@synthesize relatedWords = _relatedWords;
|
||||
@synthesize sequence = _sequence;
|
||||
@synthesize word = _word;
|
||||
@synthesize textProns = _textProns;
|
||||
@synthesize notes = _notes;
|
||||
@synthesize textProns = _textProns;
|
||||
@synthesize partOfSpeech = _partOfSpeech;
|
||||
- (id) extendedText: (NSString*) extendedText
|
||||
text: (NSString*) text
|
||||
@@ -31,8 +32,8 @@
|
||||
relatedWords: (NSArray*) relatedWords
|
||||
sequence: (NSString*) sequence
|
||||
word: (NSString*) word
|
||||
textProns: (NSArray*) textProns
|
||||
notes: (NSArray*) notes
|
||||
textProns: (NSArray*) textProns
|
||||
partOfSpeech: (NSString*) partOfSpeech
|
||||
{
|
||||
_extendedText = extendedText;
|
||||
@@ -48,8 +49,8 @@
|
||||
_relatedWords = relatedWords;
|
||||
_sequence = sequence;
|
||||
_word = word;
|
||||
_textProns = textProns;
|
||||
_notes = notes;
|
||||
_textProns = textProns;
|
||||
_partOfSpeech = partOfSpeech;
|
||||
return self;
|
||||
}
|
||||
@@ -109,17 +110,6 @@
|
||||
}
|
||||
_sequence = [dict objectForKey:@"sequence"];
|
||||
_word = [dict objectForKey:@"word"];
|
||||
id textProns_dict = [dict objectForKey:@"textProns"];
|
||||
if([textProns_dict isKindOfClass:[NSArray class]]) {
|
||||
if([(NSArray*)textProns_dict count] > 0) {
|
||||
NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[(NSArray*)textProns_dict count]];
|
||||
for (NSDictionary* dict in (NSArray*)textProns_dict) {
|
||||
NIKTextPron* d = [[NIKTextPron alloc]initWithValues:dict];
|
||||
[objs addObject:d];
|
||||
}
|
||||
_textProns = [[NSArray alloc] initWithArray:objs];
|
||||
}
|
||||
}
|
||||
id notes_dict = [dict objectForKey:@"notes"];
|
||||
if([notes_dict isKindOfClass:[NSArray class]]) {
|
||||
if([(NSArray*)notes_dict count] > 0) {
|
||||
@@ -131,6 +121,17 @@
|
||||
_notes = [[NSArray alloc] initWithArray:objs];
|
||||
}
|
||||
}
|
||||
id textProns_dict = [dict objectForKey:@"textProns"];
|
||||
if([textProns_dict isKindOfClass:[NSArray class]]) {
|
||||
if([(NSArray*)textProns_dict count] > 0) {
|
||||
NSMutableArray * objs = [[NSMutableArray alloc] initWithCapacity:[(NSArray*)textProns_dict count]];
|
||||
for (NSDictionary* dict in (NSArray*)textProns_dict) {
|
||||
NIKTextPron* d = [[NIKTextPron alloc]initWithValues:dict];
|
||||
[objs addObject:d];
|
||||
}
|
||||
_textProns = [[NSArray alloc] initWithArray:objs];
|
||||
}
|
||||
}
|
||||
_partOfSpeech = [dict objectForKey:@"partOfSpeech"];
|
||||
return self;
|
||||
}
|
||||
@@ -218,24 +219,6 @@
|
||||
}
|
||||
if(_sequence != nil) [dict setObject:_sequence forKey:@"sequence"];
|
||||
if(_word != nil) [dict setObject:_word forKey:@"word"];
|
||||
if(_textProns != nil){
|
||||
if([_textProns isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
for( NIKTextPron * textProns in (NSArray*)_textProns) {
|
||||
[array addObject:[(NIKSwaggerObject*)textProns asDictionary]];
|
||||
}
|
||||
[dict setObject:array forKey:@"textProns"];
|
||||
}
|
||||
else if(_textProns && [_textProns isKindOfClass:[NIKDate class]]) {
|
||||
NSString * dateString = [(NIKDate*)_textProns toString];
|
||||
if(dateString){
|
||||
[dict setObject:dateString forKey:@"textProns"];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(_textProns != nil) [dict setObject:[(NIKSwaggerObject*)_textProns asDictionary]forKey:@"textProns"];
|
||||
}
|
||||
if(_notes != nil){
|
||||
if([_notes isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
@@ -254,6 +237,24 @@
|
||||
else {
|
||||
if(_notes != nil) [dict setObject:[(NIKSwaggerObject*)_notes asDictionary]forKey:@"notes"];
|
||||
}
|
||||
if(_textProns != nil){
|
||||
if([_textProns isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
for( NIKTextPron * textProns in (NSArray*)_textProns) {
|
||||
[array addObject:[(NIKSwaggerObject*)textProns asDictionary]];
|
||||
}
|
||||
[dict setObject:array forKey:@"textProns"];
|
||||
}
|
||||
else if(_textProns && [_textProns isKindOfClass:[NIKDate class]]) {
|
||||
NSString * dateString = [(NIKDate*)_textProns toString];
|
||||
if(dateString){
|
||||
[dict setObject:dateString forKey:@"textProns"];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(_textProns != nil) [dict setObject:[(NIKSwaggerObject*)_textProns asDictionary]forKey:@"textProns"];
|
||||
}
|
||||
if(_partOfSpeech != nil) [dict setObject:_partOfSpeech forKey:@"partOfSpeech"];
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKDefinitionSearchResults.h"
|
||||
|
||||
@implementation NIKDefinitionSearchResults
|
||||
|
||||
@@ -7,45 +7,45 @@
|
||||
@interface NIKExample : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSString* _text; //NSString
|
||||
NSString* _title; //NSString
|
||||
NSNumber* _exampleId; //NSNumber
|
||||
NSString* _title; //NSString
|
||||
NSString* _text; //NSString
|
||||
NIKScoredWord* _score; //ScoredWord
|
||||
NIKSentence* _sentence; //Sentence
|
||||
NSNumber* _year; //NSNumber
|
||||
NIKContentProvider* _provider; //ContentProvider
|
||||
NSString* _word; //NSString
|
||||
NIKContentProvider* _provider; //ContentProvider
|
||||
NSNumber* _year; //NSNumber
|
||||
NSNumber* _rating; //NSNumber
|
||||
NSString* _url; //NSString
|
||||
NSNumber* _documentId; //NSNumber
|
||||
NSString* _url; //NSString
|
||||
}
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSString* text;
|
||||
@property(nonatomic) NSString* title;
|
||||
@property(nonatomic) NSNumber* exampleId;
|
||||
@property(nonatomic) NSString* title;
|
||||
@property(nonatomic) NSString* text;
|
||||
@property(nonatomic) NIKScoredWord* score;
|
||||
@property(nonatomic) NIKSentence* sentence;
|
||||
@property(nonatomic) NSNumber* year;
|
||||
@property(nonatomic) NIKContentProvider* provider;
|
||||
@property(nonatomic) NSString* word;
|
||||
@property(nonatomic) NIKContentProvider* provider;
|
||||
@property(nonatomic) NSNumber* year;
|
||||
@property(nonatomic) NSNumber* rating;
|
||||
@property(nonatomic) NSString* url;
|
||||
@property(nonatomic) NSNumber* documentId;
|
||||
@property(nonatomic) NSString* url;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
text: (NSString*) text
|
||||
title: (NSString*) title
|
||||
exampleId: (NSNumber*) exampleId
|
||||
title: (NSString*) title
|
||||
text: (NSString*) text
|
||||
score: (NIKScoredWord*) score
|
||||
sentence: (NIKSentence*) sentence
|
||||
year: (NSNumber*) year
|
||||
provider: (NIKContentProvider*) provider
|
||||
word: (NSString*) word
|
||||
provider: (NIKContentProvider*) provider
|
||||
year: (NSNumber*) year
|
||||
rating: (NSNumber*) rating
|
||||
url: (NSString*) url
|
||||
documentId: (NSNumber*) documentId;
|
||||
documentId: (NSNumber*) documentId
|
||||
url: (NSString*) url;
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict;
|
||||
- (NSDictionary*) asDictionary;
|
||||
|
||||
@@ -1,73 +1,74 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKExample.h"
|
||||
|
||||
@implementation NIKExample
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize text = _text;
|
||||
@synthesize title = _title;
|
||||
@synthesize exampleId = _exampleId;
|
||||
@synthesize title = _title;
|
||||
@synthesize text = _text;
|
||||
@synthesize score = _score;
|
||||
@synthesize sentence = _sentence;
|
||||
@synthesize year = _year;
|
||||
@synthesize provider = _provider;
|
||||
@synthesize word = _word;
|
||||
@synthesize provider = _provider;
|
||||
@synthesize year = _year;
|
||||
@synthesize rating = _rating;
|
||||
@synthesize url = _url;
|
||||
@synthesize documentId = _documentId;
|
||||
@synthesize url = _url;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
text: (NSString*) text
|
||||
title: (NSString*) title
|
||||
exampleId: (NSNumber*) exampleId
|
||||
title: (NSString*) title
|
||||
text: (NSString*) text
|
||||
score: (NIKScoredWord*) score
|
||||
sentence: (NIKSentence*) sentence
|
||||
year: (NSNumber*) year
|
||||
provider: (NIKContentProvider*) provider
|
||||
word: (NSString*) word
|
||||
provider: (NIKContentProvider*) provider
|
||||
year: (NSNumber*) year
|
||||
rating: (NSNumber*) rating
|
||||
url: (NSString*) url
|
||||
documentId: (NSNumber*) documentId
|
||||
url: (NSString*) url
|
||||
{
|
||||
__id = _id;
|
||||
_text = text;
|
||||
_title = title;
|
||||
_exampleId = exampleId;
|
||||
_title = title;
|
||||
_text = text;
|
||||
_score = score;
|
||||
_sentence = sentence;
|
||||
_year = year;
|
||||
_provider = provider;
|
||||
_word = word;
|
||||
_provider = provider;
|
||||
_year = year;
|
||||
_rating = rating;
|
||||
_url = url;
|
||||
_documentId = documentId;
|
||||
_url = url;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_text = [dict objectForKey:@"text"];
|
||||
_title = [dict objectForKey:@"title"];
|
||||
_exampleId = [dict objectForKey:@"exampleId"];
|
||||
_title = [dict objectForKey:@"title"];
|
||||
_text = [dict objectForKey:@"text"];
|
||||
id score_dict = [dict objectForKey:@"score"];
|
||||
_score = [[NIKScoredWord alloc]initWithValues:score_dict];
|
||||
id sentence_dict = [dict objectForKey:@"sentence"];
|
||||
_sentence = [[NIKSentence alloc]initWithValues:sentence_dict];
|
||||
_year = [dict objectForKey:@"year"];
|
||||
_word = [dict objectForKey:@"word"];
|
||||
id provider_dict = [dict objectForKey:@"provider"];
|
||||
_provider = [[NIKContentProvider alloc]initWithValues:provider_dict];
|
||||
_word = [dict objectForKey:@"word"];
|
||||
_year = [dict objectForKey:@"year"];
|
||||
_rating = [dict objectForKey:@"rating"];
|
||||
_url = [dict objectForKey:@"url"];
|
||||
_documentId = [dict objectForKey:@"documentId"];
|
||||
_url = [dict objectForKey:@"url"];
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_text != nil) [dict setObject:_text forKey:@"text"];
|
||||
if(_title != nil) [dict setObject:_title forKey:@"title"];
|
||||
if(_exampleId != nil) [dict setObject:_exampleId forKey:@"exampleId"];
|
||||
if(_title != nil) [dict setObject:_title forKey:@"title"];
|
||||
if(_text != nil) [dict setObject:_text forKey:@"text"];
|
||||
if(_score != nil){
|
||||
if([_score isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
@@ -104,7 +105,7 @@
|
||||
else {
|
||||
if(_sentence != nil) [dict setObject:[(NIKSwaggerObject*)_sentence asDictionary]forKey:@"sentence"];
|
||||
}
|
||||
if(_year != nil) [dict setObject:_year forKey:@"year"];
|
||||
if(_word != nil) [dict setObject:_word forKey:@"word"];
|
||||
if(_provider != nil){
|
||||
if([_provider isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
@@ -123,10 +124,10 @@
|
||||
else {
|
||||
if(_provider != nil) [dict setObject:[(NIKSwaggerObject*)_provider asDictionary]forKey:@"provider"];
|
||||
}
|
||||
if(_word != nil) [dict setObject:_word forKey:@"word"];
|
||||
if(_year != nil) [dict setObject:_year forKey:@"year"];
|
||||
if(_rating != nil) [dict setObject:_rating forKey:@"rating"];
|
||||
if(_url != nil) [dict setObject:_url forKey:@"url"];
|
||||
if(_documentId != nil) [dict setObject:_documentId forKey:@"documentId"];
|
||||
if(_url != nil) [dict setObject:_url forKey:@"url"];
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKExampleSearchResults.h"
|
||||
|
||||
@implementation NIKExampleSearchResults
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKExampleUsage.h"
|
||||
|
||||
@implementation NIKExampleUsage
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKFacet.h"
|
||||
|
||||
@implementation NIKFacet
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKFacetValue.h"
|
||||
|
||||
@implementation NIKFacetValue
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKFrequency.h"
|
||||
|
||||
@implementation NIKFrequency
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKFrequencySummary.h"
|
||||
|
||||
@implementation NIKFrequencySummary
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKLabel.h"
|
||||
|
||||
@implementation NIKLabel
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKNote.h"
|
||||
|
||||
@implementation NIKNote
|
||||
|
||||
@@ -4,30 +4,30 @@
|
||||
@interface NIKRelated : NIKSwaggerObject {
|
||||
@private
|
||||
NSString* _label1; //NSString
|
||||
NSString* _label2; //NSString
|
||||
NSString* _relationshipType; //NSString
|
||||
NSString* _label2; //NSString
|
||||
NSString* _label3; //NSString
|
||||
NSArray* _words; //NSString
|
||||
NSString* _label4; //NSString
|
||||
NSString* _gram; //NSString
|
||||
NSString* _label4; //NSString
|
||||
}
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSString* label1;
|
||||
@property(nonatomic) NSString* label2;
|
||||
@property(nonatomic) NSString* relationshipType;
|
||||
@property(nonatomic) NSString* label2;
|
||||
@property(nonatomic) NSString* label3;
|
||||
@property(nonatomic) NSArray* words;
|
||||
@property(nonatomic) NSString* label4;
|
||||
@property(nonatomic) NSString* gram;
|
||||
@property(nonatomic) NSString* label4;
|
||||
- (id) label1: (NSString*) label1
|
||||
label2: (NSString*) label2
|
||||
relationshipType: (NSString*) relationshipType
|
||||
label2: (NSString*) label2
|
||||
label3: (NSString*) label3
|
||||
words: (NSArray*) words
|
||||
label4: (NSString*) label4
|
||||
gram: (NSString*) gram;
|
||||
gram: (NSString*) gram
|
||||
label4: (NSString*) label4;
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict;
|
||||
- (NSDictionary*) asDictionary;
|
||||
|
||||
@@ -1,53 +1,54 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKRelated.h"
|
||||
|
||||
@implementation NIKRelated
|
||||
|
||||
@synthesize label1 = _label1;
|
||||
@synthesize label2 = _label2;
|
||||
@synthesize relationshipType = _relationshipType;
|
||||
@synthesize label2 = _label2;
|
||||
@synthesize label3 = _label3;
|
||||
@synthesize words = _words;
|
||||
@synthesize label4 = _label4;
|
||||
@synthesize gram = _gram;
|
||||
@synthesize label4 = _label4;
|
||||
- (id) label1: (NSString*) label1
|
||||
label2: (NSString*) label2
|
||||
relationshipType: (NSString*) relationshipType
|
||||
label2: (NSString*) label2
|
||||
label3: (NSString*) label3
|
||||
words: (NSArray*) words
|
||||
label4: (NSString*) label4
|
||||
gram: (NSString*) gram
|
||||
label4: (NSString*) label4
|
||||
{
|
||||
_label1 = label1;
|
||||
_label2 = label2;
|
||||
_relationshipType = relationshipType;
|
||||
_label2 = label2;
|
||||
_label3 = label3;
|
||||
_words = words;
|
||||
_label4 = label4;
|
||||
_gram = gram;
|
||||
_label4 = label4;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
{
|
||||
_label1 = [dict objectForKey:@"label1"];
|
||||
_label2 = [dict objectForKey:@"label2"];
|
||||
_relationshipType = [dict objectForKey:@"relationshipType"];
|
||||
_label2 = [dict objectForKey:@"label2"];
|
||||
_label3 = [dict objectForKey:@"label3"];
|
||||
_words = [dict objectForKey:@"words"];
|
||||
_label4 = [dict objectForKey:@"label4"];
|
||||
_gram = [dict objectForKey:@"gram"];
|
||||
_label4 = [dict objectForKey:@"label4"];
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(_label1 != nil) [dict setObject:_label1 forKey:@"label1"];
|
||||
if(_label2 != nil) [dict setObject:_label2 forKey:@"label2"];
|
||||
if(_relationshipType != nil) [dict setObject:_relationshipType forKey:@"relationshipType"];
|
||||
if(_label2 != nil) [dict setObject:_label2 forKey:@"label2"];
|
||||
if(_label3 != nil) [dict setObject:_label3 forKey:@"label3"];
|
||||
if(_words != nil) [dict setObject:_words forKey:@"words"];
|
||||
if(_label4 != nil) [dict setObject:_label4 forKey:@"label4"];
|
||||
if(_gram != nil) [dict setObject:_gram forKey:@"gram"];
|
||||
if(_label4 != nil) [dict setObject:_label4 forKey:@"label4"];
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
@interface NIKScoredWord : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSNumber* _position; //NSNumber
|
||||
NSString* _lemma; //NSString
|
||||
NSNumber* __id; //NSNumber
|
||||
NSNumber* _docTermCount; //NSNumber
|
||||
NSString* _lemma; //NSString
|
||||
NSString* _wordType; //NSString
|
||||
NSNumber* _score; //NSNumber
|
||||
NSString* _word; //NSString
|
||||
NSNumber* _sentenceId; //NSNumber
|
||||
NSString* _word; //NSString
|
||||
NSNumber* _stopword; //NSNumber
|
||||
NSNumber* _baseWordScore; //NSNumber
|
||||
NSString* _partOfSpeech; //NSString
|
||||
@@ -18,25 +18,25 @@
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSNumber* position;
|
||||
@property(nonatomic) NSString* lemma;
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSNumber* docTermCount;
|
||||
@property(nonatomic) NSString* lemma;
|
||||
@property(nonatomic) NSString* wordType;
|
||||
@property(nonatomic) NSNumber* score;
|
||||
@property(nonatomic) NSString* word;
|
||||
@property(nonatomic) NSNumber* sentenceId;
|
||||
@property(nonatomic) NSString* word;
|
||||
@property(nonatomic) NSNumber* stopword;
|
||||
@property(nonatomic) NSNumber* baseWordScore;
|
||||
@property(nonatomic) NSString* partOfSpeech;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
position: (NSNumber*) position
|
||||
lemma: (NSString*) lemma
|
||||
- (id) position: (NSNumber*) position
|
||||
_id: (NSNumber*) _id
|
||||
docTermCount: (NSNumber*) docTermCount
|
||||
lemma: (NSString*) lemma
|
||||
wordType: (NSString*) wordType
|
||||
score: (NSNumber*) score
|
||||
word: (NSString*) word
|
||||
sentenceId: (NSNumber*) sentenceId
|
||||
word: (NSString*) word
|
||||
stopword: (NSNumber*) stopword
|
||||
baseWordScore: (NSNumber*) baseWordScore
|
||||
partOfSpeech: (NSString*) partOfSpeech;
|
||||
|
||||
@@ -1,38 +1,39 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKScoredWord.h"
|
||||
|
||||
@implementation NIKScoredWord
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize position = _position;
|
||||
@synthesize lemma = _lemma;
|
||||
@synthesize _id = __id;
|
||||
@synthesize docTermCount = _docTermCount;
|
||||
@synthesize lemma = _lemma;
|
||||
@synthesize wordType = _wordType;
|
||||
@synthesize score = _score;
|
||||
@synthesize word = _word;
|
||||
@synthesize sentenceId = _sentenceId;
|
||||
@synthesize word = _word;
|
||||
@synthesize stopword = _stopword;
|
||||
@synthesize baseWordScore = _baseWordScore;
|
||||
@synthesize partOfSpeech = _partOfSpeech;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
position: (NSNumber*) position
|
||||
lemma: (NSString*) lemma
|
||||
- (id) position: (NSNumber*) position
|
||||
_id: (NSNumber*) _id
|
||||
docTermCount: (NSNumber*) docTermCount
|
||||
lemma: (NSString*) lemma
|
||||
wordType: (NSString*) wordType
|
||||
score: (NSNumber*) score
|
||||
word: (NSString*) word
|
||||
sentenceId: (NSNumber*) sentenceId
|
||||
word: (NSString*) word
|
||||
stopword: (NSNumber*) stopword
|
||||
baseWordScore: (NSNumber*) baseWordScore
|
||||
partOfSpeech: (NSString*) partOfSpeech
|
||||
{
|
||||
__id = _id;
|
||||
_position = position;
|
||||
_lemma = lemma;
|
||||
__id = _id;
|
||||
_docTermCount = docTermCount;
|
||||
_lemma = lemma;
|
||||
_wordType = wordType;
|
||||
_score = score;
|
||||
_word = word;
|
||||
_sentenceId = sentenceId;
|
||||
_word = word;
|
||||
_stopword = stopword;
|
||||
_baseWordScore = baseWordScore;
|
||||
_partOfSpeech = partOfSpeech;
|
||||
@@ -41,14 +42,14 @@
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_position = [dict objectForKey:@"position"];
|
||||
_lemma = [dict objectForKey:@"lemma"];
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_docTermCount = [dict objectForKey:@"docTermCount"];
|
||||
_lemma = [dict objectForKey:@"lemma"];
|
||||
_wordType = [dict objectForKey:@"wordType"];
|
||||
_score = [dict objectForKey:@"score"];
|
||||
_word = [dict objectForKey:@"word"];
|
||||
_sentenceId = [dict objectForKey:@"sentenceId"];
|
||||
_word = [dict objectForKey:@"word"];
|
||||
_stopword = [dict objectForKey:@"stopword"];
|
||||
_baseWordScore = [dict objectForKey:@"baseWordScore"];
|
||||
_partOfSpeech = [dict objectForKey:@"partOfSpeech"];
|
||||
@@ -57,14 +58,14 @@
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_position != nil) [dict setObject:_position forKey:@"position"];
|
||||
if(_lemma != nil) [dict setObject:_lemma forKey:@"lemma"];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_docTermCount != nil) [dict setObject:_docTermCount forKey:@"docTermCount"];
|
||||
if(_lemma != nil) [dict setObject:_lemma forKey:@"lemma"];
|
||||
if(_wordType != nil) [dict setObject:_wordType forKey:@"wordType"];
|
||||
if(_score != nil) [dict setObject:_score forKey:@"score"];
|
||||
if(_word != nil) [dict setObject:_word forKey:@"word"];
|
||||
if(_sentenceId != nil) [dict setObject:_sentenceId forKey:@"sentenceId"];
|
||||
if(_word != nil) [dict setObject:_word forKey:@"word"];
|
||||
if(_stopword != nil) [dict setObject:_stopword forKey:@"stopword"];
|
||||
if(_baseWordScore != nil) [dict setObject:_baseWordScore forKey:@"baseWordScore"];
|
||||
if(_partOfSpeech != nil) [dict setObject:_partOfSpeech forKey:@"partOfSpeech"];
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
@interface NIKSentence : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSNumber* _hasScoredWords; //NSNumber
|
||||
NSNumber* __id; //NSNumber
|
||||
NSArray* _scoredWords; //ScoredWord
|
||||
NSString* _display; //NSString
|
||||
NSNumber* _rating; //NSNumber
|
||||
@@ -14,14 +14,14 @@
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSNumber* hasScoredWords;
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSArray* scoredWords;
|
||||
@property(nonatomic) NSString* display;
|
||||
@property(nonatomic) NSNumber* rating;
|
||||
@property(nonatomic) NSNumber* documentMetadataId;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
hasScoredWords: (NSNumber*) hasScoredWords
|
||||
- (id) hasScoredWords: (NSNumber*) hasScoredWords
|
||||
_id: (NSNumber*) _id
|
||||
scoredWords: (NSArray*) scoredWords
|
||||
display: (NSString*) display
|
||||
rating: (NSNumber*) rating
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKSentence.h"
|
||||
|
||||
@implementation NIKSentence
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize hasScoredWords = _hasScoredWords;
|
||||
@synthesize _id = __id;
|
||||
@synthesize scoredWords = _scoredWords;
|
||||
@synthesize display = _display;
|
||||
@synthesize rating = _rating;
|
||||
@synthesize documentMetadataId = _documentMetadataId;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
hasScoredWords: (NSNumber*) hasScoredWords
|
||||
- (id) hasScoredWords: (NSNumber*) hasScoredWords
|
||||
_id: (NSNumber*) _id
|
||||
scoredWords: (NSArray*) scoredWords
|
||||
display: (NSString*) display
|
||||
rating: (NSNumber*) rating
|
||||
documentMetadataId: (NSNumber*) documentMetadataId
|
||||
{
|
||||
__id = _id;
|
||||
_hasScoredWords = hasScoredWords;
|
||||
__id = _id;
|
||||
_scoredWords = scoredWords;
|
||||
_display = display;
|
||||
_rating = rating;
|
||||
@@ -26,8 +27,8 @@
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_hasScoredWords = [dict objectForKey:@"hasScoredWords"];
|
||||
__id = [dict objectForKey:@"id"];
|
||||
id scoredWords_dict = [dict objectForKey:@"scoredWords"];
|
||||
if([scoredWords_dict isKindOfClass:[NSArray class]]) {
|
||||
if([(NSArray*)scoredWords_dict count] > 0) {
|
||||
@@ -47,8 +48,8 @@
|
||||
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_hasScoredWords != nil) [dict setObject:_hasScoredWords forKey:@"hasScoredWords"];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_scoredWords != nil){
|
||||
if([_scoredWords isKindOfClass:[NSArray class]]){
|
||||
NSMutableArray * array = [[NSMutableArray alloc] init];
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKSimpleDefinition.h"
|
||||
|
||||
@implementation NIKSimpleDefinition
|
||||
|
||||
@@ -4,20 +4,20 @@
|
||||
@interface NIKSimpleExample : NIKSwaggerObject {
|
||||
@private
|
||||
NSNumber* __id; //NSNumber
|
||||
NSString* _text; //NSString
|
||||
NSString* _title; //NSString
|
||||
NSString* _text; //NSString
|
||||
NSString* _url; //NSString
|
||||
}
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
@property(nonatomic) NSString* text;
|
||||
@property(nonatomic) NSString* title;
|
||||
@property(nonatomic) NSString* text;
|
||||
@property(nonatomic) NSString* url;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
text: (NSString*) text
|
||||
title: (NSString*) title
|
||||
text: (NSString*) text
|
||||
url: (NSString*) url;
|
||||
|
||||
- (id) initWithValues: (NSDictionary*)dict;
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKSimpleExample.h"
|
||||
|
||||
@implementation NIKSimpleExample
|
||||
|
||||
@synthesize _id = __id;
|
||||
@synthesize text = _text;
|
||||
@synthesize title = _title;
|
||||
@synthesize text = _text;
|
||||
@synthesize url = _url;
|
||||
- (id) _id: (NSNumber*) _id
|
||||
text: (NSString*) text
|
||||
title: (NSString*) title
|
||||
text: (NSString*) text
|
||||
url: (NSString*) url
|
||||
{
|
||||
__id = _id;
|
||||
_text = text;
|
||||
_title = title;
|
||||
_text = text;
|
||||
_url = url;
|
||||
return self;
|
||||
}
|
||||
@@ -21,8 +22,8 @@
|
||||
- (id) initWithValues: (NSDictionary*)dict
|
||||
{
|
||||
__id = [dict objectForKey:@"id"];
|
||||
_text = [dict objectForKey:@"text"];
|
||||
_title = [dict objectForKey:@"title"];
|
||||
_text = [dict objectForKey:@"text"];
|
||||
_url = [dict objectForKey:@"url"];
|
||||
return self;
|
||||
}
|
||||
@@ -30,8 +31,8 @@
|
||||
-(NSDictionary*) asDictionary {
|
||||
NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
|
||||
if(__id != nil) [dict setObject:__id forKey:@"id"];
|
||||
if(_text != nil) [dict setObject:_text forKey:@"text"];
|
||||
if(_title != nil) [dict setObject:_title forKey:@"title"];
|
||||
if(_text != nil) [dict setObject:_text forKey:@"text"];
|
||||
if(_url != nil) [dict setObject:_url forKey:@"url"];
|
||||
NSDictionary* output = [dict copy];
|
||||
return output;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKStringValue.h"
|
||||
|
||||
@implementation NIKStringValue
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKSyllable.h"
|
||||
|
||||
@implementation NIKSyllable
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#import "NIKDate.h"
|
||||
#import "NIKTextPron.h"
|
||||
|
||||
@implementation NIKTextPron
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user