Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Jun 25, 2019
1 parent 80d1ba8 commit e0e95ac
Show file tree
Hide file tree
Showing 367 changed files with 441 additions and 24,090 deletions.
70 changes: 2 additions & 68 deletions api/src/main/scala/com/outr/arango/api/APIAnalyzer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,79 +8,13 @@ import io.circe.Json
import scala.concurrent.{ExecutionContext, Future}

object APIAnalyzer {
/**
* Retrieves a an array of all analyzer definitions.
* The resulting array contains objects with the following attributes:
* - *name*: the analyzer name
* - *type*: the analyzer type
* - *properties*: the properties used to configure the specified type
* - *features*: the set of features to set on the analyzer generated fields
*
*
*
*
* **Example:**
* Retrieve all analyzer definitions:
*
* <pre><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer</span>
* </code><code>
* </code><code>HTTP/<span class="hljs-number">1.1</span> OK
* </code><code>content-type: application/json; charset=utf<span class="hljs-number">-8</span>
* </code><code>x-content-type-options: nosniff
* </code><code>
* </code><code>{
* </code><code> <span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
* </code><code> <span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
* </code><code> <span class="hljs-string">"result"</span> : [ ]
* </code><code>}
* </code></pre>
*/

def get(client: HttpClient)(implicit ec: ExecutionContext): Future[Json] = client
.method(HttpMethod.Get)
.path(path"/_api/analyzer", append = true)
.call[Json]

/**
* **A JSON object with these properties is required:**
*
* - **features** (string): The set of features to set on the analyzer generated fields.
* The default value is an empty array.
* - **type**: The analyzer type.
* - **name**: The analyzer name.
* - **properties**: The properties used to configure the specified type.
* Value may be a string, an object or null.
* The default value is *null*.
*
*
*
*
* Creates a new analyzer based on the provided configuration.
*
*
*
*
* **Example:**
*
*
* <pre><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/analyzer</span> &lt;&lt;EOF
* </code><code>{
* </code><code> <span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>,
* </code><code> <span class="hljs-string">"type"</span> : <span class="hljs-string">"identity"</span>
* </code><code>}
* </code><code>EOF
* </code><code>
* </code><code>HTTP/<span class="hljs-number">1.1</span> Created
* </code><code>content-type: application/json; charset=utf<span class="hljs-number">-8</span>
* </code><code>x-content-type-options: nosniff
* </code><code>
* </code><code>{
* </code><code> <span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>,
* </code><code> <span class="hljs-string">"type"</span> : <span class="hljs-string">"identity"</span>,
* </code><code> <span class="hljs-string">"properties"</span> : <span class="hljs-literal">null</span>,
* </code><code> <span class="hljs-string">"features"</span> : [ ]
* </code><code>}
* </code></pre>
*/

def post(client: HttpClient, body: PostAPIAnalyzer)(implicit ec: ExecutionContext): Future[Json] = client
.method(HttpMethod.Post)
.path(path"/_api/analyzer", append = true)
Expand Down
100 changes: 2 additions & 98 deletions api/src/main/scala/com/outr/arango/api/APIAnalyzerAnalyzerName.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,110 +8,14 @@ import io.circe.Json
import scala.concurrent.{ExecutionContext, Future}

object APIAnalyzerAnalyzerName {
/**
* Removes an analyzer configuration identified by *analyzer-name*.
*
* If the analyzer definition was successfully dropped, an object is returned with
* the following attributes:
* - *error*: *false*
* - *name*: The name of the removed analyzer
*
*
*
*
* **Example:**
* Removing without *force*:
*
* <pre><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/_system%3A%3AtestAnalyzer</span>
* </code><code>
* </code><code>HTTP/<span class="hljs-number">1.1</span> OK
* </code><code>content-type: application/json; charset=utf<span class="hljs-number">-8</span>
* </code><code>x-content-type-options: nosniff
* </code><code>
* </code><code>{
* </code><code> <span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
* </code><code> <span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
* </code><code> <span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>
* </code><code>}
* </code></pre>
*
*
*
*
* **Example:**
* Removing with *force*:
*
* <pre><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
* </code><code>{
* </code><code> <span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollection"</span>
* </code><code>}
* </code><code>EOF
* </code><code>
* </code><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view</span> &lt;&lt;EOF
* </code><code>{
* </code><code> <span class="hljs-string">"name"</span> : <span class="hljs-string">"testView"</span>,
* </code><code> <span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
* </code><code> <span class="hljs-string">"links"</span> : {
* </code><code> <span class="hljs-string">"testCollection"</span> : {
* </code><code> <span class="hljs-string">"analyzers"</span> : [
* </code><code> <span class="hljs-string">"_system::testAnalyzer"</span>
* </code><code> ]
* </code><code> }
* </code><code> }
* </code><code>}
* </code><code>EOF
* </code><code>
* </code><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/_system%3A%3AtestAnalyzer?force=<span class="hljs-literal">false</span></span>
* </code><code>
* </code><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/_system%3A%3AtestAnalyzer?force=<span class="hljs-literal">true</span></span>
* </code><code>
* </code><code>HTTP/<span class="hljs-number">1.1</span> OK
* </code><code>content-type: application/json; charset=utf<span class="hljs-number">-8</span>
* </code><code>x-content-type-options: nosniff
* </code><code>
* </code><code>{
* </code><code> <span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
* </code><code> <span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
* </code><code> <span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>
* </code><code>}
* </code></pre>
*/

def delete(client: HttpClient, analyzerName: String, force: Option[Boolean] = None)(implicit ec: ExecutionContext): Future[Json] = client
.method(HttpMethod.Delete)
.path(path"/_api/analyzer/{analyzer-name}".withArguments(Map("analyzer-name" -> analyzerName)), append = true)
.param[Option[Boolean]]("force", force, None)
.call[Json]

/**
* Retrieves the full definition for the specified analyzer name.
* The resulting object contains the following attributes:
* - *name*: the analyzer name
* - *type*: the analyzer type
* - *properties*: the properties used to configure the specified type
* - *features*: the set of features to set on the analyzer generated fields
*
*
*
*
* **Example:**
* Retrieve an analyzer definition:
*
* <pre><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/_system%3A%3AtestAnalyzer</span>
* </code><code>
* </code><code>HTTP/<span class="hljs-number">1.1</span> OK
* </code><code>content-type: application/json; charset=utf<span class="hljs-number">-8</span>
* </code><code>x-content-type-options: nosniff
* </code><code>
* </code><code>{
* </code><code> <span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
* </code><code> <span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
* </code><code> <span class="hljs-string">"type"</span> : <span class="hljs-string">"identity"</span>,
* </code><code> <span class="hljs-string">"properties"</span> : <span class="hljs-string">"test properties"</span>,
* </code><code> <span class="hljs-string">"features"</span> : [ ],
* </code><code> <span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>
* </code><code>}
* </code></pre>
*/

def get(client: HttpClient, analyzerName: String)(implicit ec: ExecutionContext): Future[Json] = client
.method(HttpMethod.Get)
.path(path"/_api/analyzer/{analyzer-name}".withArguments(Map("analyzer-name" -> analyzerName)), append = true)
Expand Down
131 changes: 2 additions & 129 deletions api/src/main/scala/com/outr/arango/api/APIAqlfunction.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,141 +8,14 @@ import io.circe.Json
import scala.concurrent.{ExecutionContext, Future}

object APIAqlfunction {
/**
* Returns all registered AQL user functions.
*
* The call will return a JSON array with status codes and all user functions found under *result*.
*
*
* **HTTP 200**
* *A json document with these Properties is returned:*
*
* on success *HTTP 200* is returned.
*
* - **code**: the HTTP status code
* - **result**: All functions, or the ones matching the *namespace* parameter
* - **isDeterministic**: an optional boolean value to indicate whether the function
* results are fully deterministic (function return value solely depends on
* the input value and return value is the same for repeated calls with same
* input). The *isDeterministic* attribute is currently not used but may be
* used later for optimizations.
* - **code**: A string representation of the function body
* - **name**: The fully qualified name of the user function
* - **error**: boolean flag to indicate whether an error occurred (*false* in this case)
*
*
* **HTTP 400**
* *A json document with these Properties is returned:*
*
* If the user function name is malformed, the server will respond with *HTTP 400*.
*
* - **errorMessage**: a descriptive error message
* - **errorNum**: the server error number
* - **code**: the HTTP status code
* - **error**: boolean flag to indicate whether an error occurred (*true* in this case)
*
*
*
*
* **Example:**
*
*
* <pre><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/aqlfunction/<span class="hljs-built_in">test</span></span>
* </code><code>
* </code><code>HTTP/<span class="hljs-number">1.1</span> OK
* </code><code>content-type: application/json; charset=utf<span class="hljs-number">-8</span>
* </code><code>x-content-type-options: nosniff
* </code><code>
* </code><code>{
* </code><code> <span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
* </code><code> <span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
* </code><code> <span class="hljs-string">"result"</span> : [ ]
* </code><code>}
* </code></pre>
*/

def get(client: HttpClient, namespace: Option[String] = None)(implicit ec: ExecutionContext): Future[GetAPIAqlfunctionRc200] = client
.method(HttpMethod.Get)
.path(path"/_api/aqlfunction", append = true)
.param[Option[String]]("namespace", namespace, None)
.call[GetAPIAqlfunctionRc200]

/**
* **A JSON object with these properties is required:**
*
* - **isDeterministic**: an optional boolean value to indicate whether the function
* results are fully deterministic (function return value solely depends on
* the input value and return value is the same for repeated calls with same
* input). The *isDeterministic* attribute is currently not used but may be
* used later for optimizations.
* - **code**: a string representation of the function body.
* - **name**: the fully qualified name of the user functions.
*
*
*
*
*
* In case of success, HTTP 200 is returned.
* If the function isn't valid etc. HTTP 400 including a detailed error message will be returned.
*
*
* **HTTP 200**
* *A json document with these Properties is returned:*
*
* If the function already existed and was replaced by the
* call, the server will respond with *HTTP 200*.
*
* - **code**: the HTTP status code
* - **isNewlyCreated**: boolean flag to indicate whether the function was newly created (*false* in this case)
* - **error**: boolean flag to indicate whether an error occurred (*false* in this case)
*
*
* **HTTP 201**
* *A json document with these Properties is returned:*
*
* If the function can be registered by the server, the server will respond with
* *HTTP 201*.
*
* - **code**: the HTTP status code
* - **isNewlyCreated**: boolean flag to indicate whether the function was newly created (*true* in this case)
* - **error**: boolean flag to indicate whether an error occurred (*false* in this case)
*
*
* **HTTP 400**
* *A json document with these Properties is returned:*
*
* If the JSON representation is malformed or mandatory data is missing from the
* request, the server will respond with *HTTP 400*.
*
* - **errorMessage**: a descriptive error message
* - **errorNum**: the server error number
* - **code**: the HTTP status code
* - **error**: boolean flag to indicate whether an error occurred (*true* in this case)
*
*
*
*
* **Example:**
*
*
* <pre><code><span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/aqlfunction</span> &lt;&lt;EOF
* </code><code>{
* </code><code> <span class="hljs-string">"name"</span> : <span class="hljs-string">"myfunctions::temperature::celsiustofahrenheit"</span>,
* </code><code> <span class="hljs-string">"code"</span> : <span class="hljs-string">"function (celsius) { return celsius * 1.8 + 32; }"</span>,
* </code><code> <span class="hljs-string">"isDeterministic"</span> : <span class="hljs-literal">true</span>
* </code><code>}
* </code><code>EOF
* </code><code>
* </code><code>HTTP/<span class="hljs-number">1.1</span> Created
* </code><code>content-type: application/json; charset=utf<span class="hljs-number">-8</span>
* </code><code>x-content-type-options: nosniff
* </code><code>
* </code><code>{
* </code><code> <span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
* </code><code> <span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>,
* </code><code> <span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>
* </code><code>}
* </code></pre>
*/

def post(client: HttpClient, body: PostAPIAqlfunction)(implicit ec: ExecutionContext): Future[PostAPIAqlfunctionRc200] = client
.method(HttpMethod.Post)
.path(path"/_api/aqlfunction", append = true)
Expand Down
Loading

0 comments on commit e0e95ac

Please sign in to comment.