Skip to content

Commit 42356e3

Browse files
committed
feat(specs): add cURL snippets (#3841) (generated) [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 6c30320 commit 42356e3

14 files changed

+4618
-9784
lines changed

specs/bundled/abtesting.doc.yml

Lines changed: 30 additions & 204 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,16 @@ paths:
13861386
))
13871387
13881388
// >LOG
1389+
- lang: cURL
1390+
label: curl
1391+
source: |-
1392+
curl --request POST \
1393+
--url https://analytics.us.algolia.com/2/abtests \
1394+
--header 'accept: application/json' \
1395+
--header 'content-type: application/json' \
1396+
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
1397+
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
1398+
--data '{"name":"Custom ranking sales rank test","variants":[{"index":"delcourt_production","trafficPercentage":60,"description":"Current production index"},{"index":"delcourt_production","trafficPercentage":60,"description":"Current production index"}],"endAt":"2023-06-17T00:00:00Z"}'
13891399
get:
13901400
tags:
13911401
- abtest
@@ -1660,6 +1670,16 @@ paths:
16601670
let response = try await client.listABTests()
16611671
16621672
// >LOG
1673+
- lang: cURL
1674+
label: curl
1675+
source: |-
1676+
curl --request POST \
1677+
--url https://analytics.us.algolia.com/2/abtests \
1678+
--header 'accept: application/json' \
1679+
--header 'content-type: application/json' \
1680+
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
1681+
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
1682+
--data '{"name":"Custom ranking sales rank test","variants":[{"index":"delcourt_production","trafficPercentage":60,"description":"Current production index"},{"index":"delcourt_production","trafficPercentage":60,"description":"Current production index"}],"endAt":"2023-06-17T00:00:00Z"}'
16631683
/2/abtests/{id}:
16641684
get:
16651685
tags:
@@ -1928,210 +1948,6 @@ paths:
19281948
$ref: '#/components/responses/MethodNotAllowed'
19291949
'404':
19301950
$ref: '#/components/responses/IndexNotFound'
1931-
x-codeSamples:
1932-
- lang: csharp
1933-
label: C#
1934-
source: |
1935-
// Initialize the client
1936-
var client = new AbtestingClient(
1937-
new AbtestingConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
1938-
);
1939-
1940-
// Call the API
1941-
var response = await client.DeleteABTestAsync(42);
1942-
// >LOG
1943-
- lang: go
1944-
label: Go
1945-
source: >
1946-
// Initialize the client with your application region, eg.
1947-
abtesting.ALGOLIA_APPLICATION_REGION
1948-
1949-
client, err := abtesting.NewClient("ALGOLIA_APPLICATION_ID",
1950-
"ALGOLIA_API_KEY", abtesting.US)
1951-
1952-
if err != nil {
1953-
// The client can fail to initialize if you pass an invalid parameter.
1954-
panic(err)
1955-
}
1956-
1957-
1958-
// Call the API
1959-
1960-
response, err :=
1961-
client.DeleteABTest(client.NewApiDeleteABTestRequest(
1962-
42,
1963-
))
1964-
1965-
if err != nil {
1966-
// handle the eventual error
1967-
panic(err)
1968-
}
1969-
1970-
1971-
// >LOG
1972-
1973-
// use the model directly
1974-
1975-
print(response)
1976-
- lang: java
1977-
label: Java
1978-
source: >
1979-
// Initialize the client
1980-
1981-
AbtestingClient client = new
1982-
AbtestingClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY",
1983-
"ALGOLIA_APPLICATION_REGION");
1984-
1985-
1986-
// Call the API
1987-
1988-
client.deleteABTest(42);
1989-
1990-
// >LOG
1991-
- lang: javascript
1992-
label: JavaScript
1993-
source: >
1994-
// Initialize the client
1995-
1996-
// Replace 'us' with your Algolia Application Region
1997-
1998-
const client = abtestingClient('ALGOLIA_APPLICATION_ID',
1999-
'ALGOLIA_API_KEY', 'us');
2000-
2001-
2002-
// Call the API
2003-
2004-
const response = await client.deleteABTest({ id: 42 });
2005-
2006-
2007-
// >LOG
2008-
2009-
// use typed response
2010-
2011-
console.log(response);
2012-
- lang: kotlin
2013-
label: Kotlin
2014-
source: >
2015-
// Initialize the client
2016-
2017-
val client = AbtestingClient(appId = "ALGOLIA_APPLICATION_ID",
2018-
apiKey = "ALGOLIA_API_KEY", region = "ALGOLIA_APPLICATION_REGION")
2019-
2020-
2021-
// Call the API
2022-
2023-
var response = client.deleteABTest(
2024-
id = 42,
2025-
)
2026-
2027-
2028-
// >LOG
2029-
2030-
// Use the response
2031-
2032-
println(response)
2033-
- lang: php
2034-
label: PHP
2035-
source: >
2036-
// Initialize the client
2037-
2038-
$client = AbtestingClient::create('ALGOLIA_APPLICATION_ID',
2039-
'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');
2040-
2041-
2042-
// Call the API
2043-
2044-
$response = $client->deleteABTest(
2045-
42,
2046-
);
2047-
2048-
2049-
// >LOG
2050-
2051-
// play with the response
2052-
2053-
var_dump($response);
2054-
- lang: python
2055-
label: Python
2056-
source: >
2057-
# Initialize the client
2058-
2059-
# In an asynchronous context, you can use AbtestingClient instead,
2060-
which exposes the exact same methods.
2061-
2062-
client = AbtestingClientSync(
2063-
"ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
2064-
)
2065-
2066-
2067-
# Call the API
2068-
2069-
response = client.delete_ab_test(
2070-
id=42,
2071-
)
2072-
2073-
2074-
# >LOG
2075-
2076-
# use the class directly
2077-
2078-
print(response)
2079-
- lang: ruby
2080-
label: Ruby
2081-
source: >
2082-
# Initialize the client
2083-
2084-
client = Algolia::AbtestingClient.create("ALGOLIA_APPLICATION_ID",
2085-
"ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
2086-
2087-
2088-
# Call the API
2089-
2090-
response = client.delete_ab_test(42)
2091-
2092-
2093-
# >LOG
2094-
2095-
# use the class directly
2096-
2097-
puts(response)
2098-
2099-
2100-
# print the JSON response
2101-
2102-
puts(response.to_json)
2103-
- lang: scala
2104-
label: Scala
2105-
source: |
2106-
// Initialize the client
2107-
val client = AbtestingClient(
2108-
appId = "ALGOLIA_APPLICATION_ID",
2109-
apiKey = "ALGOLIA_API_KEY",
2110-
region = Option("ALGOLIA_APPLICATION_REGION")
2111-
)
2112-
2113-
// Call the API
2114-
val response = client.deleteABTest(
2115-
id = 42
2116-
)
2117-
2118-
// >LOG
2119-
// Use the response
2120-
val value = Await.result(response, Duration(100, "sec"))
2121-
- lang: swift
2122-
label: Swift
2123-
source: >
2124-
// Initialize the client
2125-
2126-
let client = try AbtestingClient(appID: "ALGOLIA_APPLICATION_ID",
2127-
apiKey: "ALGOLIA_API_KEY", region: .us)
2128-
2129-
2130-
// Call the API
2131-
2132-
let response = try await client.deleteABTest(id: 42)
2133-
2134-
// >LOG
21351951
/2/abtests/{id}/stop:
21361952
post:
21371953
tags:
@@ -2743,6 +2559,16 @@ paths:
27432559
))
27442560
27452561
// >LOG
2562+
- lang: cURL
2563+
label: curl
2564+
source: |-
2565+
curl --request POST \
2566+
--url https://analytics.us.algolia.com/2/abtests/schedule \
2567+
--header 'accept: application/json' \
2568+
--header 'content-type: application/json' \
2569+
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
2570+
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
2571+
--data '{"name":"Custom ranking sales rank test","variants":[{"index":"delcourt_production","trafficPercentage":60,"description":"Current production index"},{"index":"delcourt_production","trafficPercentage":60,"description":"Current production index"}],"scheduledAt":"2023-06-15T15:06:44.400601Z","endAt":"2023-06-17T00:00:00Z"}'
27462572
components:
27472573
securitySchemes:
27482574
appId:

specs/bundled/algoliasearch.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,23 +134,23 @@ servers:
134134
- url: https://{appId}.algolia.net
135135
variables:
136136
appId:
137-
default: myAppId
137+
default: ALGOLIA_APPLICATION_ID
138138
- url: https://{appId}-1.algolianet.com
139139
variables:
140140
appId:
141-
default: myAppId
141+
default: ALGOLIA_APPLICATION_ID
142142
- url: https://{appId}-2.algolianet.com
143143
variables:
144144
appId:
145-
default: myAppId
145+
default: ALGOLIA_APPLICATION_ID
146146
- url: https://{appId}-3.algolianet.com
147147
variables:
148148
appId:
149-
default: myAppId
149+
default: ALGOLIA_APPLICATION_ID
150150
- url: https://{appId}-dsn.algolia.net
151151
variables:
152152
appId:
153-
default: myAppId
153+
default: ALGOLIA_APPLICATION_ID
154154
security:
155155
- appId: []
156156
apiKey: []

0 commit comments

Comments
 (0)