Skip to content

Commit dec552f

Browse files
algolia-botkai687shortcuts
committed
fix(specs): dictionary entry for stopwords has type property (generated)
algolia/api-clients-automation#3456 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Kai Welke <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 217138b commit dec552f

File tree

3 files changed

+71
-1
lines changed

3 files changed

+71
-1
lines changed

src/main/scala/algoliasearch/search/DictionaryEntry.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
package algoliasearch.search
3535

3636
import algoliasearch.search.DictionaryEntryState._
37+
import algoliasearch.search.DictionaryEntryType._
3738
import algoliasearch.search.SupportedLanguage._
3839

3940
import org.json4s.MonadicJValue.jvalueToMonadic
@@ -57,6 +58,7 @@ case class DictionaryEntry(
5758
words: Option[Seq[String]] = scala.None,
5859
decomposition: Option[Seq[String]] = scala.None,
5960
state: Option[DictionaryEntryState] = scala.None,
61+
`type`: Option[DictionaryEntryType] = scala.None,
6062
additionalProperties: Option[List[JField]] = None
6163
)
6264

@@ -70,7 +72,7 @@ class DictionaryEntrySerializer extends Serializer[DictionaryEntry] {
7072
val mf = manifest[DictionaryEntry]
7173
val obj = Extraction.extract[DictionaryEntry](jobject)(formats, mf)
7274

73-
val fields = Set("objectID", "language", "word", "words", "decomposition", "state")
75+
val fields = Set("objectID", "language", "word", "words", "decomposition", "state", "`type`")
7476
val additionalProperties = jobject removeField {
7577
case (name, _) if fields.contains(name) => true
7678
case _ => false
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/** Search API The Algolia Search API lets you search, configure, and mange your indices and records. ## Client
2+
* libraries Use Algolia's API clients and libraries to reliably integrate Algolia's APIs with your apps. The official
3+
* API clients are covered by Algolia's [Service Level Agreement](https://www.algolia.com/policies/sla/). See:
4+
* [Algolia's ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) ##
5+
* Base URLs The base URLs for requests to the Search API are: - `https://{APPLICATION_ID}.algolia.net` -
6+
* `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search
7+
* Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both
8+
* URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ##
9+
* Retry strategy To guarantee a high availability, implement a retry strategy for all API requests using the URLs of
10+
* your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` -
11+
* `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different
12+
* DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers.
13+
* All Algolia API clients implement this retry strategy. ## Authentication To authenticate your API requests, add
14+
* these headers: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the
15+
* necessary permissions to make the request. The required access control list (ACL) to make a request is listed in
16+
* each endpoint's reference. You can find your application ID and API key in the [Algolia
17+
* dashboard](https://dashboard.algolia.com/account). ## Request format Depending on the endpoint, request bodies are
18+
* either JSON objects or arrays of JSON objects, ## Parameters Parameters are passed as query parameters for GET and
19+
* DELETE requests, and in the request body for POST and PUT requests. Query parameters must be
20+
* [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). Non-ASCII characters must be
21+
* UTF-8 encoded. Plus characters (`+`) are interpreted as spaces. Arrays as query parameters must be one of: - A
22+
* comma-separated string: `attributesToRetrieve=title,description` - A URL-encoded JSON array:
23+
* `attributesToRetrieve=%5B%22title%22,%22description%22%D` ## Response status and errors The Search API returns JSON
24+
* responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API
25+
* response. Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are
26+
* indicated by a `5xx` status. Error responses have a `message` property with more information. ## Version The current
27+
* version of the Search API is version 1, as indicated by the `/1/` in each endpoint's URL.
28+
*
29+
* The version of the OpenAPI document: 1.0.0
30+
*
31+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
32+
* https://openapi-generator.tech Do not edit the class manually.
33+
*/
34+
package algoliasearch.search
35+
36+
import org.json4s._
37+
38+
sealed trait DictionaryEntryType
39+
40+
/** Whether a dictionary entry is provided by Algolia (standard), or has been added by you (custom).
41+
*/
42+
object DictionaryEntryType {
43+
case object Custom extends DictionaryEntryType {
44+
override def toString = "custom"
45+
}
46+
case object Standard extends DictionaryEntryType {
47+
override def toString = "standard"
48+
}
49+
val values: Seq[DictionaryEntryType] = Seq(Custom, Standard)
50+
51+
def withName(name: String): DictionaryEntryType = DictionaryEntryType.values
52+
.find(_.toString == name)
53+
.getOrElse(throw new MappingException(s"Unknown DictionaryEntryType value: $name"))
54+
}
55+
56+
class DictionaryEntryTypeSerializer
57+
extends CustomSerializer[DictionaryEntryType](_ =>
58+
(
59+
{
60+
case JString(value) => DictionaryEntryType.withName(value)
61+
case JNull => null
62+
},
63+
{ case value: DictionaryEntryType =>
64+
JString(value.toString)
65+
}
66+
)
67+
)

src/main/scala/algoliasearch/search/JsonSupport.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ object JsonSupport {
4747
new BuiltInOperationTypeSerializer() :+
4848
new DictionaryActionSerializer() :+
4949
new DictionaryEntryStateSerializer() :+
50+
new DictionaryEntryTypeSerializer() :+
5051
new DictionaryTypeSerializer() :+
5152
new EditTypeSerializer() :+
5253
new ExactOnSingleWordQuerySerializer() :+

0 commit comments

Comments
 (0)