Skip to content

Commit

Permalink
Merge branch 'main' into feat/specs-cURL-snippet (generated)
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot committed Oct 8, 2024
1 parent cde8d7e commit c0f90f3
Show file tree
Hide file tree
Showing 14 changed files with 4,618 additions and 9,784 deletions.
234 changes: 30 additions & 204 deletions specs/bundled/abtesting.doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,16 @@ paths:
))
// >LOG
- lang: cURL
label: curl
source: |-
curl --request POST \
--url https://analytics.us.algolia.com/2/abtests \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
--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"}'
get:
tags:
- abtest
Expand Down Expand Up @@ -1660,6 +1670,16 @@ paths:
let response = try await client.listABTests()
// >LOG
- lang: cURL
label: curl
source: |-
curl --request POST \
--url https://analytics.us.algolia.com/2/abtests \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
--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"}'
/2/abtests/{id}:
get:
tags:
Expand Down Expand Up @@ -1928,210 +1948,6 @@ paths:
$ref: '#/components/responses/MethodNotAllowed'
'404':
$ref: '#/components/responses/IndexNotFound'
x-codeSamples:
- lang: csharp
label: C#
source: |
// Initialize the client
var client = new AbtestingClient(
new AbtestingConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
);
// Call the API
var response = await client.DeleteABTestAsync(42);
// >LOG
- lang: go
label: Go
source: >
// Initialize the client with your application region, eg.
abtesting.ALGOLIA_APPLICATION_REGION
client, err := abtesting.NewClient("ALGOLIA_APPLICATION_ID",
"ALGOLIA_API_KEY", abtesting.US)
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
// Call the API
response, err :=
client.DeleteABTest(client.NewApiDeleteABTestRequest(
42,
))
if err != nil {
// handle the eventual error
panic(err)
}
// >LOG
// use the model directly
print(response)
- lang: java
label: Java
source: >
// Initialize the client
AbtestingClient client = new
AbtestingClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY",
"ALGOLIA_APPLICATION_REGION");
// Call the API
client.deleteABTest(42);
// >LOG
- lang: javascript
label: JavaScript
source: >
// Initialize the client
// Replace 'us' with your Algolia Application Region
const client = abtestingClient('ALGOLIA_APPLICATION_ID',
'ALGOLIA_API_KEY', 'us');
// Call the API
const response = await client.deleteABTest({ id: 42 });
// >LOG
// use typed response
console.log(response);
- lang: kotlin
label: Kotlin
source: >
// Initialize the client
val client = AbtestingClient(appId = "ALGOLIA_APPLICATION_ID",
apiKey = "ALGOLIA_API_KEY", region = "ALGOLIA_APPLICATION_REGION")
// Call the API
var response = client.deleteABTest(
id = 42,
)
// >LOG
// Use the response
println(response)
- lang: php
label: PHP
source: >
// Initialize the client
$client = AbtestingClient::create('ALGOLIA_APPLICATION_ID',
'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');
// Call the API
$response = $client->deleteABTest(
42,
);
// >LOG
// play with the response
var_dump($response);
- lang: python
label: Python
source: >
# Initialize the client
# In an asynchronous context, you can use AbtestingClient instead,
which exposes the exact same methods.
client = AbtestingClientSync(
"ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
)
# Call the API
response = client.delete_ab_test(
id=42,
)
# >LOG
# use the class directly
print(response)
- lang: ruby
label: Ruby
source: >
# Initialize the client
client = Algolia::AbtestingClient.create("ALGOLIA_APPLICATION_ID",
"ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
# Call the API
response = client.delete_ab_test(42)
# >LOG
# use the class directly
puts(response)
# print the JSON response
puts(response.to_json)
- lang: scala
label: Scala
source: |
// Initialize the client
val client = AbtestingClient(
appId = "ALGOLIA_APPLICATION_ID",
apiKey = "ALGOLIA_API_KEY",
region = Option("ALGOLIA_APPLICATION_REGION")
)
// Call the API
val response = client.deleteABTest(
id = 42
)
// >LOG
// Use the response
val value = Await.result(response, Duration(100, "sec"))
- lang: swift
label: Swift
source: >
// Initialize the client
let client = try AbtestingClient(appID: "ALGOLIA_APPLICATION_ID",
apiKey: "ALGOLIA_API_KEY", region: .us)
// Call the API
let response = try await client.deleteABTest(id: 42)
// >LOG
/2/abtests/{id}/stop:
post:
tags:
Expand Down Expand Up @@ -2743,6 +2559,16 @@ paths:
))
// >LOG
- lang: cURL
label: curl
source: |-
curl --request POST \
--url https://analytics.us.algolia.com/2/abtests/schedule \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
--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"}'
components:
securitySchemes:
appId:
Expand Down
10 changes: 5 additions & 5 deletions specs/bundled/algoliasearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,23 @@ servers:
- url: https://{appId}.algolia.net
variables:
appId:
default: myAppId
default: ALGOLIA_APPLICATION_ID
- url: https://{appId}-1.algolianet.com
variables:
appId:
default: myAppId
default: ALGOLIA_APPLICATION_ID
- url: https://{appId}-2.algolianet.com
variables:
appId:
default: myAppId
default: ALGOLIA_APPLICATION_ID
- url: https://{appId}-3.algolianet.com
variables:
appId:
default: myAppId
default: ALGOLIA_APPLICATION_ID
- url: https://{appId}-dsn.algolia.net
variables:
appId:
default: myAppId
default: ALGOLIA_APPLICATION_ID
security:
- appId: []
apiKey: []
Expand Down
Loading

0 comments on commit c0f90f3

Please sign in to comment.