mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
updated samples
This commit is contained in:
parent
1250cc758f
commit
ac40283501
@ -29,7 +29,9 @@ class AccountApi {
|
||||
* authenticate
|
||||
* Authenticates a User
|
||||
* username, string: A confirmed Wordnik username (required)
|
||||
|
||||
* password, string: The user's password (required)
|
||||
|
||||
* @return AuthenticationToken
|
||||
*/
|
||||
|
||||
@ -41,6 +43,8 @@ class AccountApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($password != null) {
|
||||
$queryParams['password'] = $this->apiClient->toQueryValue($password);
|
||||
@ -71,7 +75,9 @@ class AccountApi {
|
||||
* authenticatePost
|
||||
* Authenticates a user
|
||||
* username, string: A confirmed Wordnik username (required)
|
||||
|
||||
* body, string: The user's password (required)
|
||||
|
||||
* @return AuthenticationToken
|
||||
*/
|
||||
|
||||
@ -83,6 +89,8 @@ class AccountApi {
|
||||
$method = "POST";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($username != null) {
|
||||
$resourcePath = str_replace("{" . "username" . "}",
|
||||
@ -110,8 +118,11 @@ class AccountApi {
|
||||
* getWordListsForLoggedInUser
|
||||
* Fetches WordList objects for the logged-in user.
|
||||
* auth_token, string: auth_token of logged-in user (required)
|
||||
|
||||
* skip, int: Results to skip (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return array[WordList]
|
||||
*/
|
||||
|
||||
@ -123,6 +134,8 @@ class AccountApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($skip != null) {
|
||||
$queryParams['skip'] = $this->apiClient->toQueryValue($skip);
|
||||
@ -155,6 +168,7 @@ class AccountApi {
|
||||
* getApiTokenStatus
|
||||
* Returns usage statistics for the API account.
|
||||
* api_key, string: Wordnik authentication token (optional)
|
||||
|
||||
* @return ApiTokenStatus
|
||||
*/
|
||||
|
||||
@ -166,6 +180,8 @@ class AccountApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($api_key != null) {
|
||||
$headerParams['api_key'] = $this->apiClient->toHeaderValue($api_key);
|
||||
@ -192,6 +208,7 @@ class AccountApi {
|
||||
* getLoggedInUser
|
||||
* 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)
|
||||
|
||||
* @return User
|
||||
*/
|
||||
|
||||
@ -203,6 +220,8 @@ class AccountApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($auth_token != null) {
|
||||
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
|
||||
@ -226,5 +245,6 @@ class AccountApi {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -44,13 +44,12 @@ class APIClient {
|
||||
* @param array $queryParams parameters to be place in query URL
|
||||
* @param array $postData parameters to be placed in POST body
|
||||
* @param array $headerParams parameters to be place in request header
|
||||
* @return unknown
|
||||
* @return mixed
|
||||
*/
|
||||
public function callAPI($resourcePath, $method, $queryParams, $postData,
|
||||
$headerParams) {
|
||||
|
||||
$headers = array();
|
||||
$headers[] = "Content-type: application/json";
|
||||
|
||||
# Allow API key from $headerParams to override default
|
||||
$added_api_key = False;
|
||||
@ -67,7 +66,7 @@ class APIClient {
|
||||
}
|
||||
|
||||
if (is_object($postData) or is_array($postData)) {
|
||||
$postData = json_encode(self::sanitizeForSerialization($postData));
|
||||
$postData = json_encode($this->sanitizeForSerialization($postData));
|
||||
}
|
||||
|
||||
$url = $this->apiServer . $resourcePath;
|
||||
@ -118,21 +117,35 @@ class APIClient {
|
||||
$response_info['http_code']);
|
||||
}
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a JSON POST object
|
||||
*/
|
||||
public static function sanitizeForSerialization($postData) {
|
||||
foreach ($postData as $key => $value) {
|
||||
if (is_a($value, "DateTime")) {
|
||||
$postData->{$key} = $value->format(DateTime::ISO8601);
|
||||
}
|
||||
}
|
||||
return $postData;
|
||||
}
|
||||
protected function sanitizeForSerialization($data)
|
||||
{
|
||||
if (is_scalar($data) || null === $data) {
|
||||
$sanitized = $data;
|
||||
} else if ($data instanceof \DateTime) {
|
||||
$sanitized = $data->format(\DateTime::ISO8601);
|
||||
} 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
|
||||
@ -170,73 +183,43 @@ class APIClient {
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserialize a JSON string into an object
|
||||
*
|
||||
* @param object $object object or primitive to be deserialized
|
||||
* @param string $class class name is passed as a string
|
||||
* @return object an instance of $class
|
||||
*/
|
||||
public static function deserialize($object, $class) {
|
||||
/**
|
||||
* Deserialize a JSON string into an object
|
||||
*
|
||||
* @param object $object object or primitive to be deserialized
|
||||
* @param string $class class name is passed as a string
|
||||
* @return object an instance of $class
|
||||
*/
|
||||
|
||||
if (gettype($object) == "NULL") {
|
||||
return $object;
|
||||
}
|
||||
|
||||
if (substr($class, 0, 6) == 'array[') {
|
||||
$sub_class = substr($class, 6, -1);
|
||||
$sub_objects = array();
|
||||
foreach ($object as $sub_object) {
|
||||
$sub_objects[] = self::deserialize($sub_object,
|
||||
$sub_class);
|
||||
public static function deserialize($data, $class)
|
||||
{
|
||||
if (null === $data) {
|
||||
$deserialized = null;
|
||||
} else if (substr($class, 0, 6) == 'array[') {
|
||||
$subClass = substr($class, 6, -1);
|
||||
$values = array();
|
||||
foreach ($data as $value) {
|
||||
$values[] = self::deserialize($value, $subClass);
|
||||
}
|
||||
return $sub_objects;
|
||||
$deserialized = $values;
|
||||
} elseif ($class == 'DateTime') {
|
||||
return new DateTime($object);
|
||||
} elseif (in_array($class, array('string', 'int', 'float', 'bool'))) {
|
||||
settype($object, $class);
|
||||
return $object;
|
||||
} else {
|
||||
$instance = new $class(); // this instantiates class named $class
|
||||
$classVars = get_class_vars($class);
|
||||
}
|
||||
$deserialized = new \DateTime($data);
|
||||
} elseif (in_array($class, array('string', 'int', 'float', 'bool'))) {
|
||||
settype($data, $class);
|
||||
$deserialized = $data;
|
||||
} else {
|
||||
$instance = new $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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
@ -29,10 +29,15 @@ class WordApi {
|
||||
* getExamples
|
||||
* Returns examples for a word
|
||||
* word, string: Word to return examples for (required)
|
||||
|
||||
* includeDuplicates, string: Show duplicate examples from different sources (optional)
|
||||
|
||||
* useCanonical, string: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* skip, int: Results to skip (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return ExampleSearchResults
|
||||
*/
|
||||
|
||||
@ -44,6 +49,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($includeDuplicates != null) {
|
||||
$queryParams['includeDuplicates'] = $this->apiClient->toQueryValue($includeDuplicates);
|
||||
@ -83,8 +90,11 @@ class WordApi {
|
||||
* getWord
|
||||
* Given a word as a string, returns the WordObject that represents it
|
||||
* word, string: String value of WordObject to return (required)
|
||||
|
||||
* useCanonical, string: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* includeSuggestions, string: Return suggestions (for correct spelling, case variants, etc.) (optional)
|
||||
|
||||
* @return WordObject
|
||||
*/
|
||||
|
||||
@ -96,6 +106,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($useCanonical != null) {
|
||||
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
|
||||
@ -129,12 +141,19 @@ class WordApi {
|
||||
* getDefinitions
|
||||
* Return definitions for a word
|
||||
* word, string: Word to return definitions for (required)
|
||||
|
||||
* 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)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* includeRelated, string: Return related words with definitions (optional)
|
||||
|
||||
* useCanonical, string: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* includeTags, string: Return a closed set of XML tags in response (optional)
|
||||
|
||||
* @return array[Definition]
|
||||
*/
|
||||
|
||||
@ -146,6 +165,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($limit != null) {
|
||||
$queryParams['limit'] = $this->apiClient->toQueryValue($limit);
|
||||
@ -191,7 +212,9 @@ class WordApi {
|
||||
* getTopExample
|
||||
* Returns a top example for a word
|
||||
* word, string: Word to fetch examples for (required)
|
||||
|
||||
* useCanonical, string: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* @return Example
|
||||
*/
|
||||
|
||||
@ -203,6 +226,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($useCanonical != null) {
|
||||
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
|
||||
@ -233,9 +258,13 @@ class WordApi {
|
||||
* getRelatedWords
|
||||
* Given a word as a string, returns relationships from the Word Graph
|
||||
* word, string: Word to fetch relationships for (required)
|
||||
|
||||
* 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' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* limitPerRelationshipType, int: Restrict to the supplied relatinship types (optional)
|
||||
|
||||
* @return array[Related]
|
||||
*/
|
||||
|
||||
@ -247,6 +276,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($useCanonical != null) {
|
||||
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
|
||||
@ -283,10 +314,15 @@ class WordApi {
|
||||
* getTextPronunciations
|
||||
* Returns text pronunciations for a given word
|
||||
* word, string: Word to get pronunciations for (required)
|
||||
|
||||
* sourceDictionary, string: Get from a single dictionary (optional)
|
||||
|
||||
* typeFormat, string: Text pronunciation type (optional)
|
||||
|
||||
* useCanonical, string: If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return array[TextPron]
|
||||
*/
|
||||
|
||||
@ -298,6 +334,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($useCanonical != null) {
|
||||
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
|
||||
@ -337,9 +375,13 @@ class WordApi {
|
||||
* getHyphenation
|
||||
* Returns syllable information for a word
|
||||
* word, string: Word to get syllables for (required)
|
||||
|
||||
* 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' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return array[Syllable]
|
||||
*/
|
||||
|
||||
@ -351,6 +393,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($useCanonical != null) {
|
||||
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
|
||||
@ -387,9 +431,13 @@ class WordApi {
|
||||
* getWordFrequency
|
||||
* Returns word usage over time
|
||||
* word, string: Word to return (required)
|
||||
|
||||
* useCanonical, string: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* startYear, int: Starting Year (optional)
|
||||
|
||||
* endYear, int: Ending Year (optional)
|
||||
|
||||
* @return FrequencySummary
|
||||
*/
|
||||
|
||||
@ -401,6 +449,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($useCanonical != null) {
|
||||
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
|
||||
@ -437,9 +487,13 @@ class WordApi {
|
||||
* getPhrases
|
||||
* Fetches bi-gram phrases for a word
|
||||
* word, string: Word to fetch phrases for (required)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* wlmi, int: Minimum WLMI for the phrase (optional)
|
||||
|
||||
* useCanonical, string: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* @return array[Bigram]
|
||||
*/
|
||||
|
||||
@ -451,6 +505,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($limit != null) {
|
||||
$queryParams['limit'] = $this->apiClient->toQueryValue($limit);
|
||||
@ -487,7 +543,9 @@ class WordApi {
|
||||
* getEtymologies
|
||||
* Fetches etymology data
|
||||
* word, string: Word to return (required)
|
||||
|
||||
* useCanonical, string: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
|
||||
|
||||
* @return array[string]
|
||||
*/
|
||||
|
||||
@ -499,6 +557,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($useCanonical != null) {
|
||||
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
|
||||
@ -529,8 +589,11 @@ class WordApi {
|
||||
* getAudio
|
||||
* Fetches audio metadata for a word.
|
||||
* word, string: Word to get audio for. (required)
|
||||
|
||||
* useCanonical, string: Use the canonical form of the word (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return array[AudioFile]
|
||||
*/
|
||||
|
||||
@ -542,6 +605,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($useCanonical != null) {
|
||||
$queryParams['useCanonical'] = $this->apiClient->toQueryValue($useCanonical);
|
||||
@ -575,6 +640,7 @@ class WordApi {
|
||||
* getScrabbleScore
|
||||
* Returns the Scrabble score for a word
|
||||
* word, string: Word to get scrabble score for. (required)
|
||||
|
||||
* @return ScrabbleScoreResult
|
||||
*/
|
||||
|
||||
@ -586,6 +652,8 @@ class WordApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($word != null) {
|
||||
$resourcePath = str_replace("{" . "word" . "}",
|
||||
@ -610,5 +678,6 @@ class WordApi {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,11 @@ class WordListApi {
|
||||
* updateWordList
|
||||
* Updates an existing WordList
|
||||
* permalink, string: permalink of WordList to update (required)
|
||||
|
||||
* 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)
|
||||
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -42,6 +45,8 @@ class WordListApi {
|
||||
$method = "PUT";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($auth_token != null) {
|
||||
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
|
||||
@ -64,7 +69,9 @@ class WordListApi {
|
||||
* deleteWordList
|
||||
* Deletes an existing WordList
|
||||
* 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)
|
||||
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -76,6 +83,8 @@ class WordListApi {
|
||||
$method = "DELETE";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($auth_token != null) {
|
||||
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
|
||||
@ -98,7 +107,9 @@ class WordListApi {
|
||||
* getWordListByPermalink
|
||||
* Fetches a WordList by ID
|
||||
* 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)
|
||||
|
||||
* @return WordList
|
||||
*/
|
||||
|
||||
@ -110,6 +121,8 @@ class WordListApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($auth_token != null) {
|
||||
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
|
||||
@ -140,8 +153,11 @@ class WordListApi {
|
||||
* addWordsToWordList
|
||||
* Adds words to a WordList
|
||||
* permalink, string: permalink of WordList to user (required)
|
||||
|
||||
* 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)
|
||||
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -153,6 +169,8 @@ class WordListApi {
|
||||
$method = "POST";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($auth_token != null) {
|
||||
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
|
||||
@ -175,11 +193,17 @@ class WordListApi {
|
||||
* getWordListWords
|
||||
* Fetches words in a WordList
|
||||
* 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)
|
||||
|
||||
* sortBy, string: Field to sort by (optional)
|
||||
|
||||
* sortOrder, string: Direction to sort (optional)
|
||||
|
||||
* skip, int: Results to skip (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return array[WordListWord]
|
||||
*/
|
||||
|
||||
@ -191,6 +215,8 @@ class WordListApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($sortBy != null) {
|
||||
$queryParams['sortBy'] = $this->apiClient->toQueryValue($sortBy);
|
||||
@ -233,8 +259,11 @@ class WordListApi {
|
||||
* deleteWordsFromWordList
|
||||
* Removes words from a WordList
|
||||
* permalink, string: permalink of WordList to use (required)
|
||||
|
||||
* 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)
|
||||
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -246,6 +275,8 @@ class WordListApi {
|
||||
$method = "POST";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($auth_token != null) {
|
||||
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
|
||||
@ -265,5 +296,6 @@ class WordListApi {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,9 @@ class WordListsApi {
|
||||
* createWordList
|
||||
* Creates a WordList.
|
||||
* 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)
|
||||
|
||||
* @return WordList
|
||||
*/
|
||||
|
||||
@ -41,6 +43,8 @@ class WordListsApi {
|
||||
$method = "POST";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($auth_token != null) {
|
||||
$headerParams['auth_token'] = $this->apiClient->toHeaderValue($auth_token);
|
||||
@ -64,5 +68,6 @@ class WordListsApi {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -29,17 +29,29 @@ class WordsApi {
|
||||
* searchWords
|
||||
* Searches words
|
||||
* query, string: Search query (required)
|
||||
|
||||
* includePartOfSpeech, string: Only include these comma-delimited parts of speech (optional)
|
||||
|
||||
* excludePartOfSpeech, string: Exclude these comma-delimited parts of speech (optional)
|
||||
|
||||
* caseSensitive, string: Search case sensitive (optional)
|
||||
|
||||
* minCorpusCount, int: Minimum corpus frequency for terms (optional)
|
||||
|
||||
* maxCorpusCount, int: Maximum corpus frequency for terms (optional)
|
||||
|
||||
* minDictionaryCount, int: Minimum number of dictionary entries for words returned (optional)
|
||||
|
||||
* maxDictionaryCount, int: Maximum dictionary definition count (optional)
|
||||
|
||||
* minLength, int: Minimum word length (optional)
|
||||
|
||||
* maxLength, int: Maximum word length (optional)
|
||||
|
||||
* skip, int: Results to skip (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return WordSearchResults
|
||||
*/
|
||||
|
||||
@ -51,6 +63,8 @@ class WordsApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($caseSensitive != null) {
|
||||
$queryParams['caseSensitive'] = $this->apiClient->toQueryValue($caseSensitive);
|
||||
@ -111,6 +125,7 @@ class WordsApi {
|
||||
* getWordOfTheDay
|
||||
* Returns a specific WordOfTheDay
|
||||
* date, string: Fetches by date in yyyy-MM-dd (optional)
|
||||
|
||||
* @return WordOfTheDay
|
||||
*/
|
||||
|
||||
@ -122,6 +137,8 @@ class WordsApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($date != null) {
|
||||
$queryParams['date'] = $this->apiClient->toQueryValue($date);
|
||||
@ -148,21 +165,37 @@ class WordsApi {
|
||||
* reverseDictionary
|
||||
* Reverse dictionary search
|
||||
* query, string: Search term (required)
|
||||
|
||||
* findSenseForWord, string: Restricts words and finds closest sense (optional)
|
||||
|
||||
* includeSourceDictionaries, string: Only include 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)
|
||||
|
||||
* excludePartOfSpeech, string: Exclude these comma-delimited parts of speech (optional)
|
||||
|
||||
* expandTerms, string: Expand terms (optional)
|
||||
|
||||
* sortBy, string: Attribute to sort by (optional)
|
||||
|
||||
* sortOrder, string: Sort direction (optional)
|
||||
|
||||
* minCorpusCount, int: Minimum corpus frequency for terms (optional)
|
||||
|
||||
* maxCorpusCount, int: Maximum corpus frequency for terms (optional)
|
||||
|
||||
* minLength, int: Minimum word length (optional)
|
||||
|
||||
* maxLength, int: Maximum word length (optional)
|
||||
|
||||
* includeTags, string: Return a closed set of XML tags in response (optional)
|
||||
|
||||
* skip, string: Results to skip (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return DefinitionSearchResults
|
||||
*/
|
||||
|
||||
@ -174,6 +207,8 @@ class WordsApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($query != null) {
|
||||
$queryParams['query'] = $this->apiClient->toQueryValue($query);
|
||||
@ -245,17 +280,29 @@ class WordsApi {
|
||||
* getRandomWords
|
||||
* Returns an array of random WordObjects
|
||||
* includePartOfSpeech, string: CSV part-of-speech values to include (optional)
|
||||
|
||||
* excludePartOfSpeech, string: CSV part-of-speech values to exclude (optional)
|
||||
|
||||
* sortBy, string: Attribute to sort by (optional)
|
||||
|
||||
* sortOrder, string: Sort direction (optional)
|
||||
|
||||
* hasDictionaryDef, string: Only return words with dictionary definitions (optional)
|
||||
|
||||
* minCorpusCount, int: Minimum corpus frequency for terms (optional)
|
||||
|
||||
* maxCorpusCount, int: Maximum corpus frequency for terms (optional)
|
||||
|
||||
* minDictionaryCount, int: Minimum dictionary count (optional)
|
||||
|
||||
* maxDictionaryCount, int: Maximum dictionary count (optional)
|
||||
|
||||
* minLength, int: Minimum word length (optional)
|
||||
|
||||
* maxLength, int: Maximum word length (optional)
|
||||
|
||||
* limit, int: Maximum number of results to return (optional)
|
||||
|
||||
* @return array[WordObject]
|
||||
*/
|
||||
|
||||
@ -267,6 +314,8 @@ class WordsApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($hasDictionaryDef != null) {
|
||||
$queryParams['hasDictionaryDef'] = $this->apiClient->toQueryValue($hasDictionaryDef);
|
||||
@ -326,14 +375,23 @@ class WordsApi {
|
||||
* getRandomWord
|
||||
* Returns a single random WordObject
|
||||
* includePartOfSpeech, string: CSV part-of-speech values to include (optional)
|
||||
|
||||
* excludePartOfSpeech, string: CSV part-of-speech values to exclude (optional)
|
||||
|
||||
* hasDictionaryDef, string: Only return words with dictionary definitions (optional)
|
||||
|
||||
* minCorpusCount, int: Minimum corpus frequency for terms (optional)
|
||||
|
||||
* maxCorpusCount, int: Maximum corpus frequency for terms (optional)
|
||||
|
||||
* minDictionaryCount, int: Minimum dictionary count (optional)
|
||||
|
||||
* maxDictionaryCount, int: Maximum dictionary count (optional)
|
||||
|
||||
* minLength, int: Minimum word length (optional)
|
||||
|
||||
* maxLength, int: Maximum word length (optional)
|
||||
|
||||
* @return WordObject
|
||||
*/
|
||||
|
||||
@ -345,6 +403,8 @@ class WordsApi {
|
||||
$method = "GET";
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
$headerParams['Accept'] = '(mediaType,application/json)';
|
||||
$headerParams['Content-Type'] = '';
|
||||
|
||||
if($hasDictionaryDef != null) {
|
||||
$queryParams['hasDictionaryDef'] = $this->apiClient->toQueryValue($hasDictionaryDef);
|
||||
@ -392,5 +452,6 @@ class WordsApi {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user