Skip to content

Commit 2f7d20e

Browse files
algolia-botshortcutsFluf22
committed
guides: add missing snippets to docs (#4391) (generated) [skip ci]
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent ad43bfb commit 2f7d20e

File tree

132 files changed

+83049
-13082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+83049
-13082
lines changed

clients/algoliasearch-client-python/algoliasearch/ingestion/client.py

+304-140
Large diffs are not rendered by default.

docs/bundled/abtesting-snippets.json

+205-55
Large diffs are not rendered by default.

docs/bundled/analytics-snippets.json

+585-235
Large diffs are not rendered by default.

docs/bundled/composition-full-snippets.json

+19-5
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,30 @@
88
"default": "import { compositionClient } from '@algolia/client-composition';"
99
},
1010
"customDelete": {
11-
"default": "const response = await client.customDelete({ path: 'test/minimal' });"
11+
"allow del method for a custom path with minimal parameters": "const response = await client.customDelete({ path: 'test/minimal' });",
12+
"allow del method for a custom path with all parameters": "const response = await client.customDelete({ path: 'test/all', parameters: { query: 'parameters' } });"
1213
},
1314
"customGet": {
14-
"default": "const response = await client.customGet({ path: 'test/minimal' });"
15+
"allow get method for a custom path with minimal parameters": "const response = await client.customGet({ path: 'test/minimal' });",
16+
"allow get method for a custom path with all parameters": "const response = await client.customGet({ path: 'test/all', parameters: { query: 'parameters with space' } });",
17+
"requestOptions should be escaped too": "const response = await client.customGet(\n { path: 'test/all', parameters: { query: 'to be overriden' } },\n {\n queryParameters: { query: 'parameters with space', 'and an array': ['array', 'with spaces'] },\n headers: { 'x-header-1': 'spaces are left alone' },\n },\n);"
1518
},
1619
"customPost": {
17-
"default": "const response = await client.customPost({ path: 'test/minimal' });"
20+
"allow post method for a custom path with minimal parameters": "const response = await client.customPost({ path: 'test/minimal' });",
21+
"allow post method for a custom path with all parameters": "const response = await client.customPost({\n path: 'test/all',\n parameters: { query: 'parameters' },\n body: { body: 'parameters' },\n});",
22+
"requestOptions can override default query parameters": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { query: 'myQueryParameter' },\n },\n);",
23+
"requestOptions merges query parameters with default ones": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { query2: 'myQueryParameter' },\n },\n);",
24+
"requestOptions can override default headers": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n headers: { 'x-algolia-api-key': 'ALGOLIA_API_KEY' },\n },\n);",
25+
"requestOptions merges headers with default ones": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n headers: { 'x-algolia-api-key': 'ALGOLIA_API_KEY' },\n },\n);",
26+
"requestOptions queryParameters accepts booleans": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { isItWorking: true },\n },\n);",
27+
"requestOptions queryParameters accepts integers": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { myParam: 2 },\n },\n);",
28+
"requestOptions queryParameters accepts list of string": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { myParam: ['b and c', 'd'] },\n },\n);",
29+
"requestOptions queryParameters accepts list of booleans": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { myParam: [true, true, false] },\n },\n);",
30+
"requestOptions queryParameters accepts list of integers": "const response = await client.customPost(\n { path: 'test/requestOptions', parameters: { query: 'parameters' }, body: { facet: 'filters' } },\n {\n queryParameters: { myParam: [1, 2] },\n },\n);"
1831
},
1932
"customPut": {
20-
"default": "const response = await client.customPut({ path: 'test/minimal' });"
33+
"allow put method for a custom path with minimal parameters": "const response = await client.customPut({ path: 'test/minimal' });",
34+
"allow put method for a custom path with all parameters": "const response = await client.customPut({\n path: 'test/all',\n parameters: { query: 'parameters' },\n body: { body: 'parameters' },\n});"
2135
},
2236
"getComposition": {
2337
"default": "const response = await client.getComposition({ compositionID: 'foo' });"
@@ -29,7 +43,7 @@
2943
"default": "const response = await client.getTask({ compositionID: 'foo', taskID: 42 });"
3044
},
3145
"listCompositions": {
32-
"default": "const response = await client.listCompositions();"
46+
"listCompositions": "const response = await client.listCompositions();"
3347
},
3448
"multipleBatch": {
3549
"default": "const response = await client.multipleBatch({\n requests: [\n {\n action: 'upsert',\n body: {\n objectID: 'foo',\n name: 'my first composition',\n behavior: { injection: { main: { source: { search: { index: 'bar' } } }, injectedItems: [] } },\n },\n },\n { action: 'delete', body: { objectID: 'baz' } },\n ],\n});"

docs/bundled/composition-snippets.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"csharp": {
33
"import": {
4-
"default": "using Algolia.Search.Clients;\nusing Algolia.Search.Models.Composition;"
4+
"default": "using Algolia.Search.Clients;\nusing Algolia.Search.Http;\nusing Algolia.Search.Models.Composition;"
55
},
66
"search": {
77
"default": "var response = await client.SearchAsync<Hit>(\n \"foo\",\n new RequestBody { Params = new Params { Query = \"batman\" } }\n);"
@@ -43,7 +43,7 @@
4343
},
4444
"java": {
4545
"import": {
46-
"default": "import com.algolia.api.CompositionClient;\nimport com.algolia.model.composition.*;"
46+
"default": "import com.algolia.api.CompositionClient;\nimport com.algolia.config.*;"
4747
},
4848
"search": {
4949
"default": "client.search(\"foo\", new RequestBody().setParams(new Params().setQuery(\"batman\")), Hit.class);"
@@ -71,7 +71,7 @@
7171
},
7272
"kotlin": {
7373
"import": {
74-
"default": "import com.algolia.client.api.CompositionClient"
74+
"default": "import com.algolia.client.api.CompositionClient\nimport com.algolia.client.configuration.*\nimport com.algolia.client.transport.*\nimport com.algolia.client.model.composition.RequestBody"
7575
},
7676
"search": {
7777
"default": "var response = client.search(\n compositionID = \"foo\",\n requestBody = RequestBody(\n params = Params(\n query = \"batman\",\n ),\n ),\n)"
@@ -127,7 +127,7 @@
127127
},
128128
"scala": {
129129
"import": {
130-
"default": "import algoliasearch.api.CompositionClient"
130+
"default": "import algoliasearch.api.CompositionClient\nimport algoliasearch.config.*"
131131
},
132132
"search": {
133133
"default": "val response = client.search(\n compositionID = \"foo\",\n requestBody = RequestBody(\n params = Some(\n Params(\n query = Some(\"batman\")\n )\n )\n )\n)"

0 commit comments

Comments
 (0)