updated samples

This commit is contained in:
Tony Tam 2014-06-10 08:01:53 -07:00
parent 1250cc758f
commit ac40283501
6 changed files with 244 additions and 74 deletions

View File

@ -29,7 +29,9 @@ class AccountApi {
* authenticate * authenticate
* Authenticates a User * Authenticates a User
* username, string: A confirmed Wordnik username (required) * username, string: A confirmed Wordnik username (required)
* password, string: The user's password (required) * password, string: The user's password (required)
* @return AuthenticationToken * @return AuthenticationToken
*/ */
@ -41,6 +43,8 @@ class AccountApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($password != null) { if($password != null) {
$queryParams['password'] = $this->apiClient->toQueryValue($password); $queryParams['password'] = $this->apiClient->toQueryValue($password);
@ -71,7 +75,9 @@ class AccountApi {
* authenticatePost * authenticatePost
* Authenticates a user * Authenticates a user
* username, string: A confirmed Wordnik username (required) * username, string: A confirmed Wordnik username (required)
* body, string: The user's password (required) * body, string: The user's password (required)
* @return AuthenticationToken * @return AuthenticationToken
*/ */
@ -83,6 +89,8 @@ class AccountApi {
$method = "POST"; $method = "POST";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($username != null) { if($username != null) {
$resourcePath = str_replace("{" . "username" . "}", $resourcePath = str_replace("{" . "username" . "}",
@ -110,8 +118,11 @@ class AccountApi {
* getWordListsForLoggedInUser * getWordListsForLoggedInUser
* Fetches WordList objects for the logged-in user. * Fetches WordList objects for the logged-in user.
* auth_token, string: auth_token of logged-in user (required) * auth_token, string: auth_token of logged-in user (required)
* skip, int: Results to skip (optional) * skip, int: Results to skip (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return array[WordList] * @return array[WordList]
*/ */
@ -123,6 +134,8 @@ class AccountApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($skip != null) { if($skip != null) {
$queryParams['skip'] = $this->apiClient->toQueryValue($skip); $queryParams['skip'] = $this->apiClient->toQueryValue($skip);
@ -155,6 +168,7 @@ class AccountApi {
* getApiTokenStatus * getApiTokenStatus
* Returns usage statistics for the API account. * Returns usage statistics for the API account.
* api_key, string: Wordnik authentication token (optional) * api_key, string: Wordnik authentication token (optional)
* @return ApiTokenStatus * @return ApiTokenStatus
*/ */
@ -166,6 +180,8 @@ class AccountApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($api_key != null) { if($api_key != null) {
$headerParams['api_key'] = $this->apiClient->toHeaderValue($api_key); $headerParams['api_key'] = $this->apiClient->toHeaderValue($api_key);
@ -192,6 +208,7 @@ class AccountApi {
* getLoggedInUser * getLoggedInUser
* Returns the logged-in User * Returns the logged-in User
* auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required) * auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
* @return User * @return User
*/ */
@ -203,6 +220,8 @@ class AccountApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($auth_token != null) { if($auth_token != null) {
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token); $headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
@ -226,5 +245,6 @@ class AccountApi {
} }
} }

View File

@ -44,13 +44,12 @@ class APIClient {
* @param array $queryParams parameters to be place in query URL * @param array $queryParams parameters to be place in query URL
* @param array $postData parameters to be placed in POST body * @param array $postData parameters to be placed in POST body
* @param array $headerParams parameters to be place in request header * @param array $headerParams parameters to be place in request header
* @return unknown * @return mixed
*/ */
public function callAPI($resourcePath, $method, $queryParams, $postData, public function callAPI($resourcePath, $method, $queryParams, $postData,
$headerParams) { $headerParams) {
$headers = array(); $headers = array();
$headers[] = "Content-type: application/json";
# Allow API key from $headerParams to override default # Allow API key from $headerParams to override default
$added_api_key = False; $added_api_key = False;
@ -67,7 +66,7 @@ class APIClient {
} }
if (is_object($postData) or is_array($postData)) { if (is_object($postData) or is_array($postData)) {
$postData = json_encode(self::sanitizeForSerialization($postData)); $postData = json_encode($this->sanitizeForSerialization($postData));
} }
$url = $this->apiServer . $resourcePath; $url = $this->apiServer . $resourcePath;
@ -118,21 +117,35 @@ class APIClient {
$response_info['http_code']); $response_info['http_code']);
} }
return $data; return $data;
} }
/** /**
* Build a JSON POST object * Build a JSON POST object
*/ */
public static function sanitizeForSerialization($postData) { protected function sanitizeForSerialization($data)
foreach ($postData as $key => $value) { {
if (is_a($value, "DateTime")) { if (is_scalar($data) || null === $data) {
$postData->{$key} = $value->format(DateTime::ISO8601); $sanitized = $data;
} } else if ($data instanceof \DateTime) {
} $sanitized = $data->format(\DateTime::ISO8601);
return $postData; } else if (is_array($data)) {
} foreach ($data as $property => $value) {
$data[$property] = $this->sanitizeForSerialization($value);
}
$sanitized = $data;
} else if (is_object($data)) {
$values = array();
foreach (array_keys($data::$swaggerTypes) as $property) {
$values[$property] = $this->sanitizeForSerialization($data->$property);
}
$sanitized = $values;
} else {
$sanitized = (string)$data;
}
return $sanitized;
}
/** /**
* Take value and turn it into a string suitable for inclusion in * Take value and turn it into a string suitable for inclusion in
@ -170,73 +183,43 @@ class APIClient {
return $value; return $value;
} }
/** /**
* Deserialize a JSON string into an object * Deserialize a JSON string into an object
* *
* @param object $object object or primitive to be deserialized * @param object $object object or primitive to be deserialized
* @param string $class class name is passed as a string * @param string $class class name is passed as a string
* @return object an instance of $class * @return object an instance of $class
*/ */
public static function deserialize($object, $class) {
if (gettype($object) == "NULL") { public static function deserialize($data, $class)
return $object; {
} if (null === $data) {
$deserialized = null;
if (substr($class, 0, 6) == 'array[') { } else if (substr($class, 0, 6) == 'array[') {
$sub_class = substr($class, 6, -1); $subClass = substr($class, 6, -1);
$sub_objects = array(); $values = array();
foreach ($object as $sub_object) { foreach ($data as $value) {
$sub_objects[] = self::deserialize($sub_object, $values[] = self::deserialize($value, $subClass);
$sub_class);
} }
return $sub_objects; $deserialized = $values;
} elseif ($class == 'DateTime') { } elseif ($class == 'DateTime') {
return new DateTime($object); $deserialized = new \DateTime($data);
} elseif (in_array($class, array('string', 'int', 'float', 'bool'))) { } elseif (in_array($class, array('string', 'int', 'float', 'bool'))) {
settype($object, $class); settype($data, $class);
return $object; $deserialized = $data;
} else { } else {
$instance = new $class(); // this instantiates class named $class $instance = new $class();
$classVars = get_class_vars($class); foreach ($instance::$swaggerTypes as $property => $type) {
} if (isset($data->$property)) {
$instance->$property = self::deserialize($data->$property, $type);
}
}
$deserialized = $instance;
}
foreach ($object as $property => $value) { return $deserialized;
}
// Need to handle possible pluralization differences
$true_property = $property;
if (! property_exists($class, $true_property)) {
if (substr($property, -1) == 's') {
$true_property = substr($property, 0, -1);
}
}
if (array_key_exists($true_property, $classVars['swaggerTypes'])) {
$type = $classVars['swaggerTypes'][$true_property];
} else {
$type = 'string';
}
if (in_array($type, array('string', 'int', 'float', 'bool'))) {
settype($value, $type);
$instance->{$true_property} = $value;
} elseif (preg_match("/array<(.*)>/", $type, $matches)) {
$sub_class = $matches[1];
$instance->{$true_property} = array();
foreach ($value as $sub_property => $sub_value) {
$instance->{$true_property}[] = self::deserialize($sub_value,
$sub_class);
}
} else {
$instance->{$true_property} = self::deserialize($value, $type);
}
}
return $instance;
}
} }
?>

View File

@ -29,10 +29,15 @@ class WordApi {
* getExamples * getExamples
* Returns examples for a word * Returns examples for a word
* word, string: Word to return examples for (required) * word, string: Word to return examples for (required)
* includeDuplicates, string: Show duplicate examples from different sources (optional) * includeDuplicates, string: Show duplicate examples from different sources (optional)
* useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* skip, int: Results to skip (optional) * skip, int: Results to skip (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return ExampleSearchResults * @return ExampleSearchResults
*/ */
@ -44,6 +49,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($includeDuplicates != null) { if($includeDuplicates != null) {
$queryParams['includeDuplicates'] = $this->apiClient->toQueryValue($includeDuplicates); $queryParams['includeDuplicates'] = $this->apiClient->toQueryValue($includeDuplicates);
@ -83,8 +90,11 @@ class WordApi {
* getWord * getWord
* Given a word as a string, returns the WordObject that represents it * Given a word as a string, returns the WordObject that represents it
* word, string: String value of WordObject to return (required) * word, string: String value of WordObject to return (required)
* useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* includeSuggestions, string: Return suggestions (for correct spelling, case variants, etc.) (optional) * includeSuggestions, string: Return suggestions (for correct spelling, case variants, etc.) (optional)
* @return WordObject * @return WordObject
*/ */
@ -96,6 +106,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($useCanonical != null) { if($useCanonical != null) {
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical); $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
@ -129,12 +141,19 @@ class WordApi {
* getDefinitions * getDefinitions
* Return definitions for a word * Return definitions for a word
* word, string: Word to return definitions for (required) * word, string: Word to return definitions for (required)
* partOfSpeech, string: CSV list of part-of-speech types (optional) * partOfSpeech, string: CSV list of part-of-speech types (optional)
* sourceDictionaries, string: Source dictionary to return definitions from. If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results are returned from the first specified dictionary that has definitions. If left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet (optional) * sourceDictionaries, string: Source dictionary to return definitions from. If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results are returned from the first specified dictionary that has definitions. If left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* includeRelated, string: Return related words with definitions (optional) * includeRelated, string: Return related words with definitions (optional)
* useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* includeTags, string: Return a closed set of XML tags in response (optional) * includeTags, string: Return a closed set of XML tags in response (optional)
* @return array[Definition] * @return array[Definition]
*/ */
@ -146,6 +165,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($limit != null) { if($limit != null) {
$queryParams['limit'] = $this->apiClient->toQueryValue($limit); $queryParams['limit'] = $this->apiClient->toQueryValue($limit);
@ -191,7 +212,9 @@ class WordApi {
* getTopExample * getTopExample
* Returns a top example for a word * Returns a top example for a word
* word, string: Word to fetch examples for (required) * word, string: Word to fetch examples for (required)
* useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* @return Example * @return Example
*/ */
@ -203,6 +226,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($useCanonical != null) { if($useCanonical != null) {
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical); $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
@ -233,9 +258,13 @@ class WordApi {
* getRelatedWords * getRelatedWords
* Given a word as a string, returns relationships from the Word Graph * Given a word as a string, returns relationships from the Word Graph
* word, string: Word to fetch relationships for (required) * word, string: Word to fetch relationships for (required)
* relationshipTypes, string: Limits the total results per type of relationship type (optional) * relationshipTypes, string: Limits the total results per type of relationship type (optional)
* useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* limitPerRelationshipType, int: Restrict to the supplied relatinship types (optional) * limitPerRelationshipType, int: Restrict to the supplied relatinship types (optional)
* @return array[Related] * @return array[Related]
*/ */
@ -247,6 +276,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($useCanonical != null) { if($useCanonical != null) {
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical); $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
@ -283,10 +314,15 @@ class WordApi {
* getTextPronunciations * getTextPronunciations
* Returns text pronunciations for a given word * Returns text pronunciations for a given word
* word, string: Word to get pronunciations for (required) * word, string: Word to get pronunciations for (required)
* sourceDictionary, string: Get from a single dictionary (optional) * sourceDictionary, string: Get from a single dictionary (optional)
* typeFormat, string: Text pronunciation type (optional) * typeFormat, string: Text pronunciation type (optional)
* useCanonical, string: If true will try to return a correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return a correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return array[TextPron] * @return array[TextPron]
*/ */
@ -298,6 +334,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($useCanonical != null) { if($useCanonical != null) {
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical); $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
@ -337,9 +375,13 @@ class WordApi {
* getHyphenation * getHyphenation
* Returns syllable information for a word * Returns syllable information for a word
* word, string: Word to get syllables for (required) * word, string: Word to get syllables for (required)
* sourceDictionary, string: Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet. (optional) * sourceDictionary, string: Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet. (optional)
* useCanonical, string: If true will try to return a correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return a correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return array[Syllable] * @return array[Syllable]
*/ */
@ -351,6 +393,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($useCanonical != null) { if($useCanonical != null) {
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical); $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
@ -387,9 +431,13 @@ class WordApi {
* getWordFrequency * getWordFrequency
* Returns word usage over time * Returns word usage over time
* word, string: Word to return (required) * word, string: Word to return (required)
* useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* startYear, int: Starting Year (optional) * startYear, int: Starting Year (optional)
* endYear, int: Ending Year (optional) * endYear, int: Ending Year (optional)
* @return FrequencySummary * @return FrequencySummary
*/ */
@ -401,6 +449,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($useCanonical != null) { if($useCanonical != null) {
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical); $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
@ -437,9 +487,13 @@ class WordApi {
* getPhrases * getPhrases
* Fetches bi-gram phrases for a word * Fetches bi-gram phrases for a word
* word, string: Word to fetch phrases for (required) * word, string: Word to fetch phrases for (required)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* wlmi, int: Minimum WLMI for the phrase (optional) * wlmi, int: Minimum WLMI for the phrase (optional)
* useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* @return array[Bigram] * @return array[Bigram]
*/ */
@ -451,6 +505,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($limit != null) { if($limit != null) {
$queryParams['limit'] = $this->apiClient->toQueryValue($limit); $queryParams['limit'] = $this->apiClient->toQueryValue($limit);
@ -487,7 +543,9 @@ class WordApi {
* getEtymologies * getEtymologies
* Fetches etymology data * Fetches etymology data
* word, string: Word to return (required) * word, string: Word to return (required)
* useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional) * useCanonical, string: If true will try to return the correct word root ('cats' -&gt; 'cat'). If false returns exactly what was requested. (optional)
* @return array[string] * @return array[string]
*/ */
@ -499,6 +557,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($useCanonical != null) { if($useCanonical != null) {
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical); $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
@ -529,8 +589,11 @@ class WordApi {
* getAudio * getAudio
* Fetches audio metadata for a word. * Fetches audio metadata for a word.
* word, string: Word to get audio for. (required) * word, string: Word to get audio for. (required)
* useCanonical, string: Use the canonical form of the word (optional) * useCanonical, string: Use the canonical form of the word (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return array[AudioFile] * @return array[AudioFile]
*/ */
@ -542,6 +605,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($useCanonical != null) { if($useCanonical != null) {
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical); $queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
@ -575,6 +640,7 @@ class WordApi {
* getScrabbleScore * getScrabbleScore
* Returns the Scrabble score for a word * Returns the Scrabble score for a word
* word, string: Word to get scrabble score for. (required) * word, string: Word to get scrabble score for. (required)
* @return ScrabbleScoreResult * @return ScrabbleScoreResult
*/ */
@ -586,6 +652,8 @@ class WordApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($word != null) { if($word != null) {
$resourcePath = str_replace("{" . "word" . "}", $resourcePath = str_replace("{" . "word" . "}",
@ -610,5 +678,6 @@ class WordApi {
} }
} }

View File

@ -29,8 +29,11 @@ class WordListApi {
* updateWordList * updateWordList
* Updates an existing WordList * Updates an existing WordList
* permalink, string: permalink of WordList to update (required) * permalink, string: permalink of WordList to update (required)
* body, WordList: Updated WordList (optional) * body, WordList: Updated WordList (optional)
* auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required) * auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
* @return * @return
*/ */
@ -42,6 +45,8 @@ class WordListApi {
$method = "PUT"; $method = "PUT";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($auth_token != null) { if($auth_token != null) {
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token); $headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
@ -64,7 +69,9 @@ class WordListApi {
* deleteWordList * deleteWordList
* Deletes an existing WordList * Deletes an existing WordList
* permalink, string: ID of WordList to delete (required) * permalink, string: ID of WordList to delete (required)
* auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required) * auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
* @return * @return
*/ */
@ -76,6 +83,8 @@ class WordListApi {
$method = "DELETE"; $method = "DELETE";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($auth_token != null) { if($auth_token != null) {
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token); $headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
@ -98,7 +107,9 @@ class WordListApi {
* getWordListByPermalink * getWordListByPermalink
* Fetches a WordList by ID * Fetches a WordList by ID
* permalink, string: permalink of WordList to fetch (required) * permalink, string: permalink of WordList to fetch (required)
* auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required) * auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
* @return WordList * @return WordList
*/ */
@ -110,6 +121,8 @@ class WordListApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($auth_token != null) { if($auth_token != null) {
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token); $headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
@ -140,8 +153,11 @@ class WordListApi {
* addWordsToWordList * addWordsToWordList
* Adds words to a WordList * Adds words to a WordList
* permalink, string: permalink of WordList to user (required) * permalink, string: permalink of WordList to user (required)
* body, array[StringValue]: Array of words to add to WordList (optional) * body, array[StringValue]: Array of words to add to WordList (optional)
* auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required) * auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
* @return * @return
*/ */
@ -153,6 +169,8 @@ class WordListApi {
$method = "POST"; $method = "POST";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($auth_token != null) { if($auth_token != null) {
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token); $headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
@ -175,11 +193,17 @@ class WordListApi {
* getWordListWords * getWordListWords
* Fetches words in a WordList * Fetches words in a WordList
* permalink, string: ID of WordList to use (required) * permalink, string: ID of WordList to use (required)
* auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required) * auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
* sortBy, string: Field to sort by (optional) * sortBy, string: Field to sort by (optional)
* sortOrder, string: Direction to sort (optional) * sortOrder, string: Direction to sort (optional)
* skip, int: Results to skip (optional) * skip, int: Results to skip (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return array[WordListWord] * @return array[WordListWord]
*/ */
@ -191,6 +215,8 @@ class WordListApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($sortBy != null) { if($sortBy != null) {
$queryParams['sortBy'] = $this->apiClient->toQueryValue($sortBy); $queryParams['sortBy'] = $this->apiClient->toQueryValue($sortBy);
@ -233,8 +259,11 @@ class WordListApi {
* deleteWordsFromWordList * deleteWordsFromWordList
* Removes words from a WordList * Removes words from a WordList
* permalink, string: permalink of WordList to use (required) * permalink, string: permalink of WordList to use (required)
* body, array[StringValue]: Words to remove from WordList (optional) * body, array[StringValue]: Words to remove from WordList (optional)
* auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required) * auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
* @return * @return
*/ */
@ -246,6 +275,8 @@ class WordListApi {
$method = "POST"; $method = "POST";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($auth_token != null) { if($auth_token != null) {
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token); $headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
@ -265,5 +296,6 @@ class WordListApi {
} }
} }

View File

@ -29,7 +29,9 @@ class WordListsApi {
* createWordList * createWordList
* Creates a WordList. * Creates a WordList.
* body, WordList: WordList to create (optional) * body, WordList: WordList to create (optional)
* auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required) * auth_token, string: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
* @return WordList * @return WordList
*/ */
@ -41,6 +43,8 @@ class WordListsApi {
$method = "POST"; $method = "POST";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($auth_token != null) { if($auth_token != null) {
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token); $headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
@ -64,5 +68,6 @@ class WordListsApi {
} }
} }

View File

@ -29,17 +29,29 @@ class WordsApi {
* searchWords * searchWords
* Searches words * Searches words
* query, string: Search query (required) * query, string: Search query (required)
* includePartOfSpeech, string: Only include these comma-delimited parts of speech (optional) * includePartOfSpeech, string: Only include these comma-delimited parts of speech (optional)
* excludePartOfSpeech, string: Exclude these comma-delimited parts of speech (optional) * excludePartOfSpeech, string: Exclude these comma-delimited parts of speech (optional)
* caseSensitive, string: Search case sensitive (optional) * caseSensitive, string: Search case sensitive (optional)
* minCorpusCount, int: Minimum corpus frequency for terms (optional) * minCorpusCount, int: Minimum corpus frequency for terms (optional)
* maxCorpusCount, int: Maximum corpus frequency for terms (optional) * maxCorpusCount, int: Maximum corpus frequency for terms (optional)
* minDictionaryCount, int: Minimum number of dictionary entries for words returned (optional) * minDictionaryCount, int: Minimum number of dictionary entries for words returned (optional)
* maxDictionaryCount, int: Maximum dictionary definition count (optional) * maxDictionaryCount, int: Maximum dictionary definition count (optional)
* minLength, int: Minimum word length (optional) * minLength, int: Minimum word length (optional)
* maxLength, int: Maximum word length (optional) * maxLength, int: Maximum word length (optional)
* skip, int: Results to skip (optional) * skip, int: Results to skip (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return WordSearchResults * @return WordSearchResults
*/ */
@ -51,6 +63,8 @@ class WordsApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($caseSensitive != null) { if($caseSensitive != null) {
$queryParams['caseSensitive'] = $this->apiClient->toQueryValue($caseSensitive); $queryParams['caseSensitive'] = $this->apiClient->toQueryValue($caseSensitive);
@ -111,6 +125,7 @@ class WordsApi {
* getWordOfTheDay * getWordOfTheDay
* Returns a specific WordOfTheDay * Returns a specific WordOfTheDay
* date, string: Fetches by date in yyyy-MM-dd (optional) * date, string: Fetches by date in yyyy-MM-dd (optional)
* @return WordOfTheDay * @return WordOfTheDay
*/ */
@ -122,6 +137,8 @@ class WordsApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($date != null) { if($date != null) {
$queryParams['date'] = $this->apiClient->toQueryValue($date); $queryParams['date'] = $this->apiClient->toQueryValue($date);
@ -148,21 +165,37 @@ class WordsApi {
* reverseDictionary * reverseDictionary
* Reverse dictionary search * Reverse dictionary search
* query, string: Search term (required) * query, string: Search term (required)
* findSenseForWord, string: Restricts words and finds closest sense (optional) * findSenseForWord, string: Restricts words and finds closest sense (optional)
* includeSourceDictionaries, string: Only include these comma-delimited source dictionaries (optional) * includeSourceDictionaries, string: Only include these comma-delimited source dictionaries (optional)
* excludeSourceDictionaries, string: Exclude these comma-delimited source dictionaries (optional) * excludeSourceDictionaries, string: Exclude these comma-delimited source dictionaries (optional)
* includePartOfSpeech, string: Only include these comma-delimited parts of speech (optional) * includePartOfSpeech, string: Only include these comma-delimited parts of speech (optional)
* excludePartOfSpeech, string: Exclude these comma-delimited parts of speech (optional) * excludePartOfSpeech, string: Exclude these comma-delimited parts of speech (optional)
* expandTerms, string: Expand terms (optional) * expandTerms, string: Expand terms (optional)
* sortBy, string: Attribute to sort by (optional) * sortBy, string: Attribute to sort by (optional)
* sortOrder, string: Sort direction (optional) * sortOrder, string: Sort direction (optional)
* minCorpusCount, int: Minimum corpus frequency for terms (optional) * minCorpusCount, int: Minimum corpus frequency for terms (optional)
* maxCorpusCount, int: Maximum corpus frequency for terms (optional) * maxCorpusCount, int: Maximum corpus frequency for terms (optional)
* minLength, int: Minimum word length (optional) * minLength, int: Minimum word length (optional)
* maxLength, int: Maximum word length (optional) * maxLength, int: Maximum word length (optional)
* includeTags, string: Return a closed set of XML tags in response (optional) * includeTags, string: Return a closed set of XML tags in response (optional)
* skip, string: Results to skip (optional) * skip, string: Results to skip (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return DefinitionSearchResults * @return DefinitionSearchResults
*/ */
@ -174,6 +207,8 @@ class WordsApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($query != null) { if($query != null) {
$queryParams['query'] = $this->apiClient->toQueryValue($query); $queryParams['query'] = $this->apiClient->toQueryValue($query);
@ -245,17 +280,29 @@ class WordsApi {
* getRandomWords * getRandomWords
* Returns an array of random WordObjects * Returns an array of random WordObjects
* includePartOfSpeech, string: CSV part-of-speech values to include (optional) * includePartOfSpeech, string: CSV part-of-speech values to include (optional)
* excludePartOfSpeech, string: CSV part-of-speech values to exclude (optional) * excludePartOfSpeech, string: CSV part-of-speech values to exclude (optional)
* sortBy, string: Attribute to sort by (optional) * sortBy, string: Attribute to sort by (optional)
* sortOrder, string: Sort direction (optional) * sortOrder, string: Sort direction (optional)
* hasDictionaryDef, string: Only return words with dictionary definitions (optional) * hasDictionaryDef, string: Only return words with dictionary definitions (optional)
* minCorpusCount, int: Minimum corpus frequency for terms (optional) * minCorpusCount, int: Minimum corpus frequency for terms (optional)
* maxCorpusCount, int: Maximum corpus frequency for terms (optional) * maxCorpusCount, int: Maximum corpus frequency for terms (optional)
* minDictionaryCount, int: Minimum dictionary count (optional) * minDictionaryCount, int: Minimum dictionary count (optional)
* maxDictionaryCount, int: Maximum dictionary count (optional) * maxDictionaryCount, int: Maximum dictionary count (optional)
* minLength, int: Minimum word length (optional) * minLength, int: Minimum word length (optional)
* maxLength, int: Maximum word length (optional) * maxLength, int: Maximum word length (optional)
* limit, int: Maximum number of results to return (optional) * limit, int: Maximum number of results to return (optional)
* @return array[WordObject] * @return array[WordObject]
*/ */
@ -267,6 +314,8 @@ class WordsApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($hasDictionaryDef != null) { if($hasDictionaryDef != null) {
$queryParams['hasDictionaryDef'] = $this->apiClient->toQueryValue($hasDictionaryDef); $queryParams['hasDictionaryDef'] = $this->apiClient->toQueryValue($hasDictionaryDef);
@ -326,14 +375,23 @@ class WordsApi {
* getRandomWord * getRandomWord
* Returns a single random WordObject * Returns a single random WordObject
* includePartOfSpeech, string: CSV part-of-speech values to include (optional) * includePartOfSpeech, string: CSV part-of-speech values to include (optional)
* excludePartOfSpeech, string: CSV part-of-speech values to exclude (optional) * excludePartOfSpeech, string: CSV part-of-speech values to exclude (optional)
* hasDictionaryDef, string: Only return words with dictionary definitions (optional) * hasDictionaryDef, string: Only return words with dictionary definitions (optional)
* minCorpusCount, int: Minimum corpus frequency for terms (optional) * minCorpusCount, int: Minimum corpus frequency for terms (optional)
* maxCorpusCount, int: Maximum corpus frequency for terms (optional) * maxCorpusCount, int: Maximum corpus frequency for terms (optional)
* minDictionaryCount, int: Minimum dictionary count (optional) * minDictionaryCount, int: Minimum dictionary count (optional)
* maxDictionaryCount, int: Maximum dictionary count (optional) * maxDictionaryCount, int: Maximum dictionary count (optional)
* minLength, int: Minimum word length (optional) * minLength, int: Minimum word length (optional)
* maxLength, int: Maximum word length (optional) * maxLength, int: Maximum word length (optional)
* @return WordObject * @return WordObject
*/ */
@ -345,6 +403,8 @@ class WordsApi {
$method = "GET"; $method = "GET";
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$headerParams['Accept'] = '(mediaType,application/json)';
$headerParams['Content-Type'] = '';
if($hasDictionaryDef != null) { if($hasDictionaryDef != null) {
$queryParams['hasDictionaryDef'] = $this->apiClient->toQueryValue($hasDictionaryDef); $queryParams['hasDictionaryDef'] = $this->apiClient->toQueryValue($hasDictionaryDef);
@ -392,5 +452,6 @@ class WordsApi {
} }
} }