From 663670f2f13f7908b4449463a9e6da9f865c4b07 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Fri, 6 Sep 2024 08:53:41 +0000 Subject: [PATCH] feat(clients): helper to switch API key in use (#3616) (generated) [skip ci] Co-authored-by: Thomas Raffray Co-authored-by: Pierre Millot --- .../algoliasearch/Clients/AbtestingClient.cs | 13 +- .../algoliasearch/Clients/AnalyticsClient.cs | 13 +- .../algoliasearch/Clients/IngestionClient.cs | 13 +- .../algoliasearch/Clients/InsightsClient.cs | 13 +- .../algoliasearch/Clients/MonitoringClient.cs | 13 +- .../Clients/PersonalizationClient.cs | 13 +- .../Clients/QuerySuggestionsClient.cs | 13 +- .../algoliasearch/Clients/RecommendClient.cs | 13 +- .../algoliasearch/Clients/SearchClient.cs | 13 +- .../algoliasearch/Clients/UsageClient.cs | 13 +- .../lib/src/api/search_client.dart | 16 +- .../lib/src/api/insights_client.dart | 16 +- .../lib/src/api/recommend_client.dart | 16 +- .../lib/src/api/search_client.dart | 16 +- .../algolia/abtesting/client.go | 11 + .../algolia/analytics/client.go | 11 + .../algolia/ingestion/client.go | 11 + .../algolia/insights/client.go | 11 + .../algolia/monitoring/client.go | 11 + .../algolia/personalization/client.go | 11 + .../algolia/query-suggestions/client.go | 11 + .../algolia/recommend/client.go | 11 + .../algolia/search/client.go | 11 + .../algolia/usage/client.go | 11 + .../src/main/java/com/algolia/ApiClient.java | 2 +- .../algoliasearch/lite/src/liteClient.ts | 10 + .../client-abtesting/src/abtestingClient.ts | 13 +- .../client-analytics/src/analyticsClient.ts | 33 +- .../client-insights/src/insightsClient.ts | 10 + .../src/personalizationClient.ts | 10 + .../src/querySuggestionsClient.ts | 10 + .../client-search/src/searchClient.ts | 18 +- .../packages/client-usage/src/usageClient.ts | 10 + .../packages/ingestion/src/ingestionClient.ts | 25 +- .../monitoring/src/monitoringClient.ts | 10 + .../packages/recommend/src/recommendClient.ts | 10 + .../com/algolia/client/api/AbtestingClient.kt | 2 +- .../com/algolia/client/api/AnalyticsClient.kt | 2 +- .../com/algolia/client/api/ApiClient.kt | 10 +- .../com/algolia/client/api/IngestionClient.kt | 2 +- .../com/algolia/client/api/InsightsClient.kt | 2 +- .../algolia/client/api/MonitoringClient.kt | 2 +- .../client/api/PersonalizationClient.kt | 2 +- .../client/api/QuerySuggestionsClient.kt | 2 +- .../com/algolia/client/api/RecommendClient.kt | 2 +- .../com/algolia/client/api/SearchClient.kt | 2 +- .../com/algolia/client/api/UsageClient.kt | 2 +- .../com/algolia/client/transport/Requester.kt | 2 +- .../lib/Api/AbtestingClient.php | 10 + .../lib/Api/AnalyticsClient.php | 10 + .../lib/Api/IngestionClient.php | 10 + .../lib/Api/InsightsClient.php | 10 + .../lib/Api/MonitoringClient.php | 10 + .../lib/Api/PersonalizationClient.php | 10 + .../lib/Api/QuerySuggestionsClient.php | 10 + .../lib/Api/RecommendClient.php | 10 + .../lib/Api/SearchClient.php | 10 + .../lib/Api/UsageClient.php | 10 + .../lib/Configuration/Configuration.php | 2 - .../algoliasearch/abtesting/client.py | 4 + .../algoliasearch/analytics/client.py | 4 + .../algoliasearch/ingestion/client.py | 4 + .../algoliasearch/insights/client.py | 4 + .../algoliasearch/monitoring/client.py | 4 + .../algoliasearch/personalization/client.py | 4 + .../algoliasearch/query_suggestions/client.py | 4 + .../algoliasearch/recommend/client.py | 4 + .../algoliasearch/search/client.py | 4 + .../algoliasearch/usage/client.py | 4 + .../lib/algolia/api/abtesting_client.rb | 8 + .../lib/algolia/api/analytics_client.rb | 8 + .../lib/algolia/api/ingestion_client.rb | 8 + .../lib/algolia/api/insights_client.rb | 8 + .../lib/algolia/api/monitoring_client.rb | 8 + .../lib/algolia/api/personalization_client.rb | 8 + .../algolia/api/query_suggestions_client.rb | 8 + .../lib/algolia/api/recommend_client.rb | 8 + .../lib/algolia/api/search_client.rb | 8 + .../lib/algolia/api/usage_client.rb | 8 + .../interceptor/AuthInterceptor.scala | 4 +- .../Sources/Abtesting/AbtestingClient.swift | 5 + .../AbtestingClientConfiguration.swift | 2 +- .../Sources/Analytics/AnalyticsClient.swift | 5 + .../AnalyticsClientConfiguration.swift | 2 +- .../Sources/Ingestion/IngestionClient.swift | 5 + .../IngestionClientConfiguration.swift | 2 +- .../Sources/Insights/InsightsClient.swift | 5 + .../InsightsClientConfiguration.swift | 2 +- .../Sources/Monitoring/MonitoringClient.swift | 5 + .../MonitoringClientConfiguration.swift | 2 +- .../PersonalizationClient.swift | 5 + .../PersonalizationClientConfiguration.swift | 2 +- .../QuerySuggestionsClient.swift | 5 + .../QuerySuggestionsClientConfiguration.swift | 2 +- .../Sources/Recommend/RecommendClient.swift | 5 + .../RecommendClientConfiguration.swift | 2 +- .../Sources/Search/SearchClient.swift | 5 + .../Search/SearchClientConfiguration.swift | 2 +- .../Sources/Usage/UsageClient.swift | 5 + .../Usage/UsageClientConfiguration.swift | 2 +- snippets/csharp/src/Abtesting.cs | 29 + snippets/csharp/src/Analytics.cs | 43 + snippets/csharp/src/Ingestion.cs | 78 + snippets/csharp/src/Insights.cs | 25 + snippets/csharp/src/Monitoring.cs | 30 + snippets/csharp/src/Personalization.cs | 27 + snippets/csharp/src/QuerySuggestions.cs | 30 + snippets/csharp/src/Recommend.cs | 26 + snippets/csharp/src/Search.cs | 110 ++ snippets/csharp/src/Usage.cs | 23 + snippets/dart/lib/algoliasearch.dart | 8 + snippets/dart/lib/insights.dart | 27 +- snippets/dart/lib/recommend.dart | 25 + snippets/dart/lib/search.dart | 113 +- snippets/go/src/abtesting.go | 37 + snippets/go/src/analytics.go | 51 + snippets/go/src/ingestion.go | 86 ++ snippets/go/src/insights.go | 33 + snippets/go/src/monitoring.go | 40 + snippets/go/src/personalization.go | 35 + snippets/go/src/query-suggestions.go | 38 + snippets/go/src/recommend.go | 36 + snippets/go/src/search.go | 120 ++ snippets/go/src/usage.go | 33 + snippets/guides/abtesting-snippets.json | 170 ++- snippets/guides/analytics-snippets.json | 366 ++--- snippets/guides/ingestion-snippets.json | 856 +++++------ snippets/guides/insights-snippets.json | 121 +- snippets/guides/monitoring-snippets.json | 209 +-- snippets/guides/personalization-snippets.json | 142 +- .../guides/query-suggestions-snippets.json | 184 ++- snippets/guides/recommend-snippets.json | 156 +- snippets/guides/search-snippets.json | 1304 +++++++++-------- snippets/guides/usage-snippets.json | 111 +- .../src/test/java/com/algolia/Abtesting.java | 24 + .../src/test/java/com/algolia/Analytics.java | 38 + .../src/test/java/com/algolia/Ingestion.java | 73 + .../src/test/java/com/algolia/Insights.java | 20 + .../src/test/java/com/algolia/Monitoring.java | 27 + .../java/com/algolia/Personalization.java | 22 + .../java/com/algolia/QuerySuggestions.java | 25 + .../src/test/java/com/algolia/Recommend.java | 23 + .../src/test/java/com/algolia/Search.java | 107 ++ .../java/src/test/java/com/algolia/Usage.java | 20 + snippets/javascript/src/abtesting.ts | 25 + snippets/javascript/src/algoliasearch.ts | 8 + snippets/javascript/src/analytics.ts | 39 + snippets/javascript/src/ingestion.ts | 74 + snippets/javascript/src/insights.ts | 25 +- snippets/javascript/src/monitoring.ts | 28 + snippets/javascript/src/personalization.ts | 23 + snippets/javascript/src/querySuggestions.ts | 26 + snippets/javascript/src/recommend.ts | 24 + snippets/javascript/src/search.ts | 108 ++ snippets/javascript/src/usage.ts | 21 + .../kotlin/com/algolia/snippets/Abtesting.kt | 26 + .../kotlin/com/algolia/snippets/Analytics.kt | 40 + .../kotlin/com/algolia/snippets/Ingestion.kt | 75 + .../kotlin/com/algolia/snippets/Insights.kt | 26 +- .../kotlin/com/algolia/snippets/Monitoring.kt | 29 + .../com/algolia/snippets/Personalization.kt | 24 + .../com/algolia/snippets/QuerySuggestions.kt | 27 + .../kotlin/com/algolia/snippets/Recommend.kt | 25 + .../kotlin/com/algolia/snippets/Search.kt | 109 ++ .../main/kotlin/com/algolia/snippets/Usage.kt | 22 + snippets/php/src/Abtesting.php | 30 + snippets/php/src/Analytics.php | 44 + snippets/php/src/Ingestion.php | 79 + snippets/php/src/Insights.php | 30 +- snippets/php/src/Monitoring.php | 33 + snippets/php/src/Personalization.php | 28 + snippets/php/src/QuerySuggestions.php | 31 + snippets/php/src/Recommend.php | 29 + snippets/php/src/Search.php | 113 ++ snippets/php/src/Usage.php | 26 + snippets/python/abtesting.py | 29 + snippets/python/analytics.py | 43 + snippets/python/ingestion.py | 78 + snippets/python/insights.py | 32 +- snippets/python/monitoring.py | 32 + snippets/python/personalization.py | 27 + snippets/python/query_suggestions.py | 32 + snippets/python/recommend.py | 28 + snippets/python/search.py | 116 +- snippets/python/usage.py | 25 + snippets/ruby/abtesting.rb | 24 + snippets/ruby/analytics.rb | 38 + snippets/ruby/ingestion.rb | 73 + snippets/ruby/insights.rb | 28 +- snippets/ruby/monitoring.rb | 27 + snippets/ruby/personalization.rb | 22 + snippets/ruby/query_suggestions.rb | 25 + snippets/ruby/recommend.rb | 23 + snippets/ruby/search.rb | 107 ++ snippets/ruby/usage.rb | 20 + snippets/scala/src/main/scala/Abtesting.scala | 10 + snippets/scala/src/main/scala/Analytics.scala | 24 + snippets/scala/src/main/scala/Ingestion.scala | 59 + snippets/scala/src/main/scala/Insights.scala | 10 +- .../scala/src/main/scala/Monitoring.scala | 13 + .../src/main/scala/Personalization.scala | 8 + .../src/main/scala/QuerySuggestions.scala | 11 + snippets/scala/src/main/scala/Recommend.scala | 9 + snippets/scala/src/main/scala/Search.scala | 77 + snippets/scala/src/main/scala/Usage.scala | 6 + snippets/swift/Sources/Abtesting.swift | 24 + snippets/swift/Sources/Analytics.swift | 38 + snippets/swift/Sources/Ingestion.swift | 73 + snippets/swift/Sources/Insights.swift | 22 +- snippets/swift/Sources/Monitoring.swift | 27 + snippets/swift/Sources/Personalization.swift | 22 + snippets/swift/Sources/QuerySuggestions.swift | 25 + snippets/swift/Sources/Recommend.swift | 23 + snippets/swift/Sources/Search.swift | 107 ++ snippets/swift/Sources/Usage.swift | 20 + specs/bundled/abtesting.doc.yml | 190 +++ specs/bundled/abtesting.yml | 20 + specs/bundled/analytics.doc.yml | 457 ++++++ specs/bundled/analytics.yml | 20 + specs/bundled/ingestion.doc.yml | 1138 ++++++++++++++ specs/bundled/ingestion.yml | 20 + specs/bundled/insights.doc.yml | 162 +- specs/bundled/insights.yml | 20 + specs/bundled/monitoring.doc.yml | 232 +++ specs/bundled/monitoring.yml | 20 + specs/bundled/personalization.doc.yml | 151 ++ specs/bundled/personalization.yml | 20 + specs/bundled/query-suggestions.doc.yml | 199 +++ specs/bundled/query-suggestions.yml | 20 + specs/bundled/recommend.doc.yml | 178 +++ specs/bundled/recommend.yml | 20 + specs/bundled/search.doc.yml | 1112 ++++++++++++++ specs/bundled/search.yml | 20 + specs/bundled/usage.doc.yml | 90 ++ specs/bundled/usage.yml | 20 + .../src/generated/client/Abtesting.test.cs | 43 + .../src/generated/client/Analytics.test.cs | 43 + .../src/generated/client/Ingestion.test.cs | 43 + .../src/generated/client/Insights.test.cs | 43 + .../src/generated/client/Monitoring.test.cs | 43 + .../generated/client/Personalization.test.cs | 43 + .../generated/client/QuerySuggestions.test.cs | 43 + .../src/generated/client/Recommend.test.cs | 43 + .../src/generated/client/Search.test.cs | 391 +++-- .../csharp/src/generated/client/Usage.test.cs | 43 + .../dart/test/client/insights_test.dart | 42 + .../dart/test/client/recommend_test.dart | 41 + .../output/dart/test/client/search_test.dart | 41 + .../output/go/tests/client/abtesting_test.go | 48 + .../output/go/tests/client/analytics_test.go | 48 + .../output/go/tests/client/ingestion_test.go | 48 + tests/output/go/tests/client/insights_test.go | 48 + .../output/go/tests/client/monitoring_test.go | 47 + .../go/tests/client/personalization_test.go | 48 + .../go/tests/client/query-suggestions_test.go | 48 + .../output/go/tests/client/recommend_test.go | 47 + tests/output/go/tests/client/search_test.go | 279 ++-- tests/output/go/tests/client/usage_test.go | 47 + .../com/algolia/client/Abtesting.test.java | 31 + .../com/algolia/client/Analytics.test.java | 31 + .../com/algolia/client/Ingestion.test.java | 31 + .../com/algolia/client/Insights.test.java | 31 + .../com/algolia/client/Monitoring.test.java | 30 + .../algolia/client/Personalization.test.java | 31 + .../algolia/client/QuerySuggestions.test.java | 31 + .../com/algolia/client/Recommend.test.java | 30 + .../java/com/algolia/client/Search.test.java | 221 +-- .../java/com/algolia/client/Usage.test.java | 30 + .../javascript/src/client/abtesting.test.ts | 24 +- .../javascript/src/client/analytics.test.ts | 24 +- .../javascript/src/client/ingestion.test.ts | 24 +- .../javascript/src/client/insights.test.ts | 24 +- .../javascript/src/client/monitoring.test.ts | 24 +- .../src/client/personalization.test.ts | 24 +- .../src/client/querySuggestions.test.ts | 24 +- .../javascript/src/client/recommend.test.ts | 24 +- .../javascript/src/client/search.test.ts | 296 ++-- .../javascript/src/client/usage.test.ts | 24 +- .../com/algolia/client/AbtestingTest.kt | 39 + .../com/algolia/client/AnalyticsTest.kt | 39 + .../com/algolia/client/IngestionTest.kt | 39 + .../kotlin/com/algolia/client/InsightsTest.kt | 39 + .../com/algolia/client/MonitoringTest.kt | 39 + .../com/algolia/client/PersonalizationTest.kt | 39 + .../algolia/client/QuerySuggestionsTest.kt | 39 + .../com/algolia/client/RecommendTest.kt | 39 + .../kotlin/com/algolia/client/SearchTest.kt | 38 + .../kotlin/com/algolia/client/UsageTest.kt | 39 + tests/output/php/src/client/AbtestingTest.php | 26 + tests/output/php/src/client/AnalyticsTest.php | 26 + tests/output/php/src/client/IngestionTest.php | 26 + tests/output/php/src/client/InsightsTest.php | 26 + .../output/php/src/client/MonitoringTest.php | 26 + .../php/src/client/PersonalizationTest.php | 26 + .../php/src/client/QuerySuggestionsTest.php | 26 + tests/output/php/src/client/RecommendTest.php | 26 + tests/output/php/src/client/SearchTest.php | 28 + tests/output/php/src/client/UsageTest.php | 26 + .../python/tests/client/abtesting_test.py | 36 + .../python/tests/client/analytics_test.py | 36 + .../python/tests/client/ingestion_test.py | 36 + .../python/tests/client/insights_test.py | 36 + .../python/tests/client/monitoring_test.py | 36 + .../tests/client/personalization_test.py | 36 + .../tests/client/query_suggestions_test.py | 36 + .../python/tests/client/recommend_test.py | 36 + .../output/python/tests/client/search_test.py | 34 + .../output/python/tests/client/usage_test.py | 36 + .../output/ruby/test/client/abtesting_test.rb | 24 + .../output/ruby/test/client/analytics_test.rb | 24 + .../output/ruby/test/client/ingestion_test.rb | 24 + .../output/ruby/test/client/insights_test.rb | 24 + .../ruby/test/client/monitoring_test.rb | 24 + .../ruby/test/client/personalization_test.rb | 24 + .../test/client/query_suggestions_test.rb | 24 + .../output/ruby/test/client/recommend_test.rb | 24 + tests/output/ruby/test/client/search_test.rb | 24 + tests/output/ruby/test/client/usage_test.rb | 24 + .../algoliasearch/client/AbtestingTest.scala | 40 + .../algoliasearch/client/AnalyticsTest.scala | 40 + .../algoliasearch/client/IngestionTest.scala | 40 + .../algoliasearch/client/InsightsTest.scala | 40 + .../algoliasearch/client/MonitoringTest.scala | 39 + .../client/PersonalizationTest.scala | 40 + .../client/QuerySuggestionsTest.scala | 40 + .../algoliasearch/client/RecommendTest.scala | 39 + .../algoliasearch/client/SearchTest.scala | 39 + .../algoliasearch/client/UsageTest.scala | 39 + .../swift/Tests/client/AbtestingTests.swift | 33 + .../swift/Tests/client/AnalyticsTests.swift | 33 + .../swift/Tests/client/IngestionTests.swift | 33 + .../swift/Tests/client/InsightsTests.swift | 33 + .../swift/Tests/client/MonitoringTests.swift | 32 + .../Tests/client/PersonalizationTests.swift | 33 + .../Tests/client/QuerySuggestionsTests.swift | 33 + .../swift/Tests/client/RecommendTests.swift | 32 + .../swift/Tests/client/SearchTests.swift | 297 ++-- .../swift/Tests/client/UsageTests.swift | 32 + 338 files changed, 15106 insertions(+), 2436 deletions(-) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/AbtestingClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/AbtestingClient.cs index e183e8751c..adcffef937 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/AbtestingClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/AbtestingClient.cs @@ -324,7 +324,7 @@ public interface IAbtestingClient /// public partial class AbtestingClient : IAbtestingClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -382,6 +382,17 @@ public AbtestingClient(AbtestingConfig config, IHttpRequester httpRequester, ILo } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task AddABTestsAsync(AddABTestsRequest addABTestsRequest, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/AnalyticsClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/AnalyticsClient.cs index 1abb350418..2fe809ab2e 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/AnalyticsClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/AnalyticsClient.cs @@ -906,7 +906,7 @@ public interface IAnalyticsClient /// public partial class AnalyticsClient : IAnalyticsClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -964,6 +964,17 @@ public AnalyticsClient(AnalyticsConfig config, IHttpRequester httpRequester, ILo } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task CustomDeleteAsync(string path, Dictionary parameters = default, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/IngestionClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/IngestionClient.cs index 59c0a21582..afe34e5491 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/IngestionClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/IngestionClient.cs @@ -2040,7 +2040,7 @@ public interface IIngestionClient /// public partial class IngestionClient : IIngestionClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -2098,6 +2098,17 @@ public IngestionClient(IngestionConfig config, IHttpRequester httpRequester, ILo } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task CreateAuthenticationAsync(AuthenticationCreate authenticationCreate, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/InsightsClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/InsightsClient.cs index eba93477e2..d307fab3a6 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/InsightsClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/InsightsClient.cs @@ -186,7 +186,7 @@ public interface IInsightsClient /// public partial class InsightsClient : IInsightsClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -244,6 +244,17 @@ public InsightsClient(InsightsConfig config, IHttpRequester httpRequester, ILogg } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task CustomDeleteAsync(string path, Dictionary parameters = default, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/MonitoringClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/MonitoringClient.cs index 481fbf91e2..5fcab8897d 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/MonitoringClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/MonitoringClient.cs @@ -350,7 +350,7 @@ public interface IMonitoringClient /// public partial class MonitoringClient : IMonitoringClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -408,6 +408,17 @@ public MonitoringClient(MonitoringConfig config, IHttpRequester httpRequester, I } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task CustomDeleteAsync(string path, Dictionary parameters = default, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/PersonalizationClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/PersonalizationClient.cs index c38f7a131c..73a1ccc16e 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/PersonalizationClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/PersonalizationClient.cs @@ -256,7 +256,7 @@ public interface IPersonalizationClient /// public partial class PersonalizationClient : IPersonalizationClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -314,6 +314,17 @@ public PersonalizationClient(PersonalizationConfig config, IHttpRequester httpRe } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task CustomDeleteAsync(string path, Dictionary parameters = default, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/QuerySuggestionsClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/QuerySuggestionsClient.cs index 8a201505c6..c58bae6ba5 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/QuerySuggestionsClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/QuerySuggestionsClient.cs @@ -348,7 +348,7 @@ public interface IQuerySuggestionsClient /// public partial class QuerySuggestionsClient : IQuerySuggestionsClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -406,6 +406,17 @@ public QuerySuggestionsClient(QuerySuggestionsConfig config, IHttpRequester http } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task CreateConfigAsync(ConfigurationWithIndex configurationWithIndex, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/RecommendClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/RecommendClient.cs index 05aecd780d..4281bf7e14 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/RecommendClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/RecommendClient.cs @@ -304,7 +304,7 @@ public interface IRecommendClient /// public partial class RecommendClient : IRecommendClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -362,6 +362,17 @@ public RecommendClient(RecommendConfig config, IHttpRequester httpRequester, ILo } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task CustomDeleteAsync(string path, Dictionary parameters = default, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/SearchClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/SearchClient.cs index 619ff760c4..35ee54ec4c 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/SearchClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/SearchClient.cs @@ -1950,7 +1950,7 @@ public partial interface ISearchClient /// public partial class SearchClient : ISearchClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -2008,6 +2008,17 @@ public SearchClient(SearchConfig config, IHttpRequester httpRequester, ILoggerFa } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task AddApiKeyAsync(ApiKey apiKey, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Clients/UsageClient.cs b/clients/algoliasearch-client-csharp/algoliasearch/Clients/UsageClient.cs index 87eeceb7e3..bbc7df7b0d 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Clients/UsageClient.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Clients/UsageClient.cs @@ -200,7 +200,7 @@ public interface IUsageClient /// public partial class UsageClient : IUsageClient { - private readonly HttpTransport _transport; + internal HttpTransport _transport; private readonly ILogger _logger; /// @@ -258,6 +258,17 @@ public UsageClient(UsageConfig config, IHttpRequester httpRequester, ILoggerFact } } + /// + /// Helper to switch the API key sent with each request + /// + /// Your new API Key + /// + public void SetClientApiKey(string apiKey) + { + _transport._algoliaConfig.SetClientApiKey(apiKey); + } + + /// public async Task CustomDeleteAsync(string path, Dictionary parameters = default, RequestOptions options = null, CancellationToken cancellationToken = default) diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/api/search_client.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/api/search_client.dart index 90798048be..bd83a78d5f 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/api/search_client.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/api/search_client.dart @@ -10,20 +10,14 @@ import 'package:algoliasearch/src/model/search_method_params.dart'; import 'package:algoliasearch/src/model/search_responses.dart'; final class SearchClient implements ApiClient { - @override - final String apiKey; - - @override - final String appId; - @override final ClientOptions options; final RetryStrategy _retryStrategy; SearchClient({ - required this.appId, - required this.apiKey, + required String appId, + required String apiKey, this.options = const ClientOptions(), }) : _retryStrategy = RetryStrategy.create( segment: @@ -46,6 +40,12 @@ final class SearchClient implements ApiClient { assert(apiKey.isNotEmpty, '`apiKey` is missing.'); } + /// Allows to switch the API key used to authenticate requests. + @override + void setClientApiKey({required String apiKey}) { + _retryStrategy.requester.setClientApiKey(apiKey); + } + /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: diff --git a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/api/insights_client.dart b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/api/insights_client.dart index 7f69d81882..dbbb2865c3 100644 --- a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/api/insights_client.dart +++ b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/api/insights_client.dart @@ -8,12 +8,6 @@ import 'package:algolia_client_insights/src/model/events_response.dart'; import 'package:algolia_client_insights/src/model/insights_events.dart'; final class InsightsClient implements ApiClient { - @override - final String apiKey; - - @override - final String appId; - @override final ClientOptions options; @@ -22,8 +16,8 @@ final class InsightsClient implements ApiClient { final RetryStrategy _retryStrategy; InsightsClient({ - required this.appId, - required this.apiKey, + required String appId, + required String apiKey, this.options = const ClientOptions(), this.region, }) : _retryStrategy = RetryStrategy.create( @@ -47,6 +41,12 @@ final class InsightsClient implements ApiClient { assert(apiKey.isNotEmpty, '`apiKey` is missing.'); } + /// Allows to switch the API key used to authenticate requests. + @override + void setClientApiKey({required String apiKey}) { + _retryStrategy.requester.setClientApiKey(apiKey); + } + /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/api/recommend_client.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/api/recommend_client.dart index 9e01c7f1dc..7ca1d35c97 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/api/recommend_client.dart +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/api/recommend_client.dart @@ -14,20 +14,14 @@ import 'package:algolia_client_recommend/src/model/search_recommend_rules_params import 'package:algolia_client_recommend/src/model/search_recommend_rules_response.dart'; final class RecommendClient implements ApiClient { - @override - final String apiKey; - - @override - final String appId; - @override final ClientOptions options; final RetryStrategy _retryStrategy; RecommendClient({ - required this.appId, - required this.apiKey, + required String appId, + required String apiKey, this.options = const ClientOptions(), }) : _retryStrategy = RetryStrategy.create( segment: AgentSegment(value: "Recommend", version: packageVersion), @@ -49,6 +43,12 @@ final class RecommendClient implements ApiClient { assert(apiKey.isNotEmpty, '`apiKey` is missing.'); } + /// Allows to switch the API key used to authenticate requests. + @override + void setClientApiKey({required String apiKey}) { + _retryStrategy.requester.setClientApiKey(apiKey); + } + /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart index 4938452f90..1199c4d71f 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart @@ -66,20 +66,14 @@ import 'package:algolia_client_search/src/model/updated_rule_response.dart'; import 'package:algolia_client_search/src/model/user_id.dart'; final class SearchClient implements ApiClient { - @override - final String apiKey; - - @override - final String appId; - @override final ClientOptions options; final RetryStrategy _retryStrategy; SearchClient({ - required this.appId, - required this.apiKey, + required String appId, + required String apiKey, this.options = const ClientOptions(), }) : _retryStrategy = RetryStrategy.create( segment: AgentSegment(value: "Search", version: packageVersion), @@ -101,6 +95,12 @@ final class SearchClient implements ApiClient { assert(apiKey.isNotEmpty, '`apiKey` is missing.'); } + /// Allows to switch the API key used to authenticate requests. + @override + void setClientApiKey({required String apiKey}) { + _retryStrategy.requester.setClientApiKey(apiKey); + } + /// Creates a new API key with specific permissions and restrictions. /// /// Required API Key ACLs: diff --git a/clients/algoliasearch-client-go/algolia/abtesting/client.go b/clients/algoliasearch-client-go/algolia/abtesting/client.go index fc1b062cd3..f7a717a9b4 100644 --- a/clients/algoliasearch-client-go/algolia/abtesting/client.go +++ b/clients/algoliasearch-client-go/algolia/abtesting/client.go @@ -109,6 +109,17 @@ func (c *APIClient) GetConfiguration() *AbtestingConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/analytics/client.go b/clients/algoliasearch-client-go/algolia/analytics/client.go index ead7273c60..d4350812d0 100644 --- a/clients/algoliasearch-client-go/algolia/analytics/client.go +++ b/clients/algoliasearch-client-go/algolia/analytics/client.go @@ -109,6 +109,17 @@ func (c *APIClient) GetConfiguration() *AnalyticsConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/ingestion/client.go b/clients/algoliasearch-client-go/algolia/ingestion/client.go index 4c0a71ba26..191095d2fa 100644 --- a/clients/algoliasearch-client-go/algolia/ingestion/client.go +++ b/clients/algoliasearch-client-go/algolia/ingestion/client.go @@ -105,6 +105,17 @@ func (c *APIClient) GetConfiguration() *IngestionConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/insights/client.go b/clients/algoliasearch-client-go/algolia/insights/client.go index 67f253ebed..75a11ac726 100644 --- a/clients/algoliasearch-client-go/algolia/insights/client.go +++ b/clients/algoliasearch-client-go/algolia/insights/client.go @@ -109,6 +109,17 @@ func (c *APIClient) GetConfiguration() *InsightsConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/monitoring/client.go b/clients/algoliasearch-client-go/algolia/monitoring/client.go index 34b4030324..54f6d87603 100644 --- a/clients/algoliasearch-client-go/algolia/monitoring/client.go +++ b/clients/algoliasearch-client-go/algolia/monitoring/client.go @@ -102,6 +102,17 @@ func (c *APIClient) GetConfiguration() *MonitoringConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/personalization/client.go b/clients/algoliasearch-client-go/algolia/personalization/client.go index bb45ca7bf3..3054f8830e 100644 --- a/clients/algoliasearch-client-go/algolia/personalization/client.go +++ b/clients/algoliasearch-client-go/algolia/personalization/client.go @@ -105,6 +105,17 @@ func (c *APIClient) GetConfiguration() *PersonalizationConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/query-suggestions/client.go b/clients/algoliasearch-client-go/algolia/query-suggestions/client.go index dda7c5ba3f..6f93b04572 100644 --- a/clients/algoliasearch-client-go/algolia/query-suggestions/client.go +++ b/clients/algoliasearch-client-go/algolia/query-suggestions/client.go @@ -105,6 +105,17 @@ func (c *APIClient) GetConfiguration() *QuerySuggestionsConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/recommend/client.go b/clients/algoliasearch-client-go/algolia/recommend/client.go index 23fd3dfbb0..080200c9d0 100644 --- a/clients/algoliasearch-client-go/algolia/recommend/client.go +++ b/clients/algoliasearch-client-go/algolia/recommend/client.go @@ -111,6 +111,17 @@ func (c *APIClient) GetConfiguration() *RecommendConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/search/client.go b/clients/algoliasearch-client-go/algolia/search/client.go index 3183843182..62adf654a7 100644 --- a/clients/algoliasearch-client-go/algolia/search/client.go +++ b/clients/algoliasearch-client-go/algolia/search/client.go @@ -111,6 +111,17 @@ func (c *APIClient) GetConfiguration() *SearchConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-go/algolia/usage/client.go b/clients/algoliasearch-client-go/algolia/usage/client.go index bcbb20ab93..d2e26ee364 100644 --- a/clients/algoliasearch-client-go/algolia/usage/client.go +++ b/clients/algoliasearch-client-go/algolia/usage/client.go @@ -102,6 +102,17 @@ func (c *APIClient) GetConfiguration() *UsageConfiguration { return c.cfg } +// Allow update of stored API key used to authenticate requests. +func (c *APIClient) SetClientApiKey(apiKey string) error { + if c.cfg == nil { + return errors.New("client config is not set") + } + + c.cfg.ApiKey = apiKey + + return nil +} + // prepareRequest build the request. func (c *APIClient) prepareRequest( ctx context.Context, diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/ApiClient.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/ApiClient.java index fff2ae1991..8d64330723 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/ApiClient.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/ApiClient.java @@ -15,8 +15,8 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; -import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; +import org.jetbrains.annotations.Nullable; /** * Represents a base client for making API requests. The client uses a {@link Requester} for diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/src/liteClient.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/src/liteClient.ts index 7ca5c3912f..0c337abdb8 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/src/liteClient.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/src/liteClient.ts @@ -118,6 +118,16 @@ export function createLiteClient({ addAlgoliaAgent(segment: string, version?: string): void { transporter.algoliaAgent.add({ segment, version }); }, + + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, /** * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets. * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes. diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingClient.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingClient.ts index 2d2e943892..f21ccd7996 100644 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingClient.ts @@ -99,6 +99,16 @@ export function createAbtestingClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * Creates a new A/B test. * @@ -337,14 +347,13 @@ export function createAbtestingClient({ const requestPath = '/2/abtests'; const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (offset !== undefined) { queryParameters.offset = offset.toString(); } + if (limit !== undefined) { queryParameters.limit = limit.toString(); } - if (indexPrefix !== undefined) { queryParameters.indexPrefix = indexPrefix.toString(); } diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsClient.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsClient.ts index 8bf69d51df..617b403edd 100644 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsClient.ts @@ -129,6 +129,16 @@ export function createAnalyticsClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * This method allow you to send requests to the Algolia REST API. * @@ -277,7 +287,6 @@ export function createAnalyticsClient({ if (index !== undefined) { queryParameters.index = index.toString(); } - if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } @@ -325,12 +334,14 @@ export function createAnalyticsClient({ if (index !== undefined) { queryParameters.index = index.toString(); } + if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } if (endDate !== undefined) { queryParameters.endDate = endDate.toString(); } + if (tags !== undefined) { queryParameters.tags = tags.toString(); } @@ -419,6 +430,7 @@ export function createAnalyticsClient({ if (index !== undefined) { queryParameters.index = index.toString(); } + if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } @@ -466,7 +478,6 @@ export function createAnalyticsClient({ if (index !== undefined) { queryParameters.index = index.toString(); } - if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } @@ -517,10 +528,10 @@ export function createAnalyticsClient({ if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } - if (endDate !== undefined) { queryParameters.endDate = endDate.toString(); } + if (tags !== undefined) { queryParameters.tags = tags.toString(); } @@ -562,14 +573,12 @@ export function createAnalyticsClient({ if (index !== undefined) { queryParameters.index = index.toString(); } - if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } if (endDate !== undefined) { queryParameters.endDate = endDate.toString(); } - if (tags !== undefined) { queryParameters.tags = tags.toString(); } @@ -608,10 +617,10 @@ export function createAnalyticsClient({ const requestPath = '/2/conversions/purchaseRate'; const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (index !== undefined) { queryParameters.index = index.toString(); } + if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } @@ -659,10 +668,10 @@ export function createAnalyticsClient({ if (index !== undefined) { queryParameters.index = index.toString(); } - if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } + if (endDate !== undefined) { queryParameters.endDate = endDate.toString(); } @@ -711,10 +720,10 @@ export function createAnalyticsClient({ if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } - if (endDate !== undefined) { queryParameters.endDate = endDate.toString(); } + if (tags !== undefined) { queryParameters.tags = tags.toString(); } @@ -755,6 +764,7 @@ export function createAnalyticsClient({ const requestPath = '/2/searches/noClicks'; const headers: Headers = {}; const queryParameters: QueryParameters = {}; + if (index !== undefined) { queryParameters.index = index.toString(); } @@ -767,7 +777,6 @@ export function createAnalyticsClient({ if (limit !== undefined) { queryParameters.limit = limit.toString(); } - if (offset !== undefined) { queryParameters.offset = offset.toString(); } @@ -814,7 +823,6 @@ export function createAnalyticsClient({ if (index !== undefined) { queryParameters.index = index.toString(); } - if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } @@ -900,6 +908,7 @@ export function createAnalyticsClient({ const requestPath = '/2/countries'; const headers: Headers = {}; const queryParameters: QueryParameters = {}; + if (index !== undefined) { queryParameters.index = index.toString(); } @@ -912,7 +921,6 @@ export function createAnalyticsClient({ if (limit !== undefined) { queryParameters.limit = limit.toString(); } - if (offset !== undefined) { queryParameters.offset = offset.toString(); } @@ -957,10 +965,10 @@ export function createAnalyticsClient({ const requestPath = '/2/filters'; const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (index !== undefined) { queryParameters.index = index.toString(); } + if (search !== undefined) { queryParameters.search = search.toString(); } @@ -1042,6 +1050,7 @@ export function createAnalyticsClient({ if (offset !== undefined) { queryParameters.offset = offset.toString(); } + if (tags !== undefined) { queryParameters.tags = tags.toString(); } diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsClient.ts b/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsClient.ts index 3fee33ab3a..2d9ffac848 100644 --- a/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsClient.ts @@ -92,6 +92,16 @@ export function createInsightsClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationClient.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationClient.ts index 77438b9504..375635e7df 100644 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationClient.ts @@ -95,6 +95,16 @@ export function createPersonalizationClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsClient.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsClient.ts index 372a9043c7..32f1ccc5d3 100644 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsClient.ts @@ -99,6 +99,16 @@ export function createQuerySuggestionsClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application. * diff --git a/clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts b/clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts index 5797e6b47f..70efdb33f4 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts @@ -225,6 +225,16 @@ export function createSearchClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`. * @@ -1471,7 +1481,6 @@ export function createSearchClient({ .replace('{objectID}', encodeURIComponent(objectID)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (forwardToReplicas !== undefined) { queryParameters.forwardToReplicas = forwardToReplicas.toString(); } @@ -1610,6 +1619,7 @@ export function createSearchClient({ if (offset !== undefined) { queryParameters.offset = offset.toString(); } + if (length !== undefined) { queryParameters.length = length.toString(); } @@ -2019,7 +2029,6 @@ export function createSearchClient({ if (page !== undefined) { queryParameters.page = page.toString(); } - if (hitsPerPage !== undefined) { queryParameters.hitsPerPage = hitsPerPage.toString(); } @@ -2052,10 +2061,10 @@ export function createSearchClient({ const requestPath = '/1/clusters/mapping'; const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (page !== undefined) { queryParameters.page = page.toString(); } + if (hitsPerPage !== undefined) { queryParameters.hitsPerPage = hitsPerPage.toString(); } @@ -2355,7 +2364,6 @@ export function createSearchClient({ .replace('{objectID}', encodeURIComponent(objectID)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (forwardToReplicas !== undefined) { queryParameters.forwardToReplicas = forwardToReplicas.toString(); } @@ -2399,10 +2407,10 @@ export function createSearchClient({ const requestPath = '/1/indexes/{indexName}/rules/batch'.replace('{indexName}', encodeURIComponent(indexName)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (forwardToReplicas !== undefined) { queryParameters.forwardToReplicas = forwardToReplicas.toString(); } + if (clearExistingRules !== undefined) { queryParameters.clearExistingRules = clearExistingRules.toString(); } diff --git a/clients/algoliasearch-client-javascript/packages/client-usage/src/usageClient.ts b/clients/algoliasearch-client-javascript/packages/client-usage/src/usageClient.ts index 88c19fe2ea..863323a894 100644 --- a/clients/algoliasearch-client-javascript/packages/client-usage/src/usageClient.ts +++ b/clients/algoliasearch-client-javascript/packages/client-usage/src/usageClient.ts @@ -86,6 +86,16 @@ export function createUsageClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-javascript/packages/ingestion/src/ingestionClient.ts b/clients/algoliasearch-client-javascript/packages/ingestion/src/ingestionClient.ts index b3df113f2e..29b0ab116c 100644 --- a/clients/algoliasearch-client-javascript/packages/ingestion/src/ingestionClient.ts +++ b/clients/algoliasearch-client-javascript/packages/ingestion/src/ingestionClient.ts @@ -209,6 +209,16 @@ export function createIngestionClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * Creates a new authentication resource. * @@ -1233,7 +1243,6 @@ export function createIngestionClient({ if (platform !== undefined) { queryParameters.platform = platform.toString(); } - if (sort !== undefined) { queryParameters.sort = sort.toString(); } @@ -1275,13 +1284,13 @@ export function createIngestionClient({ const requestPath = '/1/destinations'; const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (itemsPerPage !== undefined) { queryParameters.itemsPerPage = itemsPerPage.toString(); } if (page !== undefined) { queryParameters.page = page.toString(); } + if (type !== undefined) { queryParameters.type = type.toString(); } @@ -1339,6 +1348,7 @@ export function createIngestionClient({ if (itemsPerPage !== undefined) { queryParameters.itemsPerPage = itemsPerPage.toString(); } + if (page !== undefined) { queryParameters.page = page.toString(); } @@ -1351,7 +1361,6 @@ export function createIngestionClient({ if (sort !== undefined) { queryParameters.sort = sort.toString(); } - if (order !== undefined) { queryParameters.order = order.toString(); } @@ -1399,13 +1408,13 @@ export function createIngestionClient({ const requestPath = '/1/runs'; const headers: Headers = {}; const queryParameters: QueryParameters = {}; - if (itemsPerPage !== undefined) { queryParameters.itemsPerPage = itemsPerPage.toString(); } if (page !== undefined) { queryParameters.page = page.toString(); } + if (status !== undefined) { queryParameters.status = status.toString(); } @@ -1418,13 +1427,14 @@ export function createIngestionClient({ if (sort !== undefined) { queryParameters.sort = sort.toString(); } - if (order !== undefined) { queryParameters.order = order.toString(); } + if (startDate !== undefined) { queryParameters.startDate = startDate.toString(); } + if (endDate !== undefined) { queryParameters.endDate = endDate.toString(); } @@ -1466,6 +1476,7 @@ export function createIngestionClient({ if (itemsPerPage !== undefined) { queryParameters.itemsPerPage = itemsPerPage.toString(); } + if (page !== undefined) { queryParameters.page = page.toString(); } @@ -1478,7 +1489,6 @@ export function createIngestionClient({ if (sort !== undefined) { queryParameters.sort = sort.toString(); } - if (order !== undefined) { queryParameters.order = order.toString(); } @@ -1529,13 +1539,13 @@ export function createIngestionClient({ if (action !== undefined) { queryParameters.action = action.toString(); } - if (enabled !== undefined) { queryParameters.enabled = enabled.toString(); } if (sourceID !== undefined) { queryParameters.sourceID = sourceID.toString(); } + if (destinationID !== undefined) { queryParameters.destinationID = destinationID.toString(); } @@ -1595,7 +1605,6 @@ export function createIngestionClient({ if (action !== undefined) { queryParameters.action = action.toString(); } - if (enabled !== undefined) { queryParameters.enabled = enabled.toString(); } diff --git a/clients/algoliasearch-client-javascript/packages/monitoring/src/monitoringClient.ts b/clients/algoliasearch-client-javascript/packages/monitoring/src/monitoringClient.ts index 6ed0587717..5ac8bd7bfd 100644 --- a/clients/algoliasearch-client-javascript/packages/monitoring/src/monitoringClient.ts +++ b/clients/algoliasearch-client-javascript/packages/monitoring/src/monitoringClient.ts @@ -95,6 +95,16 @@ export function createMonitoringClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-javascript/packages/recommend/src/recommendClient.ts b/clients/algoliasearch-client-javascript/packages/recommend/src/recommendClient.ts index 05868b224d..903f1b4133 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/src/recommendClient.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/src/recommendClient.ts @@ -125,6 +125,16 @@ export function createRecommendClient({ transporter.algoliaAgent.add({ segment, version }); }, + /** + * Helper method to switch the API key used to authenticate the requests. + * + * @param params - Method params. + * @param params.apiKey - The new API Key to use. + */ + setClientApiKey({ apiKey }: { apiKey: string }): void { + transporter.baseHeaders['x-algolia-api-key'] = apiKey; + }, + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/AbtestingClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/AbtestingClient.kt index 55dc2bff66..4598df9a1c 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/AbtestingClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/AbtestingClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class AbtestingClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, public val region: String? = null, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/AnalyticsClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/AnalyticsClient.kt index 7b655439c0..0b16cbee1d 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/AnalyticsClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/AnalyticsClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class AnalyticsClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, public val region: String? = null, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/ApiClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/ApiClient.kt index 55f5c3a006..414900641b 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/ApiClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/ApiClient.kt @@ -12,7 +12,15 @@ import com.algolia.client.transport.Requester */ public sealed interface ApiClient { public val appId: String - public val apiKey: String + public var apiKey: String public val options: ClientOptions public val requester: Requester + + /** + * Helper method to switch the API key used to authenticate requests. + */ + public fun setClientApiKey(apiKey: String) { + this.apiKey = apiKey + this.requester.setClientApiKey(apiKey) + } } diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/IngestionClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/IngestionClient.kt index 1dd6d9e15b..80040f1a9a 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/IngestionClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/IngestionClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class IngestionClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, public val region: String, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/InsightsClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/InsightsClient.kt index 8cfd7024f7..41c3564648 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/InsightsClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/InsightsClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class InsightsClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, public val region: String? = null, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/MonitoringClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/MonitoringClient.kt index 08b385b8b5..0238890d07 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/MonitoringClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/MonitoringClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class MonitoringClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/PersonalizationClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/PersonalizationClient.kt index 5246d197b0..e524a8760b 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/PersonalizationClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/PersonalizationClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class PersonalizationClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, public val region: String, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/QuerySuggestionsClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/QuerySuggestionsClient.kt index e17be0b63d..96bb0efc37 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/QuerySuggestionsClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/QuerySuggestionsClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class QuerySuggestionsClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, public val region: String, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/RecommendClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/RecommendClient.kt index 3eb25c9ca6..1c7903d78e 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/RecommendClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/RecommendClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class RecommendClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/SearchClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/SearchClient.kt index 3571966a4b..e629760fac 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/SearchClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/SearchClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class SearchClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/UsageClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/UsageClient.kt index e73006191c..963ff3e889 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/UsageClient.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/UsageClient.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.* public class UsageClient( override val appId: String, - override val apiKey: String, + override var apiKey: String, override val options: ClientOptions = ClientOptions(), ) : ApiClient { diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/transport/Requester.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/transport/Requester.kt index 94f772139a..967a4b4f60 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/transport/Requester.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/transport/Requester.kt @@ -31,5 +31,5 @@ public interface Requester { returnType: TypeInfo, ): T - public fun setClientApiKey(apiKey: String); + public fun setClientApiKey(apiKey: String) } diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingClient.php b/clients/algoliasearch-client-php/lib/Api/AbtestingClient.php index 7bd863fa24..2568e36c4d 100644 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingClient.php +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingClient.php @@ -99,6 +99,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * Creates a new A/B test. * diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsClient.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsClient.php index 113fe2754c..db608eb6ae 100644 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsClient.php +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsClient.php @@ -97,6 +97,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-php/lib/Api/IngestionClient.php b/clients/algoliasearch-client-php/lib/Api/IngestionClient.php index 44965abc3c..909246856f 100644 --- a/clients/algoliasearch-client-php/lib/Api/IngestionClient.php +++ b/clients/algoliasearch-client-php/lib/Api/IngestionClient.php @@ -118,6 +118,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * Creates a new authentication resource. * diff --git a/clients/algoliasearch-client-php/lib/Api/InsightsClient.php b/clients/algoliasearch-client-php/lib/Api/InsightsClient.php index 2d948e46ca..df18d9e836 100644 --- a/clients/algoliasearch-client-php/lib/Api/InsightsClient.php +++ b/clients/algoliasearch-client-php/lib/Api/InsightsClient.php @@ -98,6 +98,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-php/lib/Api/MonitoringClient.php b/clients/algoliasearch-client-php/lib/Api/MonitoringClient.php index dbcbc5d518..93af2680a6 100644 --- a/clients/algoliasearch-client-php/lib/Api/MonitoringClient.php +++ b/clients/algoliasearch-client-php/lib/Api/MonitoringClient.php @@ -93,6 +93,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationClient.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationClient.php index ac88bc234b..d69bba11cb 100644 --- a/clients/algoliasearch-client-php/lib/Api/PersonalizationClient.php +++ b/clients/algoliasearch-client-php/lib/Api/PersonalizationClient.php @@ -98,6 +98,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php index 32c6a388ed..cd01ac2295 100644 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsClient.php @@ -99,6 +99,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application. * diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendClient.php b/clients/algoliasearch-client-php/lib/Api/RecommendClient.php index 9016fb5a05..085e27e773 100644 --- a/clients/algoliasearch-client-php/lib/Api/RecommendClient.php +++ b/clients/algoliasearch-client-php/lib/Api/RecommendClient.php @@ -99,6 +99,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-php/lib/Api/SearchClient.php b/clients/algoliasearch-client-php/lib/Api/SearchClient.php index c851b6db82..6f4c832ac8 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchClient.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchClient.php @@ -127,6 +127,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * Creates a new API key with specific permissions and restrictions. * diff --git a/clients/algoliasearch-client-php/lib/Api/UsageClient.php b/clients/algoliasearch-client-php/lib/Api/UsageClient.php index 3f8f06f5b3..72ee0ceb98 100644 --- a/clients/algoliasearch-client-php/lib/Api/UsageClient.php +++ b/clients/algoliasearch-client-php/lib/Api/UsageClient.php @@ -93,6 +93,16 @@ public function getClientConfig() return $this->config; } + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + /** * This method allow you to send requests to the Algolia REST API. * diff --git a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php index 72b9de5b48..226d7bbeaf 100644 --- a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php +++ b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php @@ -269,8 +269,6 @@ public function setDefaultHeaders(array $defaultHeaders) * Switch the API key used to authenticate requessts. * * @param string $apiKey The new API key to be used - * - * @return void */ public function setClientApiKey($apiKey) { diff --git a/clients/algoliasearch-client-python/algoliasearch/abtesting/client.py b/clients/algoliasearch-client-python/algoliasearch/abtesting/client.py index a0c837d27e..446a4eca86 100644 --- a/clients/algoliasearch-client-python/algoliasearch/abtesting/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/abtesting/client.py @@ -116,6 +116,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def add_ab_tests_with_http_info( self, add_ab_tests_request: AddABTestsRequest, diff --git a/clients/algoliasearch-client-python/algoliasearch/analytics/client.py b/clients/algoliasearch-client-python/algoliasearch/analytics/client.py index ea34332681..b12f721cd6 100644 --- a/clients/algoliasearch-client-python/algoliasearch/analytics/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/analytics/client.py @@ -162,6 +162,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/ingestion/client.py b/clients/algoliasearch-client-python/algoliasearch/ingestion/client.py index f5c148d251..7d7df6fd06 100644 --- a/clients/algoliasearch-client-python/algoliasearch/ingestion/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/ingestion/client.py @@ -204,6 +204,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def create_authentication_with_http_info( self, authentication_create: AuthenticationCreate, diff --git a/clients/algoliasearch-client-python/algoliasearch/insights/client.py b/clients/algoliasearch-client-python/algoliasearch/insights/client.py index 9decdb34b8..500f79feb0 100644 --- a/clients/algoliasearch-client-python/algoliasearch/insights/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/insights/client.py @@ -108,6 +108,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/monitoring/client.py b/clients/algoliasearch-client-python/algoliasearch/monitoring/client.py index aa3a226c82..2d4f832edf 100644 --- a/clients/algoliasearch-client-python/algoliasearch/monitoring/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/monitoring/client.py @@ -114,6 +114,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/personalization/client.py b/clients/algoliasearch-client-python/algoliasearch/personalization/client.py index e9c960650a..7e150bde82 100644 --- a/clients/algoliasearch-client-python/algoliasearch/personalization/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/personalization/client.py @@ -118,6 +118,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/query_suggestions/client.py b/clients/algoliasearch-client-python/algoliasearch/query_suggestions/client.py index 1bf3d65d1d..663fee60d6 100644 --- a/clients/algoliasearch-client-python/algoliasearch/query_suggestions/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/query_suggestions/client.py @@ -116,6 +116,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def create_config_with_http_info( self, configuration_with_index: ConfigurationWithIndex, diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/client.py b/clients/algoliasearch-client-python/algoliasearch/recommend/client.py index 55cfc5ab11..fed092cfa7 100644 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/client.py @@ -122,6 +122,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/search/client.py b/clients/algoliasearch-client-python/algoliasearch/search/client.py index 17d3ab14cf..dd97692053 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/client.py @@ -203,6 +203,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def wait_for_task( self, index_name: str, diff --git a/clients/algoliasearch-client-python/algoliasearch/usage/client.py b/clients/algoliasearch-client-python/algoliasearch/usage/client.py index fff3117f48..37c2915403 100644 --- a/clients/algoliasearch-client-python/algoliasearch/usage/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/usage/client.py @@ -107,6 +107,10 @@ async def close(self) -> None: """Closes the underlying `transporter` of the API client.""" return await self._transporter.close() + def set_client_api_key(self, api_key: str) -> None: + """Sets a new API key to authenticate requests.""" + self._transporter._config.set_client_api_key(api_key) + async def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/abtesting_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/abtesting_client.rb index 45bdc9b357..84bac17106 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/abtesting_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/abtesting_client.rb @@ -39,6 +39,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # Creates a new A/B test. # # Required API Key ACLs: diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/analytics_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/analytics_client.rb index 3cfba8cc61..00ecf4bf93 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/analytics_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/analytics_client.rb @@ -39,6 +39,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # This method allow you to send requests to the Algolia REST API. # @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/ingestion_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/ingestion_client.rb index b23c21105e..97e72910d4 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/ingestion_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/ingestion_client.rb @@ -39,6 +39,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # Creates a new authentication resource. # # Required API Key ACLs: diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/insights_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/insights_client.rb index 31692a7054..7369f2bc44 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/insights_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/insights_client.rb @@ -39,6 +39,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # This method allow you to send requests to the Algolia REST API. # @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/monitoring_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/monitoring_client.rb index 5cd63b1f49..536999519f 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/monitoring_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/monitoring_client.rb @@ -24,6 +24,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # This method allow you to send requests to the Algolia REST API. # @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/personalization_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/personalization_client.rb index bc8f0a6a7a..b8e4edb39f 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/personalization_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/personalization_client.rb @@ -39,6 +39,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # This method allow you to send requests to the Algolia REST API. # @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/query_suggestions_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/query_suggestions_client.rb index adda7fa335..c779edc003 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/query_suggestions_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/query_suggestions_client.rb @@ -39,6 +39,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application. # # Required API Key ACLs: diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/recommend_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/recommend_client.rb index 732b35f212..6f7dfb0f4c 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/recommend_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/recommend_client.rb @@ -32,6 +32,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # This method allow you to send requests to the Algolia REST API. # @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/search_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/search_client.rb index a718a3903f..ab544b62af 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/search_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/search_client.rb @@ -35,6 +35,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # Creates a new API key with specific permissions and restrictions. # # Required API Key ACLs: diff --git a/clients/algoliasearch-client-ruby/lib/algolia/api/usage_client.rb b/clients/algoliasearch-client-ruby/lib/algolia/api/usage_client.rb index 402644c0c2..45b0430ff8 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/api/usage_client.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/api/usage_client.rb @@ -24,6 +24,14 @@ def self.create_with_config(config) new(config) end + # Helper method to switch the API key used to authenticate the requests. + # + # @param api_key [String] the new API key to use. + # @return [void] + def set_client_api_key(api_key) + @api_client.set_client_api_key(api_key) + end + # This method allow you to send requests to the Algolia REST API. # @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/internal/interceptor/AuthInterceptor.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/internal/interceptor/AuthInterceptor.scala index 59b9d667a3..b9b72f17f0 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/internal/interceptor/AuthInterceptor.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/internal/interceptor/AuthInterceptor.scala @@ -10,8 +10,8 @@ import okhttp3.{Interceptor, Response} * API key */ private[algoliasearch] class AuthInterceptor( - applicationId: String, - private var apiKey: String + applicationId: String, + private var apiKey: String ) extends Interceptor { private val HeaderApplicationId = "x-algolia-application-id" diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClient.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClient.swift index cdb47f9727..74bc5c8ac7 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClient.swift @@ -27,6 +27,11 @@ open class AbtestingClient { try self.init(configuration: AbtestingClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter addABTestsRequest: (body) /// - returns: ABTestResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClientConfiguration.swift index 54ab48a100..067e987590 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClientConfiguration.swift @@ -12,7 +12,7 @@ public struct AbtestingClientConfiguration: BaseConfiguration, Credentials { ] public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClient.swift b/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClient.swift index 1a26341636..a86c5fd9d0 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClient.swift @@ -27,6 +27,11 @@ open class AnalyticsClient { try self.init(configuration: AnalyticsClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. /// - parameter parameters: (query) Query parameters to apply to the current query. (optional) /// - returns: AnyCodable diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClientConfiguration.swift index 0da070eb74..32b54ad3ec 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClientConfiguration.swift @@ -12,7 +12,7 @@ public struct AnalyticsClientConfiguration: BaseConfiguration, Credentials { ] public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClient.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClient.swift index 5ced3ee3c3..ac7002e4f9 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClient.swift @@ -27,6 +27,11 @@ open class IngestionClient { try self.init(configuration: IngestionClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter authenticationCreate: (body) /// - returns: AuthenticationCreateResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClientConfiguration.swift index af7d53d357..a073c322ef 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClientConfiguration.swift @@ -12,7 +12,7 @@ public struct IngestionClientConfiguration: BaseConfiguration, Credentials { ] public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/Insights/InsightsClient.swift b/clients/algoliasearch-client-swift/Sources/Insights/InsightsClient.swift index 771ecada37..b30e8d42e7 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/InsightsClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/InsightsClient.swift @@ -27,6 +27,11 @@ open class InsightsClient { try self.init(configuration: InsightsClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. /// - parameter parameters: (query) Query parameters to apply to the current query. (optional) /// - returns: AnyCodable diff --git a/clients/algoliasearch-client-swift/Sources/Insights/InsightsClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Insights/InsightsClientConfiguration.swift index d1262e1690..9d9d6b2071 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/InsightsClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/InsightsClientConfiguration.swift @@ -12,7 +12,7 @@ public struct InsightsClientConfiguration: BaseConfiguration, Credentials { ] public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClient.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClient.swift index e85552ef9d..0dae3f29b9 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClient.swift @@ -27,6 +27,11 @@ open class MonitoringClient { try self.init(configuration: MonitoringClientConfiguration(appID: appID, apiKey: apiKey)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. /// - parameter parameters: (query) Query parameters to apply to the current query. (optional) /// - returns: AnyCodable diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClientConfiguration.swift index 65d50e7e63..4070fdfecf 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClientConfiguration.swift @@ -8,7 +8,7 @@ import Foundation public struct MonitoringClientConfiguration: BaseConfiguration, Credentials { public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift b/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift index 323841d64d..282eba36ed 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift @@ -27,6 +27,11 @@ open class PersonalizationClient { try self.init(configuration: PersonalizationClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. /// - parameter parameters: (query) Query parameters to apply to the current query. (optional) /// - returns: AnyCodable diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClientConfiguration.swift index d68658d3b9..5859eb3307 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClientConfiguration.swift @@ -12,7 +12,7 @@ public struct PersonalizationClientConfiguration: BaseConfiguration, Credentials ] public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClient.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClient.swift index 9300796d71..5b7cd01ca5 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClient.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClient.swift @@ -27,6 +27,11 @@ open class QuerySuggestionsClient { try self.init(configuration: QuerySuggestionsClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter configurationWithIndex: (body) /// - returns: BaseResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClientConfiguration.swift index 843250e784..93fb1eb7a8 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClientConfiguration.swift @@ -12,7 +12,7 @@ public struct QuerySuggestionsClientConfiguration: BaseConfiguration, Credential ] public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClient.swift b/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClient.swift index 46f466c04d..a0443e7c3e 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClient.swift @@ -27,6 +27,11 @@ open class RecommendClient { try self.init(configuration: RecommendClientConfiguration(appID: appID, apiKey: apiKey)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. /// - parameter parameters: (query) Query parameters to apply to the current query. (optional) /// - returns: AnyCodable diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClientConfiguration.swift index 5d6b6944d0..ee4c296f2a 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClientConfiguration.swift @@ -8,7 +8,7 @@ import Foundation public struct RecommendClientConfiguration: BaseConfiguration, Credentials { public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/Search/SearchClient.swift b/clients/algoliasearch-client-swift/Sources/Search/SearchClient.swift index 620c2f0046..384cf900da 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/SearchClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/SearchClient.swift @@ -27,6 +27,11 @@ open class SearchClient { try self.init(configuration: SearchClientConfiguration(appID: appID, apiKey: apiKey)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter apiKey: (body) /// - returns: AddApiKeyResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) diff --git a/clients/algoliasearch-client-swift/Sources/Search/SearchClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Search/SearchClientConfiguration.swift index 670aa77211..cc386ec74b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/SearchClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/SearchClientConfiguration.swift @@ -8,7 +8,7 @@ import Foundation public struct SearchClientConfiguration: BaseConfiguration, Credentials { public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/clients/algoliasearch-client-swift/Sources/Usage/UsageClient.swift b/clients/algoliasearch-client-swift/Sources/Usage/UsageClient.swift index 4d34f87240..7f5d009c38 100644 --- a/clients/algoliasearch-client-swift/Sources/Usage/UsageClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Usage/UsageClient.swift @@ -27,6 +27,11 @@ open class UsageClient { try self.init(configuration: UsageClientConfiguration(appID: appID, apiKey: apiKey)) } + open func setClientApiKey(apiKey: String) { + self.configuration.apiKey = apiKey + self.transporter.setClientApiKey(apiKey: apiKey) + } + /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. /// - parameter parameters: (query) Query parameters to apply to the current query. (optional) /// - returns: AnyCodable diff --git a/clients/algoliasearch-client-swift/Sources/Usage/UsageClientConfiguration.swift b/clients/algoliasearch-client-swift/Sources/Usage/UsageClientConfiguration.swift index 0801959517..3d6aa68762 100644 --- a/clients/algoliasearch-client-swift/Sources/Usage/UsageClientConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/Usage/UsageClientConfiguration.swift @@ -8,7 +8,7 @@ import Foundation public struct UsageClientConfiguration: BaseConfiguration, Credentials { public let appID: String - public let apiKey: String + public var apiKey: String public var writeTimeout: TimeInterval public var readTimeout: TimeInterval public var logLevel: LogLevel diff --git a/snippets/csharp/src/Abtesting.cs b/snippets/csharp/src/Abtesting.cs index 03034dd696..c1c3c74593 100644 --- a/snippets/csharp/src/Abtesting.cs +++ b/snippets/csharp/src/Abtesting.cs @@ -36,6 +36,7 @@ public async Task SnippetForAbtestingClientAddABTests() }, } ); + // >LOG // SEPARATOR< } @@ -54,6 +55,7 @@ public async Task SnippetForAbtestingClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -72,6 +74,7 @@ public async Task SnippetForAbtestingClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -90,6 +93,7 @@ public async Task SnippetForAbtestingClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -108,6 +112,7 @@ public async Task SnippetForAbtestingClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -126,6 +131,7 @@ public async Task SnippetForAbtestingClientDeleteABTest() // Call the API var response = await client.DeleteABTestAsync(42); + // >LOG // SEPARATOR< } @@ -144,6 +150,7 @@ public async Task SnippetForAbtestingClientGetABTest() // Call the API var response = await client.GetABTestAsync(42); + // >LOG // SEPARATOR< } @@ -162,6 +169,7 @@ public async Task SnippetForAbtestingClientListABTests() // Call the API var response = await client.ListABTestsAsync(); + // >LOG // SEPARATOR< } @@ -194,6 +202,26 @@ public async Task SnippetForAbtestingClientScheduleABTest() }, } ); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForAbtestingClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new AbtestingClient( + new AbtestingConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + ); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -212,6 +240,7 @@ public async Task SnippetForAbtestingClientStopABTest() // Call the API var response = await client.StopABTestAsync(42); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/Analytics.cs b/snippets/csharp/src/Analytics.cs index a5630388e6..bb4aa21ac7 100644 --- a/snippets/csharp/src/Analytics.cs +++ b/snippets/csharp/src/Analytics.cs @@ -23,6 +23,7 @@ public async Task SnippetForAnalyticsClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -41,6 +42,7 @@ public async Task SnippetForAnalyticsClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -59,6 +61,7 @@ public async Task SnippetForAnalyticsClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -77,6 +80,7 @@ public async Task SnippetForAnalyticsClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -95,6 +99,7 @@ public async Task SnippetForAnalyticsClientGetAddToCartRate() // Call the API var response = await client.GetAddToCartRateAsync("index"); + // >LOG // SEPARATOR< } @@ -113,6 +118,7 @@ public async Task SnippetForAnalyticsClientGetAverageClickPosition() // Call the API var response = await client.GetAverageClickPositionAsync("index"); + // >LOG // SEPARATOR< } @@ -131,6 +137,7 @@ public async Task SnippetForAnalyticsClientGetClickPositions() // Call the API var response = await client.GetClickPositionsAsync("index"); + // >LOG // SEPARATOR< } @@ -149,6 +156,7 @@ public async Task SnippetForAnalyticsClientGetClickThroughRate() // Call the API var response = await client.GetClickThroughRateAsync("index"); + // >LOG // SEPARATOR< } @@ -167,6 +175,7 @@ public async Task SnippetForAnalyticsClientGetConversionRate() // Call the API var response = await client.GetConversionRateAsync("index"); + // >LOG // SEPARATOR< } @@ -185,6 +194,7 @@ public async Task SnippetForAnalyticsClientGetNoClickRate() // Call the API var response = await client.GetNoClickRateAsync("index"); + // >LOG // SEPARATOR< } @@ -203,6 +213,7 @@ public async Task SnippetForAnalyticsClientGetNoResultsRate() // Call the API var response = await client.GetNoResultsRateAsync("index"); + // >LOG // SEPARATOR< } @@ -221,6 +232,7 @@ public async Task SnippetForAnalyticsClientGetPurchaseRate() // Call the API var response = await client.GetPurchaseRateAsync("index"); + // >LOG // SEPARATOR< } @@ -239,6 +251,7 @@ public async Task SnippetForAnalyticsClientGetRevenue() // Call the API var response = await client.GetRevenueAsync("index"); + // >LOG // SEPARATOR< } @@ -257,6 +270,7 @@ public async Task SnippetForAnalyticsClientGetSearchesCount() // Call the API var response = await client.GetSearchesCountAsync("index"); + // >LOG // SEPARATOR< } @@ -275,6 +289,7 @@ public async Task SnippetForAnalyticsClientGetSearchesNoClicks() // Call the API var response = await client.GetSearchesNoClicksAsync("index"); + // >LOG // SEPARATOR< } @@ -293,6 +308,7 @@ public async Task SnippetForAnalyticsClientGetSearchesNoResults() // Call the API var response = await client.GetSearchesNoResultsAsync("index"); + // >LOG // SEPARATOR< } @@ -311,6 +327,7 @@ public async Task SnippetForAnalyticsClientGetStatus() // Call the API var response = await client.GetStatusAsync("index"); + // >LOG // SEPARATOR< } @@ -329,6 +346,7 @@ public async Task SnippetForAnalyticsClientGetTopCountries() // Call the API var response = await client.GetTopCountriesAsync("index"); + // >LOG // SEPARATOR< } @@ -347,6 +365,7 @@ public async Task SnippetForAnalyticsClientGetTopFilterAttributes() // Call the API var response = await client.GetTopFilterAttributesAsync("index"); + // >LOG // SEPARATOR< } @@ -365,6 +384,7 @@ public async Task SnippetForAnalyticsClientGetTopFilterForAttribute() // Call the API var response = await client.GetTopFilterForAttributeAsync("myAttribute", "index"); + // >LOG // SEPARATOR< } @@ -383,6 +403,7 @@ public async Task SnippetForAnalyticsClientGetTopFiltersNoResults() // Call the API var response = await client.GetTopFiltersNoResultsAsync("index"); + // >LOG // SEPARATOR< } @@ -401,6 +422,7 @@ public async Task SnippetForAnalyticsClientGetTopHits() // Call the API var response = await client.GetTopHitsAsync("index"); + // >LOG // SEPARATOR< } @@ -419,6 +441,7 @@ public async Task SnippetForAnalyticsClientGetTopSearches() // Call the API var response = await client.GetTopSearchesAsync("index"); + // >LOG // SEPARATOR< } @@ -437,6 +460,26 @@ public async Task SnippetForAnalyticsClientGetUsersCount() // Call the API var response = await client.GetUsersCountAsync("index"); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForAnalyticsClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new AnalyticsClient( + new AnalyticsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + ); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/Ingestion.cs b/snippets/csharp/src/Ingestion.cs index e58c4e9864..08e45ff464 100644 --- a/snippets/csharp/src/Ingestion.cs +++ b/snippets/csharp/src/Ingestion.cs @@ -37,6 +37,7 @@ public async Task SnippetForIngestionClientCreateAuthentication() ), } ); + // >LOG // SEPARATOR< } @@ -63,6 +64,7 @@ public async Task SnippetForIngestionClientCreateDestination() AuthenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", } ); + // >LOG // SEPARATOR< } @@ -97,6 +99,7 @@ public async Task SnippetForIngestionClientCreateSource() AuthenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", } ); + // >LOG // SEPARATOR< } @@ -122,6 +125,7 @@ public async Task SnippetForIngestionClientCreateTask() Action = Enum.Parse("Replace"), } ); + // >LOG // SEPARATOR< } @@ -150,6 +154,7 @@ public async Task SnippetForIngestionClientCreateTaskV1() Action = Enum.Parse("Replace"), } ); + // >LOG // SEPARATOR< } @@ -175,6 +180,7 @@ public async Task SnippetForIngestionClientCreateTransformation() Description = "baz", } ); + // >LOG // SEPARATOR< } @@ -193,6 +199,7 @@ public async Task SnippetForIngestionClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -211,6 +218,7 @@ public async Task SnippetForIngestionClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -229,6 +237,7 @@ public async Task SnippetForIngestionClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -247,6 +256,7 @@ public async Task SnippetForIngestionClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -265,6 +275,7 @@ public async Task SnippetForIngestionClientDeleteAuthentication() // Call the API var response = await client.DeleteAuthenticationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -283,6 +294,7 @@ public async Task SnippetForIngestionClientDeleteDestination() // Call the API var response = await client.DeleteDestinationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -301,6 +313,7 @@ public async Task SnippetForIngestionClientDeleteSource() // Call the API var response = await client.DeleteSourceAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -319,6 +332,7 @@ public async Task SnippetForIngestionClientDeleteTask() // Call the API var response = await client.DeleteTaskAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -337,6 +351,7 @@ public async Task SnippetForIngestionClientDeleteTaskV1() // Call the API var response = await client.DeleteTaskV1Async("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -355,6 +370,7 @@ public async Task SnippetForIngestionClientDeleteTransformation() // Call the API var response = await client.DeleteTransformationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -373,6 +389,7 @@ public async Task SnippetForIngestionClientDisableTask() // Call the API var response = await client.DisableTaskAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -391,6 +408,7 @@ public async Task SnippetForIngestionClientDisableTaskV1() // Call the API var response = await client.DisableTaskV1Async("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -409,6 +427,7 @@ public async Task SnippetForIngestionClientEnableTask() // Call the API var response = await client.EnableTaskAsync("76ab4c2a-ce17-496f-b7a6-506dc59ee498"); + // >LOG // SEPARATOR< } @@ -427,6 +446,7 @@ public async Task SnippetForIngestionClientEnableTaskV1() // Call the API var response = await client.EnableTaskV1Async("76ab4c2a-ce17-496f-b7a6-506dc59ee498"); + // >LOG // SEPARATOR< } @@ -452,6 +472,7 @@ public async Task SnippetForIngestionClientGenerateTransformationCode() "fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing", } ); + // >LOG // SEPARATOR< } @@ -470,6 +491,7 @@ public async Task SnippetForIngestionClientGetAuthentication() // Call the API var response = await client.GetAuthenticationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -488,6 +510,7 @@ public async Task SnippetForIngestionClientGetDestination() // Call the API var response = await client.GetDestinationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -509,6 +532,7 @@ public async Task SnippetForIngestionClientGetEvent() "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "6c02aeb1-775e-418e-870b-1faccd4b2c0c" ); + // >LOG // SEPARATOR< } @@ -527,6 +551,7 @@ public async Task SnippetForIngestionClientGetRun() // Call the API var response = await client.GetRunAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -545,6 +570,7 @@ public async Task SnippetForIngestionClientGetSource() // Call the API var response = await client.GetSourceAsync("75eeb306-51d3-4e5e-a279-3c92bd8893ac"); + // >LOG // SEPARATOR< } @@ -563,6 +589,7 @@ public async Task SnippetForIngestionClientGetTask() // Call the API var response = await client.GetTaskAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -581,6 +608,7 @@ public async Task SnippetForIngestionClientGetTaskV1() // Call the API var response = await client.GetTaskV1Async("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -599,6 +627,7 @@ public async Task SnippetForIngestionClientGetTransformation() // Call the API var response = await client.GetTransformationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -617,6 +646,7 @@ public async Task SnippetForIngestionClientListAuthentications() // Call the API var response = await client.ListAuthenticationsAsync(); + // >LOG // SEPARATOR< } @@ -635,6 +665,7 @@ public async Task SnippetForIngestionClientListDestinations() // Call the API var response = await client.ListDestinationsAsync(); + // >LOG // SEPARATOR< } @@ -653,6 +684,7 @@ public async Task SnippetForIngestionClientListEvents() // Call the API var response = await client.ListEventsAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -671,6 +703,7 @@ public async Task SnippetForIngestionClientListRuns() // Call the API var response = await client.ListRunsAsync(); + // >LOG // SEPARATOR< } @@ -689,6 +722,7 @@ public async Task SnippetForIngestionClientListSources() // Call the API var response = await client.ListSourcesAsync(); + // >LOG // SEPARATOR< } @@ -707,6 +741,7 @@ public async Task SnippetForIngestionClientListTasks() // Call the API var response = await client.ListTasksAsync(); + // >LOG // SEPARATOR< } @@ -725,6 +760,7 @@ public async Task SnippetForIngestionClientListTasksV1() // Call the API var response = await client.ListTasksV1Async(); + // >LOG // SEPARATOR< } @@ -743,6 +779,7 @@ public async Task SnippetForIngestionClientListTransformationModels() // Call the API var response = await client.ListTransformationModelsAsync(); + // >LOG // SEPARATOR< } @@ -761,6 +798,7 @@ public async Task SnippetForIngestionClientListTransformations() // Call the API var response = await client.ListTransformationsAsync(); + // >LOG // SEPARATOR< } @@ -806,6 +844,7 @@ public async Task SnippetForIngestionClientPushTask() }, } ); + // >LOG // SEPARATOR< } @@ -832,6 +871,7 @@ public async Task SnippetForIngestionClientRunSource() EntityType = Enum.Parse("Product"), } ); + // >LOG // SEPARATOR< } @@ -850,6 +890,7 @@ public async Task SnippetForIngestionClientRunTask() // Call the API var response = await client.RunTaskAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -868,6 +909,7 @@ public async Task SnippetForIngestionClientRunTaskV1() // Call the API var response = await client.RunTaskV1Async("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -895,6 +937,7 @@ public async Task SnippetForIngestionClientSearchAuthentications() }, } ); + // >LOG // SEPARATOR< } @@ -922,6 +965,7 @@ public async Task SnippetForIngestionClientSearchDestinations() }, } ); + // >LOG // SEPARATOR< } @@ -949,6 +993,7 @@ public async Task SnippetForIngestionClientSearchSources() }, } ); + // >LOG // SEPARATOR< } @@ -977,6 +1022,7 @@ public async Task SnippetForIngestionClientSearchTasks() }, } ); + // >LOG // SEPARATOR< } @@ -1005,6 +1051,7 @@ public async Task SnippetForIngestionClientSearchTasksV1() }, } ); + // >LOG // SEPARATOR< } @@ -1033,6 +1080,26 @@ public async Task SnippetForIngestionClientSearchTransformations() }, } ); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForIngestionClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new IngestionClient( + new IngestionConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + ); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -1053,6 +1120,7 @@ public async Task SnippetForIngestionClientTriggerDockerSourceDiscover() var response = await client.TriggerDockerSourceDiscoverAsync( "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ); + // >LOG // SEPARATOR< } @@ -1077,6 +1145,7 @@ public async Task SnippetForIngestionClientTryTransformation() SampleRecord = new Dictionary { { "bar", "baz" } }, } ); + // >LOG // SEPARATOR< } @@ -1102,6 +1171,7 @@ public async Task SnippetForIngestionClientTryTransformationBeforeUpdate() SampleRecord = new Dictionary { { "bar", "baz" } }, } ); + // >LOG // SEPARATOR< } @@ -1123,6 +1193,7 @@ public async Task SnippetForIngestionClientUpdateAuthentication() "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new AuthenticationUpdate { Name = "newName", } ); + // >LOG // SEPARATOR< } @@ -1144,6 +1215,7 @@ public async Task SnippetForIngestionClientUpdateDestination() "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new DestinationUpdate { Name = "newName", } ); + // >LOG // SEPARATOR< } @@ -1165,6 +1237,7 @@ public async Task SnippetForIngestionClientUpdateSource() "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new SourceUpdate { Name = "newName", } ); + // >LOG // SEPARATOR< } @@ -1186,6 +1259,7 @@ public async Task SnippetForIngestionClientUpdateTask() "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TaskUpdate { Enabled = false, Cron = "* * * * *", } ); + // >LOG // SEPARATOR< } @@ -1207,6 +1281,7 @@ public async Task SnippetForIngestionClientUpdateTaskV1() "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TaskUpdateV1 { Enabled = false, } ); + // >LOG // SEPARATOR< } @@ -1233,6 +1308,7 @@ public async Task SnippetForIngestionClientUpdateTransformation() Description = "baz", } ); + // >LOG // SEPARATOR< } @@ -1267,6 +1343,7 @@ public async Task SnippetForIngestionClientValidateSource() AuthenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", } ); + // >LOG // SEPARATOR< } @@ -1288,6 +1365,7 @@ public async Task SnippetForIngestionClientValidateSourceBeforeUpdate() "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new SourceUpdate { Name = "newName", } ); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/Insights.cs b/snippets/csharp/src/Insights.cs index fb876ecc49..c6566acc1a 100644 --- a/snippets/csharp/src/Insights.cs +++ b/snippets/csharp/src/Insights.cs @@ -23,6 +23,7 @@ public async Task SnippetForInsightsClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -41,6 +42,7 @@ public async Task SnippetForInsightsClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -59,6 +61,7 @@ public async Task SnippetForInsightsClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -77,6 +80,7 @@ public async Task SnippetForInsightsClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -95,6 +99,7 @@ public async Task SnippetForInsightsClientDeleteUserToken() // Call the API await client.DeleteUserTokenAsync("test-user-1"); + // >LOG // SEPARATOR< } @@ -134,6 +139,26 @@ public async Task SnippetForInsightsClientPushEvents() }, } ); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForInsightsClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new InsightsClient( + new InsightsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + ); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/Monitoring.cs b/snippets/csharp/src/Monitoring.cs index ebae427766..ebcae63906 100644 --- a/snippets/csharp/src/Monitoring.cs +++ b/snippets/csharp/src/Monitoring.cs @@ -21,6 +21,7 @@ public async Task SnippetForMonitoringClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -37,6 +38,7 @@ public async Task SnippetForMonitoringClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -53,6 +55,7 @@ public async Task SnippetForMonitoringClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -69,6 +72,7 @@ public async Task SnippetForMonitoringClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -85,6 +89,7 @@ public async Task SnippetForMonitoringClientGetClusterIncidents() // Call the API var response = await client.GetClusterIncidentsAsync("c1-de"); + // >LOG // SEPARATOR< } @@ -101,6 +106,7 @@ public async Task SnippetForMonitoringClientGetClusterStatus() // Call the API var response = await client.GetClusterStatusAsync("c1-de"); + // >LOG // SEPARATOR< } @@ -117,6 +123,7 @@ public async Task SnippetForMonitoringClientGetIncidents() // Call the API var response = await client.GetIncidentsAsync(); + // >LOG // SEPARATOR< } @@ -133,6 +140,7 @@ public async Task SnippetForMonitoringClientGetIndexingTime() // Call the API var response = await client.GetIndexingTimeAsync("c1-de"); + // >LOG // SEPARATOR< } @@ -149,6 +157,7 @@ public async Task SnippetForMonitoringClientGetLatency() // Call the API var response = await client.GetLatencyAsync("c1-de"); + // >LOG // SEPARATOR< } @@ -168,6 +177,7 @@ public async Task SnippetForMonitoringClientGetMetrics() Enum.Parse("AvgBuildTime"), Enum.Parse("Minute") ); + // >LOG // SEPARATOR< } @@ -184,6 +194,7 @@ public async Task SnippetForMonitoringClientGetReachability() // Call the API var response = await client.GetReachabilityAsync("c1-de"); + // >LOG // SEPARATOR< } @@ -200,6 +211,7 @@ public async Task SnippetForMonitoringClientGetServers() // Call the API var response = await client.GetServersAsync(); + // >LOG // SEPARATOR< } @@ -216,6 +228,24 @@ public async Task SnippetForMonitoringClientGetStatus() // Call the API var response = await client.GetStatusAsync(); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForMonitoringClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new MonitoringClient(new MonitoringConfig("YOUR_APP_ID", "YOUR_API_KEY")); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/Personalization.cs b/snippets/csharp/src/Personalization.cs index 32fb5193f9..7662aed426 100644 --- a/snippets/csharp/src/Personalization.cs +++ b/snippets/csharp/src/Personalization.cs @@ -23,6 +23,7 @@ public async Task SnippetForPersonalizationClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -41,6 +42,7 @@ public async Task SnippetForPersonalizationClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -59,6 +61,7 @@ public async Task SnippetForPersonalizationClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -77,6 +80,7 @@ public async Task SnippetForPersonalizationClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -95,6 +99,7 @@ public async Task SnippetForPersonalizationClientDeleteUserProfile() // Call the API var response = await client.DeleteUserProfileAsync("UserToken"); + // >LOG // SEPARATOR< } @@ -113,6 +118,7 @@ public async Task SnippetForPersonalizationClientGetPersonalizationStrategy() // Call the API var response = await client.GetPersonalizationStrategyAsync(); + // >LOG // SEPARATOR< } @@ -131,6 +137,26 @@ public async Task SnippetForPersonalizationClientGetUserTokenProfile() // Call the API var response = await client.GetUserTokenProfileAsync("UserToken"); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForPersonalizationClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new PersonalizationClient( + new PersonalizationConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + ); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -167,6 +193,7 @@ public async Task SnippetForPersonalizationClientSetPersonalizationStrategy() PersonalizationImpact = 42, } ); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/QuerySuggestions.cs b/snippets/csharp/src/QuerySuggestions.cs index 65d3d10c31..6709e509b9 100644 --- a/snippets/csharp/src/QuerySuggestions.cs +++ b/snippets/csharp/src/QuerySuggestions.cs @@ -43,6 +43,7 @@ public async Task SnippetForQuerySuggestionsClientCreateConfig() Exclude = new List { "test" }, } ); + // >LOG // SEPARATOR< } @@ -61,6 +62,7 @@ public async Task SnippetForQuerySuggestionsClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -79,6 +81,7 @@ public async Task SnippetForQuerySuggestionsClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -97,6 +100,7 @@ public async Task SnippetForQuerySuggestionsClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -115,6 +119,7 @@ public async Task SnippetForQuerySuggestionsClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -133,6 +138,7 @@ public async Task SnippetForQuerySuggestionsClientDeleteConfig() // Call the API var response = await client.DeleteConfigAsync(""); + // >LOG // SEPARATOR< } @@ -151,6 +157,7 @@ public async Task SnippetForQuerySuggestionsClientGetAllConfigs() // Call the API var response = await client.GetAllConfigsAsync(); + // >LOG // SEPARATOR< } @@ -169,6 +176,7 @@ public async Task SnippetForQuerySuggestionsClientGetConfig() // Call the API var response = await client.GetConfigAsync(""); + // >LOG // SEPARATOR< } @@ -187,6 +195,7 @@ public async Task SnippetForQuerySuggestionsClientGetConfigStatus() // Call the API var response = await client.GetConfigStatusAsync(""); + // >LOG // SEPARATOR< } @@ -205,6 +214,26 @@ public async Task SnippetForQuerySuggestionsClientGetLogFile() // Call the API var response = await client.GetLogFileAsync(""); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForQuerySuggestionsClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new QuerySuggestionsClient( + new QuerySuggestionsConfig("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + ); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -243,6 +272,7 @@ public async Task SnippetForQuerySuggestionsClientUpdateConfig() Exclude = new List { "test" }, } ); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/Recommend.cs b/snippets/csharp/src/Recommend.cs index ca09a44d9c..a828e2e264 100644 --- a/snippets/csharp/src/Recommend.cs +++ b/snippets/csharp/src/Recommend.cs @@ -21,6 +21,7 @@ public async Task SnippetForRecommendClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -37,6 +38,7 @@ public async Task SnippetForRecommendClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -53,6 +55,7 @@ public async Task SnippetForRecommendClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -69,6 +72,7 @@ public async Task SnippetForRecommendClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -89,6 +93,7 @@ public async Task SnippetForRecommendClientDeleteRecommendRule() Enum.Parse("RelatedProducts"), "objectID" ); + // >LOG // SEPARATOR< } @@ -109,6 +114,7 @@ public async Task SnippetForRecommendClientGetRecommendRule() Enum.Parse("RelatedProducts"), "objectID" ); + // >LOG // SEPARATOR< } @@ -129,6 +135,7 @@ public async Task SnippetForRecommendClientGetRecommendStatus() Enum.Parse("RelatedProducts"), 12345L ); + // >LOG // SEPARATOR< } @@ -161,6 +168,7 @@ public async Task SnippetForRecommendClientGetRecommendations() }, } ); + // >LOG // SEPARATOR< } @@ -180,6 +188,24 @@ public async Task SnippetForRecommendClientSearchRecommendRules() "", Enum.Parse("RelatedProducts") ); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForRecommendClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new RecommendClient(new RecommendConfig("YOUR_APP_ID", "YOUR_API_KEY")); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/Search.cs b/snippets/csharp/src/Search.cs index 6170c2c7f8..33b09876da 100644 --- a/snippets/csharp/src/Search.cs +++ b/snippets/csharp/src/Search.cs @@ -30,6 +30,7 @@ public async Task SnippetForSearchClientAddApiKey() MaxHitsPerQuery = 20, } ); + // >LOG // SEPARATOR< } @@ -50,6 +51,7 @@ public async Task SnippetForSearchClientAddOrUpdateObject() "uniqueID", new Dictionary { { "key", "value" } } ); + // >LOG // SEPARATOR< } @@ -68,6 +70,7 @@ public async Task SnippetForSearchClientAppendSource() var response = await client.AppendSourceAsync( new Source { VarSource = "theSource", Description = "theDescription", } ); + // >LOG // SEPARATOR< } @@ -87,6 +90,7 @@ public async Task SnippetForSearchClientAssignUserId() "userID", new AssignUserIdParams { Cluster = "theCluster", } ); + // >LOG // SEPARATOR< } @@ -121,6 +125,7 @@ public async Task SnippetForSearchClientBatch() }, } ); + // >LOG // SEPARATOR< } @@ -150,6 +155,7 @@ public async Task SnippetForSearchClientBatch1() }, } ); + // >LOG // SEPARATOR< } @@ -179,6 +185,7 @@ public async Task SnippetForSearchClientBatch2() }, } ); + // >LOG // SEPARATOR< } @@ -208,6 +215,7 @@ public async Task SnippetForSearchClientBatch3() }, } ); + // >LOG // SEPARATOR< } @@ -237,6 +245,7 @@ public async Task SnippetForSearchClientBatch4() }, } ); + // >LOG // SEPARATOR< } @@ -266,6 +275,7 @@ public async Task SnippetForSearchClientBatch5() }, } ); + // >LOG // SEPARATOR< } @@ -295,6 +305,7 @@ public async Task SnippetForSearchClientBatch6() }, } ); + // >LOG // SEPARATOR< } @@ -318,6 +329,7 @@ public async Task SnippetForSearchClientBatchAssignUserIds() Users = new List { "user1", "user2" }, } ); + // >LOG // SEPARATOR< } @@ -356,6 +368,7 @@ public async Task SnippetForSearchClientBatchDictionaryEntries() }, } ); + // >LOG // SEPARATOR< } @@ -386,6 +399,7 @@ public async Task SnippetForSearchClientBatchDictionaryEntries1() }, } ); + // >LOG // SEPARATOR< } @@ -420,6 +434,7 @@ public async Task SnippetForSearchClientBatchDictionaryEntries2() }, } ); + // >LOG // SEPARATOR< } @@ -436,6 +451,7 @@ public async Task SnippetForSearchClientBrowse() // Call the API var response = await client.BrowseAsync(""); + // >LOG // SEPARATOR< } @@ -452,6 +468,7 @@ public async Task SnippetForSearchClientClearObjects() // Call the API var response = await client.ClearObjectsAsync(""); + // >LOG // SEPARATOR< } @@ -468,6 +485,7 @@ public async Task SnippetForSearchClientClearRules() // Call the API var response = await client.ClearRulesAsync(""); + // >LOG // SEPARATOR< } @@ -484,6 +502,7 @@ public async Task SnippetForSearchClientClearSynonyms() // Call the API var response = await client.ClearSynonymsAsync(""); + // >LOG // SEPARATOR< } @@ -500,6 +519,7 @@ public async Task SnippetForSearchClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -516,6 +536,7 @@ public async Task SnippetForSearchClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -532,6 +553,7 @@ public async Task SnippetForSearchClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -548,6 +570,7 @@ public async Task SnippetForSearchClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -564,6 +587,7 @@ public async Task SnippetForSearchClientDeleteApiKey() // Call the API var response = await client.DeleteApiKeyAsync("myTestApiKey"); + // >LOG // SEPARATOR< } @@ -583,6 +607,7 @@ public async Task SnippetForSearchClientDeleteBy() "", new DeleteByParams { Filters = "brand:brandName", } ); + // >LOG // SEPARATOR< } @@ -599,6 +624,7 @@ public async Task SnippetForSearchClientDeleteIndex() // Call the API var response = await client.DeleteIndexAsync(""); + // >LOG // SEPARATOR< } @@ -615,6 +641,7 @@ public async Task SnippetForSearchClientDeleteObject() // Call the API var response = await client.DeleteObjectAsync("", "uniqueID"); + // >LOG // SEPARATOR< } @@ -634,6 +661,7 @@ public async Task SnippetForSearchClientDeleteObjects() "", new List { "1", "2" } ); + // >LOG // SEPARATOR< } @@ -650,6 +678,7 @@ public async Task SnippetForSearchClientDeleteRule() // Call the API var response = await client.DeleteRuleAsync("", "id1"); + // >LOG // SEPARATOR< } @@ -666,6 +695,7 @@ public async Task SnippetForSearchClientDeleteSource() // Call the API var response = await client.DeleteSourceAsync("theSource"); + // >LOG // SEPARATOR< } @@ -682,6 +712,7 @@ public async Task SnippetForSearchClientDeleteSynonym() // Call the API var response = await client.DeleteSynonymAsync("", "id1"); + // >LOG // SEPARATOR< } @@ -705,6 +736,7 @@ public async Task SnippetForSearchClientGenerateSecuredApiKey() RestrictIndices = new List { "Movies" }, } ); + // >LOG // SEPARATOR< } @@ -740,6 +772,7 @@ public async Task SnippetForSearchClientGenerateSecuredApiKey1() }, } ); + // >LOG // SEPARATOR< } @@ -756,6 +789,7 @@ public async Task SnippetForSearchClientGetApiKey() // Call the API var response = await client.GetApiKeyAsync("myTestApiKey"); + // >LOG // SEPARATOR< } @@ -772,6 +806,7 @@ public async Task SnippetForSearchClientGetAppTask() // Call the API var response = await client.GetAppTaskAsync(123L); + // >LOG // SEPARATOR< } @@ -788,6 +823,7 @@ public async Task SnippetForSearchClientGetDictionaryLanguages() // Call the API var response = await client.GetDictionaryLanguagesAsync(); + // >LOG // SEPARATOR< } @@ -804,6 +840,7 @@ public async Task SnippetForSearchClientGetDictionarySettings() // Call the API var response = await client.GetDictionarySettingsAsync(); + // >LOG // SEPARATOR< } @@ -820,6 +857,7 @@ public async Task SnippetForSearchClientGetLogs() // Call the API var response = await client.GetLogsAsync(); + // >LOG // SEPARATOR< } @@ -840,6 +878,7 @@ public async Task SnippetForSearchClientGetObject() "uniqueID", new List { "attr1", "attr2" } ); + // >LOG // SEPARATOR< } @@ -869,6 +908,7 @@ public async Task SnippetForSearchClientGetObjects() }, } ); + // >LOG // SEPARATOR< } @@ -885,6 +925,7 @@ public async Task SnippetForSearchClientGetRule() // Call the API var response = await client.GetRuleAsync("", "qr-1725004648916"); + // >LOG // SEPARATOR< } @@ -901,6 +942,7 @@ public async Task SnippetForSearchClientGetSettings() // Call the API var response = await client.GetSettingsAsync(""); + // >LOG // SEPARATOR< } @@ -917,6 +959,7 @@ public async Task SnippetForSearchClientGetSources() // Call the API var response = await client.GetSourcesAsync(); + // >LOG // SEPARATOR< } @@ -933,6 +976,7 @@ public async Task SnippetForSearchClientGetSynonym() // Call the API var response = await client.GetSynonymAsync("", "id1"); + // >LOG // SEPARATOR< } @@ -949,6 +993,7 @@ public async Task SnippetForSearchClientGetTask() // Call the API var response = await client.GetTaskAsync("", 123L); + // >LOG // SEPARATOR< } @@ -965,6 +1010,7 @@ public async Task SnippetForSearchClientGetTopUserIds() // Call the API var response = await client.GetTopUserIdsAsync(); + // >LOG // SEPARATOR< } @@ -981,6 +1027,7 @@ public async Task SnippetForSearchClientGetUserId() // Call the API var response = await client.GetUserIdAsync("uniqueID"); + // >LOG // SEPARATOR< } @@ -997,6 +1044,7 @@ public async Task SnippetForSearchClientHasPendingMappings() // Call the API var response = await client.HasPendingMappingsAsync(); + // >LOG // SEPARATOR< } @@ -1013,6 +1061,7 @@ public async Task SnippetForSearchClientIndexExists() // Call the API var response = await client.IndexExistsAsync(""); + // >LOG // SEPARATOR< } @@ -1029,6 +1078,7 @@ public async Task SnippetForSearchClientIndexExists1() // Call the API var response = await client.IndexExistsAsync(""); + // >LOG // SEPARATOR< } @@ -1045,6 +1095,7 @@ public async Task SnippetForSearchClientIndexExists2() // Call the API var response = await client.IndexExistsAsync(""); + // >LOG // SEPARATOR< } @@ -1061,6 +1112,7 @@ public async Task SnippetForSearchClientListApiKeys() // Call the API var response = await client.ListApiKeysAsync(); + // >LOG // SEPARATOR< } @@ -1077,6 +1129,7 @@ public async Task SnippetForSearchClientListClusters() // Call the API var response = await client.ListClustersAsync(); + // >LOG // SEPARATOR< } @@ -1093,6 +1146,7 @@ public async Task SnippetForSearchClientListIndices() // Call the API var response = await client.ListIndicesAsync(); + // >LOG // SEPARATOR< } @@ -1109,6 +1163,7 @@ public async Task SnippetForSearchClientListUserIds() // Call the API var response = await client.ListUserIdsAsync(); + // >LOG // SEPARATOR< } @@ -1138,6 +1193,7 @@ public async Task SnippetForSearchClientMultipleBatch() }, } ); + // >LOG // SEPARATOR< } @@ -1166,6 +1222,7 @@ public async Task SnippetForSearchClientOperationIndex() }, } ); + // >LOG // SEPARATOR< } @@ -1189,6 +1246,7 @@ public async Task SnippetForSearchClientOperationIndex1() Destination = "", } ); + // >LOG // SEPARATOR< } @@ -1212,6 +1270,7 @@ public async Task SnippetForSearchClientOperationIndex2() Destination = "", } ); + // >LOG // SEPARATOR< } @@ -1232,6 +1291,7 @@ public async Task SnippetForSearchClientPartialUpdateObject() "uniqueID", new Dictionary { { "attributeId", "new value" } } ); + // >LOG // SEPARATOR< } @@ -1256,6 +1316,7 @@ public async Task SnippetForSearchClientPartialUpdateObjects() }, true ); + // >LOG // SEPARATOR< } @@ -1280,6 +1341,7 @@ public async Task SnippetForSearchClientPartialUpdateObjects1() }, false ); + // >LOG // SEPARATOR< } @@ -1296,6 +1358,7 @@ public async Task SnippetForSearchClientRemoveUserId() // Call the API var response = await client.RemoveUserIdAsync("uniqueID"); + // >LOG // SEPARATOR< } @@ -1328,6 +1391,7 @@ public async Task SnippetForSearchClientReplaceAllObjects() }, 3 ); + // >LOG // SEPARATOR< } @@ -1349,6 +1413,7 @@ public async Task SnippetForSearchClientReplaceSources() new Source { VarSource = "theSource", Description = "theDescription", } } ); + // >LOG // SEPARATOR< } @@ -1365,6 +1430,7 @@ public async Task SnippetForSearchClientRestoreApiKey() // Call the API var response = await client.RestoreApiKeyAsync("myApiKey"); + // >LOG // SEPARATOR< } @@ -1384,6 +1450,7 @@ public async Task SnippetForSearchClientSaveObject() "", new Dictionary { { "objectID", "id" }, { "test", "val" } } ); + // >LOG // SEPARATOR< } @@ -1407,6 +1474,7 @@ public async Task SnippetForSearchClientSaveObjects() new Dictionary { { "objectID", "2" }, { "name", "Benoit" } } } ); + // >LOG // SEPARATOR< } @@ -1430,6 +1498,7 @@ public async Task SnippetForSearchClientSaveObjects1() new Dictionary { { "objectID", "2" }, { "name", "Benoit" } } } ); + // >LOG // SEPARATOR< } @@ -1457,6 +1526,7 @@ public async Task SnippetForSearchClientSaveRule() }, } ); + // >LOG // SEPARATOR< } @@ -1496,6 +1566,7 @@ public async Task SnippetForSearchClientSaveRules() false, true ); + // >LOG // SEPARATOR< } @@ -1522,6 +1593,7 @@ public async Task SnippetForSearchClientSaveSynonym() }, true ); + // >LOG // SEPARATOR< } @@ -1558,6 +1630,7 @@ public async Task SnippetForSearchClientSaveSynonyms() true, true ); + // >LOG // SEPARATOR< } @@ -1589,6 +1662,7 @@ public async Task SnippetForSearchClientSearch() }, } ); + // >LOG // SEPARATOR< } @@ -1620,6 +1694,7 @@ public async Task SnippetForSearchClientSearch1() }, } ); + // >LOG // SEPARATOR< } @@ -1651,6 +1726,7 @@ public async Task SnippetForSearchClientSearch2() }, } ); + // >LOG // SEPARATOR< } @@ -1682,6 +1758,7 @@ public async Task SnippetForSearchClientSearch3() }, } ); + // >LOG // SEPARATOR< } @@ -1713,6 +1790,7 @@ public async Task SnippetForSearchClientSearch4() }, } ); + // >LOG // SEPARATOR< } @@ -1744,6 +1822,7 @@ public async Task SnippetForSearchClientSearch5() }, } ); + // >LOG // SEPARATOR< } @@ -1763,6 +1842,7 @@ public async Task SnippetForSearchClientSearchDictionaryEntries() Enum.Parse("Stopwords"), new SearchDictionaryEntriesParams { Query = "about", } ); + // >LOG // SEPARATOR< } @@ -1779,6 +1859,7 @@ public async Task SnippetForSearchClientSearchForFacetValues() // Call the API var response = await client.SearchForFacetValuesAsync("", "facetName"); + // >LOG // SEPARATOR< } @@ -1798,6 +1879,7 @@ public async Task SnippetForSearchClientSearchRules() "", new SearchRulesParams { Query = "zorro", } ); + // >LOG // SEPARATOR< } @@ -1814,6 +1896,7 @@ public async Task SnippetForSearchClientSearchSingleIndex() // Call the API var response = await client.SearchSingleIndexAsync(""); + // >LOG // SEPARATOR< } @@ -1830,6 +1913,7 @@ public async Task SnippetForSearchClientSearchSynonyms() // Call the API var response = await client.SearchSynonymsAsync(""); + // >LOG // SEPARATOR< } @@ -1854,6 +1938,24 @@ public async Task SnippetForSearchClientSearchUserIds() HitsPerPage = 10, } ); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForSearchClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY")); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -1883,6 +1985,7 @@ public async Task SnippetForSearchClientSetDictionarySettings() }, } ); + // >LOG // SEPARATOR< } @@ -1910,6 +2013,7 @@ public async Task SnippetForSearchClientSetSettings() }, } ); + // >LOG // SEPARATOR< } @@ -1935,6 +2039,7 @@ public async Task SnippetForSearchClientUpdateApiKey() MaxHitsPerQuery = 20, } ); + // >LOG // SEPARATOR< } @@ -1954,6 +2059,7 @@ public async Task SnippetForSearchClientWaitForApiKey() "api-key-add-operation-test-csharp", Enum.Parse("Add") ); + // >LOG // SEPARATOR< } @@ -1988,6 +2094,7 @@ public async Task SnippetForSearchClientWaitForApiKey1() MaxHitsPerQuery = 20, } ); + // >LOG // SEPARATOR< } @@ -2007,6 +2114,7 @@ public async Task SnippetForSearchClientWaitForApiKey2() "api-key-delete-operation-test-csharp", Enum.Parse("Delete") ); + // >LOG // SEPARATOR< } @@ -2023,6 +2131,7 @@ public async Task SnippetForSearchClientWaitForAppTask() // Call the API var response = await client.WaitForAppTaskAsync(123L); + // >LOG // SEPARATOR< } @@ -2039,6 +2148,7 @@ public async Task SnippetForSearchClientWaitForTask() // Call the API var response = await client.WaitForTaskAsync("", 123L); + // >LOG // SEPARATOR< } } diff --git a/snippets/csharp/src/Usage.cs b/snippets/csharp/src/Usage.cs index b5493baef7..eb6cbc1f6e 100644 --- a/snippets/csharp/src/Usage.cs +++ b/snippets/csharp/src/Usage.cs @@ -21,6 +21,7 @@ public async Task SnippetForUsageClientCustomDelete() // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -37,6 +38,7 @@ public async Task SnippetForUsageClientCustomGet() // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -53,6 +55,7 @@ public async Task SnippetForUsageClientCustomPost() // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -69,6 +72,7 @@ public async Task SnippetForUsageClientCustomPut() // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG // SEPARATOR< } @@ -90,6 +94,7 @@ public async Task SnippetForUsageClientGetIndexUsage() "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z" ); + // >LOG // SEPARATOR< } @@ -110,6 +115,24 @@ public async Task SnippetForUsageClientGetUsage() "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z" ); + // >LOG + // SEPARATOR< + } + + /// + /// Snippet for the SetClientApiKey method. + /// + /// switch API key + /// + public async Task SnippetForUsageClientSetClientApiKey() + { + // >SEPARATOR setClientApiKey default + // Initialize the client + var client = new UsageClient(new UsageConfig("YOUR_APP_ID", "YOUR_API_KEY")); + + // Call the API + client.SetClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/dart/lib/algoliasearch.dart b/snippets/dart/lib/algoliasearch.dart index c5cea131fc..38493b0e73 100644 --- a/snippets/dart/lib/algoliasearch.dart +++ b/snippets/dart/lib/algoliasearch.dart @@ -15,6 +15,7 @@ void snippetForcustomPost() async { final response = await client.customPost( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -39,6 +40,7 @@ void snippetForgetRecommendations() async { ], ), ); + // >LOG // SEPARATOR< } @@ -62,6 +64,7 @@ void snippetForsearch() async { ], ), ); + // >LOG // SEPARATOR< } @@ -85,6 +88,7 @@ void snippetForsearch1() async { ], ), ); + // >LOG // SEPARATOR< } @@ -108,6 +112,7 @@ void snippetForsearch2() async { ], ), ); + // >LOG // SEPARATOR< } @@ -131,6 +136,7 @@ void snippetForsearch3() async { ], ), ); + // >LOG // SEPARATOR< } @@ -157,6 +163,7 @@ void snippetForsearch4() async { ], ), ); + // >LOG // SEPARATOR< } @@ -182,5 +189,6 @@ void snippetForsearch5() async { ], ), ); + // >LOG // SEPARATOR< } diff --git a/snippets/dart/lib/insights.dart b/snippets/dart/lib/insights.dart index 1cef8ab9e1..29f7dd292c 100644 --- a/snippets/dart/lib/insights.dart +++ b/snippets/dart/lib/insights.dart @@ -18,6 +18,7 @@ void snippetForcustomDelete() async { final response = await client.customDelete( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -36,6 +37,7 @@ void snippetForcustomGet() async { final response = await client.customGet( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -54,6 +56,7 @@ void snippetForcustomPost() async { final response = await client.customPost( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -72,6 +75,7 @@ void snippetForcustomPut() async { final response = await client.customPut( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -87,9 +91,10 @@ void snippetFordeleteUserToken() async { region: 'YOUR_APP_ID_REGION'); // Call the API - final response = await client.deleteUserToken( + await client.deleteUserToken( userToken: "test-user-1", ); + // >LOG // SEPARATOR< } @@ -128,5 +133,25 @@ void snippetForpushEvents() async { ], ), ); + // >LOG + // SEPARATOR< +} + +// Snippet for the setClientApiKey method. +// +// switch API key +void snippetForsetClientApiKey() async { + // >SEPARATOR setClientApiKey default + // Initialize the client + final client = InsightsClient( + appId: 'YOUR_APP_ID', + apiKey: 'YOUR_API_KEY', + region: 'YOUR_APP_ID_REGION'); + + // Call the API + client.setClientApiKey( + apiKey: "updated-api-key", + ); + // >LOG // SEPARATOR< } diff --git a/snippets/dart/lib/recommend.dart b/snippets/dart/lib/recommend.dart index 3f9b603a1e..bbde6f0881 100644 --- a/snippets/dart/lib/recommend.dart +++ b/snippets/dart/lib/recommend.dart @@ -15,6 +15,7 @@ void snippetForcustomDelete() async { final response = await client.customDelete( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -30,6 +31,7 @@ void snippetForcustomGet() async { final response = await client.customGet( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -45,6 +47,7 @@ void snippetForcustomPost() async { final response = await client.customPost( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -60,6 +63,7 @@ void snippetForcustomPut() async { final response = await client.customPut( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -77,6 +81,7 @@ void snippetFordeleteRecommendRule() async { model: RecommendModels.fromJson("related-products"), objectID: "objectID", ); + // >LOG // SEPARATOR< } @@ -94,6 +99,7 @@ void snippetForgetRecommendRule() async { model: RecommendModels.fromJson("related-products"), objectID: "objectID", ); + // >LOG // SEPARATOR< } @@ -111,6 +117,7 @@ void snippetForgetRecommendStatus() async { model: RecommendModels.fromJson("related-products"), taskID: 12345, ); + // >LOG // SEPARATOR< } @@ -135,6 +142,7 @@ void snippetForgetRecommendations() async { ], ), ); + // >LOG // SEPARATOR< } @@ -151,5 +159,22 @@ void snippetForsearchRecommendRules() async { indexName: "", model: RecommendModels.fromJson("related-products"), ); + // >LOG + // SEPARATOR< +} + +// Snippet for the setClientApiKey method. +// +// switch API key +void snippetForsetClientApiKey() async { + // >SEPARATOR setClientApiKey default + // Initialize the client + final client = RecommendClient(appId: 'YOUR_APP_ID', apiKey: 'YOUR_API_KEY'); + + // Call the API + client.setClientApiKey( + apiKey: "updated-api-key", + ); + // >LOG // SEPARATOR< } diff --git a/snippets/dart/lib/search.dart b/snippets/dart/lib/search.dart index 116ae306ce..440907ddad 100644 --- a/snippets/dart/lib/search.dart +++ b/snippets/dart/lib/search.dart @@ -24,6 +24,7 @@ void snippetForaddApiKey() async { maxHitsPerQuery: 20, ), ); + // >LOG // SEPARATOR< } @@ -43,6 +44,7 @@ void snippetForaddOrUpdateObject() async { 'key': "value", }, ); + // >LOG // SEPARATOR< } @@ -61,6 +63,7 @@ void snippetForappendSource() async { description: "theDescription", ), ); + // >LOG // SEPARATOR< } @@ -79,6 +82,7 @@ void snippetForassignUserId() async { cluster: "theCluster", ), ); + // >LOG // SEPARATOR< } @@ -112,6 +116,7 @@ void snippetForbatch() async { ], ), ); + // >LOG // SEPARATOR< } @@ -137,6 +142,7 @@ void snippetForbatch1() async { ], ), ); + // >LOG // SEPARATOR< } @@ -162,6 +168,7 @@ void snippetForbatch2() async { ], ), ); + // >LOG // SEPARATOR< } @@ -187,6 +194,7 @@ void snippetForbatch3() async { ], ), ); + // >LOG // SEPARATOR< } @@ -212,6 +220,7 @@ void snippetForbatch4() async { ], ), ); + // >LOG // SEPARATOR< } @@ -237,6 +246,7 @@ void snippetForbatch5() async { ], ), ); + // >LOG // SEPARATOR< } @@ -262,6 +272,7 @@ void snippetForbatch6() async { ], ), ); + // >LOG // SEPARATOR< } @@ -284,6 +295,7 @@ void snippetForbatchAssignUserIds() async { ], ), ); + // >LOG // SEPARATOR< } @@ -321,6 +333,7 @@ void snippetForbatchDictionaryEntries() async { ], ), ); + // >LOG // SEPARATOR< } @@ -347,6 +360,7 @@ void snippetForbatchDictionaryEntries1() async { ], ), ); + // >LOG // SEPARATOR< } @@ -374,6 +388,7 @@ void snippetForbatchDictionaryEntries2() async { ], ), ); + // >LOG // SEPARATOR< } @@ -389,6 +404,7 @@ void snippetForbrowse() async { final response = await client.browse( indexName: "", ); + // >LOG // SEPARATOR< } @@ -404,6 +420,7 @@ void snippetForclearObjects() async { final response = await client.clearObjects( indexName: "", ); + // >LOG // SEPARATOR< } @@ -419,6 +436,7 @@ void snippetForclearRules() async { final response = await client.clearRules( indexName: "", ); + // >LOG // SEPARATOR< } @@ -434,6 +452,7 @@ void snippetForclearSynonyms() async { final response = await client.clearSynonyms( indexName: "", ); + // >LOG // SEPARATOR< } @@ -449,6 +468,7 @@ void snippetForcustomDelete() async { final response = await client.customDelete( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -464,6 +484,7 @@ void snippetForcustomGet() async { final response = await client.customGet( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -479,6 +500,7 @@ void snippetForcustomPost() async { final response = await client.customPost( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -494,6 +516,7 @@ void snippetForcustomPut() async { final response = await client.customPut( path: "test/minimal", ); + // >LOG // SEPARATOR< } @@ -509,6 +532,7 @@ void snippetFordeleteApiKey() async { final response = await client.deleteApiKey( key: "myTestApiKey", ); + // >LOG // SEPARATOR< } @@ -527,6 +551,7 @@ void snippetFordeleteBy() async { filters: "brand:brandName", ), ); + // >LOG // SEPARATOR< } @@ -542,6 +567,7 @@ void snippetFordeleteIndex() async { final response = await client.deleteIndex( indexName: "", ); + // >LOG // SEPARATOR< } @@ -558,6 +584,7 @@ void snippetFordeleteObject() async { indexName: "", objectID: "uniqueID", ); + // >LOG // SEPARATOR< } @@ -577,6 +604,7 @@ void snippetFordeleteObjects() async { "2", ], ); + // >LOG // SEPARATOR< } @@ -593,6 +621,7 @@ void snippetFordeleteRule() async { indexName: "", objectID: "id1", ); + // >LOG // SEPARATOR< } @@ -608,6 +637,7 @@ void snippetFordeleteSource() async { final response = await client.deleteSource( source: "theSource", ); + // >LOG // SEPARATOR< } @@ -624,6 +654,7 @@ void snippetFordeleteSynonym() async { indexName: "", objectID: "id1", ); + // >LOG // SEPARATOR< } @@ -636,7 +667,7 @@ void snippetForgenerateSecuredApiKey() async { final client = SearchClient(appId: 'YOUR_APP_ID', apiKey: 'YOUR_API_KEY'); // Call the API - final response = await client.generateSecuredApiKey( + final response = client.generateSecuredApiKey( parentApiKey: "2640659426d5107b6e47d75db9cbaef8", restrictions: SecuredApiKeyRestrictions( validUntil: 2524604400, @@ -645,6 +676,7 @@ void snippetForgenerateSecuredApiKey() async { ], ), ); + // >LOG // SEPARATOR< } @@ -657,7 +689,7 @@ void snippetForgenerateSecuredApiKey1() async { final client = SearchClient(appId: 'YOUR_APP_ID', apiKey: 'YOUR_API_KEY'); // Call the API - final response = await client.generateSecuredApiKey( + final response = client.generateSecuredApiKey( parentApiKey: "2640659426d5107b6e47d75db9cbaef8", restrictions: SecuredApiKeyRestrictions( validUntil: 2524604400, @@ -681,6 +713,7 @@ void snippetForgenerateSecuredApiKey1() async { ), ), ); + // >LOG // SEPARATOR< } @@ -696,6 +729,7 @@ void snippetForgetApiKey() async { final response = await client.getApiKey( key: "myTestApiKey", ); + // >LOG // SEPARATOR< } @@ -711,6 +745,7 @@ void snippetForgetAppTask() async { final response = await client.getAppTask( taskID: 123, ); + // >LOG // SEPARATOR< } @@ -724,6 +759,7 @@ void snippetForgetDictionaryLanguages() async { // Call the API final response = await client.getDictionaryLanguages(); + // >LOG // SEPARATOR< } @@ -737,6 +773,7 @@ void snippetForgetDictionarySettings() async { // Call the API final response = await client.getDictionarySettings(); + // >LOG // SEPARATOR< } @@ -750,6 +787,7 @@ void snippetForgetLogs() async { // Call the API final response = await client.getLogs(); + // >LOG // SEPARATOR< } @@ -770,6 +808,7 @@ void snippetForgetObject() async { "attr2", ], ); + // >LOG // SEPARATOR< } @@ -796,6 +835,7 @@ void snippetForgetObjects() async { ], ), ); + // >LOG // SEPARATOR< } @@ -812,6 +852,7 @@ void snippetForgetRule() async { indexName: "", objectID: "qr-1725004648916", ); + // >LOG // SEPARATOR< } @@ -827,6 +868,7 @@ void snippetForgetSettings() async { final response = await client.getSettings( indexName: "", ); + // >LOG // SEPARATOR< } @@ -840,6 +882,7 @@ void snippetForgetSources() async { // Call the API final response = await client.getSources(); + // >LOG // SEPARATOR< } @@ -856,6 +899,7 @@ void snippetForgetSynonym() async { indexName: "", objectID: "id1", ); + // >LOG // SEPARATOR< } @@ -872,6 +916,7 @@ void snippetForgetTask() async { indexName: "", taskID: 123, ); + // >LOG // SEPARATOR< } @@ -885,6 +930,7 @@ void snippetForgetTopUserIds() async { // Call the API final response = await client.getTopUserIds(); + // >LOG // SEPARATOR< } @@ -900,6 +946,7 @@ void snippetForgetUserId() async { final response = await client.getUserId( userID: "uniqueID", ); + // >LOG // SEPARATOR< } @@ -913,6 +960,7 @@ void snippetForhasPendingMappings() async { // Call the API final response = await client.hasPendingMappings(); + // >LOG // SEPARATOR< } @@ -928,6 +976,7 @@ void snippetForindexExists() async { final response = await client.indexExists( indexName: "", ); + // >LOG // SEPARATOR< } @@ -943,6 +992,7 @@ void snippetForindexExists1() async { final response = await client.indexExists( indexName: "", ); + // >LOG // SEPARATOR< } @@ -958,6 +1008,7 @@ void snippetForindexExists2() async { final response = await client.indexExists( indexName: "", ); + // >LOG // SEPARATOR< } @@ -971,6 +1022,7 @@ void snippetForlistApiKeys() async { // Call the API final response = await client.listApiKeys(); + // >LOG // SEPARATOR< } @@ -984,6 +1036,7 @@ void snippetForlistClusters() async { // Call the API final response = await client.listClusters(); + // >LOG // SEPARATOR< } @@ -997,6 +1050,7 @@ void snippetForlistIndices() async { // Call the API final response = await client.listIndices(); + // >LOG // SEPARATOR< } @@ -1010,6 +1064,7 @@ void snippetForlistUserIds() async { // Call the API final response = await client.listUserIds(); + // >LOG // SEPARATOR< } @@ -1035,6 +1090,7 @@ void snippetFormultipleBatch() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1058,6 +1114,7 @@ void snippetForoperationIndex() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1077,6 +1134,7 @@ void snippetForoperationIndex1() async { destination: "", ), ); + // >LOG // SEPARATOR< } @@ -1096,6 +1154,7 @@ void snippetForoperationIndex2() async { destination: "", ), ); + // >LOG // SEPARATOR< } @@ -1115,6 +1174,7 @@ void snippetForpartialUpdateObject() async { 'attributeId': "new value", }, ); + // >LOG // SEPARATOR< } @@ -1141,6 +1201,7 @@ void snippetForpartialUpdateObjects() async { ], createIfNotExists: true, ); + // >LOG // SEPARATOR< } @@ -1167,6 +1228,7 @@ void snippetForpartialUpdateObjects1() async { ], createIfNotExists: false, ); + // >LOG // SEPARATOR< } @@ -1182,6 +1244,7 @@ void snippetForremoveUserId() async { final response = await client.removeUserId( userID: "uniqueID", ); + // >LOG // SEPARATOR< } @@ -1240,6 +1303,7 @@ void snippetForreplaceAllObjects() async { ], batchSize: 3, ); + // >LOG // SEPARATOR< } @@ -1260,6 +1324,7 @@ void snippetForreplaceSources() async { ), ], ); + // >LOG // SEPARATOR< } @@ -1275,6 +1340,7 @@ void snippetForrestoreApiKey() async { final response = await client.restoreApiKey( key: "myApiKey", ); + // >LOG // SEPARATOR< } @@ -1294,6 +1360,7 @@ void snippetForsaveObject() async { 'test': "val", }, ); + // >LOG // SEPARATOR< } @@ -1319,6 +1386,7 @@ void snippetForsaveObjects() async { }, ], ); + // >LOG // SEPARATOR< } @@ -1344,6 +1412,7 @@ void snippetForsaveObjects1() async { }, ], ); + // >LOG // SEPARATOR< } @@ -1369,6 +1438,7 @@ void snippetForsaveRule() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1406,6 +1476,7 @@ void snippetForsaveRules() async { forwardToReplicas: false, clearExistingRules: true, ); + // >LOG // SEPARATOR< } @@ -1432,6 +1503,7 @@ void snippetForsaveSynonym() async { ), forwardToReplicas: true, ); + // >LOG // SEPARATOR< } @@ -1470,6 +1542,7 @@ void snippetForsaveSynonyms() async { forwardToReplicas: true, replaceExistingSynonyms: true, ); + // >LOG // SEPARATOR< } @@ -1493,6 +1566,7 @@ void snippetForsearch() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1516,6 +1590,7 @@ void snippetForsearch1() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1539,6 +1614,7 @@ void snippetForsearch2() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1562,6 +1638,7 @@ void snippetForsearch3() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1588,6 +1665,7 @@ void snippetForsearch4() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1613,6 +1691,7 @@ void snippetForsearch5() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1631,6 +1710,7 @@ void snippetForsearchDictionaryEntries() async { query: "about", ), ); + // >LOG // SEPARATOR< } @@ -1647,6 +1727,7 @@ void snippetForsearchForFacetValues() async { indexName: "", facetName: "facetName", ); + // >LOG // SEPARATOR< } @@ -1665,6 +1746,7 @@ void snippetForsearchRules() async { query: "zorro", ), ); + // >LOG // SEPARATOR< } @@ -1680,6 +1762,7 @@ void snippetForsearchSingleIndex() async { final response = await client.searchSingleIndex( indexName: "", ); + // >LOG // SEPARATOR< } @@ -1695,6 +1778,7 @@ void snippetForsearchSynonyms() async { final response = await client.searchSynonyms( indexName: "", ); + // >LOG // SEPARATOR< } @@ -1715,6 +1799,23 @@ void snippetForsearchUserIds() async { hitsPerPage: 10, ), ); + // >LOG + // SEPARATOR< +} + +// Snippet for the setClientApiKey method. +// +// switch API key +void snippetForsetClientApiKey() async { + // >SEPARATOR setClientApiKey default + // Initialize the client + final client = SearchClient(appId: 'YOUR_APP_ID', apiKey: 'YOUR_API_KEY'); + + // Call the API + client.setClientApiKey( + apiKey: "updated-api-key", + ); + // >LOG // SEPARATOR< } @@ -1738,6 +1839,7 @@ void snippetForsetDictionarySettings() async { ), ), ); + // >LOG // SEPARATOR< } @@ -1760,6 +1862,7 @@ void snippetForsetSettings() async { ], ), ); + // >LOG // SEPARATOR< } @@ -1784,6 +1887,7 @@ void snippetForupdateApiKey() async { maxHitsPerQuery: 20, ), ); + // >LOG // SEPARATOR< } @@ -1800,6 +1904,7 @@ void snippetForwaitForApiKey() async { key: "api-key-add-operation-test-dart", operation: ApiKeyOperation.fromJson("add"), ); + // >LOG // SEPARATOR< } @@ -1835,6 +1940,7 @@ void snippetForwaitForApiKey1() async { maxHitsPerQuery: 20, ), ); + // >LOG // SEPARATOR< } @@ -1851,6 +1957,7 @@ void snippetForwaitForApiKey2() async { key: "api-key-delete-operation-test-dart", operation: ApiKeyOperation.fromJson("delete"), ); + // >LOG // SEPARATOR< } @@ -1866,6 +1973,7 @@ void snippetForwaitForAppTask() async { final response = await client.waitForAppTask( taskID: 123, ); + // >LOG // SEPARATOR< } @@ -1882,5 +1990,6 @@ void snippetForwaitForTask() async { indexName: "", taskID: 123, ); + // >LOG // SEPARATOR< } diff --git a/snippets/go/src/abtesting.go b/snippets/go/src/abtesting.go index 6ceaad3eba..825c870f34 100644 --- a/snippets/go/src/abtesting.go +++ b/snippets/go/src/abtesting.go @@ -34,6 +34,7 @@ func SnippetForAddABTestsOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -62,6 +63,7 @@ func SnippetForCustomDeleteOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -90,6 +92,7 @@ func SnippetForCustomGetOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -118,6 +121,7 @@ func SnippetForCustomPostOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -146,6 +150,7 @@ func SnippetForCustomPutOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -174,6 +179,7 @@ func SnippetForDeleteABTestOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -202,6 +208,7 @@ func SnippetForGetABTestOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -228,6 +235,7 @@ func SnippetForListABTestsOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -260,10 +268,38 @@ func SnippetForScheduleABTestOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfAbtesting() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION + client, err := abtesting.NewClient("YOUR_APP_ID", "YOUR_API_KEY", abtesting.US) + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} func SnippetForStopABTestOfAbtesting() { /* Snippet for the stopABTest method. @@ -288,6 +324,7 @@ func SnippetForStopABTestOfAbtesting() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< diff --git a/snippets/go/src/analytics.go b/snippets/go/src/analytics.go index 5bd6c2698a..d961b6a158 100644 --- a/snippets/go/src/analytics.go +++ b/snippets/go/src/analytics.go @@ -30,6 +30,7 @@ func SnippetForCustomDeleteOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -58,6 +59,7 @@ func SnippetForCustomGetOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -86,6 +88,7 @@ func SnippetForCustomPostOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -114,6 +117,7 @@ func SnippetForCustomPutOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -142,6 +146,7 @@ func SnippetForGetAddToCartRateOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -170,6 +175,7 @@ func SnippetForGetAverageClickPositionOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -198,6 +204,7 @@ func SnippetForGetClickPositionsOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -226,6 +233,7 @@ func SnippetForGetClickThroughRateOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -254,6 +262,7 @@ func SnippetForGetConversionRateOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -282,6 +291,7 @@ func SnippetForGetNoClickRateOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -310,6 +320,7 @@ func SnippetForGetNoResultsRateOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -338,6 +349,7 @@ func SnippetForGetPurchaseRateOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -366,6 +378,7 @@ func SnippetForGetRevenueOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -394,6 +407,7 @@ func SnippetForGetSearchesCountOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -422,6 +436,7 @@ func SnippetForGetSearchesNoClicksOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -450,6 +465,7 @@ func SnippetForGetSearchesNoResultsOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -478,6 +494,7 @@ func SnippetForGetStatusOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -506,6 +523,7 @@ func SnippetForGetTopCountriesOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -534,6 +552,7 @@ func SnippetForGetTopFilterAttributesOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -562,6 +581,7 @@ func SnippetForGetTopFilterForAttributeOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -590,6 +610,7 @@ func SnippetForGetTopFiltersNoResultsOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -618,6 +639,7 @@ func SnippetForGetTopHitsOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -646,6 +668,7 @@ func SnippetForGetTopSearchesOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -674,7 +697,35 @@ func SnippetForGetUsersCountOfAnalytics() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfAnalytics() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION + client, err := analytics.NewClient("YOUR_APP_ID", "YOUR_API_KEY", analytics.US) + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} diff --git a/snippets/go/src/ingestion.go b/snippets/go/src/ingestion.go index 2de5664b2f..3263466adc 100644 --- a/snippets/go/src/ingestion.go +++ b/snippets/go/src/ingestion.go @@ -32,6 +32,7 @@ func SnippetForCreateAuthenticationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -62,6 +63,7 @@ func SnippetForCreateDestinationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -94,6 +96,7 @@ func SnippetForCreateSourceOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -123,6 +126,7 @@ func SnippetForCreateTaskOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -153,6 +157,7 @@ func SnippetForCreateTaskV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -182,6 +187,7 @@ func SnippetForCreateTransformationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -210,6 +216,7 @@ func SnippetForCustomDeleteOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -238,6 +245,7 @@ func SnippetForCustomGetOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -266,6 +274,7 @@ func SnippetForCustomPostOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -294,6 +303,7 @@ func SnippetForCustomPutOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -322,6 +332,7 @@ func SnippetForDeleteAuthenticationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -350,6 +361,7 @@ func SnippetForDeleteDestinationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -378,6 +390,7 @@ func SnippetForDeleteSourceOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -406,6 +419,7 @@ func SnippetForDeleteTaskOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -434,6 +448,7 @@ func SnippetForDeleteTaskV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -462,6 +477,7 @@ func SnippetForDeleteTransformationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -490,6 +506,7 @@ func SnippetForDisableTaskOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -518,6 +535,7 @@ func SnippetForDisableTaskV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -546,6 +564,7 @@ func SnippetForEnableTaskOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -574,6 +593,7 @@ func SnippetForEnableTaskV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -603,6 +623,7 @@ func SnippetForGenerateTransformationCodeOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -631,6 +652,7 @@ func SnippetForGetAuthenticationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -659,6 +681,7 @@ func SnippetForGetDestinationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -687,6 +710,7 @@ func SnippetForGetEventOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -715,6 +739,7 @@ func SnippetForGetRunOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -743,6 +768,7 @@ func SnippetForGetSourceOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -771,6 +797,7 @@ func SnippetForGetTaskOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -799,6 +826,7 @@ func SnippetForGetTaskV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -827,6 +855,7 @@ func SnippetForGetTransformationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -853,6 +882,7 @@ func SnippetForListAuthenticationsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -879,6 +909,7 @@ func SnippetForListDestinationsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -907,6 +938,7 @@ func SnippetForListEventsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -933,6 +965,7 @@ func SnippetForListRunsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -959,6 +992,7 @@ func SnippetForListSourcesOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -985,6 +1019,7 @@ func SnippetForListTasksOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1011,6 +1046,7 @@ func SnippetForListTasksV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1037,6 +1073,7 @@ func SnippetForListTransformationModelsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1063,6 +1100,7 @@ func SnippetForListTransformationsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1093,6 +1131,7 @@ func SnippetForPushTaskOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1124,6 +1163,7 @@ func SnippetForRunSourceOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1152,6 +1192,7 @@ func SnippetForRunTaskOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1180,6 +1221,7 @@ func SnippetForRunTaskV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1210,6 +1252,7 @@ func SnippetForSearchAuthenticationsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1240,6 +1283,7 @@ func SnippetForSearchDestinationsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1270,6 +1314,7 @@ func SnippetForSearchSourcesOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1300,6 +1345,7 @@ func SnippetForSearchTasksOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1330,6 +1376,7 @@ func SnippetForSearchTasksV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1360,10 +1407,38 @@ func SnippetForSearchTransformationsOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfIngestion() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION + client, err := ingestion.NewClient("YOUR_APP_ID", "YOUR_API_KEY", ingestion.US) + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} func SnippetForTriggerDockerSourceDiscoverOfIngestion() { /* Snippet for the triggerDockerSourceDiscover method. @@ -1388,6 +1463,7 @@ func SnippetForTriggerDockerSourceDiscoverOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1417,6 +1493,7 @@ func SnippetForTryTransformationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1446,6 +1523,7 @@ func SnippetForTryTransformationBeforeUpdateOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1475,6 +1553,7 @@ func SnippetForUpdateAuthenticationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1504,6 +1583,7 @@ func SnippetForUpdateDestinationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1533,6 +1613,7 @@ func SnippetForUpdateSourceOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1562,6 +1643,7 @@ func SnippetForUpdateTaskOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1591,6 +1673,7 @@ func SnippetForUpdateTaskV1OfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1620,6 +1703,7 @@ func SnippetForUpdateTransformationOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1650,6 +1734,7 @@ func SnippetForValidateSourceOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1679,6 +1764,7 @@ func SnippetForValidateSourceBeforeUpdateOfIngestion() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< diff --git a/snippets/go/src/insights.go b/snippets/go/src/insights.go index 7f29c31d43..688d81cca9 100644 --- a/snippets/go/src/insights.go +++ b/snippets/go/src/insights.go @@ -30,6 +30,7 @@ func SnippetForCustomDeleteOfInsights() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -58,6 +59,7 @@ func SnippetForCustomGetOfInsights() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -86,6 +88,7 @@ func SnippetForCustomPostOfInsights() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -114,6 +117,7 @@ func SnippetForCustomPutOfInsights() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -142,6 +146,7 @@ func SnippetForDeleteUserTokenOfInsights() { panic(err) } + // >LOG // SEPARATOR< } func SnippetForPushEventsOfInsights() { @@ -173,7 +178,35 @@ func SnippetForPushEventsOfInsights() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfInsights() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client with your application region, eg. insights.YOUR_APP_ID_REGION + client, err := insights.NewClient("YOUR_APP_ID", "YOUR_API_KEY", insights.US) + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} diff --git a/snippets/go/src/monitoring.go b/snippets/go/src/monitoring.go index de91971e0a..4470def3fe 100644 --- a/snippets/go/src/monitoring.go +++ b/snippets/go/src/monitoring.go @@ -30,6 +30,7 @@ func SnippetForCustomDeleteOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -58,6 +59,7 @@ func SnippetForCustomGetOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -86,6 +88,7 @@ func SnippetForCustomPostOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -114,6 +117,7 @@ func SnippetForCustomPutOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -142,6 +146,7 @@ func SnippetForGetClusterIncidentsOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -170,6 +175,7 @@ func SnippetForGetClusterStatusOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -196,6 +202,7 @@ func SnippetForGetIncidentsOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -224,6 +231,7 @@ func SnippetForGetIndexingTimeOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -252,6 +260,7 @@ func SnippetForGetLatencyOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -280,6 +289,7 @@ func SnippetForGetMetricsOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -308,6 +318,7 @@ func SnippetForGetReachabilityOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -334,6 +345,7 @@ func SnippetForGetServersOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -360,7 +372,35 @@ func SnippetForGetStatusOfMonitoring() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfMonitoring() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client + client, err := monitoring.NewClient("YOUR_APP_ID", "YOUR_API_KEY") + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} diff --git a/snippets/go/src/personalization.go b/snippets/go/src/personalization.go index db6dbad1c7..f3c229b0f4 100644 --- a/snippets/go/src/personalization.go +++ b/snippets/go/src/personalization.go @@ -30,6 +30,7 @@ func SnippetForCustomDeleteOfPersonalization() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -58,6 +59,7 @@ func SnippetForCustomGetOfPersonalization() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -86,6 +88,7 @@ func SnippetForCustomPostOfPersonalization() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -114,6 +117,7 @@ func SnippetForCustomPutOfPersonalization() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -142,6 +146,7 @@ func SnippetForDeleteUserProfileOfPersonalization() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -168,6 +173,7 @@ func SnippetForGetPersonalizationStrategyOfPersonalization() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -196,10 +202,38 @@ func SnippetForGetUserTokenProfileOfPersonalization() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfPersonalization() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION + client, err := personalization.NewClient("YOUR_APP_ID", "YOUR_API_KEY", personalization.US) + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} func SnippetForSetPersonalizationStrategyOfPersonalization() { /* Snippet for the setPersonalizationStrategy method. @@ -227,6 +261,7 @@ func SnippetForSetPersonalizationStrategyOfPersonalization() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< diff --git a/snippets/go/src/query-suggestions.go b/snippets/go/src/query-suggestions.go index 883113da3c..316c2f288f 100644 --- a/snippets/go/src/query-suggestions.go +++ b/snippets/go/src/query-suggestions.go @@ -38,6 +38,7 @@ func SnippetForCreateConfigOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -66,6 +67,7 @@ func SnippetForCustomDeleteOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -94,6 +96,7 @@ func SnippetForCustomGetOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -122,6 +125,7 @@ func SnippetForCustomPostOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -150,6 +154,7 @@ func SnippetForCustomPutOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -178,6 +183,7 @@ func SnippetForDeleteConfigOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -204,6 +210,7 @@ func SnippetForGetAllConfigsOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -232,6 +239,7 @@ func SnippetForGetConfigOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -260,6 +268,7 @@ func SnippetForGetConfigStatusOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -288,10 +297,38 @@ func SnippetForGetLogFileOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfSuggestions() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION + client, err := suggestions.NewClient("YOUR_APP_ID", "YOUR_API_KEY", suggestions.US) + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} func SnippetForUpdateConfigOfSuggestions() { /* Snippet for the updateConfig method. @@ -324,6 +361,7 @@ func SnippetForUpdateConfigOfSuggestions() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< diff --git a/snippets/go/src/recommend.go b/snippets/go/src/recommend.go index 24b25982c5..6b34dc9c32 100644 --- a/snippets/go/src/recommend.go +++ b/snippets/go/src/recommend.go @@ -30,6 +30,7 @@ func SnippetForCustomDeleteOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -58,6 +59,7 @@ func SnippetForCustomGetOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -86,6 +88,7 @@ func SnippetForCustomPostOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -114,6 +117,7 @@ func SnippetForCustomPutOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -142,6 +146,7 @@ func SnippetForDeleteRecommendRuleOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -170,6 +175,7 @@ func SnippetForGetRecommendRuleOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -198,6 +204,7 @@ func SnippetForGetRecommendStatusOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -229,6 +236,7 @@ func SnippetForGetRecommendationsOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -257,7 +265,35 @@ func SnippetForSearchRecommendRulesOfRecommend() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfRecommend() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client + client, err := recommend.NewClient("YOUR_APP_ID", "YOUR_API_KEY") + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} diff --git a/snippets/go/src/search.go b/snippets/go/src/search.go index cb65c8c476..86b7122684 100644 --- a/snippets/go/src/search.go +++ b/snippets/go/src/search.go @@ -32,6 +32,7 @@ func SnippetForAddApiKeyOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -60,6 +61,7 @@ func SnippetForAddOrUpdateObjectOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -89,6 +91,7 @@ func SnippetForAppendSourceOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -118,6 +121,7 @@ func SnippetForAssignUserIdOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -148,6 +152,7 @@ func SnippetForBatchOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -178,6 +183,7 @@ func SnippetForBatchOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -208,6 +214,7 @@ func SnippetForBatchOfSearch2() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -238,6 +245,7 @@ func SnippetForBatchOfSearch3() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -268,6 +276,7 @@ func SnippetForBatchOfSearch4() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -298,6 +307,7 @@ func SnippetForBatchOfSearch5() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -328,6 +338,7 @@ func SnippetForBatchOfSearch6() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -358,6 +369,7 @@ func SnippetForBatchAssignUserIdsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -391,6 +403,7 @@ func SnippetForBatchDictionaryEntriesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -422,6 +435,7 @@ func SnippetForBatchDictionaryEntriesOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -453,6 +467,7 @@ func SnippetForBatchDictionaryEntriesOfSearch2() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -481,6 +496,7 @@ func SnippetForBrowseOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -509,6 +525,7 @@ func SnippetForClearObjectsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -537,6 +554,7 @@ func SnippetForClearRulesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -565,6 +583,7 @@ func SnippetForClearSynonymsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -593,6 +612,7 @@ func SnippetForCustomDeleteOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -621,6 +641,7 @@ func SnippetForCustomGetOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -649,6 +670,7 @@ func SnippetForCustomPostOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -677,6 +699,7 @@ func SnippetForCustomPutOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -705,6 +728,7 @@ func SnippetForDeleteApiKeyOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -734,6 +758,7 @@ func SnippetForDeleteByOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -762,6 +787,7 @@ func SnippetForDeleteIndexOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -790,6 +816,7 @@ func SnippetForDeleteObjectOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -819,6 +846,7 @@ func SnippetForDeleteObjectsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -847,6 +875,7 @@ func SnippetForDeleteRuleOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -875,6 +904,7 @@ func SnippetForDeleteSourceOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -903,6 +933,7 @@ func SnippetForDeleteSynonymOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -933,6 +964,7 @@ func SnippetForGenerateSecuredApiKeyOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -965,6 +997,7 @@ func SnippetForGenerateSecuredApiKeyOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -993,6 +1026,7 @@ func SnippetForGetApiKeyOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1021,6 +1055,7 @@ func SnippetForGetAppTaskOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1047,6 +1082,7 @@ func SnippetForGetDictionaryLanguagesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1073,6 +1109,7 @@ func SnippetForGetDictionarySettingsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1099,6 +1136,7 @@ func SnippetForGetLogsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1128,6 +1166,7 @@ func SnippetForGetObjectOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1159,6 +1198,7 @@ func SnippetForGetObjectsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1187,6 +1227,7 @@ func SnippetForGetRuleOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1215,6 +1256,7 @@ func SnippetForGetSettingsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1241,6 +1283,7 @@ func SnippetForGetSourcesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1269,6 +1312,7 @@ func SnippetForGetSynonymOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1297,6 +1341,7 @@ func SnippetForGetTaskOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1323,6 +1368,7 @@ func SnippetForGetTopUserIdsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1351,6 +1397,7 @@ func SnippetForGetUserIdOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1377,6 +1424,7 @@ func SnippetForHasPendingMappingsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1405,6 +1453,7 @@ func SnippetForIndexExistsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1433,6 +1482,7 @@ func SnippetForIndexExistsOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1461,6 +1511,7 @@ func SnippetForIndexExistsOfSearch2() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1487,6 +1538,7 @@ func SnippetForListApiKeysOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1513,6 +1565,7 @@ func SnippetForListClustersOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1539,6 +1592,7 @@ func SnippetForListIndicesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1565,6 +1619,7 @@ func SnippetForListUserIdsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1595,6 +1650,7 @@ func SnippetForMultipleBatchOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1625,6 +1681,7 @@ func SnippetForOperationIndexOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1654,6 +1711,7 @@ func SnippetForOperationIndexOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1683,6 +1741,7 @@ func SnippetForOperationIndexOfSearch2() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1711,6 +1770,7 @@ func SnippetForPartialUpdateObjectOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1740,6 +1800,7 @@ func SnippetForPartialUpdateObjectsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1769,6 +1830,7 @@ func SnippetForPartialUpdateObjectsOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1797,6 +1859,7 @@ func SnippetForRemoveUserIdOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1826,6 +1889,7 @@ func SnippetForReplaceAllObjectsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1855,6 +1919,7 @@ func SnippetForReplaceSourcesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1883,6 +1948,7 @@ func SnippetForRestoreApiKeyOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1911,6 +1977,7 @@ func SnippetForSaveObjectOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1940,6 +2007,7 @@ func SnippetForSaveObjectsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1969,6 +2037,7 @@ func SnippetForSaveObjectsOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -1999,6 +2068,7 @@ func SnippetForSaveRuleOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2030,6 +2100,7 @@ func SnippetForSaveRulesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2060,6 +2131,7 @@ func SnippetForSaveSynonymOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2091,6 +2163,7 @@ func SnippetForSaveSynonymsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2122,6 +2195,7 @@ func SnippetForSearchOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2153,6 +2227,7 @@ func SnippetForSearchOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2184,6 +2259,7 @@ func SnippetForSearchOfSearch2() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2215,6 +2291,7 @@ func SnippetForSearchOfSearch3() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2247,6 +2324,7 @@ func SnippetForSearchOfSearch4() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2279,6 +2357,7 @@ func SnippetForSearchOfSearch5() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2308,6 +2387,7 @@ func SnippetForSearchDictionaryEntriesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2336,6 +2416,7 @@ func SnippetForSearchForFacetValuesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2365,6 +2446,7 @@ func SnippetForSearchRulesOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2393,6 +2475,7 @@ func SnippetForSearchSingleIndexOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2421,6 +2504,7 @@ func SnippetForSearchSynonymsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2450,10 +2534,38 @@ func SnippetForSearchUserIdsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfSearch() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client + client, err := search.NewClient("YOUR_APP_ID", "YOUR_API_KEY") + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} func SnippetForSetDictionarySettingsOfSearch() { /* Snippet for the setDictionarySettings method. @@ -2480,6 +2592,7 @@ func SnippetForSetDictionarySettingsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2510,6 +2623,7 @@ func SnippetForSetSettingsOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2540,6 +2654,7 @@ func SnippetForUpdateApiKeyOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2568,6 +2683,7 @@ func SnippetForWaitForApiKeyOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2600,6 +2716,7 @@ func SnippetForWaitForApiKeyOfSearch1() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2628,6 +2745,7 @@ func SnippetForWaitForApiKeyOfSearch2() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2656,6 +2774,7 @@ func SnippetForWaitForAppTaskOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -2684,6 +2803,7 @@ func SnippetForWaitForTaskOfSearch() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< diff --git a/snippets/go/src/usage.go b/snippets/go/src/usage.go index 6038b6a900..30608c665c 100644 --- a/snippets/go/src/usage.go +++ b/snippets/go/src/usage.go @@ -30,6 +30,7 @@ func SnippetForCustomDeleteOfUsage() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -58,6 +59,7 @@ func SnippetForCustomGetOfUsage() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -86,6 +88,7 @@ func SnippetForCustomPostOfUsage() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -114,6 +117,7 @@ func SnippetForCustomPutOfUsage() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -142,6 +146,7 @@ func SnippetForGetIndexUsageOfUsage() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< @@ -170,7 +175,35 @@ func SnippetForGetUsageOfUsage() { panic(err) } + // >LOG // use the model directly print(response) // SEPARATOR< } +func SnippetForSetClientApiKeyOfUsage() { + /* + Snippet for the setClientApiKey method. + + switch API key + */ + + // >SEPARATOR setClientApiKey default + // Initialize the client + client, err := usage.NewClient("YOUR_APP_ID", "YOUR_API_KEY") + if err != nil { + // The client can fail to initialize if you pass an invalid parameter. + panic(err) + } + + // Call the API + err = client.SetClientApiKey( + "updated-api-key", + ) + if err != nil { + // handle the eventual error + panic(err) + } + + // >LOG + // SEPARATOR< +} diff --git a/snippets/guides/abtesting-snippets.json b/snippets/guides/abtesting-snippets.json index ec69970861..510ee23f45 100644 --- a/snippets/guides/abtesting-snippets.json +++ b/snippets/guides/abtesting-snippets.json @@ -30,6 +30,9 @@ "scheduleABTest": { "default": "var response = await client.ScheduleABTestAsync(\n new ScheduleABTestsRequest\n {\n EndAt = \"2022-12-31T00:00:00.000Z\",\n ScheduledAt = \"2022-11-31T00:00:00.000Z\",\n Name = \"myABTest\",\n Variants = new List\n {\n new AddABTestsVariant(\n new AbTestsVariant { Index = \"AB_TEST_1\", TrafficPercentage = 30, }\n ),\n new AddABTestsVariant(new AbTestsVariant { Index = \"AB_TEST_2\", TrafficPercentage = 50, })\n },\n }\n);" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "stopABTest": { "default": "var response = await client.StopABTestAsync(42);" }, @@ -43,34 +46,40 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/abtesting\"" }, "addABTests": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.AddABTests(client.NewApiAddABTestsRequest(\n\n abtesting.NewEmptyAddABTestsRequest().SetEndAt(\"2022-12-31T00:00:00.000Z\").SetName(\"myABTest\").SetVariants(\n []abtesting.AddABTestsVariant{*abtesting.AbTestsVariantAsAddABTestsVariant(\n abtesting.NewEmptyAbTestsVariant().SetIndex(\"AB_TEST_1\").SetTrafficPercentage(30)), *abtesting.AbTestsVariantAsAddABTestsVariant(\n abtesting.NewEmptyAbTestsVariant().SetIndex(\"AB_TEST_2\").SetTrafficPercentage(50))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.AddABTests(client.NewApiAddABTestsRequest(\n\n abtesting.NewEmptyAddABTestsRequest().SetEndAt(\"2022-12-31T00:00:00.000Z\").SetName(\"myABTest\").SetVariants(\n []abtesting.AddABTestsVariant{*abtesting.AbTestsVariantAsAddABTestsVariant(\n abtesting.NewEmptyAbTestsVariant().SetIndex(\"AB_TEST_1\").SetTrafficPercentage(30)), *abtesting.AbTestsVariantAsAddABTestsVariant(\n abtesting.NewEmptyAbTestsVariant().SetIndex(\"AB_TEST_2\").SetTrafficPercentage(50))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customDelete": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteABTest": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteABTest(client.NewApiDeleteABTestRequest(\n 42,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteABTest(client.NewApiDeleteABTestRequest(\n 42,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getABTest": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetABTest(client.NewApiGetABTestRequest(\n 42,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetABTest(client.NewApiGetABTestRequest(\n 42,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listABTests": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListABTests(client.NewApiListABTestsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListABTests(client.NewApiListABTestsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "scheduleABTest": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ScheduleABTest(client.NewApiScheduleABTestRequest(\n\n abtesting.NewEmptyScheduleABTestsRequest().SetEndAt(\"2022-12-31T00:00:00.000Z\").SetScheduledAt(\"2022-11-31T00:00:00.000Z\").SetName(\"myABTest\").SetVariants(\n []abtesting.AddABTestsVariant{*abtesting.AbTestsVariantAsAddABTestsVariant(\n abtesting.NewEmptyAbTestsVariant().SetIndex(\"AB_TEST_1\").SetTrafficPercentage(30)), *abtesting.AbTestsVariantAsAddABTestsVariant(\n abtesting.NewEmptyAbTestsVariant().SetIndex(\"AB_TEST_2\").SetTrafficPercentage(50))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ScheduleABTest(client.NewApiScheduleABTestRequest(\n\n abtesting.NewEmptyScheduleABTestsRequest().SetEndAt(\"2022-12-31T00:00:00.000Z\").SetScheduledAt(\"2022-11-31T00:00:00.000Z\").SetName(\"myABTest\").SetVariants(\n []abtesting.AddABTestsVariant{*abtesting.AbTestsVariantAsAddABTestsVariant(\n abtesting.NewEmptyAbTestsVariant().SetIndex(\"AB_TEST_1\").SetTrafficPercentage(30)), *abtesting.AbTestsVariantAsAddABTestsVariant(\n abtesting.NewEmptyAbTestsVariant().SetIndex(\"AB_TEST_2\").SetTrafficPercentage(50))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "stopABTest": { - "default": "// Initialize the client with your application region, eg. abtesting.YOUR_APP_ID_REGION\nclient, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.StopABTest(client.NewApiStopABTestRequest(\n 42,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.StopABTest(client.NewApiStopABTestRequest(\n 42,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "init": { + "default": "client, err := abtesting.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", abtesting.US)" } }, "java": { @@ -104,6 +113,9 @@ "scheduleABTest": { "default": "client.scheduleABTest(\n new ScheduleABTestsRequest()\n .setEndAt(\"2022-12-31T00:00:00.000Z\")\n .setScheduledAt(\"2022-11-31T00:00:00.000Z\")\n .setName(\"myABTest\")\n .setVariants(\n Arrays.asList(\n new AbTestsVariant().setIndex(\"AB_TEST_1\").setTrafficPercentage(30),\n new AbTestsVariant().setIndex(\"AB_TEST_2\").setTrafficPercentage(50)\n )\n )\n);" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "stopABTest": { "default": "client.stopABTest(42);" }, @@ -116,34 +128,37 @@ "default": "import { abtestingClient } from '@algolia/client-abtesting';" }, "addABTests": { - "default": "const response = await client.addABTests({\n endAt: '2022-12-31T00:00:00.000Z',\n name: 'myABTest',\n variants: [\n { index: 'AB_TEST_1', trafficPercentage: 30 },\n { index: 'AB_TEST_2', trafficPercentage: 50 },\n ],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.addABTests({\n endAt: '2022-12-31T00:00:00.000Z',\n name: 'myABTest',\n variants: [\n { index: 'AB_TEST_1', trafficPercentage: 30 },\n { index: 'AB_TEST_2', trafficPercentage: 50 },\n ],\n});" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "deleteABTest": { - "default": "const response = await client.deleteABTest({ id: 42 });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteABTest({ id: 42 });" }, "getABTest": { - "default": "const response = await client.getABTest({ id: 42 });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getABTest({ id: 42 });" }, "listABTests": { - "default": "const response = await client.listABTests();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listABTests();" }, "scheduleABTest": { - "default": "const response = await client.scheduleABTest({\n endAt: '2022-12-31T00:00:00.000Z',\n scheduledAt: '2022-11-31T00:00:00.000Z',\n name: 'myABTest',\n variants: [\n { index: 'AB_TEST_1', trafficPercentage: 30 },\n { index: 'AB_TEST_2', trafficPercentage: 50 },\n ],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.scheduleABTest({\n endAt: '2022-12-31T00:00:00.000Z',\n scheduledAt: '2022-11-31T00:00:00.000Z',\n name: 'myABTest',\n variants: [\n { index: 'AB_TEST_1', trafficPercentage: 30 },\n { index: 'AB_TEST_2', trafficPercentage: 50 },\n ],\n});" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "stopABTest": { - "default": "const response = await client.stopABTest({ id: 42 });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.stopABTest({ id: 42 });" }, "init": { "default": "const client = abtestingClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION');" @@ -154,34 +169,37 @@ "default": "import com.algolia.client.api.AbtestingClient" }, "addABTests": { - "default": "var response = client.addABTests(\n addABTestsRequest = AddABTestsRequest(\n endAt = \"2022-12-31T00:00:00.000Z\",\n name = \"myABTest\",\n variants = listOf(\n AbTestsVariant(\n index = \"AB_TEST_1\",\n trafficPercentage = 30,\n ),\n AbTestsVariant(\n index = \"AB_TEST_2\",\n trafficPercentage = 50,\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.addABTests(\n addABTestsRequest = AddABTestsRequest(\n endAt = \"2022-12-31T00:00:00.000Z\",\n name = \"myABTest\",\n variants = listOf(\n AbTestsVariant(\n index = \"AB_TEST_1\",\n trafficPercentage = 30,\n ),\n AbTestsVariant(\n index = \"AB_TEST_2\",\n trafficPercentage = 50,\n ),\n ),\n ),\n)" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "deleteABTest": { - "default": "var response = client.deleteABTest(\n id = 42,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteABTest(\n id = 42,\n)" }, "getABTest": { - "default": "var response = client.getABTest(\n id = 42,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getABTest(\n id = 42,\n)" }, "listABTests": { - "default": "var response = client.listABTests()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listABTests()" }, "scheduleABTest": { - "default": "var response = client.scheduleABTest(\n scheduleABTestsRequest = ScheduleABTestsRequest(\n endAt = \"2022-12-31T00:00:00.000Z\",\n scheduledAt = \"2022-11-31T00:00:00.000Z\",\n name = \"myABTest\",\n variants = listOf(\n AbTestsVariant(\n index = \"AB_TEST_1\",\n trafficPercentage = 30,\n ),\n AbTestsVariant(\n index = \"AB_TEST_2\",\n trafficPercentage = 50,\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.scheduleABTest(\n scheduleABTestsRequest = ScheduleABTestsRequest(\n endAt = \"2022-12-31T00:00:00.000Z\",\n scheduledAt = \"2022-11-31T00:00:00.000Z\",\n name = \"myABTest\",\n variants = listOf(\n AbTestsVariant(\n index = \"AB_TEST_1\",\n trafficPercentage = 30,\n ),\n AbTestsVariant(\n index = \"AB_TEST_2\",\n trafficPercentage = 50,\n ),\n ),\n ),\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "stopABTest": { - "default": "var response = client.stopABTest(\n id = 42,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.stopABTest(\n id = 42,\n)" }, "init": { "default": "val client = AbtestingClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -192,34 +210,37 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\AbtestingClient;" }, "addABTests": { - "default": "$response = $client->addABTests(\n ['endAt' => '2022-12-31T00:00:00.000Z',\n 'name' => 'myABTest',\n 'variants' => [\n ['index' => 'AB_TEST_1',\n 'trafficPercentage' => 30,\n ],\n\n ['index' => 'AB_TEST_2',\n 'trafficPercentage' => 50,\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->addABTests(\n ['endAt' => '2022-12-31T00:00:00.000Z',\n 'name' => 'myABTest',\n 'variants' => [\n ['index' => 'AB_TEST_1',\n 'trafficPercentage' => 30,\n ],\n\n ['index' => 'AB_TEST_2',\n 'trafficPercentage' => 50,\n ],\n ],\n ],\n);" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "deleteABTest": { - "default": "$response = $client->deleteABTest(\n 42,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteABTest(\n 42,\n);" }, "getABTest": { - "default": "$response = $client->getABTest(\n 42,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getABTest(\n 42,\n);" }, "listABTests": { - "default": "$response = $client->listABTests();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listABTests();" }, "scheduleABTest": { - "default": "$response = $client->scheduleABTest(\n ['endAt' => '2022-12-31T00:00:00.000Z',\n 'scheduledAt' => '2022-11-31T00:00:00.000Z',\n 'name' => 'myABTest',\n 'variants' => [\n ['index' => 'AB_TEST_1',\n 'trafficPercentage' => 30,\n ],\n\n ['index' => 'AB_TEST_2',\n 'trafficPercentage' => 50,\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->scheduleABTest(\n ['endAt' => '2022-12-31T00:00:00.000Z',\n 'scheduledAt' => '2022-11-31T00:00:00.000Z',\n 'name' => 'myABTest',\n 'variants' => [\n ['index' => 'AB_TEST_1',\n 'trafficPercentage' => 30,\n ],\n\n ['index' => 'AB_TEST_2',\n 'trafficPercentage' => 50,\n ],\n ],\n ],\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "stopABTest": { - "default": "$response = $client->stopABTest(\n 42,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->stopABTest(\n 42,\n);" }, "init": { "default": "$client = AbtestingClient::create('', '', 'YOUR_APP_ID_REGION');" @@ -230,34 +251,37 @@ "default": "from algoliasearch.abtesting.client import AbtestingClient" }, "addABTests": { - "default": "response = await _client.add_ab_tests(\n add_ab_tests_request={\n \"endAt\": \"2022-12-31T00:00:00.000Z\",\n \"name\": \"myABTest\",\n \"variants\": [\n {\n \"index\": \"AB_TEST_1\",\n \"trafficPercentage\": 30,\n },\n {\n \"index\": \"AB_TEST_2\",\n \"trafficPercentage\": 50,\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.add_ab_tests(\n add_ab_tests_request={\n \"endAt\": \"2022-12-31T00:00:00.000Z\",\n \"name\": \"myABTest\",\n \"variants\": [\n {\n \"index\": \"AB_TEST_1\",\n \"trafficPercentage\": 30,\n },\n {\n \"index\": \"AB_TEST_2\",\n \"trafficPercentage\": 50,\n },\n ],\n },\n)" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "deleteABTest": { - "default": "response = await _client.delete_ab_test(\n id=42,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_ab_test(\n id=42,\n)" }, "getABTest": { - "default": "response = await _client.get_ab_test(\n id=42,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_ab_test(\n id=42,\n)" }, "listABTests": { - "default": "response = await _client.list_ab_tests()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_ab_tests()" }, "scheduleABTest": { - "default": "response = await _client.schedule_ab_test(\n schedule_ab_tests_request={\n \"endAt\": \"2022-12-31T00:00:00.000Z\",\n \"scheduledAt\": \"2022-11-31T00:00:00.000Z\",\n \"name\": \"myABTest\",\n \"variants\": [\n {\n \"index\": \"AB_TEST_1\",\n \"trafficPercentage\": 30,\n },\n {\n \"index\": \"AB_TEST_2\",\n \"trafficPercentage\": 50,\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.schedule_ab_test(\n schedule_ab_tests_request={\n \"endAt\": \"2022-12-31T00:00:00.000Z\",\n \"scheduledAt\": \"2022-11-31T00:00:00.000Z\",\n \"name\": \"myABTest\",\n \"variants\": [\n {\n \"index\": \"AB_TEST_1\",\n \"trafficPercentage\": 30,\n },\n {\n \"index\": \"AB_TEST_2\",\n \"trafficPercentage\": 50,\n },\n ],\n },\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "stopABTest": { - "default": "response = await _client.stop_ab_test(\n id=42,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.stop_ab_test(\n id=42,\n)" }, "init": { "default": "_client = AbtestingClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -268,34 +292,37 @@ "default": "require \"algolia\"" }, "addABTests": { - "default": "response = client.add_ab_tests(\n AddABTestsRequest.new(\n end_at: \"2022-12-31T00:00:00.000Z\",\n name: \"myABTest\",\n variants: [\n AbTestsVariant.new(index: \"AB_TEST_1\", traffic_percentage: 30),\n AbTestsVariant.new(index: \"AB_TEST_2\", traffic_percentage: 50)\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.add_ab_tests(\n AddABTestsRequest.new(\n end_at: \"2022-12-31T00:00:00.000Z\",\n name: \"myABTest\",\n variants: [\n AbTestsVariant.new(index: \"AB_TEST_1\", traffic_percentage: 30),\n AbTestsVariant.new(index: \"AB_TEST_2\", traffic_percentage: 50)\n ]\n )\n)" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "deleteABTest": { - "default": "response = client.delete_ab_test(42)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_ab_test(42)" }, "getABTest": { - "default": "response = client.get_ab_test(42)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_ab_test(42)" }, "listABTests": { - "default": "response = client.list_ab_tests\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_ab_tests" }, "scheduleABTest": { - "default": "response = client.schedule_ab_test(\n ScheduleABTestsRequest.new(\n end_at: \"2022-12-31T00:00:00.000Z\",\n scheduled_at: \"2022-11-31T00:00:00.000Z\",\n name: \"myABTest\",\n variants: [\n AbTestsVariant.new(index: \"AB_TEST_1\", traffic_percentage: 30),\n AbTestsVariant.new(index: \"AB_TEST_2\", traffic_percentage: 50)\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.schedule_ab_test(\n ScheduleABTestsRequest.new(\n end_at: \"2022-12-31T00:00:00.000Z\",\n scheduled_at: \"2022-11-31T00:00:00.000Z\",\n name: \"myABTest\",\n variants: [\n AbTestsVariant.new(index: \"AB_TEST_1\", traffic_percentage: 30),\n AbTestsVariant.new(index: \"AB_TEST_2\", traffic_percentage: 50)\n ]\n )\n)" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "stopABTest": { - "default": "response = client.stop_ab_test(42)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.stop_ab_test(42)" }, "init": { "default": "client = Algolia::AbtestingClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -306,34 +333,34 @@ "default": "import algoliasearch.api.AbtestingClient" }, "addABTests": { - "default": "val response = client.addABTests(\n addABTestsRequest = AddABTestsRequest(\n endAt = \"2022-12-31T00:00:00.000Z\",\n name = \"myABTest\",\n variants = Seq(\n AbTestsVariant(\n index = \"AB_TEST_1\",\n trafficPercentage = 30\n ),\n AbTestsVariant(\n index = \"AB_TEST_2\",\n trafficPercentage = 50\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.addABTests(\n addABTestsRequest = AddABTestsRequest(\n endAt = \"2022-12-31T00:00:00.000Z\",\n name = \"myABTest\",\n variants = Seq(\n AbTestsVariant(\n index = \"AB_TEST_1\",\n trafficPercentage = 30\n ),\n AbTestsVariant(\n index = \"AB_TEST_2\",\n trafficPercentage = 50\n )\n )\n )\n)" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "deleteABTest": { - "default": "val response = client.deleteABTest(\n id = 42\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteABTest(\n id = 42\n)" }, "getABTest": { - "default": "val response = client.getABTest(\n id = 42\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getABTest(\n id = 42\n)" }, "listABTests": { - "default": "val response = client.listABTests(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listABTests(\n)" }, "scheduleABTest": { - "default": "val response = client.scheduleABTest(\n scheduleABTestsRequest = ScheduleABTestsRequest(\n endAt = \"2022-12-31T00:00:00.000Z\",\n scheduledAt = \"2022-11-31T00:00:00.000Z\",\n name = \"myABTest\",\n variants = Seq(\n AbTestsVariant(\n index = \"AB_TEST_1\",\n trafficPercentage = 30\n ),\n AbTestsVariant(\n index = \"AB_TEST_2\",\n trafficPercentage = 50\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.scheduleABTest(\n scheduleABTestsRequest = ScheduleABTestsRequest(\n endAt = \"2022-12-31T00:00:00.000Z\",\n scheduledAt = \"2022-11-31T00:00:00.000Z\",\n name = \"myABTest\",\n variants = Seq(\n AbTestsVariant(\n index = \"AB_TEST_1\",\n trafficPercentage = 30\n ),\n AbTestsVariant(\n index = \"AB_TEST_2\",\n trafficPercentage = 50\n )\n )\n )\n)" }, "stopABTest": { - "default": "val response = client.stopABTest(\n id = 42\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.stopABTest(\n id = 42\n)" }, "init": { "default": "val client = AbtestingClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = Option(\"YOUR_APP_ID_REGION\"))" @@ -370,6 +397,9 @@ "scheduleABTest": { "default": "let response = try await client.scheduleABTest(scheduleABTestsRequest: ScheduleABTestsRequest(\n name: \"myABTest\",\n variants: [\n AddABTestsVariant.abTestsVariant(AbTestsVariant(index: \"AB_TEST_1\", trafficPercentage: 30)),\n AddABTestsVariant.abTestsVariant(AbTestsVariant(index: \"AB_TEST_2\", trafficPercentage: 50)),\n ],\n scheduledAt: \"2022-11-31T00:00:00.000Z\",\n endAt: \"2022-12-31T00:00:00.000Z\"\n))" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "stopABTest": { "default": "let response = try await client.stopABTest(id: 42)" }, diff --git a/snippets/guides/analytics-snippets.json b/snippets/guides/analytics-snippets.json index c7292d8906..476e6e6347 100644 --- a/snippets/guides/analytics-snippets.json +++ b/snippets/guides/analytics-snippets.json @@ -75,6 +75,9 @@ "getUsersCount": { "default": "var response = await client.GetUsersCountAsync(\"index\");" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "init": { "default": "var client = new AnalyticsClient(" } @@ -85,76 +88,82 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/analytics\"" }, "customDelete": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getAddToCartRate": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetAddToCartRate(client.NewApiGetAddToCartRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetAddToCartRate(client.NewApiGetAddToCartRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getAverageClickPosition": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetAverageClickPosition(client.NewApiGetAverageClickPositionRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetAverageClickPosition(client.NewApiGetAverageClickPositionRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getClickPositions": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetClickPositions(client.NewApiGetClickPositionsRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetClickPositions(client.NewApiGetClickPositionsRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getClickThroughRate": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetClickThroughRate(client.NewApiGetClickThroughRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetClickThroughRate(client.NewApiGetClickThroughRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getConversionRate": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetConversionRate(client.NewApiGetConversionRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetConversionRate(client.NewApiGetConversionRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getNoClickRate": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetNoClickRate(client.NewApiGetNoClickRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetNoClickRate(client.NewApiGetNoClickRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getNoResultsRate": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetNoResultsRate(client.NewApiGetNoResultsRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetNoResultsRate(client.NewApiGetNoResultsRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getPurchaseRate": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetPurchaseRate(client.NewApiGetPurchaseRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetPurchaseRate(client.NewApiGetPurchaseRateRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getRevenue": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetRevenue(client.NewApiGetRevenueRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetRevenue(client.NewApiGetRevenueRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getSearchesCount": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetSearchesCount(client.NewApiGetSearchesCountRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetSearchesCount(client.NewApiGetSearchesCountRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getSearchesNoClicks": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetSearchesNoClicks(client.NewApiGetSearchesNoClicksRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetSearchesNoClicks(client.NewApiGetSearchesNoClicksRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getSearchesNoResults": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetSearchesNoResults(client.NewApiGetSearchesNoResultsRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetSearchesNoResults(client.NewApiGetSearchesNoResultsRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getStatus": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetStatus(client.NewApiGetStatusRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetStatus(client.NewApiGetStatusRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTopCountries": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTopCountries(client.NewApiGetTopCountriesRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTopCountries(client.NewApiGetTopCountriesRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTopFilterAttributes": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTopFilterAttributes(client.NewApiGetTopFilterAttributesRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTopFilterAttributes(client.NewApiGetTopFilterAttributesRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTopFilterForAttribute": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTopFilterForAttribute(client.NewApiGetTopFilterForAttributeRequest(\n \"myAttribute\", \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTopFilterForAttribute(client.NewApiGetTopFilterForAttributeRequest(\n \"myAttribute\", \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTopFiltersNoResults": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTopFiltersNoResults(client.NewApiGetTopFiltersNoResultsRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTopFiltersNoResults(client.NewApiGetTopFiltersNoResultsRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTopHits": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTopHits(client.NewApiGetTopHitsRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTopHits(client.NewApiGetTopHitsRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTopSearches": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTopSearches(client.NewApiGetTopSearchesRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTopSearches(client.NewApiGetTopSearchesRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getUsersCount": { - "default": "// Initialize the client with your application region, eg. analytics.YOUR_APP_ID_REGION\nclient, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetUsersCount(client.NewApiGetUsersCountRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetUsersCount(client.NewApiGetUsersCountRequest(\n \"index\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "init": { + "default": "client, err := analytics.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", analytics.US)" } }, "java": { @@ -233,6 +242,9 @@ "getUsersCount": { "default": "client.getUsersCount(\"index\");" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "init": { "default": "AnalyticsClient client = new AnalyticsClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\");" } @@ -242,76 +254,79 @@ "default": "import { analyticsClient } from '@algolia/client-analytics';" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "getAddToCartRate": { - "default": "const response = await client.getAddToCartRate({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getAddToCartRate({ index: 'index' });" }, "getAverageClickPosition": { - "default": "const response = await client.getAverageClickPosition({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getAverageClickPosition({ index: 'index' });" }, "getClickPositions": { - "default": "const response = await client.getClickPositions({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getClickPositions({ index: 'index' });" }, "getClickThroughRate": { - "default": "const response = await client.getClickThroughRate({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getClickThroughRate({ index: 'index' });" }, "getConversionRate": { - "default": "const response = await client.getConversionRate({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getConversionRate({ index: 'index' });" }, "getNoClickRate": { - "default": "const response = await client.getNoClickRate({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getNoClickRate({ index: 'index' });" }, "getNoResultsRate": { - "default": "const response = await client.getNoResultsRate({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getNoResultsRate({ index: 'index' });" }, "getPurchaseRate": { - "default": "const response = await client.getPurchaseRate({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getPurchaseRate({ index: 'index' });" }, "getRevenue": { - "default": "const response = await client.getRevenue({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getRevenue({ index: 'index' });" }, "getSearchesCount": { - "default": "const response = await client.getSearchesCount({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getSearchesCount({ index: 'index' });" }, "getSearchesNoClicks": { - "default": "const response = await client.getSearchesNoClicks({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getSearchesNoClicks({ index: 'index' });" }, "getSearchesNoResults": { - "default": "const response = await client.getSearchesNoResults({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getSearchesNoResults({ index: 'index' });" }, "getStatus": { - "default": "const response = await client.getStatus({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getStatus({ index: 'index' });" }, "getTopCountries": { - "default": "const response = await client.getTopCountries({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTopCountries({ index: 'index' });" }, "getTopFilterAttributes": { - "default": "const response = await client.getTopFilterAttributes({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTopFilterAttributes({ index: 'index' });" }, "getTopFilterForAttribute": { - "default": "const response = await client.getTopFilterForAttribute({ attribute: 'myAttribute', index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTopFilterForAttribute({ attribute: 'myAttribute', index: 'index' });" }, "getTopFiltersNoResults": { - "default": "const response = await client.getTopFiltersNoResults({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTopFiltersNoResults({ index: 'index' });" }, "getTopHits": { - "default": "const response = await client.getTopHits({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTopHits({ index: 'index' });" }, "getTopSearches": { - "default": "const response = await client.getTopSearches({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTopSearches({ index: 'index' });" }, "getUsersCount": { - "default": "const response = await client.getUsersCount({ index: 'index' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getUsersCount({ index: 'index' });" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "init": { "default": "const client = analyticsClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION');" @@ -322,76 +337,79 @@ "default": "import com.algolia.client.api.AnalyticsClient" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "getAddToCartRate": { - "default": "var response = client.getAddToCartRate(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getAddToCartRate(\n index = \"index\",\n)" }, "getAverageClickPosition": { - "default": "var response = client.getAverageClickPosition(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getAverageClickPosition(\n index = \"index\",\n)" }, "getClickPositions": { - "default": "var response = client.getClickPositions(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getClickPositions(\n index = \"index\",\n)" }, "getClickThroughRate": { - "default": "var response = client.getClickThroughRate(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getClickThroughRate(\n index = \"index\",\n)" }, "getConversionRate": { - "default": "var response = client.getConversionRate(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getConversionRate(\n index = \"index\",\n)" }, "getNoClickRate": { - "default": "var response = client.getNoClickRate(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getNoClickRate(\n index = \"index\",\n)" }, "getNoResultsRate": { - "default": "var response = client.getNoResultsRate(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getNoResultsRate(\n index = \"index\",\n)" }, "getPurchaseRate": { - "default": "var response = client.getPurchaseRate(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getPurchaseRate(\n index = \"index\",\n)" }, "getRevenue": { - "default": "var response = client.getRevenue(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getRevenue(\n index = \"index\",\n)" }, "getSearchesCount": { - "default": "var response = client.getSearchesCount(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getSearchesCount(\n index = \"index\",\n)" }, "getSearchesNoClicks": { - "default": "var response = client.getSearchesNoClicks(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getSearchesNoClicks(\n index = \"index\",\n)" }, "getSearchesNoResults": { - "default": "var response = client.getSearchesNoResults(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getSearchesNoResults(\n index = \"index\",\n)" }, "getStatus": { - "default": "var response = client.getStatus(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getStatus(\n index = \"index\",\n)" }, "getTopCountries": { - "default": "var response = client.getTopCountries(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTopCountries(\n index = \"index\",\n)" }, "getTopFilterAttributes": { - "default": "var response = client.getTopFilterAttributes(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTopFilterAttributes(\n index = \"index\",\n)" }, "getTopFilterForAttribute": { - "default": "var response = client.getTopFilterForAttribute(\n attribute = \"myAttribute\",\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTopFilterForAttribute(\n attribute = \"myAttribute\",\n index = \"index\",\n)" }, "getTopFiltersNoResults": { - "default": "var response = client.getTopFiltersNoResults(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTopFiltersNoResults(\n index = \"index\",\n)" }, "getTopHits": { - "default": "var response = client.getTopHits(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTopHits(\n index = \"index\",\n)" }, "getTopSearches": { - "default": "var response = client.getTopSearches(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTopSearches(\n index = \"index\",\n)" }, "getUsersCount": { - "default": "var response = client.getUsersCount(\n index = \"index\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getUsersCount(\n index = \"index\",\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "init": { "default": "val client = AnalyticsClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -402,76 +420,79 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\AnalyticsClient;" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "getAddToCartRate": { - "default": "$response = $client->getAddToCartRate(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getAddToCartRate(\n 'index',\n);" }, "getAverageClickPosition": { - "default": "$response = $client->getAverageClickPosition(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getAverageClickPosition(\n 'index',\n);" }, "getClickPositions": { - "default": "$response = $client->getClickPositions(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getClickPositions(\n 'index',\n);" }, "getClickThroughRate": { - "default": "$response = $client->getClickThroughRate(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getClickThroughRate(\n 'index',\n);" }, "getConversionRate": { - "default": "$response = $client->getConversionRate(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getConversionRate(\n 'index',\n);" }, "getNoClickRate": { - "default": "$response = $client->getNoClickRate(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getNoClickRate(\n 'index',\n);" }, "getNoResultsRate": { - "default": "$response = $client->getNoResultsRate(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getNoResultsRate(\n 'index',\n);" }, "getPurchaseRate": { - "default": "$response = $client->getPurchaseRate(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getPurchaseRate(\n 'index',\n);" }, "getRevenue": { - "default": "$response = $client->getRevenue(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getRevenue(\n 'index',\n);" }, "getSearchesCount": { - "default": "$response = $client->getSearchesCount(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getSearchesCount(\n 'index',\n);" }, "getSearchesNoClicks": { - "default": "$response = $client->getSearchesNoClicks(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getSearchesNoClicks(\n 'index',\n);" }, "getSearchesNoResults": { - "default": "$response = $client->getSearchesNoResults(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getSearchesNoResults(\n 'index',\n);" }, "getStatus": { - "default": "$response = $client->getStatus(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getStatus(\n 'index',\n);" }, "getTopCountries": { - "default": "$response = $client->getTopCountries(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTopCountries(\n 'index',\n);" }, "getTopFilterAttributes": { - "default": "$response = $client->getTopFilterAttributes(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTopFilterAttributes(\n 'index',\n);" }, "getTopFilterForAttribute": { - "default": "$response = $client->getTopFilterForAttribute(\n 'myAttribute',\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTopFilterForAttribute(\n 'myAttribute',\n 'index',\n);" }, "getTopFiltersNoResults": { - "default": "$response = $client->getTopFiltersNoResults(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTopFiltersNoResults(\n 'index',\n);" }, "getTopHits": { - "default": "$response = $client->getTopHits(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTopHits(\n 'index',\n);" }, "getTopSearches": { - "default": "$response = $client->getTopSearches(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTopSearches(\n 'index',\n);" }, "getUsersCount": { - "default": "$response = $client->getUsersCount(\n 'index',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getUsersCount(\n 'index',\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "init": { "default": "$client = AnalyticsClient::create('', '', 'YOUR_APP_ID_REGION');" @@ -482,76 +503,79 @@ "default": "from algoliasearch.analytics.client import AnalyticsClient" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "getAddToCartRate": { - "default": "response = await _client.get_add_to_cart_rate(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_add_to_cart_rate(\n index=\"index\",\n)" }, "getAverageClickPosition": { - "default": "response = await _client.get_average_click_position(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_average_click_position(\n index=\"index\",\n)" }, "getClickPositions": { - "default": "response = await _client.get_click_positions(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_click_positions(\n index=\"index\",\n)" }, "getClickThroughRate": { - "default": "response = await _client.get_click_through_rate(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_click_through_rate(\n index=\"index\",\n)" }, "getConversionRate": { - "default": "response = await _client.get_conversion_rate(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_conversion_rate(\n index=\"index\",\n)" }, "getNoClickRate": { - "default": "response = await _client.get_no_click_rate(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_no_click_rate(\n index=\"index\",\n)" }, "getNoResultsRate": { - "default": "response = await _client.get_no_results_rate(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_no_results_rate(\n index=\"index\",\n)" }, "getPurchaseRate": { - "default": "response = await _client.get_purchase_rate(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_purchase_rate(\n index=\"index\",\n)" }, "getRevenue": { - "default": "response = await _client.get_revenue(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_revenue(\n index=\"index\",\n)" }, "getSearchesCount": { - "default": "response = await _client.get_searches_count(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_searches_count(\n index=\"index\",\n)" }, "getSearchesNoClicks": { - "default": "response = await _client.get_searches_no_clicks(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_searches_no_clicks(\n index=\"index\",\n)" }, "getSearchesNoResults": { - "default": "response = await _client.get_searches_no_results(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_searches_no_results(\n index=\"index\",\n)" }, "getStatus": { - "default": "response = await _client.get_status(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_status(\n index=\"index\",\n)" }, "getTopCountries": { - "default": "response = await _client.get_top_countries(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_top_countries(\n index=\"index\",\n)" }, "getTopFilterAttributes": { - "default": "response = await _client.get_top_filter_attributes(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_top_filter_attributes(\n index=\"index\",\n)" }, "getTopFilterForAttribute": { - "default": "response = await _client.get_top_filter_for_attribute(\n attribute=\"myAttribute\",\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_top_filter_for_attribute(\n attribute=\"myAttribute\",\n index=\"index\",\n)" }, "getTopFiltersNoResults": { - "default": "response = await _client.get_top_filters_no_results(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_top_filters_no_results(\n index=\"index\",\n)" }, "getTopHits": { - "default": "response = await _client.get_top_hits(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_top_hits(\n index=\"index\",\n)" }, "getTopSearches": { - "default": "response = await _client.get_top_searches(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_top_searches(\n index=\"index\",\n)" }, "getUsersCount": { - "default": "response = await _client.get_users_count(\n index=\"index\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_users_count(\n index=\"index\",\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "init": { "default": "_client = AnalyticsClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -562,76 +586,79 @@ "default": "require \"algolia\"" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "getAddToCartRate": { - "default": "response = client.get_add_to_cart_rate(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_add_to_cart_rate(\"index\")" }, "getAverageClickPosition": { - "default": "response = client.get_average_click_position(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_average_click_position(\"index\")" }, "getClickPositions": { - "default": "response = client.get_click_positions(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_click_positions(\"index\")" }, "getClickThroughRate": { - "default": "response = client.get_click_through_rate(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_click_through_rate(\"index\")" }, "getConversionRate": { - "default": "response = client.get_conversion_rate(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_conversion_rate(\"index\")" }, "getNoClickRate": { - "default": "response = client.get_no_click_rate(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_no_click_rate(\"index\")" }, "getNoResultsRate": { - "default": "response = client.get_no_results_rate(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_no_results_rate(\"index\")" }, "getPurchaseRate": { - "default": "response = client.get_purchase_rate(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_purchase_rate(\"index\")" }, "getRevenue": { - "default": "response = client.get_revenue(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_revenue(\"index\")" }, "getSearchesCount": { - "default": "response = client.get_searches_count(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_searches_count(\"index\")" }, "getSearchesNoClicks": { - "default": "response = client.get_searches_no_clicks(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_searches_no_clicks(\"index\")" }, "getSearchesNoResults": { - "default": "response = client.get_searches_no_results(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_searches_no_results(\"index\")" }, "getStatus": { - "default": "response = client.get_status(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_status(\"index\")" }, "getTopCountries": { - "default": "response = client.get_top_countries(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_top_countries(\"index\")" }, "getTopFilterAttributes": { - "default": "response = client.get_top_filter_attributes(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_top_filter_attributes(\"index\")" }, "getTopFilterForAttribute": { - "default": "response = client.get_top_filter_for_attribute(\"myAttribute\", \"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_top_filter_for_attribute(\"myAttribute\", \"index\")" }, "getTopFiltersNoResults": { - "default": "response = client.get_top_filters_no_results(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_top_filters_no_results(\"index\")" }, "getTopHits": { - "default": "response = client.get_top_hits(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_top_hits(\"index\")" }, "getTopSearches": { - "default": "response = client.get_top_searches(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_top_searches(\"index\")" }, "getUsersCount": { - "default": "response = client.get_users_count(\"index\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_users_count(\"index\")" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "init": { "default": "client = Algolia::AnalyticsClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -642,76 +669,76 @@ "default": "import algoliasearch.api.AnalyticsClient" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "getAddToCartRate": { - "default": "val response = client.getAddToCartRate(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getAddToCartRate(\n index = \"index\"\n)" }, "getAverageClickPosition": { - "default": "val response = client.getAverageClickPosition(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getAverageClickPosition(\n index = \"index\"\n)" }, "getClickPositions": { - "default": "val response = client.getClickPositions(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getClickPositions(\n index = \"index\"\n)" }, "getClickThroughRate": { - "default": "val response = client.getClickThroughRate(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getClickThroughRate(\n index = \"index\"\n)" }, "getConversionRate": { - "default": "val response = client.getConversionRate(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getConversionRate(\n index = \"index\"\n)" }, "getNoClickRate": { - "default": "val response = client.getNoClickRate(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getNoClickRate(\n index = \"index\"\n)" }, "getNoResultsRate": { - "default": "val response = client.getNoResultsRate(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getNoResultsRate(\n index = \"index\"\n)" }, "getPurchaseRate": { - "default": "val response = client.getPurchaseRate(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getPurchaseRate(\n index = \"index\"\n)" }, "getRevenue": { - "default": "val response = client.getRevenue(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getRevenue(\n index = \"index\"\n)" }, "getSearchesCount": { - "default": "val response = client.getSearchesCount(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getSearchesCount(\n index = \"index\"\n)" }, "getSearchesNoClicks": { - "default": "val response = client.getSearchesNoClicks(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getSearchesNoClicks(\n index = \"index\"\n)" }, "getSearchesNoResults": { - "default": "val response = client.getSearchesNoResults(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getSearchesNoResults(\n index = \"index\"\n)" }, "getStatus": { - "default": "val response = client.getStatus(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getStatus(\n index = \"index\"\n)" }, "getTopCountries": { - "default": "val response = client.getTopCountries(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTopCountries(\n index = \"index\"\n)" }, "getTopFilterAttributes": { - "default": "val response = client.getTopFilterAttributes(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTopFilterAttributes(\n index = \"index\"\n)" }, "getTopFilterForAttribute": { - "default": "val response = client.getTopFilterForAttribute(\n attribute = \"myAttribute\",\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTopFilterForAttribute(\n attribute = \"myAttribute\",\n index = \"index\"\n)" }, "getTopFiltersNoResults": { - "default": "val response = client.getTopFiltersNoResults(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTopFiltersNoResults(\n index = \"index\"\n)" }, "getTopHits": { - "default": "val response = client.getTopHits(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTopHits(\n index = \"index\"\n)" }, "getTopSearches": { - "default": "val response = client.getTopSearches(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTopSearches(\n index = \"index\"\n)" }, "getUsersCount": { - "default": "val response = client.getUsersCount(\n index = \"index\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getUsersCount(\n index = \"index\"\n)" }, "init": { "default": "val client = AnalyticsClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = Option(\"YOUR_APP_ID_REGION\"))" @@ -793,6 +820,9 @@ "getUsersCount": { "default": "let response = try await client.getUsersCount(index: \"index\")" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "init": { "default": "let client = try AnalyticsClient(appID: \"YOUR_APP_ID\", apiKey: \"YOUR_API_KEY\", region: .us)" } diff --git a/snippets/guides/ingestion-snippets.json b/snippets/guides/ingestion-snippets.json index 2dd3cd873f..65da9d19a6 100644 --- a/snippets/guides/ingestion-snippets.json +++ b/snippets/guides/ingestion-snippets.json @@ -147,6 +147,9 @@ "searchTransformations": { "default": "var response = await client.SearchTransformationsAsync(\n new TransformationSearch\n {\n TransformationIDs = new List\n {\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n },\n }\n);" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "triggerDockerSourceDiscover": { "default": "var response = await client.TriggerDockerSourceDiscoverAsync(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n);" }, @@ -190,181 +193,187 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/ingestion\"" }, "createAuthentication": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CreateAuthentication(client.NewApiCreateAuthenticationRequest(\n\n ingestion.NewEmptyAuthenticationCreate().SetType(ingestion.AuthenticationType(\"oauth\")).SetName(\"authName\").SetInput(ingestion.AuthOAuthAsAuthInput(\n ingestion.NewEmptyAuthOAuth().SetUrl(\"http://test.oauth\").SetClientId(\"myID\").SetClientSecret(\"mySecret\"))),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CreateAuthentication(client.NewApiCreateAuthenticationRequest(\n\n ingestion.NewEmptyAuthenticationCreate().SetType(ingestion.AuthenticationType(\"oauth\")).SetName(\"authName\").SetInput(ingestion.AuthOAuthAsAuthInput(\n ingestion.NewEmptyAuthOAuth().SetUrl(\"http://test.oauth\").SetClientId(\"myID\").SetClientSecret(\"mySecret\"))),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "createDestination": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CreateDestination(client.NewApiCreateDestinationRequest(\n\n ingestion.NewEmptyDestinationCreate().SetType(ingestion.DestinationType(\"search\")).SetName(\"destinationName\").SetInput(ingestion.DestinationIndexNameAsDestinationInput(\n ingestion.NewEmptyDestinationIndexName().SetIndexName(\"\"))).SetAuthenticationID(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CreateDestination(client.NewApiCreateDestinationRequest(\n\n ingestion.NewEmptyDestinationCreate().SetType(ingestion.DestinationType(\"search\")).SetName(\"destinationName\").SetInput(ingestion.DestinationIndexNameAsDestinationInput(\n ingestion.NewEmptyDestinationIndexName().SetIndexName(\"\"))).SetAuthenticationID(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "createSource": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CreateSource(client.NewApiCreateSourceRequest(\n\n ingestion.NewEmptySourceCreate().SetType(ingestion.SourceType(\"commercetools\")).SetName(\"sourceName\").SetInput(ingestion.SourceCommercetoolsAsSourceInput(\n ingestion.NewEmptySourceCommercetools().SetStoreKeys(\n []string{\"myStore\"}).SetLocales(\n []string{\"de\"}).SetUrl(\"http://commercetools.com\").SetProjectKey(\"keyID\"))).SetAuthenticationID(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CreateSource(client.NewApiCreateSourceRequest(\n\n ingestion.NewEmptySourceCreate().SetType(ingestion.SourceType(\"commercetools\")).SetName(\"sourceName\").SetInput(ingestion.SourceCommercetoolsAsSourceInput(\n ingestion.NewEmptySourceCommercetools().SetStoreKeys(\n []string{\"myStore\"}).SetLocales(\n []string{\"de\"}).SetUrl(\"http://commercetools.com\").SetProjectKey(\"keyID\"))).SetAuthenticationID(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "createTask": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CreateTask(client.NewApiCreateTaskRequest(\n\n ingestion.NewEmptyTaskCreate().SetSourceID(\"search\").SetDestinationID(\"destinationName\").SetAction(ingestion.ActionType(\"replace\")),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CreateTask(client.NewApiCreateTaskRequest(\n\n ingestion.NewEmptyTaskCreate().SetSourceID(\"search\").SetDestinationID(\"destinationName\").SetAction(ingestion.ActionType(\"replace\")),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "createTaskV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CreateTaskV1(client.NewApiCreateTaskV1Request(\n\n ingestion.NewEmptyTaskCreateV1().SetSourceID(\"search\").SetDestinationID(\"destinationName\").SetTrigger(ingestion.OnDemandTriggerInputAsTaskCreateTrigger(\n ingestion.NewEmptyOnDemandTriggerInput().SetType(ingestion.OnDemandTriggerType(\"onDemand\")))).SetAction(ingestion.ActionType(\"replace\")),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CreateTaskV1(client.NewApiCreateTaskV1Request(\n\n ingestion.NewEmptyTaskCreateV1().SetSourceID(\"search\").SetDestinationID(\"destinationName\").SetTrigger(ingestion.OnDemandTriggerInputAsTaskCreateTrigger(\n ingestion.NewEmptyOnDemandTriggerInput().SetType(ingestion.OnDemandTriggerType(\"onDemand\")))).SetAction(ingestion.ActionType(\"replace\")),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "createTransformation": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CreateTransformation(client.NewApiCreateTransformationRequest(\n\n ingestion.NewEmptyTransformationCreate().SetCode(\"foo\").SetName(\"bar\").SetDescription(\"baz\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CreateTransformation(client.NewApiCreateTransformationRequest(\n\n ingestion.NewEmptyTransformationCreate().SetCode(\"foo\").SetName(\"bar\").SetDescription(\"baz\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customDelete": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteAuthentication": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteAuthentication(client.NewApiDeleteAuthenticationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteAuthentication(client.NewApiDeleteAuthenticationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteDestination": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteDestination(client.NewApiDeleteDestinationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteDestination(client.NewApiDeleteDestinationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteSource": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteSource(client.NewApiDeleteSourceRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteSource(client.NewApiDeleteSourceRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteTask": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteTask(client.NewApiDeleteTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteTask(client.NewApiDeleteTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteTaskV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteTaskV1(client.NewApiDeleteTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteTaskV1(client.NewApiDeleteTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteTransformation": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteTransformation(client.NewApiDeleteTransformationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteTransformation(client.NewApiDeleteTransformationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "disableTask": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DisableTask(client.NewApiDisableTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DisableTask(client.NewApiDisableTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "disableTaskV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DisableTaskV1(client.NewApiDisableTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DisableTaskV1(client.NewApiDisableTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "enableTask": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.EnableTask(client.NewApiEnableTaskRequest(\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.EnableTask(client.NewApiEnableTaskRequest(\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "enableTaskV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.EnableTaskV1(client.NewApiEnableTaskV1Request(\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.EnableTaskV1(client.NewApiEnableTaskV1Request(\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "generateTransformationCode": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GenerateTransformationCode(client.NewApiGenerateTransformationCodeRequest(\n\n ingestion.NewEmptyGenerateTransformationCodePayload().SetId(\"foo\").SetUserPrompt(\"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GenerateTransformationCode(client.NewApiGenerateTransformationCodeRequest(\n\n ingestion.NewEmptyGenerateTransformationCodePayload().SetId(\"foo\").SetUserPrompt(\"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getAuthentication": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetAuthentication(client.NewApiGetAuthenticationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetAuthentication(client.NewApiGetAuthenticationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getDestination": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetDestination(client.NewApiGetDestinationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetDestination(client.NewApiGetDestinationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getEvent": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetEvent(client.NewApiGetEventRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"6c02aeb1-775e-418e-870b-1faccd4b2c0c\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetEvent(client.NewApiGetEventRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"6c02aeb1-775e-418e-870b-1faccd4b2c0c\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getRun": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetRun(client.NewApiGetRunRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetRun(client.NewApiGetRunRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getSource": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetSource(client.NewApiGetSourceRequest(\n \"75eeb306-51d3-4e5e-a279-3c92bd8893ac\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetSource(client.NewApiGetSourceRequest(\n \"75eeb306-51d3-4e5e-a279-3c92bd8893ac\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTask": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTask(client.NewApiGetTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTask(client.NewApiGetTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTaskV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTaskV1(client.NewApiGetTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTaskV1(client.NewApiGetTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTransformation": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetTransformation(client.NewApiGetTransformationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetTransformation(client.NewApiGetTransformationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listAuthentications": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListAuthentications(client.NewApiListAuthenticationsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListAuthentications(client.NewApiListAuthenticationsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listDestinations": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListDestinations(client.NewApiListDestinationsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListDestinations(client.NewApiListDestinationsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listEvents": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListEvents(client.NewApiListEventsRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListEvents(client.NewApiListEventsRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listRuns": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListRuns(client.NewApiListRunsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListRuns(client.NewApiListRunsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listSources": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListSources(client.NewApiListSourcesRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListSources(client.NewApiListSourcesRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listTasks": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListTasks(client.NewApiListTasksRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListTasks(client.NewApiListTasksRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listTasksV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListTasksV1(client.NewApiListTasksV1Request())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListTasksV1(client.NewApiListTasksV1Request())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listTransformationModels": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListTransformationModels()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListTransformationModels()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listTransformations": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ListTransformations(client.NewApiListTransformationsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ListTransformations(client.NewApiListTransformationsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "pushTask": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.PushTask(client.NewApiPushTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyPushTaskPayload().SetAction(ingestion.Action(\"addObject\")).SetRecords(\n []ingestion.PushTaskRecords{*ingestion.NewEmptyPushTaskRecords().SetAdditionalProperty(\"key\", \"bar\").SetAdditionalProperty(\"foo\", \"1\").SetObjectID(\"o\"), *ingestion.NewEmptyPushTaskRecords().SetAdditionalProperty(\"key\", \"baz\").SetAdditionalProperty(\"foo\", \"2\").SetObjectID(\"k\")}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.PushTask(client.NewApiPushTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyPushTaskPayload().SetAction(ingestion.Action(\"addObject\")).SetRecords(\n []ingestion.PushTaskRecords{*ingestion.NewEmptyPushTaskRecords().SetAdditionalProperty(\"key\", \"bar\").SetAdditionalProperty(\"foo\", \"1\").SetObjectID(\"o\"), *ingestion.NewEmptyPushTaskRecords().SetAdditionalProperty(\"key\", \"baz\").SetAdditionalProperty(\"foo\", \"2\").SetObjectID(\"k\")}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "runSource": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.RunSource(client.NewApiRunSourceRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n).WithRunSourcePayload(\n ingestion.NewEmptyRunSourcePayload().SetIndexToInclude(\n []string{\"products_us\", \"products eu\"}).SetEntityIDs(\n []string{\"1234\", \"5678\"}).SetEntityType(ingestion.EntityType(\"product\"))))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.RunSource(client.NewApiRunSourceRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n).WithRunSourcePayload(\n ingestion.NewEmptyRunSourcePayload().SetIndexToInclude(\n []string{\"products_us\", \"products eu\"}).SetEntityIDs(\n []string{\"1234\", \"5678\"}).SetEntityType(ingestion.EntityType(\"product\"))))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "runTask": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.RunTask(client.NewApiRunTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.RunTask(client.NewApiRunTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "runTaskV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.RunTaskV1(client.NewApiRunTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.RunTaskV1(client.NewApiRunTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchAuthentications": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.SearchAuthentications(client.NewApiSearchAuthenticationsRequest(\n\n ingestion.NewEmptyAuthenticationSearch().SetAuthenticationIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.SearchAuthentications(client.NewApiSearchAuthenticationsRequest(\n\n ingestion.NewEmptyAuthenticationSearch().SetAuthenticationIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchDestinations": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.SearchDestinations(client.NewApiSearchDestinationsRequest(\n\n ingestion.NewEmptyDestinationSearch().SetDestinationIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.SearchDestinations(client.NewApiSearchDestinationsRequest(\n\n ingestion.NewEmptyDestinationSearch().SetDestinationIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchSources": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.SearchSources(client.NewApiSearchSourcesRequest(\n\n ingestion.NewEmptySourceSearch().SetSourceIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.SearchSources(client.NewApiSearchSourcesRequest(\n\n ingestion.NewEmptySourceSearch().SetSourceIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchTasks": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.SearchTasks(client.NewApiSearchTasksRequest(\n\n ingestion.NewEmptyTaskSearch().SetTaskIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.SearchTasks(client.NewApiSearchTasksRequest(\n\n ingestion.NewEmptyTaskSearch().SetTaskIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchTasksV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.SearchTasksV1(client.NewApiSearchTasksV1Request(\n\n ingestion.NewEmptyTaskSearch().SetTaskIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.SearchTasksV1(client.NewApiSearchTasksV1Request(\n\n ingestion.NewEmptyTaskSearch().SetTaskIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchTransformations": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.SearchTransformations(client.NewApiSearchTransformationsRequest(\n\n ingestion.NewEmptyTransformationSearch().SetTransformationIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.SearchTransformations(client.NewApiSearchTransformationsRequest(\n\n ingestion.NewEmptyTransformationSearch().SetTransformationIDs(\n []string{\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "triggerDockerSourceDiscover": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.TriggerDockerSourceDiscover(client.NewApiTriggerDockerSourceDiscoverRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.TriggerDockerSourceDiscover(client.NewApiTriggerDockerSourceDiscoverRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "tryTransformation": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.TryTransformation(client.NewApiTryTransformationRequest(\n\n ingestion.NewEmptyTransformationTry().SetCode(\"foo\").SetSampleRecord(map[string]any{\"bar\": \"baz\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.TryTransformation(client.NewApiTryTransformationRequest(\n\n ingestion.NewEmptyTransformationTry().SetCode(\"foo\").SetSampleRecord(map[string]any{\"bar\": \"baz\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "tryTransformationBeforeUpdate": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.TryTransformationBeforeUpdate(client.NewApiTryTransformationBeforeUpdateRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyTransformationTry().SetCode(\"foo\").SetSampleRecord(map[string]any{\"bar\": \"baz\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.TryTransformationBeforeUpdate(client.NewApiTryTransformationBeforeUpdateRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyTransformationTry().SetCode(\"foo\").SetSampleRecord(map[string]any{\"bar\": \"baz\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "updateAuthentication": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.UpdateAuthentication(client.NewApiUpdateAuthenticationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyAuthenticationUpdate().SetName(\"newName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.UpdateAuthentication(client.NewApiUpdateAuthenticationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyAuthenticationUpdate().SetName(\"newName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "updateDestination": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.UpdateDestination(client.NewApiUpdateDestinationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyDestinationUpdate().SetName(\"newName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.UpdateDestination(client.NewApiUpdateDestinationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyDestinationUpdate().SetName(\"newName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "updateSource": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.UpdateSource(client.NewApiUpdateSourceRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptySourceUpdate().SetName(\"newName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.UpdateSource(client.NewApiUpdateSourceRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptySourceUpdate().SetName(\"newName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "updateTask": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.UpdateTask(client.NewApiUpdateTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyTaskUpdate().SetEnabled(false).SetCron(\"* * * * *\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.UpdateTask(client.NewApiUpdateTaskRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyTaskUpdate().SetEnabled(false).SetCron(\"* * * * *\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "updateTaskV1": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.UpdateTaskV1(client.NewApiUpdateTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyTaskUpdateV1().SetEnabled(false),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.UpdateTaskV1(client.NewApiUpdateTaskV1Request(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyTaskUpdateV1().SetEnabled(false),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "updateTransformation": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.UpdateTransformation(client.NewApiUpdateTransformationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyTransformationCreate().SetCode(\"foo\").SetName(\"bar\").SetDescription(\"baz\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.UpdateTransformation(client.NewApiUpdateTransformationRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptyTransformationCreate().SetCode(\"foo\").SetName(\"bar\").SetDescription(\"baz\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "validateSource": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ValidateSource(client.NewApiValidateSourceRequest().WithSourceCreate(\n ingestion.NewEmptySourceCreate().SetType(ingestion.SourceType(\"commercetools\")).SetName(\"sourceName\").SetInput(ingestion.SourceCommercetoolsAsSourceInput(\n ingestion.NewEmptySourceCommercetools().SetStoreKeys(\n []string{\"myStore\"}).SetLocales(\n []string{\"de\"}).SetUrl(\"http://commercetools.com\").SetProjectKey(\"keyID\"))).SetAuthenticationID(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ValidateSource(client.NewApiValidateSourceRequest().WithSourceCreate(\n ingestion.NewEmptySourceCreate().SetType(ingestion.SourceType(\"commercetools\")).SetName(\"sourceName\").SetInput(ingestion.SourceCommercetoolsAsSourceInput(\n ingestion.NewEmptySourceCommercetools().SetStoreKeys(\n []string{\"myStore\"}).SetLocales(\n []string{\"de\"}).SetUrl(\"http://commercetools.com\").SetProjectKey(\"keyID\"))).SetAuthenticationID(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "validateSourceBeforeUpdate": { - "default": "// Initialize the client with your application region, eg. ingestion.YOUR_APP_ID_REGION\nclient, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.ValidateSourceBeforeUpdate(client.NewApiValidateSourceBeforeUpdateRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptySourceUpdate().SetName(\"newName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.ValidateSourceBeforeUpdate(client.NewApiValidateSourceBeforeUpdateRequest(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ingestion.NewEmptySourceUpdate().SetName(\"newName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "init": { + "default": "client, err := ingestion.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", ingestion.US)" } }, "java": { @@ -515,6 +524,9 @@ "searchTransformations": { "default": "client.searchTransformations(\n new TransformationSearch()\n .setTransformationIDs(\n Arrays.asList(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n )\n )\n);" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "triggerDockerSourceDiscover": { "default": "client.triggerDockerSourceDiscover(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\");" }, @@ -557,181 +569,184 @@ "default": "import { ingestionClient } from '@algolia/ingestion';" }, "createAuthentication": { - "default": "const response = await client.createAuthentication({\n type: 'oauth',\n name: 'authName',\n input: { url: 'http://test.oauth', client_id: 'myID', client_secret: 'mySecret' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.createAuthentication({\n type: 'oauth',\n name: 'authName',\n input: { url: 'http://test.oauth', client_id: 'myID', client_secret: 'mySecret' },\n});" }, "createDestination": { - "default": "const response = await client.createDestination({\n type: 'search',\n name: 'destinationName',\n input: { indexName: 'full_name______' },\n authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.createDestination({\n type: 'search',\n name: 'destinationName',\n input: { indexName: 'full_name______' },\n authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n});" }, "createSource": { - "default": "const response = await client.createSource({\n type: 'commercetools',\n name: 'sourceName',\n input: { storeKeys: ['myStore'], locales: ['de'], url: 'http://commercetools.com', projectKey: 'keyID' },\n authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.createSource({\n type: 'commercetools',\n name: 'sourceName',\n input: { storeKeys: ['myStore'], locales: ['de'], url: 'http://commercetools.com', projectKey: 'keyID' },\n authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n});" }, "createTask": { - "default": "const response = await client.createTask({ sourceID: 'search', destinationID: 'destinationName', action: 'replace' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.createTask({ sourceID: 'search', destinationID: 'destinationName', action: 'replace' });" }, "createTaskV1": { - "default": "const response = await client.createTaskV1({\n sourceID: 'search',\n destinationID: 'destinationName',\n trigger: { type: 'onDemand' },\n action: 'replace',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.createTaskV1({\n sourceID: 'search',\n destinationID: 'destinationName',\n trigger: { type: 'onDemand' },\n action: 'replace',\n});" }, "createTransformation": { - "default": "const response = await client.createTransformation({ code: 'foo', name: 'bar', description: 'baz' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.createTransformation({ code: 'foo', name: 'bar', description: 'baz' });" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "deleteAuthentication": { - "default": "const response = await client.deleteAuthentication({ authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteAuthentication({ authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "deleteDestination": { - "default": "const response = await client.deleteDestination({ destinationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteDestination({ destinationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "deleteSource": { - "default": "const response = await client.deleteSource({ sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteSource({ sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "deleteTask": { - "default": "const response = await client.deleteTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "deleteTaskV1": { - "default": "const response = await client.deleteTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "deleteTransformation": { - "default": "const response = await client.deleteTransformation({ transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteTransformation({ transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "disableTask": { - "default": "const response = await client.disableTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.disableTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "disableTaskV1": { - "default": "const response = await client.disableTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.disableTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "enableTask": { - "default": "const response = await client.enableTask({ taskID: '76ab4c2a-ce17-496f-b7a6-506dc59ee498' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.enableTask({ taskID: '76ab4c2a-ce17-496f-b7a6-506dc59ee498' });" }, "enableTaskV1": { - "default": "const response = await client.enableTaskV1({ taskID: '76ab4c2a-ce17-496f-b7a6-506dc59ee498' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.enableTaskV1({ taskID: '76ab4c2a-ce17-496f-b7a6-506dc59ee498' });" }, "generateTransformationCode": { - "default": "const response = await client.generateTransformationCode({\n id: 'foo',\n userPrompt: 'fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.generateTransformationCode({\n id: 'foo',\n userPrompt: 'fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing',\n});" }, "getAuthentication": { - "default": "const response = await client.getAuthentication({ authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getAuthentication({ authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "getDestination": { - "default": "const response = await client.getDestination({ destinationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getDestination({ destinationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "getEvent": { - "default": "const response = await client.getEvent({\n runID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n eventID: '6c02aeb1-775e-418e-870b-1faccd4b2c0c',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getEvent({\n runID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n eventID: '6c02aeb1-775e-418e-870b-1faccd4b2c0c',\n});" }, "getRun": { - "default": "const response = await client.getRun({ runID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getRun({ runID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "getSource": { - "default": "const response = await client.getSource({ sourceID: '75eeb306-51d3-4e5e-a279-3c92bd8893ac' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getSource({ sourceID: '75eeb306-51d3-4e5e-a279-3c92bd8893ac' });" }, "getTask": { - "default": "const response = await client.getTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "getTaskV1": { - "default": "const response = await client.getTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "getTransformation": { - "default": "const response = await client.getTransformation({ transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTransformation({ transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "listAuthentications": { - "default": "const response = await client.listAuthentications();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listAuthentications();" }, "listDestinations": { - "default": "const response = await client.listDestinations();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listDestinations();" }, "listEvents": { - "default": "const response = await client.listEvents({ runID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listEvents({ runID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "listRuns": { - "default": "const response = await client.listRuns();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listRuns();" }, "listSources": { - "default": "const response = await client.listSources();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listSources();" }, "listTasks": { - "default": "const response = await client.listTasks();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listTasks();" }, "listTasksV1": { - "default": "const response = await client.listTasksV1();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listTasksV1();" }, "listTransformationModels": { - "default": "const response = await client.listTransformationModels();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listTransformationModels();" }, "listTransformations": { - "default": "const response = await client.listTransformations();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listTransformations();" }, "pushTask": { - "default": "const response = await client.pushTask({\n taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n pushTaskPayload: {\n action: 'addObject',\n records: [\n { key: 'bar', foo: '1', objectID: 'o' },\n { key: 'baz', foo: '2', objectID: 'k' },\n ],\n },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.pushTask({\n taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n pushTaskPayload: {\n action: 'addObject',\n records: [\n { key: 'bar', foo: '1', objectID: 'o' },\n { key: 'baz', foo: '2', objectID: 'k' },\n ],\n },\n});" }, "runSource": { - "default": "const response = await client.runSource({\n sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n runSourcePayload: {\n indexToInclude: ['products_us', 'products eu'],\n entityIDs: ['1234', '5678'],\n entityType: 'product',\n },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.runSource({\n sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n runSourcePayload: {\n indexToInclude: ['products_us', 'products eu'],\n entityIDs: ['1234', '5678'],\n entityType: 'product',\n },\n});" }, "runTask": { - "default": "const response = await client.runTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.runTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "runTaskV1": { - "default": "const response = await client.runTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.runTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "searchAuthentications": { - "default": "const response = await client.searchAuthentications({\n authenticationIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchAuthentications({\n authenticationIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'],\n});" }, "searchDestinations": { - "default": "const response = await client.searchDestinations({\n destinationIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchDestinations({\n destinationIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'],\n});" }, "searchSources": { - "default": "const response = await client.searchSources({\n sourceIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchSources({\n sourceIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'],\n});" }, "searchTasks": { - "default": "const response = await client.searchTasks({\n taskIDs: [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchTasks({\n taskIDs: [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n});" }, "searchTasksV1": { - "default": "const response = await client.searchTasksV1({\n taskIDs: [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchTasksV1({\n taskIDs: [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n});" }, "searchTransformations": { - "default": "const response = await client.searchTransformations({\n transformationIDs: [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchTransformations({\n transformationIDs: [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n});" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "triggerDockerSourceDiscover": { - "default": "const response = await client.triggerDockerSourceDiscover({ sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.triggerDockerSourceDiscover({ sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' });" }, "tryTransformation": { - "default": "const response = await client.tryTransformation({ code: 'foo', sampleRecord: { bar: 'baz' } });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.tryTransformation({ code: 'foo', sampleRecord: { bar: 'baz' } });" }, "tryTransformationBeforeUpdate": { - "default": "const response = await client.tryTransformationBeforeUpdate({\n transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n transformationTry: { code: 'foo', sampleRecord: { bar: 'baz' } },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.tryTransformationBeforeUpdate({\n transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n transformationTry: { code: 'foo', sampleRecord: { bar: 'baz' } },\n});" }, "updateAuthentication": { - "default": "const response = await client.updateAuthentication({\n authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n authenticationUpdate: { name: 'newName' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.updateAuthentication({\n authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n authenticationUpdate: { name: 'newName' },\n});" }, "updateDestination": { - "default": "const response = await client.updateDestination({\n destinationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n destinationUpdate: { name: 'newName' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.updateDestination({\n destinationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n destinationUpdate: { name: 'newName' },\n});" }, "updateSource": { - "default": "const response = await client.updateSource({\n sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n sourceUpdate: { name: 'newName' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.updateSource({\n sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n sourceUpdate: { name: 'newName' },\n});" }, "updateTask": { - "default": "const response = await client.updateTask({\n taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n taskUpdate: { enabled: false, cron: '* * * * *' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.updateTask({\n taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n taskUpdate: { enabled: false, cron: '* * * * *' },\n});" }, "updateTaskV1": { - "default": "const response = await client.updateTaskV1({\n taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n taskUpdate: { enabled: false },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.updateTaskV1({\n taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n taskUpdate: { enabled: false },\n});" }, "updateTransformation": { - "default": "const response = await client.updateTransformation({\n transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n transformationCreate: { code: 'foo', name: 'bar', description: 'baz' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.updateTransformation({\n transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n transformationCreate: { code: 'foo', name: 'bar', description: 'baz' },\n});" }, "validateSource": { - "default": "const response = await client.validateSource({\n type: 'commercetools',\n name: 'sourceName',\n input: { storeKeys: ['myStore'], locales: ['de'], url: 'http://commercetools.com', projectKey: 'keyID' },\n authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.validateSource({\n type: 'commercetools',\n name: 'sourceName',\n input: { storeKeys: ['myStore'], locales: ['de'], url: 'http://commercetools.com', projectKey: 'keyID' },\n authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n});" }, "validateSourceBeforeUpdate": { - "default": "const response = await client.validateSourceBeforeUpdate({\n sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n sourceUpdate: { name: 'newName' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.validateSourceBeforeUpdate({\n sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n sourceUpdate: { name: 'newName' },\n});" }, "init": { "default": "const client = ingestionClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION');" @@ -742,181 +757,184 @@ "default": "import com.algolia.client.api.IngestionClient" }, "createAuthentication": { - "default": "var response = client.createAuthentication(\n authenticationCreate = AuthenticationCreate(\n type = AuthenticationType.entries.first { it.value == \"oauth\" },\n name = \"authName\",\n input = AuthOAuth(\n url = \"http://test.oauth\",\n clientId = \"myID\",\n clientSecret = \"mySecret\",\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.createAuthentication(\n authenticationCreate = AuthenticationCreate(\n type = AuthenticationType.entries.first { it.value == \"oauth\" },\n name = \"authName\",\n input = AuthOAuth(\n url = \"http://test.oauth\",\n clientId = \"myID\",\n clientSecret = \"mySecret\",\n ),\n ),\n)" }, "createDestination": { - "default": "var response = client.createDestination(\n destinationCreate = DestinationCreate(\n type = DestinationType.entries.first { it.value == \"search\" },\n name = \"destinationName\",\n input = DestinationIndexName(\n indexName = \"\",\n ),\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.createDestination(\n destinationCreate = DestinationCreate(\n type = DestinationType.entries.first { it.value == \"search\" },\n name = \"destinationName\",\n input = DestinationIndexName(\n indexName = \"\",\n ),\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ),\n)" }, "createSource": { - "default": "var response = client.createSource(\n sourceCreate = SourceCreate(\n type = SourceType.entries.first { it.value == \"commercetools\" },\n name = \"sourceName\",\n input = SourceCommercetools(\n storeKeys = listOf(\"myStore\"),\n locales = listOf(\"de\"),\n url = \"http://commercetools.com\",\n projectKey = \"keyID\",\n ),\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.createSource(\n sourceCreate = SourceCreate(\n type = SourceType.entries.first { it.value == \"commercetools\" },\n name = \"sourceName\",\n input = SourceCommercetools(\n storeKeys = listOf(\"myStore\"),\n locales = listOf(\"de\"),\n url = \"http://commercetools.com\",\n projectKey = \"keyID\",\n ),\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ),\n)" }, "createTask": { - "default": "var response = client.createTask(\n taskCreate = TaskCreate(\n sourceID = \"search\",\n destinationID = \"destinationName\",\n action = ActionType.entries.first { it.value == \"replace\" },\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.createTask(\n taskCreate = TaskCreate(\n sourceID = \"search\",\n destinationID = \"destinationName\",\n action = ActionType.entries.first { it.value == \"replace\" },\n ),\n)" }, "createTaskV1": { - "default": "var response = client.createTaskV1(\n taskCreate = TaskCreateV1(\n sourceID = \"search\",\n destinationID = \"destinationName\",\n trigger = OnDemandTriggerInput(\n type = OnDemandTriggerType.entries.first { it.value == \"onDemand\" },\n ),\n action = ActionType.entries.first { it.value == \"replace\" },\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.createTaskV1(\n taskCreate = TaskCreateV1(\n sourceID = \"search\",\n destinationID = \"destinationName\",\n trigger = OnDemandTriggerInput(\n type = OnDemandTriggerType.entries.first { it.value == \"onDemand\" },\n ),\n action = ActionType.entries.first { it.value == \"replace\" },\n ),\n)" }, "createTransformation": { - "default": "var response = client.createTransformation(\n transformationCreate = TransformationCreate(\n code = \"foo\",\n name = \"bar\",\n description = \"baz\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.createTransformation(\n transformationCreate = TransformationCreate(\n code = \"foo\",\n name = \"bar\",\n description = \"baz\",\n ),\n)" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "deleteAuthentication": { - "default": "var response = client.deleteAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteDestination": { - "default": "var response = client.deleteDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteSource": { - "default": "var response = client.deleteSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteTask": { - "default": "var response = client.deleteTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteTaskV1": { - "default": "var response = client.deleteTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteTransformation": { - "default": "var response = client.deleteTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "disableTask": { - "default": "var response = client.disableTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.disableTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "disableTaskV1": { - "default": "var response = client.disableTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.disableTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "enableTask": { - "default": "var response = client.enableTask(\n taskID = \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.enableTask(\n taskID = \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n)" }, "enableTaskV1": { - "default": "var response = client.enableTaskV1(\n taskID = \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.enableTaskV1(\n taskID = \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n)" }, "generateTransformationCode": { - "default": "var response = client.generateTransformationCode(\n generateTransformationCodePayload = GenerateTransformationCodePayload(\n id = \"foo\",\n userPrompt = \"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.generateTransformationCode(\n generateTransformationCodePayload = GenerateTransformationCodePayload(\n id = \"foo\",\n userPrompt = \"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\",\n ),\n)" }, "getAuthentication": { - "default": "var response = client.getAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getDestination": { - "default": "var response = client.getDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getEvent": { - "default": "var response = client.getEvent(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n eventID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0c\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getEvent(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n eventID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0c\",\n)" }, "getRun": { - "default": "var response = client.getRun(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getRun(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getSource": { - "default": "var response = client.getSource(\n sourceID = \"75eeb306-51d3-4e5e-a279-3c92bd8893ac\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getSource(\n sourceID = \"75eeb306-51d3-4e5e-a279-3c92bd8893ac\",\n)" }, "getTask": { - "default": "var response = client.getTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getTaskV1": { - "default": "var response = client.getTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getTransformation": { - "default": "var response = client.getTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "listAuthentications": { - "default": "var response = client.listAuthentications()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listAuthentications()" }, "listDestinations": { - "default": "var response = client.listDestinations()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listDestinations()" }, "listEvents": { - "default": "var response = client.listEvents(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.listEvents(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "listRuns": { - "default": "var response = client.listRuns()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listRuns()" }, "listSources": { - "default": "var response = client.listSources()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listSources()" }, "listTasks": { - "default": "var response = client.listTasks()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listTasks()" }, "listTasksV1": { - "default": "var response = client.listTasksV1()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listTasksV1()" }, "listTransformationModels": { - "default": "var response = client.listTransformationModels()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listTransformationModels()" }, "listTransformations": { - "default": "var response = client.listTransformations()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listTransformations()" }, "pushTask": { - "default": "var response = client.pushTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n pushTaskPayload = PushTaskPayload(\n action = Action.entries.first { it.value == \"addObject\" },\n records = listOf(\n PushTaskRecords(\n objectID = \"o\",\n additionalProperties = mapOf(\n \"key\" to JsonPrimitive(\"bar\"),\n \"foo\" to JsonPrimitive(\"1\"),\n ),\n ),\n PushTaskRecords(\n objectID = \"k\",\n additionalProperties = mapOf(\n \"key\" to JsonPrimitive(\"baz\"),\n \"foo\" to JsonPrimitive(\"2\"),\n ),\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.pushTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n pushTaskPayload = PushTaskPayload(\n action = Action.entries.first { it.value == \"addObject\" },\n records = listOf(\n PushTaskRecords(\n objectID = \"o\",\n additionalProperties = mapOf(\n \"key\" to JsonPrimitive(\"bar\"),\n \"foo\" to JsonPrimitive(\"1\"),\n ),\n ),\n PushTaskRecords(\n objectID = \"k\",\n additionalProperties = mapOf(\n \"key\" to JsonPrimitive(\"baz\"),\n \"foo\" to JsonPrimitive(\"2\"),\n ),\n ),\n ),\n ),\n)" }, "runSource": { - "default": "var response = client.runSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n runSourcePayload = RunSourcePayload(\n indexToInclude = listOf(\"products_us\", \"products eu\"),\n entityIDs = listOf(\"1234\", \"5678\"),\n entityType = EntityType.entries.first { it.value == \"product\" },\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.runSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n runSourcePayload = RunSourcePayload(\n indexToInclude = listOf(\"products_us\", \"products eu\"),\n entityIDs = listOf(\"1234\", \"5678\"),\n entityType = EntityType.entries.first { it.value == \"product\" },\n ),\n)" }, "runTask": { - "default": "var response = client.runTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.runTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "runTaskV1": { - "default": "var response = client.runTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.runTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "searchAuthentications": { - "default": "var response = client.searchAuthentications(\n authenticationSearch = AuthenticationSearch(\n authenticationIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchAuthentications(\n authenticationSearch = AuthenticationSearch(\n authenticationIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"),\n ),\n)" }, "searchDestinations": { - "default": "var response = client.searchDestinations(\n destinationSearch = DestinationSearch(\n destinationIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchDestinations(\n destinationSearch = DestinationSearch(\n destinationIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"),\n ),\n)" }, "searchSources": { - "default": "var response = client.searchSources(\n sourceSearch = SourceSearch(\n sourceIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchSources(\n sourceSearch = SourceSearch(\n sourceIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"),\n ),\n)" }, "searchTasks": { - "default": "var response = client.searchTasks(\n taskSearch = TaskSearch(\n taskIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchTasks(\n taskSearch = TaskSearch(\n taskIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"),\n ),\n)" }, "searchTasksV1": { - "default": "var response = client.searchTasksV1(\n taskSearch = TaskSearch(\n taskIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchTasksV1(\n taskSearch = TaskSearch(\n taskIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"),\n ),\n)" }, "searchTransformations": { - "default": "var response = client.searchTransformations(\n transformationSearch = TransformationSearch(\n transformationIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchTransformations(\n transformationSearch = TransformationSearch(\n transformationIDs = listOf(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\", \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"),\n ),\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "triggerDockerSourceDiscover": { - "default": "var response = client.triggerDockerSourceDiscover(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.triggerDockerSourceDiscover(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "tryTransformation": { - "default": "var response = client.tryTransformation(\n transformationTry = TransformationTry(\n code = \"foo\",\n sampleRecord = buildJsonObject {\n put(\n \"bar\",\n JsonPrimitive(\"baz\"),\n )\n },\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.tryTransformation(\n transformationTry = TransformationTry(\n code = \"foo\",\n sampleRecord = buildJsonObject {\n put(\n \"bar\",\n JsonPrimitive(\"baz\"),\n )\n },\n ),\n)" }, "tryTransformationBeforeUpdate": { - "default": "var response = client.tryTransformationBeforeUpdate(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformationTry = TransformationTry(\n code = \"foo\",\n sampleRecord = buildJsonObject {\n put(\n \"bar\",\n JsonPrimitive(\"baz\"),\n )\n },\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.tryTransformationBeforeUpdate(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformationTry = TransformationTry(\n code = \"foo\",\n sampleRecord = buildJsonObject {\n put(\n \"bar\",\n JsonPrimitive(\"baz\"),\n )\n },\n ),\n)" }, "updateAuthentication": { - "default": "var response = client.updateAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n authenticationUpdate = AuthenticationUpdate(\n name = \"newName\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.updateAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n authenticationUpdate = AuthenticationUpdate(\n name = \"newName\",\n ),\n)" }, "updateDestination": { - "default": "var response = client.updateDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n destinationUpdate = DestinationUpdate(\n name = \"newName\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.updateDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n destinationUpdate = DestinationUpdate(\n name = \"newName\",\n ),\n)" }, "updateSource": { - "default": "var response = client.updateSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n sourceUpdate = SourceUpdate(\n name = \"newName\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.updateSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n sourceUpdate = SourceUpdate(\n name = \"newName\",\n ),\n)" }, "updateTask": { - "default": "var response = client.updateTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n taskUpdate = TaskUpdate(\n enabled = false,\n cron = \"* * * * *\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.updateTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n taskUpdate = TaskUpdate(\n enabled = false,\n cron = \"* * * * *\",\n ),\n)" }, "updateTaskV1": { - "default": "var response = client.updateTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n taskUpdate = TaskUpdateV1(\n enabled = false,\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.updateTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n taskUpdate = TaskUpdateV1(\n enabled = false,\n ),\n)" }, "updateTransformation": { - "default": "var response = client.updateTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformationCreate = TransformationCreate(\n code = \"foo\",\n name = \"bar\",\n description = \"baz\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.updateTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformationCreate = TransformationCreate(\n code = \"foo\",\n name = \"bar\",\n description = \"baz\",\n ),\n)" }, "validateSource": { - "default": "var response = client.validateSource(\n sourceCreate = SourceCreate(\n type = SourceType.entries.first { it.value == \"commercetools\" },\n name = \"sourceName\",\n input = SourceCommercetools(\n storeKeys = listOf(\"myStore\"),\n locales = listOf(\"de\"),\n url = \"http://commercetools.com\",\n projectKey = \"keyID\",\n ),\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.validateSource(\n sourceCreate = SourceCreate(\n type = SourceType.entries.first { it.value == \"commercetools\" },\n name = \"sourceName\",\n input = SourceCommercetools(\n storeKeys = listOf(\"myStore\"),\n locales = listOf(\"de\"),\n url = \"http://commercetools.com\",\n projectKey = \"keyID\",\n ),\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n ),\n)" }, "validateSourceBeforeUpdate": { - "default": "var response = client.validateSourceBeforeUpdate(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n sourceUpdate = SourceUpdate(\n name = \"newName\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.validateSourceBeforeUpdate(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n sourceUpdate = SourceUpdate(\n name = \"newName\",\n ),\n)" }, "init": { "default": "val client = IngestionClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -927,181 +945,184 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\IngestionClient;" }, "createAuthentication": { - "default": "$response = $client->createAuthentication(\n ['type' => 'oauth',\n 'name' => 'authName',\n 'input' => ['url' => 'http://test.oauth',\n 'client_id' => 'myID',\n 'client_secret' => 'mySecret',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->createAuthentication(\n ['type' => 'oauth',\n 'name' => 'authName',\n 'input' => ['url' => 'http://test.oauth',\n 'client_id' => 'myID',\n 'client_secret' => 'mySecret',\n ],\n ],\n);" }, "createDestination": { - "default": "$response = $client->createDestination(\n ['type' => 'search',\n 'name' => 'destinationName',\n 'input' => ['indexName' => '',\n ],\n 'authenticationID' => '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->createDestination(\n ['type' => 'search',\n 'name' => 'destinationName',\n 'input' => ['indexName' => '',\n ],\n 'authenticationID' => '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ],\n);" }, "createSource": { - "default": "$response = $client->createSource(\n ['type' => 'commercetools',\n 'name' => 'sourceName',\n 'input' => ['storeKeys' => [\n 'myStore',\n ],\n 'locales' => [\n 'de',\n ],\n 'url' => 'http://commercetools.com',\n 'projectKey' => 'keyID',\n ],\n 'authenticationID' => '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->createSource(\n ['type' => 'commercetools',\n 'name' => 'sourceName',\n 'input' => ['storeKeys' => [\n 'myStore',\n ],\n 'locales' => [\n 'de',\n ],\n 'url' => 'http://commercetools.com',\n 'projectKey' => 'keyID',\n ],\n 'authenticationID' => '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ],\n);" }, "createTask": { - "default": "$response = $client->createTask(\n ['sourceID' => 'search',\n 'destinationID' => 'destinationName',\n 'action' => 'replace',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->createTask(\n ['sourceID' => 'search',\n 'destinationID' => 'destinationName',\n 'action' => 'replace',\n ],\n);" }, "createTaskV1": { - "default": "$response = $client->createTaskV1(\n ['sourceID' => 'search',\n 'destinationID' => 'destinationName',\n 'trigger' => ['type' => 'onDemand',\n ],\n 'action' => 'replace',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->createTaskV1(\n ['sourceID' => 'search',\n 'destinationID' => 'destinationName',\n 'trigger' => ['type' => 'onDemand',\n ],\n 'action' => 'replace',\n ],\n);" }, "createTransformation": { - "default": "$response = $client->createTransformation(\n ['code' => 'foo',\n 'name' => 'bar',\n 'description' => 'baz',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->createTransformation(\n ['code' => 'foo',\n 'name' => 'bar',\n 'description' => 'baz',\n ],\n);" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "deleteAuthentication": { - "default": "$response = $client->deleteAuthentication(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteAuthentication(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "deleteDestination": { - "default": "$response = $client->deleteDestination(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteDestination(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "deleteSource": { - "default": "$response = $client->deleteSource(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteSource(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "deleteTask": { - "default": "$response = $client->deleteTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "deleteTaskV1": { - "default": "$response = $client->deleteTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "deleteTransformation": { - "default": "$response = $client->deleteTransformation(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteTransformation(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "disableTask": { - "default": "$response = $client->disableTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->disableTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "disableTaskV1": { - "default": "$response = $client->disableTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->disableTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "enableTask": { - "default": "$response = $client->enableTask(\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->enableTask(\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n);" }, "enableTaskV1": { - "default": "$response = $client->enableTaskV1(\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->enableTaskV1(\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n);" }, "generateTransformationCode": { - "default": "$response = $client->generateTransformationCode(\n ['id' => 'foo',\n 'userPrompt' => 'fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->generateTransformationCode(\n ['id' => 'foo',\n 'userPrompt' => 'fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing',\n ],\n);" }, "getAuthentication": { - "default": "$response = $client->getAuthentication(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getAuthentication(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "getDestination": { - "default": "$response = $client->getDestination(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getDestination(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "getEvent": { - "default": "$response = $client->getEvent(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n '6c02aeb1-775e-418e-870b-1faccd4b2c0c',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getEvent(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n '6c02aeb1-775e-418e-870b-1faccd4b2c0c',\n);" }, "getRun": { - "default": "$response = $client->getRun(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getRun(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "getSource": { - "default": "$response = $client->getSource(\n '75eeb306-51d3-4e5e-a279-3c92bd8893ac',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getSource(\n '75eeb306-51d3-4e5e-a279-3c92bd8893ac',\n);" }, "getTask": { - "default": "$response = $client->getTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "getTaskV1": { - "default": "$response = $client->getTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "getTransformation": { - "default": "$response = $client->getTransformation(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTransformation(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "listAuthentications": { - "default": "$response = $client->listAuthentications();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listAuthentications();" }, "listDestinations": { - "default": "$response = $client->listDestinations();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listDestinations();" }, "listEvents": { - "default": "$response = $client->listEvents(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listEvents(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "listRuns": { - "default": "$response = $client->listRuns();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listRuns();" }, "listSources": { - "default": "$response = $client->listSources();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listSources();" }, "listTasks": { - "default": "$response = $client->listTasks();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listTasks();" }, "listTasksV1": { - "default": "$response = $client->listTasksV1();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listTasksV1();" }, "listTransformationModels": { - "default": "$response = $client->listTransformationModels();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listTransformationModels();" }, "listTransformations": { - "default": "$response = $client->listTransformations();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listTransformations();" }, "pushTask": { - "default": "$response = $client->pushTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['action' => 'addObject',\n 'records' => [\n ['key' => 'bar',\n 'foo' => '1',\n 'objectID' => 'o',\n ],\n\n ['key' => 'baz',\n 'foo' => '2',\n 'objectID' => 'k',\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->pushTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['action' => 'addObject',\n 'records' => [\n ['key' => 'bar',\n 'foo' => '1',\n 'objectID' => 'o',\n ],\n\n ['key' => 'baz',\n 'foo' => '2',\n 'objectID' => 'k',\n ],\n ],\n ],\n);" }, "runSource": { - "default": "$response = $client->runSource(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['indexToInclude' => [\n 'products_us',\n\n 'products eu',\n ],\n 'entityIDs' => [\n '1234',\n\n '5678',\n ],\n 'entityType' => 'product',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->runSource(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['indexToInclude' => [\n 'products_us',\n\n 'products eu',\n ],\n 'entityIDs' => [\n '1234',\n\n '5678',\n ],\n 'entityType' => 'product',\n ],\n);" }, "runTask": { - "default": "$response = $client->runTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->runTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "runTaskV1": { - "default": "$response = $client->runTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->runTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "searchAuthentications": { - "default": "$response = $client->searchAuthentications(\n ['authenticationIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchAuthentications(\n ['authenticationIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n ],\n ],\n);" }, "searchDestinations": { - "default": "$response = $client->searchDestinations(\n ['destinationIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchDestinations(\n ['destinationIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n ],\n ],\n);" }, "searchSources": { - "default": "$response = $client->searchSources(\n ['sourceIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchSources(\n ['sourceIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n ],\n ],\n);" }, "searchTasks": { - "default": "$response = $client->searchTasks(\n ['taskIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchTasks(\n ['taskIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n ],\n);" }, "searchTasksV1": { - "default": "$response = $client->searchTasksV1(\n ['taskIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchTasksV1(\n ['taskIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n ],\n);" }, "searchTransformations": { - "default": "$response = $client->searchTransformations(\n ['transformationIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchTransformations(\n ['transformationIDs' => [\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n\n '947ac9c4-7e58-4c87-b1e7-14a68e99699a',\n\n '76ab4c2a-ce17-496f-b7a6-506dc59ee498',\n ],\n ],\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "triggerDockerSourceDiscover": { - "default": "$response = $client->triggerDockerSourceDiscover(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->triggerDockerSourceDiscover(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n);" }, "tryTransformation": { - "default": "$response = $client->tryTransformation(\n ['code' => 'foo',\n 'sampleRecord' => ['bar' => 'baz',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->tryTransformation(\n ['code' => 'foo',\n 'sampleRecord' => ['bar' => 'baz',\n ],\n ],\n);" }, "tryTransformationBeforeUpdate": { - "default": "$response = $client->tryTransformationBeforeUpdate(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['code' => 'foo',\n 'sampleRecord' => ['bar' => 'baz',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->tryTransformationBeforeUpdate(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['code' => 'foo',\n 'sampleRecord' => ['bar' => 'baz',\n ],\n ],\n);" }, "updateAuthentication": { - "default": "$response = $client->updateAuthentication(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['name' => 'newName',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->updateAuthentication(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['name' => 'newName',\n ],\n);" }, "updateDestination": { - "default": "$response = $client->updateDestination(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['name' => 'newName',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->updateDestination(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['name' => 'newName',\n ],\n);" }, "updateSource": { - "default": "$response = $client->updateSource(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['name' => 'newName',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->updateSource(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['name' => 'newName',\n ],\n);" }, "updateTask": { - "default": "$response = $client->updateTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['enabled' => false,\n 'cron' => '* * * * *',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->updateTask(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['enabled' => false,\n 'cron' => '* * * * *',\n ],\n);" }, "updateTaskV1": { - "default": "$response = $client->updateTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['enabled' => false,\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->updateTaskV1(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['enabled' => false,\n ],\n);" }, "updateTransformation": { - "default": "$response = $client->updateTransformation(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['code' => 'foo',\n 'name' => 'bar',\n 'description' => 'baz',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->updateTransformation(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['code' => 'foo',\n 'name' => 'bar',\n 'description' => 'baz',\n ],\n);" }, "validateSource": { - "default": "$response = $client->validateSource(\n ['type' => 'commercetools',\n 'name' => 'sourceName',\n 'input' => ['storeKeys' => [\n 'myStore',\n ],\n 'locales' => [\n 'de',\n ],\n 'url' => 'http://commercetools.com',\n 'projectKey' => 'keyID',\n ],\n 'authenticationID' => '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->validateSource(\n ['type' => 'commercetools',\n 'name' => 'sourceName',\n 'input' => ['storeKeys' => [\n 'myStore',\n ],\n 'locales' => [\n 'de',\n ],\n 'url' => 'http://commercetools.com',\n 'projectKey' => 'keyID',\n ],\n 'authenticationID' => '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ],\n);" }, "validateSourceBeforeUpdate": { - "default": "$response = $client->validateSourceBeforeUpdate(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['name' => 'newName',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->validateSourceBeforeUpdate(\n '6c02aeb1-775e-418e-870b-1faccd4b2c0f',\n ['name' => 'newName',\n ],\n);" }, "init": { "default": "$client = IngestionClient::create('', '', 'YOUR_APP_ID_REGION');" @@ -1112,181 +1133,184 @@ "default": "from algoliasearch.ingestion.client import IngestionClient" }, "createAuthentication": { - "default": "response = await _client.create_authentication(\n authentication_create={\n \"type\": \"oauth\",\n \"name\": \"authName\",\n \"input\": {\n \"url\": \"http://test.oauth\",\n \"client_id\": \"myID\",\n \"client_secret\": \"mySecret\",\n },\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.create_authentication(\n authentication_create={\n \"type\": \"oauth\",\n \"name\": \"authName\",\n \"input\": {\n \"url\": \"http://test.oauth\",\n \"client_id\": \"myID\",\n \"client_secret\": \"mySecret\",\n },\n },\n)" }, "createDestination": { - "default": "response = await _client.create_destination(\n destination_create={\n \"type\": \"search\",\n \"name\": \"destinationName\",\n \"input\": {\n \"indexName\": \"\",\n },\n \"authenticationID\": \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.create_destination(\n destination_create={\n \"type\": \"search\",\n \"name\": \"destinationName\",\n \"input\": {\n \"indexName\": \"\",\n },\n \"authenticationID\": \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n },\n)" }, "createSource": { - "default": "response = await _client.create_source(\n source_create={\n \"type\": \"commercetools\",\n \"name\": \"sourceName\",\n \"input\": {\n \"storeKeys\": [\n \"myStore\",\n ],\n \"locales\": [\n \"de\",\n ],\n \"url\": \"http://commercetools.com\",\n \"projectKey\": \"keyID\",\n },\n \"authenticationID\": \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.create_source(\n source_create={\n \"type\": \"commercetools\",\n \"name\": \"sourceName\",\n \"input\": {\n \"storeKeys\": [\n \"myStore\",\n ],\n \"locales\": [\n \"de\",\n ],\n \"url\": \"http://commercetools.com\",\n \"projectKey\": \"keyID\",\n },\n \"authenticationID\": \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n },\n)" }, "createTask": { - "default": "response = await _client.create_task(\n task_create={\n \"sourceID\": \"search\",\n \"destinationID\": \"destinationName\",\n \"action\": \"replace\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.create_task(\n task_create={\n \"sourceID\": \"search\",\n \"destinationID\": \"destinationName\",\n \"action\": \"replace\",\n },\n)" }, "createTaskV1": { - "default": "response = await _client.create_task_v1(\n task_create={\n \"sourceID\": \"search\",\n \"destinationID\": \"destinationName\",\n \"trigger\": {\n \"type\": \"onDemand\",\n },\n \"action\": \"replace\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.create_task_v1(\n task_create={\n \"sourceID\": \"search\",\n \"destinationID\": \"destinationName\",\n \"trigger\": {\n \"type\": \"onDemand\",\n },\n \"action\": \"replace\",\n },\n)" }, "createTransformation": { - "default": "response = await _client.create_transformation(\n transformation_create={\n \"code\": \"foo\",\n \"name\": \"bar\",\n \"description\": \"baz\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.create_transformation(\n transformation_create={\n \"code\": \"foo\",\n \"name\": \"bar\",\n \"description\": \"baz\",\n },\n)" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "deleteAuthentication": { - "default": "response = await _client.delete_authentication(\n authentication_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_authentication(\n authentication_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteDestination": { - "default": "response = await _client.delete_destination(\n destination_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_destination(\n destination_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteSource": { - "default": "response = await _client.delete_source(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_source(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteTask": { - "default": "response = await _client.delete_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteTaskV1": { - "default": "response = await _client.delete_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "deleteTransformation": { - "default": "response = await _client.delete_transformation(\n transformation_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_transformation(\n transformation_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "disableTask": { - "default": "response = await _client.disable_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.disable_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "disableTaskV1": { - "default": "response = await _client.disable_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.disable_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "enableTask": { - "default": "response = await _client.enable_task(\n task_id=\"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.enable_task(\n task_id=\"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n)" }, "enableTaskV1": { - "default": "response = await _client.enable_task_v1(\n task_id=\"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.enable_task_v1(\n task_id=\"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n)" }, "generateTransformationCode": { - "default": "response = await _client.generate_transformation_code(\n generate_transformation_code_payload={\n \"id\": \"foo\",\n \"userPrompt\": \"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.generate_transformation_code(\n generate_transformation_code_payload={\n \"id\": \"foo\",\n \"userPrompt\": \"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\",\n },\n)" }, "getAuthentication": { - "default": "response = await _client.get_authentication(\n authentication_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_authentication(\n authentication_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getDestination": { - "default": "response = await _client.get_destination(\n destination_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_destination(\n destination_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getEvent": { - "default": "response = await _client.get_event(\n run_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n event_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0c\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_event(\n run_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n event_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0c\",\n)" }, "getRun": { - "default": "response = await _client.get_run(\n run_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_run(\n run_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getSource": { - "default": "response = await _client.get_source(\n source_id=\"75eeb306-51d3-4e5e-a279-3c92bd8893ac\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_source(\n source_id=\"75eeb306-51d3-4e5e-a279-3c92bd8893ac\",\n)" }, "getTask": { - "default": "response = await _client.get_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getTaskV1": { - "default": "response = await _client.get_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "getTransformation": { - "default": "response = await _client.get_transformation(\n transformation_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_transformation(\n transformation_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "listAuthentications": { - "default": "response = await _client.list_authentications()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_authentications()" }, "listDestinations": { - "default": "response = await _client.list_destinations()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_destinations()" }, "listEvents": { - "default": "response = await _client.list_events(\n run_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_events(\n run_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "listRuns": { - "default": "response = await _client.list_runs()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_runs()" }, "listSources": { - "default": "response = await _client.list_sources()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_sources()" }, "listTasks": { - "default": "response = await _client.list_tasks()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_tasks()" }, "listTasksV1": { - "default": "response = await _client.list_tasks_v1()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_tasks_v1()" }, "listTransformationModels": { - "default": "response = await _client.list_transformation_models()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_transformation_models()" }, "listTransformations": { - "default": "response = await _client.list_transformations()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_transformations()" }, "pushTask": { - "default": "response = await _client.push_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n push_task_payload={\n \"action\": \"addObject\",\n \"records\": [\n {\n \"key\": \"bar\",\n \"foo\": \"1\",\n \"objectID\": \"o\",\n },\n {\n \"key\": \"baz\",\n \"foo\": \"2\",\n \"objectID\": \"k\",\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.push_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n push_task_payload={\n \"action\": \"addObject\",\n \"records\": [\n {\n \"key\": \"bar\",\n \"foo\": \"1\",\n \"objectID\": \"o\",\n },\n {\n \"key\": \"baz\",\n \"foo\": \"2\",\n \"objectID\": \"k\",\n },\n ],\n },\n)" }, "runSource": { - "default": "response = await _client.run_source(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n run_source_payload={\n \"indexToInclude\": [\n \"products_us\",\n \"products eu\",\n ],\n \"entityIDs\": [\n \"1234\",\n \"5678\",\n ],\n \"entityType\": \"product\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.run_source(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n run_source_payload={\n \"indexToInclude\": [\n \"products_us\",\n \"products eu\",\n ],\n \"entityIDs\": [\n \"1234\",\n \"5678\",\n ],\n \"entityType\": \"product\",\n },\n)" }, "runTask": { - "default": "response = await _client.run_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.run_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "runTaskV1": { - "default": "response = await _client.run_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.run_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "searchAuthentications": { - "default": "response = await _client.search_authentications(\n authentication_search={\n \"authenticationIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_authentications(\n authentication_search={\n \"authenticationIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n ],\n },\n)" }, "searchDestinations": { - "default": "response = await _client.search_destinations(\n destination_search={\n \"destinationIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_destinations(\n destination_search={\n \"destinationIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n ],\n },\n)" }, "searchSources": { - "default": "response = await _client.search_sources(\n source_search={\n \"sourceIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_sources(\n source_search={\n \"sourceIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n ],\n },\n)" }, "searchTasks": { - "default": "response = await _client.search_tasks(\n task_search={\n \"taskIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_tasks(\n task_search={\n \"taskIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n ],\n },\n)" }, "searchTasksV1": { - "default": "response = await _client.search_tasks_v1(\n task_search={\n \"taskIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_tasks_v1(\n task_search={\n \"taskIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n ],\n },\n)" }, "searchTransformations": { - "default": "response = await _client.search_transformations(\n transformation_search={\n \"transformationIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_transformations(\n transformation_search={\n \"transformationIDs\": [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n ],\n },\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "triggerDockerSourceDiscover": { - "default": "response = await _client.trigger_docker_source_discover(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.trigger_docker_source_discover(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n)" }, "tryTransformation": { - "default": "response = await _client.try_transformation(\n transformation_try={\n \"code\": \"foo\",\n \"sampleRecord\": {\n \"bar\": \"baz\",\n },\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.try_transformation(\n transformation_try={\n \"code\": \"foo\",\n \"sampleRecord\": {\n \"bar\": \"baz\",\n },\n },\n)" }, "tryTransformationBeforeUpdate": { - "default": "response = await _client.try_transformation_before_update(\n transformation_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformation_try={\n \"code\": \"foo\",\n \"sampleRecord\": {\n \"bar\": \"baz\",\n },\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.try_transformation_before_update(\n transformation_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformation_try={\n \"code\": \"foo\",\n \"sampleRecord\": {\n \"bar\": \"baz\",\n },\n },\n)" }, "updateAuthentication": { - "default": "response = await _client.update_authentication(\n authentication_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n authentication_update={\n \"name\": \"newName\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.update_authentication(\n authentication_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n authentication_update={\n \"name\": \"newName\",\n },\n)" }, "updateDestination": { - "default": "response = await _client.update_destination(\n destination_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n destination_update={\n \"name\": \"newName\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.update_destination(\n destination_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n destination_update={\n \"name\": \"newName\",\n },\n)" }, "updateSource": { - "default": "response = await _client.update_source(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n source_update={\n \"name\": \"newName\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.update_source(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n source_update={\n \"name\": \"newName\",\n },\n)" }, "updateTask": { - "default": "response = await _client.update_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n task_update={\n \"enabled\": False,\n \"cron\": \"* * * * *\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.update_task(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n task_update={\n \"enabled\": False,\n \"cron\": \"* * * * *\",\n },\n)" }, "updateTaskV1": { - "default": "response = await _client.update_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n task_update={\n \"enabled\": False,\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.update_task_v1(\n task_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n task_update={\n \"enabled\": False,\n },\n)" }, "updateTransformation": { - "default": "response = await _client.update_transformation(\n transformation_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformation_create={\n \"code\": \"foo\",\n \"name\": \"bar\",\n \"description\": \"baz\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.update_transformation(\n transformation_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformation_create={\n \"code\": \"foo\",\n \"name\": \"bar\",\n \"description\": \"baz\",\n },\n)" }, "validateSource": { - "default": "response = await _client.validate_source(\n source_create={\n \"type\": \"commercetools\",\n \"name\": \"sourceName\",\n \"input\": {\n \"storeKeys\": [\n \"myStore\",\n ],\n \"locales\": [\n \"de\",\n ],\n \"url\": \"http://commercetools.com\",\n \"projectKey\": \"keyID\",\n },\n \"authenticationID\": \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.validate_source(\n source_create={\n \"type\": \"commercetools\",\n \"name\": \"sourceName\",\n \"input\": {\n \"storeKeys\": [\n \"myStore\",\n ],\n \"locales\": [\n \"de\",\n ],\n \"url\": \"http://commercetools.com\",\n \"projectKey\": \"keyID\",\n },\n \"authenticationID\": \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n },\n)" }, "validateSourceBeforeUpdate": { - "default": "response = await _client.validate_source_before_update(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n source_update={\n \"name\": \"newName\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.validate_source_before_update(\n source_id=\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n source_update={\n \"name\": \"newName\",\n },\n)" }, "init": { "default": "_client = IngestionClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -1297,181 +1321,184 @@ "default": "require \"algolia\"" }, "createAuthentication": { - "default": "response = client.create_authentication(\n AuthenticationCreate.new(\n type: \"oauth\",\n name: \"authName\",\n input: AuthOAuth.new(url: \"http://test.oauth\", client_id: \"myID\", client_secret: \"mySecret\")\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.create_authentication(\n AuthenticationCreate.new(\n type: \"oauth\",\n name: \"authName\",\n input: AuthOAuth.new(url: \"http://test.oauth\", client_id: \"myID\", client_secret: \"mySecret\")\n )\n)" }, "createDestination": { - "default": "response = client.create_destination(\n DestinationCreate.new(\n type: \"search\",\n name: \"destinationName\",\n input: DestinationIndexName.new(index_name: \"\"),\n authentication_id: \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.create_destination(\n DestinationCreate.new(\n type: \"search\",\n name: \"destinationName\",\n input: DestinationIndexName.new(index_name: \"\"),\n authentication_id: \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n )\n)" }, "createSource": { - "default": "response = client.create_source(\n SourceCreate.new(\n type: \"commercetools\",\n name: \"sourceName\",\n input: SourceCommercetools.new(\n store_keys: [\"myStore\"],\n locales: [\"de\"],\n url: \"http://commercetools.com\",\n project_key: \"keyID\"\n ),\n authentication_id: \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.create_source(\n SourceCreate.new(\n type: \"commercetools\",\n name: \"sourceName\",\n input: SourceCommercetools.new(\n store_keys: [\"myStore\"],\n locales: [\"de\"],\n url: \"http://commercetools.com\",\n project_key: \"keyID\"\n ),\n authentication_id: \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n )\n)" }, "createTask": { - "default": "response = client.create_task(\n TaskCreate.new(source_id: \"search\", destination_id: \"destinationName\", action: \"replace\")\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.create_task(\n TaskCreate.new(source_id: \"search\", destination_id: \"destinationName\", action: \"replace\")\n)" }, "createTaskV1": { - "default": "response = client.create_task_v1(\n TaskCreateV1.new(\n source_id: \"search\",\n destination_id: \"destinationName\",\n trigger: OnDemandTriggerInput.new(type: \"onDemand\"),\n action: \"replace\"\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.create_task_v1(\n TaskCreateV1.new(\n source_id: \"search\",\n destination_id: \"destinationName\",\n trigger: OnDemandTriggerInput.new(type: \"onDemand\"),\n action: \"replace\"\n )\n)" }, "createTransformation": { - "default": "response = client.create_transformation(TransformationCreate.new(code: \"foo\", name: \"bar\", description: \"baz\"))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.create_transformation(TransformationCreate.new(code: \"foo\", name: \"bar\", description: \"baz\"))" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "deleteAuthentication": { - "default": "response = client.delete_authentication(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_authentication(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "deleteDestination": { - "default": "response = client.delete_destination(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_destination(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "deleteSource": { - "default": "response = client.delete_source(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_source(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "deleteTask": { - "default": "response = client.delete_task(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_task(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "deleteTaskV1": { - "default": "response = client.delete_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "deleteTransformation": { - "default": "response = client.delete_transformation(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_transformation(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "disableTask": { - "default": "response = client.disable_task(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.disable_task(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "disableTaskV1": { - "default": "response = client.disable_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.disable_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "enableTask": { - "default": "response = client.enable_task(\"76ab4c2a-ce17-496f-b7a6-506dc59ee498\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.enable_task(\"76ab4c2a-ce17-496f-b7a6-506dc59ee498\")" }, "enableTaskV1": { - "default": "response = client.enable_task_v1(\"76ab4c2a-ce17-496f-b7a6-506dc59ee498\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.enable_task_v1(\"76ab4c2a-ce17-496f-b7a6-506dc59ee498\")" }, "generateTransformationCode": { - "default": "response = client.generate_transformation_code(\n GenerateTransformationCodePayload.new(\n id: \"foo\",\n user_prompt: \"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\"\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.generate_transformation_code(\n GenerateTransformationCodePayload.new(\n id: \"foo\",\n user_prompt: \"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\"\n )\n)" }, "getAuthentication": { - "default": "response = client.get_authentication(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_authentication(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "getDestination": { - "default": "response = client.get_destination(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_destination(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "getEvent": { - "default": "response = client.get_event(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"6c02aeb1-775e-418e-870b-1faccd4b2c0c\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_event(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"6c02aeb1-775e-418e-870b-1faccd4b2c0c\")" }, "getRun": { - "default": "response = client.get_run(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_run(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "getSource": { - "default": "response = client.get_source(\"75eeb306-51d3-4e5e-a279-3c92bd8893ac\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_source(\"75eeb306-51d3-4e5e-a279-3c92bd8893ac\")" }, "getTask": { - "default": "response = client.get_task(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_task(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "getTaskV1": { - "default": "response = client.get_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "getTransformation": { - "default": "response = client.get_transformation(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_transformation(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "listAuthentications": { - "default": "response = client.list_authentications\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_authentications" }, "listDestinations": { - "default": "response = client.list_destinations\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_destinations" }, "listEvents": { - "default": "response = client.list_events(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_events(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "listRuns": { - "default": "response = client.list_runs\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_runs" }, "listSources": { - "default": "response = client.list_sources\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_sources" }, "listTasks": { - "default": "response = client.list_tasks\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_tasks" }, "listTasksV1": { - "default": "response = client.list_tasks_v1\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_tasks_v1" }, "listTransformationModels": { - "default": "response = client.list_transformation_models\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_transformation_models" }, "listTransformations": { - "default": "response = client.list_transformations\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_transformations" }, "pushTask": { - "default": "response = client.push_task(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n PushTaskPayload.new(\n action: \"addObject\",\n records: [\n PushTaskRecords.new(key: \"bar\", foo: \"1\", object_id: \"o\"),\n PushTaskRecords.new(key: \"baz\", foo: \"2\", object_id: \"k\")\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.push_task(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n PushTaskPayload.new(\n action: \"addObject\",\n records: [\n PushTaskRecords.new(key: \"bar\", foo: \"1\", object_id: \"o\"),\n PushTaskRecords.new(key: \"baz\", foo: \"2\", object_id: \"k\")\n ]\n )\n)" }, "runSource": { - "default": "response = client.run_source(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n RunSourcePayload.new(\n index_to_include: [\"products_us\", \"products eu\"],\n entity_ids: [\"1234\", \"5678\"],\n entity_type: \"product\"\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.run_source(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n RunSourcePayload.new(\n index_to_include: [\"products_us\", \"products eu\"],\n entity_ids: [\"1234\", \"5678\"],\n entity_type: \"product\"\n )\n)" }, "runTask": { - "default": "response = client.run_task(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.run_task(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "runTaskV1": { - "default": "response = client.run_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.run_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "searchAuthentications": { - "default": "response = client.search_authentications(\n AuthenticationSearch.new(\n authentication_ids: [\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_authentications(\n AuthenticationSearch.new(\n authentication_ids: [\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"]\n )\n)" }, "searchDestinations": { - "default": "response = client.search_destinations(\n DestinationSearch.new(\n destination_ids: [\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_destinations(\n DestinationSearch.new(\n destination_ids: [\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"]\n )\n)" }, "searchSources": { - "default": "response = client.search_sources(\n SourceSearch.new(source_ids: [\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_sources(\n SourceSearch.new(source_ids: [\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\"])\n)" }, "searchTasks": { - "default": "response = client.search_tasks(\n TaskSearch.new(\n task_ids: [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_tasks(\n TaskSearch.new(\n task_ids: [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n ]\n )\n)" }, "searchTasksV1": { - "default": "response = client.search_tasks_v1(\n TaskSearch.new(\n task_ids: [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_tasks_v1(\n TaskSearch.new(\n task_ids: [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n ]\n )\n)" }, "searchTransformations": { - "default": "response = client.search_transformations(\n TransformationSearch.new(\n transformation_ids: [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_transformations(\n TransformationSearch.new(\n transformation_ids: [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n ]\n )\n)" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "triggerDockerSourceDiscover": { - "default": "response = client.trigger_docker_source_discover(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.trigger_docker_source_discover(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, "tryTransformation": { - "default": "response = client.try_transformation(TransformationTry.new(code: \"foo\", sample_record: {bar: \"baz\"}))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.try_transformation(TransformationTry.new(code: \"foo\", sample_record: {bar: \"baz\"}))" }, "tryTransformationBeforeUpdate": { - "default": "response = client.try_transformation_before_update(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n TransformationTry.new(code: \"foo\", sample_record: {bar: \"baz\"})\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.try_transformation_before_update(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n TransformationTry.new(code: \"foo\", sample_record: {bar: \"baz\"})\n)" }, "updateAuthentication": { - "default": "response = client.update_authentication(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n AuthenticationUpdate.new(name: \"newName\")\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.update_authentication(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n AuthenticationUpdate.new(name: \"newName\")\n)" }, "updateDestination": { - "default": "response = client.update_destination(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", DestinationUpdate.new(name: \"newName\"))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.update_destination(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", DestinationUpdate.new(name: \"newName\"))" }, "updateSource": { - "default": "response = client.update_source(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", SourceUpdate.new(name: \"newName\"))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.update_source(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", SourceUpdate.new(name: \"newName\"))" }, "updateTask": { - "default": "response = client.update_task(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n TaskUpdate.new(enabled: false, cron: \"* * * * *\")\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.update_task(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n TaskUpdate.new(enabled: false, cron: \"* * * * *\")\n)" }, "updateTaskV1": { - "default": "response = client.update_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", TaskUpdateV1.new(enabled: false))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.update_task_v1(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", TaskUpdateV1.new(enabled: false))" }, "updateTransformation": { - "default": "response = client.update_transformation(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n TransformationCreate.new(code: \"foo\", name: \"bar\", description: \"baz\")\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.update_transformation(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n TransformationCreate.new(code: \"foo\", name: \"bar\", description: \"baz\")\n)" }, "validateSource": { - "default": "response = client.validate_source(\n SourceCreate.new(\n type: \"commercetools\",\n name: \"sourceName\",\n input: SourceCommercetools.new(\n store_keys: [\"myStore\"],\n locales: [\"de\"],\n url: \"http://commercetools.com\",\n project_key: \"keyID\"\n ),\n authentication_id: \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.validate_source(\n SourceCreate.new(\n type: \"commercetools\",\n name: \"sourceName\",\n input: SourceCommercetools.new(\n store_keys: [\"myStore\"],\n locales: [\"de\"],\n url: \"http://commercetools.com\",\n project_key: \"keyID\"\n ),\n authentication_id: \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n )\n)" }, "validateSourceBeforeUpdate": { - "default": "response = client.validate_source_before_update(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n SourceUpdate.new(name: \"newName\")\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.validate_source_before_update(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n SourceUpdate.new(name: \"newName\")\n)" }, "init": { "default": "client = Algolia::IngestionClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -1482,181 +1509,181 @@ "default": "import algoliasearch.api.IngestionClient" }, "createAuthentication": { - "default": "val response = client.createAuthentication(\n authenticationCreate = AuthenticationCreate(\n `type` = AuthenticationType.withName(\"oauth\"),\n name = \"authName\",\n input = AuthOAuth(\n url = \"http://test.oauth\",\n client_id = \"myID\",\n client_secret = \"mySecret\"\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.createAuthentication(\n authenticationCreate = AuthenticationCreate(\n `type` = AuthenticationType.withName(\"oauth\"),\n name = \"authName\",\n input = AuthOAuth(\n url = \"http://test.oauth\",\n client_id = \"myID\",\n client_secret = \"mySecret\"\n )\n )\n)" }, "createDestination": { - "default": "val response = client.createDestination(\n destinationCreate = DestinationCreate(\n `type` = DestinationType.withName(\"search\"),\n name = \"destinationName\",\n input = DestinationIndexName(\n indexName = \"\"\n ),\n authenticationID = Some(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.createDestination(\n destinationCreate = DestinationCreate(\n `type` = DestinationType.withName(\"search\"),\n name = \"destinationName\",\n input = DestinationIndexName(\n indexName = \"\"\n ),\n authenticationID = Some(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n )\n)" }, "createSource": { - "default": "val response = client.createSource(\n sourceCreate = SourceCreate(\n `type` = SourceType.withName(\"commercetools\"),\n name = \"sourceName\",\n input = Some(\n SourceCommercetools(\n storeKeys = Some(Seq(\"myStore\")),\n locales = Some(Seq(\"de\")),\n url = \"http://commercetools.com\",\n projectKey = \"keyID\"\n )\n ),\n authenticationID = Some(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.createSource(\n sourceCreate = SourceCreate(\n `type` = SourceType.withName(\"commercetools\"),\n name = \"sourceName\",\n input = Some(\n SourceCommercetools(\n storeKeys = Some(Seq(\"myStore\")),\n locales = Some(Seq(\"de\")),\n url = \"http://commercetools.com\",\n projectKey = \"keyID\"\n )\n ),\n authenticationID = Some(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n )\n)" }, "createTask": { - "default": "val response = client.createTask(\n taskCreate = TaskCreate(\n sourceID = \"search\",\n destinationID = \"destinationName\",\n action = ActionType.withName(\"replace\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.createTask(\n taskCreate = TaskCreate(\n sourceID = \"search\",\n destinationID = \"destinationName\",\n action = ActionType.withName(\"replace\")\n )\n)" }, "createTaskV1": { - "default": "val response = client.createTaskV1(\n taskCreate = TaskCreateV1(\n sourceID = \"search\",\n destinationID = \"destinationName\",\n trigger = OnDemandTriggerInput(\n `type` = OnDemandTriggerType.withName(\"onDemand\")\n ),\n action = ActionType.withName(\"replace\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.createTaskV1(\n taskCreate = TaskCreateV1(\n sourceID = \"search\",\n destinationID = \"destinationName\",\n trigger = OnDemandTriggerInput(\n `type` = OnDemandTriggerType.withName(\"onDemand\")\n ),\n action = ActionType.withName(\"replace\")\n )\n)" }, "createTransformation": { - "default": "val response = client.createTransformation(\n transformationCreate = TransformationCreate(\n code = \"foo\",\n name = \"bar\",\n description = Some(\"baz\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.createTransformation(\n transformationCreate = TransformationCreate(\n code = \"foo\",\n name = \"bar\",\n description = Some(\"baz\")\n )\n)" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "deleteAuthentication": { - "default": "val response = client.deleteAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "deleteDestination": { - "default": "val response = client.deleteDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "deleteSource": { - "default": "val response = client.deleteSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "deleteTask": { - "default": "val response = client.deleteTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "deleteTaskV1": { - "default": "val response = client.deleteTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "deleteTransformation": { - "default": "val response = client.deleteTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "disableTask": { - "default": "val response = client.disableTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.disableTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "disableTaskV1": { - "default": "val response = client.disableTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.disableTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "enableTask": { - "default": "val response = client.enableTask(\n taskID = \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.enableTask(\n taskID = \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n)" }, "enableTaskV1": { - "default": "val response = client.enableTaskV1(\n taskID = \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.enableTaskV1(\n taskID = \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n)" }, "generateTransformationCode": { - "default": "val response = client.generateTransformationCode(\n generateTransformationCodePayload = GenerateTransformationCodePayload(\n id = \"foo\",\n userPrompt =\n \"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\"\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.generateTransformationCode(\n generateTransformationCodePayload = GenerateTransformationCodePayload(\n id = \"foo\",\n userPrompt =\n \"fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing\"\n )\n)" }, "getAuthentication": { - "default": "val response = client.getAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "getDestination": { - "default": "val response = client.getDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "getEvent": { - "default": "val response = client.getEvent(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n eventID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0c\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getEvent(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n eventID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0c\"\n)" }, "getRun": { - "default": "val response = client.getRun(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getRun(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "getSource": { - "default": "val response = client.getSource(\n sourceID = \"75eeb306-51d3-4e5e-a279-3c92bd8893ac\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getSource(\n sourceID = \"75eeb306-51d3-4e5e-a279-3c92bd8893ac\"\n)" }, "getTask": { - "default": "val response = client.getTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "getTaskV1": { - "default": "val response = client.getTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "getTransformation": { - "default": "val response = client.getTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "listAuthentications": { - "default": "val response = client.listAuthentications(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listAuthentications(\n)" }, "listDestinations": { - "default": "val response = client.listDestinations(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listDestinations(\n)" }, "listEvents": { - "default": "val response = client.listEvents(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listEvents(\n runID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "listRuns": { - "default": "val response = client.listRuns(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listRuns(\n)" }, "listSources": { - "default": "val response = client.listSources(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listSources(\n)" }, "listTasks": { - "default": "val response = client.listTasks(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listTasks(\n)" }, "listTasksV1": { - "default": "val response = client.listTasksV1(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listTasksV1(\n)" }, "listTransformationModels": { - "default": "val response = client.listTransformationModels(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listTransformationModels(\n)" }, "listTransformations": { - "default": "val response = client.listTransformations(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listTransformations(\n)" }, "pushTask": { - "default": "val response = client.pushTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n pushTaskPayload = PushTaskPayload(\n action = Action.withName(\"addObject\"),\n records = Seq(\n PushTaskRecords(\n objectID = \"o\",\n additionalProperties = Some(List(JField(\"key\", JString(\"bar\")), JField(\"foo\", JString(\"1\"))))\n ),\n PushTaskRecords(\n objectID = \"k\",\n additionalProperties = Some(List(JField(\"key\", JString(\"baz\")), JField(\"foo\", JString(\"2\"))))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.pushTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n pushTaskPayload = PushTaskPayload(\n action = Action.withName(\"addObject\"),\n records = Seq(\n PushTaskRecords(\n objectID = \"o\",\n additionalProperties = Some(List(JField(\"key\", JString(\"bar\")), JField(\"foo\", JString(\"1\"))))\n ),\n PushTaskRecords(\n objectID = \"k\",\n additionalProperties = Some(List(JField(\"key\", JString(\"baz\")), JField(\"foo\", JString(\"2\"))))\n )\n )\n )\n)" }, "runSource": { - "default": "val response = client.runSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n runSourcePayload = Some(\n RunSourcePayload(\n indexToInclude = Some(Seq(\"products_us\", \"products eu\")),\n entityIDs = Some(Seq(\"1234\", \"5678\")),\n entityType = Some(EntityType.withName(\"product\"))\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.runSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n runSourcePayload = Some(\n RunSourcePayload(\n indexToInclude = Some(Seq(\"products_us\", \"products eu\")),\n entityIDs = Some(Seq(\"1234\", \"5678\")),\n entityType = Some(EntityType.withName(\"product\"))\n )\n )\n)" }, "runTask": { - "default": "val response = client.runTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.runTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "runTaskV1": { - "default": "val response = client.runTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.runTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "searchAuthentications": { - "default": "val response = client.searchAuthentications(\n authenticationSearch = AuthenticationSearch(\n authenticationIDs = Seq(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchAuthentications(\n authenticationSearch = AuthenticationSearch(\n authenticationIDs = Seq(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\")\n )\n)" }, "searchDestinations": { - "default": "val response = client.searchDestinations(\n destinationSearch = DestinationSearch(\n destinationIDs = Seq(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchDestinations(\n destinationSearch = DestinationSearch(\n destinationIDs = Seq(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\")\n )\n)" }, "searchSources": { - "default": "val response = client.searchSources(\n sourceSearch = SourceSearch(\n sourceIDs = Seq(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchSources(\n sourceSearch = SourceSearch(\n sourceIDs = Seq(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\", \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\")\n )\n)" }, "searchTasks": { - "default": "val response = client.searchTasks(\n taskSearch = TaskSearch(\n taskIDs = Seq(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchTasks(\n taskSearch = TaskSearch(\n taskIDs = Seq(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n )\n )\n)" }, "searchTasksV1": { - "default": "val response = client.searchTasksV1(\n taskSearch = TaskSearch(\n taskIDs = Seq(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchTasksV1(\n taskSearch = TaskSearch(\n taskIDs = Seq(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n )\n )\n)" }, "searchTransformations": { - "default": "val response = client.searchTransformations(\n transformationSearch = TransformationSearch(\n transformationIDs = Seq(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchTransformations(\n transformationSearch = TransformationSearch(\n transformationIDs = Seq(\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\"\n )\n )\n)" }, "triggerDockerSourceDiscover": { - "default": "val response = client.triggerDockerSourceDiscover(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.triggerDockerSourceDiscover(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\"\n)" }, "tryTransformation": { - "default": "val response = client.tryTransformation(\n transformationTry = TransformationTry(\n code = \"foo\",\n sampleRecord = JObject(List(JField(\"bar\", JString(\"baz\"))))\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.tryTransformation(\n transformationTry = TransformationTry(\n code = \"foo\",\n sampleRecord = JObject(List(JField(\"bar\", JString(\"baz\"))))\n )\n)" }, "tryTransformationBeforeUpdate": { - "default": "val response = client.tryTransformationBeforeUpdate(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformationTry = TransformationTry(\n code = \"foo\",\n sampleRecord = JObject(List(JField(\"bar\", JString(\"baz\"))))\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.tryTransformationBeforeUpdate(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformationTry = TransformationTry(\n code = \"foo\",\n sampleRecord = JObject(List(JField(\"bar\", JString(\"baz\"))))\n )\n)" }, "updateAuthentication": { - "default": "val response = client.updateAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n authenticationUpdate = AuthenticationUpdate(\n name = Some(\"newName\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.updateAuthentication(\n authenticationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n authenticationUpdate = AuthenticationUpdate(\n name = Some(\"newName\")\n )\n)" }, "updateDestination": { - "default": "val response = client.updateDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n destinationUpdate = DestinationUpdate(\n name = Some(\"newName\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.updateDestination(\n destinationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n destinationUpdate = DestinationUpdate(\n name = Some(\"newName\")\n )\n)" }, "updateSource": { - "default": "val response = client.updateSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n sourceUpdate = SourceUpdate(\n name = Some(\"newName\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.updateSource(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n sourceUpdate = SourceUpdate(\n name = Some(\"newName\")\n )\n)" }, "updateTask": { - "default": "val response = client.updateTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n taskUpdate = TaskUpdate(\n enabled = Some(false),\n cron = Some(\"* * * * *\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.updateTask(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n taskUpdate = TaskUpdate(\n enabled = Some(false),\n cron = Some(\"* * * * *\")\n )\n)" }, "updateTaskV1": { - "default": "val response = client.updateTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n taskUpdate = TaskUpdateV1(\n enabled = Some(false)\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.updateTaskV1(\n taskID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n taskUpdate = TaskUpdateV1(\n enabled = Some(false)\n )\n)" }, "updateTransformation": { - "default": "val response = client.updateTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformationCreate = TransformationCreate(\n code = \"foo\",\n name = \"bar\",\n description = Some(\"baz\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.updateTransformation(\n transformationID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n transformationCreate = TransformationCreate(\n code = \"foo\",\n name = \"bar\",\n description = Some(\"baz\")\n )\n)" }, "validateSource": { - "default": "val response = client.validateSource(\n sourceCreate = Some(\n SourceCreate(\n `type` = SourceType.withName(\"commercetools\"),\n name = \"sourceName\",\n input = Some(\n SourceCommercetools(\n storeKeys = Some(Seq(\"myStore\")),\n locales = Some(Seq(\"de\")),\n url = \"http://commercetools.com\",\n projectKey = \"keyID\"\n )\n ),\n authenticationID = Some(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.validateSource(\n sourceCreate = Some(\n SourceCreate(\n `type` = SourceType.withName(\"commercetools\"),\n name = \"sourceName\",\n input = Some(\n SourceCommercetools(\n storeKeys = Some(Seq(\"myStore\")),\n locales = Some(Seq(\"de\")),\n url = \"http://commercetools.com\",\n projectKey = \"keyID\"\n )\n ),\n authenticationID = Some(\"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")\n )\n )\n)" }, "validateSourceBeforeUpdate": { - "default": "val response = client.validateSourceBeforeUpdate(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n sourceUpdate = SourceUpdate(\n name = Some(\"newName\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.validateSourceBeforeUpdate(\n sourceID = \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n sourceUpdate = SourceUpdate(\n name = Some(\"newName\")\n )\n)" }, "init": { "default": "val client = IngestionClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -1810,6 +1837,9 @@ "searchTransformations": { "default": "let response = try await client\n .searchTransformations(transformationSearch: TransformationSearch(transformationIDs: [\n \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\",\n \"947ac9c4-7e58-4c87-b1e7-14a68e99699a\",\n \"76ab4c2a-ce17-496f-b7a6-506dc59ee498\",\n ]))" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "triggerDockerSourceDiscover": { "default": "let response = try await client.triggerDockerSourceDiscover(sourceID: \"6c02aeb1-775e-418e-870b-1faccd4b2c0f\")" }, diff --git a/snippets/guides/insights-snippets.json b/snippets/guides/insights-snippets.json index 5a2163b486..bafbfe8528 100644 --- a/snippets/guides/insights-snippets.json +++ b/snippets/guides/insights-snippets.json @@ -21,6 +21,9 @@ "pushEvents": { "default": "var response = await client.PushEventsAsync(\n new InsightsEvents\n {\n Events = new List\n {\n new EventsItems(\n new ClickedObjectIDsAfterSearch\n {\n EventType = Enum.Parse(\"Click\"),\n EventName = \"Product Clicked\",\n Index = \"products\",\n UserToken = \"user-123456\",\n AuthenticatedUserToken = \"user-123456\",\n Timestamp = 1641290601962L,\n ObjectIDs = new List { \"9780545139700\", \"9780439784542\" },\n QueryID = \"43b15df305339e827f0ac0bdc5ebcaa7\",\n Positions = new List { 7, 6 },\n }\n )\n },\n }\n);" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "init": { "default": "var client = new InsightsClient(" } @@ -42,11 +45,14 @@ "default": "final response = await client.customPut(\n path: \"test/minimal\",\n);" }, "deleteUserToken": { - "default": "final response = await client.deleteUserToken(\n userToken: \"test-user-1\",\n);" + "default": "await client.deleteUserToken(\n userToken: \"test-user-1\",\n);" }, "pushEvents": { "default": "final response = await client.pushEvents(\n insightsEvents: InsightsEvents(\n events: [\n ClickedObjectIDsAfterSearch(\n eventType: ClickEvent.fromJson(\"click\"),\n eventName: \"Product Clicked\",\n index: \"products\",\n userToken: \"user-123456\",\n authenticatedUserToken: \"user-123456\",\n timestamp: 1641290601962,\n objectIDs: [\n \"9780545139700\",\n \"9780439784542\",\n ],\n queryID: \"43b15df305339e827f0ac0bdc5ebcaa7\",\n positions: [\n 7,\n 6,\n ],\n ),\n ],\n ),\n);" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey: \"updated-api-key\",\n);" + }, "init": { "default": "final client = InsightsClient(" } @@ -56,22 +62,28 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/insights\"" }, "customDelete": { - "default": "// Initialize the client with your application region, eg. insights.YOUR_APP_ID_REGION\nclient, err := insights.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", insights.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "// Initialize the client with your application region, eg. insights.YOUR_APP_ID_REGION\nclient, err := insights.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", insights.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "// Initialize the client with your application region, eg. insights.YOUR_APP_ID_REGION\nclient, err := insights.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", insights.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "// Initialize the client with your application region, eg. insights.YOUR_APP_ID_REGION\nclient, err := insights.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", insights.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteUserToken": { - "default": "// Initialize the client with your application region, eg. insights.YOUR_APP_ID_REGION\nclient, err := insights.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", insights.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nerr = client.DeleteUserToken(client.NewApiDeleteUserTokenRequest(\n \"test-user-1\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n" + "default": "err = client.DeleteUserToken(client.NewApiDeleteUserTokenRequest(\n \"test-user-1\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "pushEvents": { - "default": "// Initialize the client with your application region, eg. insights.YOUR_APP_ID_REGION\nclient, err := insights.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", insights.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.PushEvents(client.NewApiPushEventsRequest(\n\n insights.NewEmptyInsightsEvents().SetEvents(\n []insights.EventsItems{*insights.ClickedObjectIDsAfterSearchAsEventsItems(\n insights.NewEmptyClickedObjectIDsAfterSearch().SetEventType(insights.ClickEvent(\"click\")).SetEventName(\"Product Clicked\").SetIndex(\"products\").SetUserToken(\"user-123456\").SetAuthenticatedUserToken(\"user-123456\").SetTimestamp(1641290601962).SetObjectIDs(\n []string{\"9780545139700\", \"9780439784542\"}).SetQueryID(\"43b15df305339e827f0ac0bdc5ebcaa7\").SetPositions(\n []int32{7, 6}))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.PushEvents(client.NewApiPushEventsRequest(\n\n insights.NewEmptyInsightsEvents().SetEvents(\n []insights.EventsItems{*insights.ClickedObjectIDsAfterSearchAsEventsItems(\n insights.NewEmptyClickedObjectIDsAfterSearch().SetEventType(insights.ClickEvent(\"click\")).SetEventName(\"Product Clicked\").SetIndex(\"products\").SetUserToken(\"user-123456\").SetAuthenticatedUserToken(\"user-123456\").SetTimestamp(1641290601962).SetObjectIDs(\n []string{\"9780545139700\", \"9780439784542\"}).SetQueryID(\"43b15df305339e827f0ac0bdc5ebcaa7\").SetPositions(\n []int32{7, 6}))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "init": { + "default": "client, err := insights.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", insights.US)" } }, "java": { @@ -96,6 +108,9 @@ "pushEvents": { "default": "client.pushEvents(\n new InsightsEvents()\n .setEvents(\n Arrays.asList(\n new ClickedObjectIDsAfterSearch()\n .setEventType(ClickEvent.CLICK)\n .setEventName(\"Product Clicked\")\n .setIndex(\"products\")\n .setUserToken(\"user-123456\")\n .setAuthenticatedUserToken(\"user-123456\")\n .setTimestamp(1641290601962L)\n .setObjectIDs(Arrays.asList(\"9780545139700\", \"9780439784542\"))\n .setQueryID(\"43b15df305339e827f0ac0bdc5ebcaa7\")\n .setPositions(Arrays.asList(7, 6))\n )\n )\n);" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "init": { "default": "InsightsClient client = new InsightsClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\");" } @@ -105,22 +120,25 @@ "default": "import { insightsClient } from '@algolia/client-insights';" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "deleteUserToken": { - "default": "const response = await client.deleteUserToken({ userToken: 'test-user-1' });\n\n// use typed response\nconsole.log(response);" + "default": "await client.deleteUserToken({ userToken: 'test-user-1' });" }, "pushEvents": { - "default": "const response = await client.pushEvents({\n events: [\n {\n eventType: 'click',\n eventName: 'Product Clicked',\n index: 'products',\n userToken: 'user-123456',\n authenticatedUserToken: 'user-123456',\n timestamp: 1641290601962,\n objectIDs: ['9780545139700', '9780439784542'],\n queryID: '43b15df305339e827f0ac0bdc5ebcaa7',\n positions: [7, 6],\n },\n ],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.pushEvents({\n events: [\n {\n eventType: 'click',\n eventName: 'Product Clicked',\n index: 'products',\n userToken: 'user-123456',\n authenticatedUserToken: 'user-123456',\n timestamp: 1641290601962,\n objectIDs: ['9780545139700', '9780439784542'],\n queryID: '43b15df305339e827f0ac0bdc5ebcaa7',\n positions: [7, 6],\n },\n ],\n});" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "init": { "default": "const client = insightsClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION');" @@ -131,22 +149,25 @@ "default": "import com.algolia.client.api.InsightsClient" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "deleteUserToken": { - "default": "var response = client.deleteUserToken(\n userToken = \"test-user-1\",\n)\n\n// Use the response\nprintln(response)" + "default": "client.deleteUserToken(\n userToken = \"test-user-1\",\n)" }, "pushEvents": { - "default": "var response = client.pushEvents(\n insightsEvents = InsightsEvents(\n events = listOf(\n ClickedObjectIDsAfterSearch(\n eventType = ClickEvent.entries.first { it.value == \"click\" },\n eventName = \"Product Clicked\",\n index = \"products\",\n userToken = \"user-123456\",\n authenticatedUserToken = \"user-123456\",\n timestamp = 1641290601962L,\n objectIDs = listOf(\"9780545139700\", \"9780439784542\"),\n queryID = \"43b15df305339e827f0ac0bdc5ebcaa7\",\n positions = listOf(7, 6),\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.pushEvents(\n insightsEvents = InsightsEvents(\n events = listOf(\n ClickedObjectIDsAfterSearch(\n eventType = ClickEvent.entries.first { it.value == \"click\" },\n eventName = \"Product Clicked\",\n index = \"products\",\n userToken = \"user-123456\",\n authenticatedUserToken = \"user-123456\",\n timestamp = 1641290601962L,\n objectIDs = listOf(\"9780545139700\", \"9780439784542\"),\n queryID = \"43b15df305339e827f0ac0bdc5ebcaa7\",\n positions = listOf(7, 6),\n ),\n ),\n ),\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "init": { "default": "val client = InsightsClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -157,22 +178,25 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\InsightsClient;" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "deleteUserToken": { - "default": "$response = $client->deleteUserToken(\n 'test-user-1',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$client->deleteUserToken(\n 'test-user-1',\n);" }, "pushEvents": { - "default": "$response = $client->pushEvents(\n ['events' => [\n ['eventType' => 'click',\n 'eventName' => 'Product Clicked',\n 'index' => 'products',\n 'userToken' => 'user-123456',\n 'authenticatedUserToken' => 'user-123456',\n 'timestamp' => 1641290601962,\n 'objectIDs' => [\n '9780545139700',\n\n '9780439784542',\n ],\n 'queryID' => '43b15df305339e827f0ac0bdc5ebcaa7',\n 'positions' => [\n 7,\n\n 6,\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->pushEvents(\n ['events' => [\n ['eventType' => 'click',\n 'eventName' => 'Product Clicked',\n 'index' => 'products',\n 'userToken' => 'user-123456',\n 'authenticatedUserToken' => 'user-123456',\n 'timestamp' => 1641290601962,\n 'objectIDs' => [\n '9780545139700',\n\n '9780439784542',\n ],\n 'queryID' => '43b15df305339e827f0ac0bdc5ebcaa7',\n 'positions' => [\n 7,\n\n 6,\n ],\n ],\n ],\n ],\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "init": { "default": "$client = InsightsClient::create('', '', 'YOUR_APP_ID_REGION');" @@ -183,22 +207,25 @@ "default": "from algoliasearch.insights.client import InsightsClient" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "deleteUserToken": { - "default": "response = await _client.delete_user_token(\n user_token=\"test-user-1\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "await _client.delete_user_token(\n user_token=\"test-user-1\",\n)" }, "pushEvents": { - "default": "response = await _client.push_events(\n insights_events={\n \"events\": [\n {\n \"eventType\": \"click\",\n \"eventName\": \"Product Clicked\",\n \"index\": \"products\",\n \"userToken\": \"user-123456\",\n \"authenticatedUserToken\": \"user-123456\",\n \"timestamp\": 1641290601962,\n \"objectIDs\": [\n \"9780545139700\",\n \"9780439784542\",\n ],\n \"queryID\": \"43b15df305339e827f0ac0bdc5ebcaa7\",\n \"positions\": [\n 7,\n 6,\n ],\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.push_events(\n insights_events={\n \"events\": [\n {\n \"eventType\": \"click\",\n \"eventName\": \"Product Clicked\",\n \"index\": \"products\",\n \"userToken\": \"user-123456\",\n \"authenticatedUserToken\": \"user-123456\",\n \"timestamp\": 1641290601962,\n \"objectIDs\": [\n \"9780545139700\",\n \"9780439784542\",\n ],\n \"queryID\": \"43b15df305339e827f0ac0bdc5ebcaa7\",\n \"positions\": [\n 7,\n 6,\n ],\n },\n ],\n },\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "init": { "default": "_client = InsightsClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -209,22 +236,25 @@ "default": "require \"algolia\"" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "deleteUserToken": { - "default": "response = client.delete_user_token(\"test-user-1\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "client.delete_user_token(\"test-user-1\")" }, "pushEvents": { - "default": "response = client.push_events(\n InsightsEvents.new(\n events: [\n ClickedObjectIDsAfterSearch.new(\n event_type: \"click\",\n event_name: \"Product Clicked\",\n index: \"products\",\n user_token: \"user-123456\",\n authenticated_user_token: \"user-123456\",\n timestamp: 1641290601962,\n object_ids: [\"9780545139700\", \"9780439784542\"],\n query_id: \"43b15df305339e827f0ac0bdc5ebcaa7\",\n positions: [7, 6]\n )\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.push_events(\n InsightsEvents.new(\n events: [\n ClickedObjectIDsAfterSearch.new(\n event_type: \"click\",\n event_name: \"Product Clicked\",\n index: \"products\",\n user_token: \"user-123456\",\n authenticated_user_token: \"user-123456\",\n timestamp: 1641290601962,\n object_ids: [\"9780545139700\", \"9780439784542\"],\n query_id: \"43b15df305339e827f0ac0bdc5ebcaa7\",\n positions: [7, 6]\n )\n ]\n )\n)" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "init": { "default": "client = Algolia::InsightsClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -235,22 +265,22 @@ "default": "import algoliasearch.api.InsightsClient" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "deleteUserToken": { - "default": "val response = client.deleteUserToken(\n userToken = \"test-user-1\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "client.deleteUserToken(\n userToken = \"test-user-1\"\n)" }, "pushEvents": { - "default": "val response = client.pushEvents(\n insightsEvents = InsightsEvents(\n events = Seq(\n ClickedObjectIDsAfterSearch(\n eventType = ClickEvent.withName(\"click\"),\n eventName = \"Product Clicked\",\n index = \"products\",\n userToken = \"user-123456\",\n authenticatedUserToken = Some(\"user-123456\"),\n timestamp = Some(1641290601962L),\n objectIDs = Seq(\"9780545139700\", \"9780439784542\"),\n queryID = \"43b15df305339e827f0ac0bdc5ebcaa7\",\n positions = Seq(7, 6)\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.pushEvents(\n insightsEvents = InsightsEvents(\n events = Seq(\n ClickedObjectIDsAfterSearch(\n eventType = ClickEvent.withName(\"click\"),\n eventName = \"Product Clicked\",\n index = \"products\",\n userToken = \"user-123456\",\n authenticatedUserToken = Some(\"user-123456\"),\n timestamp = Some(1641290601962L),\n objectIDs = Seq(\"9780545139700\", \"9780439784542\"),\n queryID = \"43b15df305339e827f0ac0bdc5ebcaa7\",\n positions = Seq(7, 6)\n )\n )\n )\n)" }, "init": { "default": "val client = InsightsClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = Option(\"YOUR_APP_ID_REGION\"))" @@ -273,11 +303,14 @@ "default": "let response = try await client.customPut(path: \"test/minimal\")" }, "deleteUserToken": { - "default": "let response = try await client.deleteUserToken(userToken: \"test-user-1\")" + "default": "try await client.deleteUserToken(userToken: \"test-user-1\")" }, "pushEvents": { "default": "let response = try await client\n .pushEvents(insightsEvents: InsightsEvents(events: [\n EventsItems\n .clickedObjectIDsAfterSearch(ClickedObjectIDsAfterSearch(\n eventName: \"Product Clicked\",\n eventType: ClickEvent.click,\n index: \"products\",\n objectIDs: [\"9780545139700\", \"9780439784542\"],\n positions: [7, 6],\n queryID: \"43b15df305339e827f0ac0bdc5ebcaa7\",\n userToken: \"user-123456\",\n authenticatedUserToken: \"user-123456\",\n timestamp: Int64(1_641_290_601_962)\n )),\n ]))" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "init": { "default": "let client = try InsightsClient(appID: \"YOUR_APP_ID\", apiKey: \"YOUR_API_KEY\", region: .us)" } diff --git a/snippets/guides/monitoring-snippets.json b/snippets/guides/monitoring-snippets.json index b0b39a4023..5ac817f54e 100644 --- a/snippets/guides/monitoring-snippets.json +++ b/snippets/guides/monitoring-snippets.json @@ -42,6 +42,9 @@ "getStatus": { "default": "var response = await client.GetStatusAsync();" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "init": { "default": "var client = new MonitoringClient(new MonitoringConfig(\"YOUR_APP_ID\", \"YOUR_API_KEY\"));" } @@ -52,43 +55,46 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/monitoring\"" }, "customDelete": { - "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getClusterIncidents": { - "default": "response, err := client.GetClusterIncidents(client.NewApiGetClusterIncidentsRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetClusterIncidents(client.NewApiGetClusterIncidentsRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getClusterStatus": { - "default": "response, err := client.GetClusterStatus(client.NewApiGetClusterStatusRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetClusterStatus(client.NewApiGetClusterStatusRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getIncidents": { - "default": "response, err := client.GetIncidents()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetIncidents()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getIndexingTime": { - "default": "response, err := client.GetIndexingTime(client.NewApiGetIndexingTimeRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetIndexingTime(client.NewApiGetIndexingTimeRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getLatency": { - "default": "response, err := client.GetLatency(client.NewApiGetLatencyRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetLatency(client.NewApiGetLatencyRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getMetrics": { - "default": "response, err := client.GetMetrics(client.NewApiGetMetricsRequest(\n monitoring.Metric(\"avg_build_time\"), monitoring.Period(\"minute\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetMetrics(client.NewApiGetMetricsRequest(\n monitoring.Metric(\"avg_build_time\"), monitoring.Period(\"minute\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getReachability": { - "default": "response, err := client.GetReachability(client.NewApiGetReachabilityRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetReachability(client.NewApiGetReachabilityRequest(\n \"c1-de\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getServers": { - "default": "response, err := client.GetServers()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetServers()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getStatus": { - "default": "response, err := client.GetStatus()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetStatus()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "init": { "default": "client, err := monitoring.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -137,6 +143,9 @@ "getStatus": { "default": "client.getStatus();" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "init": { "default": "MonitoringClient client = new MonitoringClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\");" } @@ -146,43 +155,46 @@ "default": "import { monitoringClient } from '@algolia/monitoring';" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "getClusterIncidents": { - "default": "const response = await client.getClusterIncidents({ clusters: 'c1-de' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getClusterIncidents({ clusters: 'c1-de' });" }, "getClusterStatus": { - "default": "const response = await client.getClusterStatus({ clusters: 'c1-de' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getClusterStatus({ clusters: 'c1-de' });" }, "getIncidents": { - "default": "const response = await client.getIncidents();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getIncidents();" }, "getIndexingTime": { - "default": "const response = await client.getIndexingTime({ clusters: 'c1-de' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getIndexingTime({ clusters: 'c1-de' });" }, "getLatency": { - "default": "const response = await client.getLatency({ clusters: 'c1-de' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getLatency({ clusters: 'c1-de' });" }, "getMetrics": { - "default": "const response = await client.getMetrics({ metric: 'avg_build_time', period: 'minute' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getMetrics({ metric: 'avg_build_time', period: 'minute' });" }, "getReachability": { - "default": "const response = await client.getReachability({ clusters: 'c1-de' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getReachability({ clusters: 'c1-de' });" }, "getServers": { - "default": "const response = await client.getServers();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getServers();" }, "getStatus": { - "default": "const response = await client.getStatus();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getStatus();" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "init": { "default": "const client = monitoringClient('YOUR_APP_ID', 'YOUR_API_KEY');" @@ -193,43 +205,46 @@ "default": "import com.algolia.client.api.MonitoringClient" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "getClusterIncidents": { - "default": "var response = client.getClusterIncidents(\n clusters = \"c1-de\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getClusterIncidents(\n clusters = \"c1-de\",\n)" }, "getClusterStatus": { - "default": "var response = client.getClusterStatus(\n clusters = \"c1-de\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getClusterStatus(\n clusters = \"c1-de\",\n)" }, "getIncidents": { - "default": "var response = client.getIncidents()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getIncidents()" }, "getIndexingTime": { - "default": "var response = client.getIndexingTime(\n clusters = \"c1-de\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getIndexingTime(\n clusters = \"c1-de\",\n)" }, "getLatency": { - "default": "var response = client.getLatency(\n clusters = \"c1-de\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getLatency(\n clusters = \"c1-de\",\n)" }, "getMetrics": { - "default": "var response = client.getMetrics(\n metric = Metric.entries.first { it.value == \"avg_build_time\" },\n period = Period.entries.first { it.value == \"minute\" },\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getMetrics(\n metric = Metric.entries.first { it.value == \"avg_build_time\" },\n period = Period.entries.first { it.value == \"minute\" },\n)" }, "getReachability": { - "default": "var response = client.getReachability(\n clusters = \"c1-de\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getReachability(\n clusters = \"c1-de\",\n)" }, "getServers": { - "default": "var response = client.getServers()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getServers()" }, "getStatus": { - "default": "var response = client.getStatus()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getStatus()" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "init": { "default": "val client = MonitoringClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\")" @@ -240,43 +255,46 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\MonitoringClient;" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "getClusterIncidents": { - "default": "$response = $client->getClusterIncidents(\n 'c1-de',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getClusterIncidents(\n 'c1-de',\n);" }, "getClusterStatus": { - "default": "$response = $client->getClusterStatus(\n 'c1-de',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getClusterStatus(\n 'c1-de',\n);" }, "getIncidents": { - "default": "$response = $client->getIncidents();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getIncidents();" }, "getIndexingTime": { - "default": "$response = $client->getIndexingTime(\n 'c1-de',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getIndexingTime(\n 'c1-de',\n);" }, "getLatency": { - "default": "$response = $client->getLatency(\n 'c1-de',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getLatency(\n 'c1-de',\n);" }, "getMetrics": { - "default": "$response = $client->getMetrics(\n 'avg_build_time',\n 'minute',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getMetrics(\n 'avg_build_time',\n 'minute',\n);" }, "getReachability": { - "default": "$response = $client->getReachability(\n 'c1-de',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getReachability(\n 'c1-de',\n);" }, "getServers": { - "default": "$response = $client->getServers();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getServers();" }, "getStatus": { - "default": "$response = $client->getStatus();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getStatus();" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "init": { "default": "$client = MonitoringClient::create('', '');" @@ -287,43 +305,46 @@ "default": "from algoliasearch.monitoring.client import MonitoringClient" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "getClusterIncidents": { - "default": "response = await _client.get_cluster_incidents(\n clusters=\"c1-de\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_cluster_incidents(\n clusters=\"c1-de\",\n)" }, "getClusterStatus": { - "default": "response = await _client.get_cluster_status(\n clusters=\"c1-de\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_cluster_status(\n clusters=\"c1-de\",\n)" }, "getIncidents": { - "default": "response = await _client.get_incidents()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_incidents()" }, "getIndexingTime": { - "default": "response = await _client.get_indexing_time(\n clusters=\"c1-de\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_indexing_time(\n clusters=\"c1-de\",\n)" }, "getLatency": { - "default": "response = await _client.get_latency(\n clusters=\"c1-de\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_latency(\n clusters=\"c1-de\",\n)" }, "getMetrics": { - "default": "response = await _client.get_metrics(\n metric=\"avg_build_time\",\n period=\"minute\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_metrics(\n metric=\"avg_build_time\",\n period=\"minute\",\n)" }, "getReachability": { - "default": "response = await _client.get_reachability(\n clusters=\"c1-de\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_reachability(\n clusters=\"c1-de\",\n)" }, "getServers": { - "default": "response = await _client.get_servers()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_servers()" }, "getStatus": { - "default": "response = await _client.get_status()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_status()" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "init": { "default": "_client = MonitoringClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -334,43 +355,46 @@ "default": "require \"algolia\"" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "getClusterIncidents": { - "default": "response = client.get_cluster_incidents(\"c1-de\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_cluster_incidents(\"c1-de\")" }, "getClusterStatus": { - "default": "response = client.get_cluster_status(\"c1-de\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_cluster_status(\"c1-de\")" }, "getIncidents": { - "default": "response = client.get_incidents\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_incidents" }, "getIndexingTime": { - "default": "response = client.get_indexing_time(\"c1-de\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_indexing_time(\"c1-de\")" }, "getLatency": { - "default": "response = client.get_latency(\"c1-de\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_latency(\"c1-de\")" }, "getMetrics": { - "default": "response = client.get_metrics(\"avg_build_time\", \"minute\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_metrics(\"avg_build_time\", \"minute\")" }, "getReachability": { - "default": "response = client.get_reachability(\"c1-de\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_reachability(\"c1-de\")" }, "getServers": { - "default": "response = client.get_servers\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_servers" }, "getStatus": { - "default": "response = client.get_status\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_status" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "init": { "default": "client = Algolia::MonitoringClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -381,43 +405,43 @@ "default": "import algoliasearch.api.MonitoringClient" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "getClusterIncidents": { - "default": "val response = client.getClusterIncidents(\n clusters = \"c1-de\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getClusterIncidents(\n clusters = \"c1-de\"\n)" }, "getClusterStatus": { - "default": "val response = client.getClusterStatus(\n clusters = \"c1-de\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getClusterStatus(\n clusters = \"c1-de\"\n)" }, "getIncidents": { - "default": "val response = client.getIncidents(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getIncidents(\n)" }, "getIndexingTime": { - "default": "val response = client.getIndexingTime(\n clusters = \"c1-de\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getIndexingTime(\n clusters = \"c1-de\"\n)" }, "getLatency": { - "default": "val response = client.getLatency(\n clusters = \"c1-de\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getLatency(\n clusters = \"c1-de\"\n)" }, "getMetrics": { - "default": "val response = client.getMetrics(\n metric = Metric.withName(\"avg_build_time\"),\n period = Period.withName(\"minute\")\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getMetrics(\n metric = Metric.withName(\"avg_build_time\"),\n period = Period.withName(\"minute\")\n)" }, "getReachability": { - "default": "val response = client.getReachability(\n clusters = \"c1-de\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getReachability(\n clusters = \"c1-de\"\n)" }, "getServers": { - "default": "val response = client.getServers(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getServers(\n)" }, "getStatus": { - "default": "val response = client.getStatus(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getStatus(\n)" }, "init": { "default": "val client = MonitoringClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\")" @@ -466,6 +490,9 @@ "getStatus": { "default": "let response = try await client.getStatus()" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "init": { "default": "let client = try MonitoringClient(appID: \"YOUR_APP_ID\", apiKey: \"YOUR_API_KEY\")" } diff --git a/snippets/guides/personalization-snippets.json b/snippets/guides/personalization-snippets.json index 06c2d88c19..9f6cc06a79 100644 --- a/snippets/guides/personalization-snippets.json +++ b/snippets/guides/personalization-snippets.json @@ -24,6 +24,9 @@ "getUserTokenProfile": { "default": "var response = await client.GetUserTokenProfileAsync(\"UserToken\");" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "setPersonalizationStrategy": { "default": "var response = await client.SetPersonalizationStrategyAsync(\n new PersonalizationStrategyParams\n {\n EventScoring = new List\n {\n new EventScoring\n {\n Score = 42,\n EventName = \"Algolia\",\n EventType = Enum.Parse(\"Click\"),\n }\n },\n FacetScoring = new List\n {\n new FacetScoring { Score = 42, FacetName = \"Event\", }\n },\n PersonalizationImpact = 42,\n }\n);" }, @@ -37,28 +40,34 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/personalization\"" }, "customDelete": { - "default": "// Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION\nclient, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "// Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION\nclient, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "// Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION\nclient, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "// Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION\nclient, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteUserProfile": { - "default": "// Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION\nclient, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteUserProfile(client.NewApiDeleteUserProfileRequest(\n \"UserToken\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteUserProfile(client.NewApiDeleteUserProfileRequest(\n \"UserToken\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getPersonalizationStrategy": { - "default": "// Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION\nclient, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetPersonalizationStrategy()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetPersonalizationStrategy()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getUserTokenProfile": { - "default": "// Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION\nclient, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetUserTokenProfile(client.NewApiGetUserTokenProfileRequest(\n \"UserToken\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetUserTokenProfile(client.NewApiGetUserTokenProfileRequest(\n \"UserToken\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "setPersonalizationStrategy": { - "default": "// Initialize the client with your application region, eg. personalization.YOUR_APP_ID_REGION\nclient, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.SetPersonalizationStrategy(client.NewApiSetPersonalizationStrategyRequest(\n\n personalization.NewEmptyPersonalizationStrategyParams().SetEventScoring(\n []personalization.EventScoring{*personalization.NewEmptyEventScoring().SetScore(42).SetEventName(\"Algolia\").SetEventType(personalization.EventType(\"click\"))}).SetFacetScoring(\n []personalization.FacetScoring{*personalization.NewEmptyFacetScoring().SetScore(42).SetFacetName(\"Event\")}).SetPersonalizationImpact(42),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.SetPersonalizationStrategy(client.NewApiSetPersonalizationStrategyRequest(\n\n personalization.NewEmptyPersonalizationStrategyParams().SetEventScoring(\n []personalization.EventScoring{*personalization.NewEmptyEventScoring().SetScore(42).SetEventName(\"Algolia\").SetEventType(personalization.EventType(\"click\"))}).SetFacetScoring(\n []personalization.FacetScoring{*personalization.NewEmptyFacetScoring().SetScore(42).SetFacetName(\"Event\")}).SetPersonalizationImpact(42),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "init": { + "default": "client, err := personalization.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", personalization.US)" } }, "java": { @@ -86,6 +95,9 @@ "getUserTokenProfile": { "default": "client.getUserTokenProfile(\"UserToken\");" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "setPersonalizationStrategy": { "default": "client.setPersonalizationStrategy(\n new PersonalizationStrategyParams()\n .setEventScoring(Arrays.asList(new EventScoring().setScore(42).setEventName(\"Algolia\").setEventType(EventType.CLICK)))\n .setFacetScoring(Arrays.asList(new FacetScoring().setScore(42).setFacetName(\"Event\")))\n .setPersonalizationImpact(42)\n);" }, @@ -98,28 +110,31 @@ "default": "import { personalizationClient } from '@algolia/client-personalization';" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "deleteUserProfile": { - "default": "const response = await client.deleteUserProfile({ userToken: 'UserToken' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteUserProfile({ userToken: 'UserToken' });" }, "getPersonalizationStrategy": { - "default": "const response = await client.getPersonalizationStrategy();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getPersonalizationStrategy();" }, "getUserTokenProfile": { - "default": "const response = await client.getUserTokenProfile({ userToken: 'UserToken' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getUserTokenProfile({ userToken: 'UserToken' });" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "setPersonalizationStrategy": { - "default": "const response = await client.setPersonalizationStrategy({\n eventScoring: [{ score: 42, eventName: 'Algolia', eventType: 'click' }],\n facetScoring: [{ score: 42, facetName: 'Event' }],\n personalizationImpact: 42,\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.setPersonalizationStrategy({\n eventScoring: [{ score: 42, eventName: 'Algolia', eventType: 'click' }],\n facetScoring: [{ score: 42, facetName: 'Event' }],\n personalizationImpact: 42,\n});" }, "init": { "default": "const client = personalizationClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION');" @@ -130,28 +145,31 @@ "default": "import com.algolia.client.api.PersonalizationClient" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "deleteUserProfile": { - "default": "var response = client.deleteUserProfile(\n userToken = \"UserToken\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteUserProfile(\n userToken = \"UserToken\",\n)" }, "getPersonalizationStrategy": { - "default": "var response = client.getPersonalizationStrategy()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getPersonalizationStrategy()" }, "getUserTokenProfile": { - "default": "var response = client.getUserTokenProfile(\n userToken = \"UserToken\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getUserTokenProfile(\n userToken = \"UserToken\",\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "setPersonalizationStrategy": { - "default": "var response = client.setPersonalizationStrategy(\n personalizationStrategyParams = PersonalizationStrategyParams(\n eventScoring = listOf(\n EventScoring(\n score = 42,\n eventName = \"Algolia\",\n eventType = EventType.entries.first { it.value == \"click\" },\n ),\n ),\n facetScoring = listOf(\n FacetScoring(\n score = 42,\n facetName = \"Event\",\n ),\n ),\n personalizationImpact = 42,\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.setPersonalizationStrategy(\n personalizationStrategyParams = PersonalizationStrategyParams(\n eventScoring = listOf(\n EventScoring(\n score = 42,\n eventName = \"Algolia\",\n eventType = EventType.entries.first { it.value == \"click\" },\n ),\n ),\n facetScoring = listOf(\n FacetScoring(\n score = 42,\n facetName = \"Event\",\n ),\n ),\n personalizationImpact = 42,\n ),\n)" }, "init": { "default": "val client = PersonalizationClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -162,28 +180,31 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\PersonalizationClient;" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "deleteUserProfile": { - "default": "$response = $client->deleteUserProfile(\n 'UserToken',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteUserProfile(\n 'UserToken',\n);" }, "getPersonalizationStrategy": { - "default": "$response = $client->getPersonalizationStrategy();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getPersonalizationStrategy();" }, "getUserTokenProfile": { - "default": "$response = $client->getUserTokenProfile(\n 'UserToken',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getUserTokenProfile(\n 'UserToken',\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "setPersonalizationStrategy": { - "default": "$response = $client->setPersonalizationStrategy(\n ['eventScoring' => [\n ['score' => 42,\n 'eventName' => 'Algolia',\n 'eventType' => 'click',\n ],\n ],\n 'facetScoring' => [\n ['score' => 42,\n 'facetName' => 'Event',\n ],\n ],\n 'personalizationImpact' => 42,\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->setPersonalizationStrategy(\n ['eventScoring' => [\n ['score' => 42,\n 'eventName' => 'Algolia',\n 'eventType' => 'click',\n ],\n ],\n 'facetScoring' => [\n ['score' => 42,\n 'facetName' => 'Event',\n ],\n ],\n 'personalizationImpact' => 42,\n ],\n);" }, "init": { "default": "$client = PersonalizationClient::create('', '', 'YOUR_APP_ID_REGION');" @@ -194,28 +215,31 @@ "default": "from algoliasearch.personalization.client import PersonalizationClient" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "deleteUserProfile": { - "default": "response = await _client.delete_user_profile(\n user_token=\"UserToken\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_user_profile(\n user_token=\"UserToken\",\n)" }, "getPersonalizationStrategy": { - "default": "response = await _client.get_personalization_strategy()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_personalization_strategy()" }, "getUserTokenProfile": { - "default": "response = await _client.get_user_token_profile(\n user_token=\"UserToken\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_user_token_profile(\n user_token=\"UserToken\",\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "setPersonalizationStrategy": { - "default": "response = await _client.set_personalization_strategy(\n personalization_strategy_params={\n \"eventScoring\": [\n {\n \"score\": 42,\n \"eventName\": \"Algolia\",\n \"eventType\": \"click\",\n },\n ],\n \"facetScoring\": [\n {\n \"score\": 42,\n \"facetName\": \"Event\",\n },\n ],\n \"personalizationImpact\": 42,\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.set_personalization_strategy(\n personalization_strategy_params={\n \"eventScoring\": [\n {\n \"score\": 42,\n \"eventName\": \"Algolia\",\n \"eventType\": \"click\",\n },\n ],\n \"facetScoring\": [\n {\n \"score\": 42,\n \"facetName\": \"Event\",\n },\n ],\n \"personalizationImpact\": 42,\n },\n)" }, "init": { "default": "_client = PersonalizationClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -226,28 +250,31 @@ "default": "require \"algolia\"" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "deleteUserProfile": { - "default": "response = client.delete_user_profile(\"UserToken\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_user_profile(\"UserToken\")" }, "getPersonalizationStrategy": { - "default": "response = client.get_personalization_strategy\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_personalization_strategy" }, "getUserTokenProfile": { - "default": "response = client.get_user_token_profile(\"UserToken\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_user_token_profile(\"UserToken\")" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "setPersonalizationStrategy": { - "default": "response = client.set_personalization_strategy(\n PersonalizationStrategyParams.new(\n event_scoring: [EventScoring.new(score: 42, event_name: \"Algolia\", event_type: \"click\")],\n facet_scoring: [FacetScoring.new(score: 42, facet_name: \"Event\")],\n personalization_impact: 42\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.set_personalization_strategy(\n PersonalizationStrategyParams.new(\n event_scoring: [EventScoring.new(score: 42, event_name: \"Algolia\", event_type: \"click\")],\n facet_scoring: [FacetScoring.new(score: 42, facet_name: \"Event\")],\n personalization_impact: 42\n )\n)" }, "init": { "default": "client = Algolia::PersonalizationClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -258,28 +285,28 @@ "default": "import algoliasearch.api.PersonalizationClient" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "deleteUserProfile": { - "default": "val response = client.deleteUserProfile(\n userToken = \"UserToken\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteUserProfile(\n userToken = \"UserToken\"\n)" }, "getPersonalizationStrategy": { - "default": "val response = client.getPersonalizationStrategy(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getPersonalizationStrategy(\n)" }, "getUserTokenProfile": { - "default": "val response = client.getUserTokenProfile(\n userToken = \"UserToken\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getUserTokenProfile(\n userToken = \"UserToken\"\n)" }, "setPersonalizationStrategy": { - "default": "val response = client.setPersonalizationStrategy(\n personalizationStrategyParams = PersonalizationStrategyParams(\n eventScoring = Seq(\n EventScoring(\n score = 42,\n eventName = \"Algolia\",\n eventType = EventType.withName(\"click\")\n )\n ),\n facetScoring = Seq(\n FacetScoring(\n score = 42,\n facetName = \"Event\"\n )\n ),\n personalizationImpact = 42\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.setPersonalizationStrategy(\n personalizationStrategyParams = PersonalizationStrategyParams(\n eventScoring = Seq(\n EventScoring(\n score = 42,\n eventName = \"Algolia\",\n eventType = EventType.withName(\"click\")\n )\n ),\n facetScoring = Seq(\n FacetScoring(\n score = 42,\n facetName = \"Event\"\n )\n ),\n personalizationImpact = 42\n )\n)" }, "init": { "default": "val client = PersonalizationClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -310,6 +337,9 @@ "getUserTokenProfile": { "default": "let response = try await client.getUserTokenProfile(userToken: \"UserToken\")" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "setPersonalizationStrategy": { "default": "let response = try await client\n .setPersonalizationStrategy(personalizationStrategyParams: PersonalizationStrategyParams(\n eventScoring: [EventScoring(\n score: 42,\n eventName: \"Algolia\",\n eventType: PersonalizationEventType.click\n )],\n facetScoring: [FacetScoring(score: 42, facetName: \"Event\")],\n personalizationImpact: 42\n ))" }, diff --git a/snippets/guides/query-suggestions-snippets.json b/snippets/guides/query-suggestions-snippets.json index 03f1d048df..3df1f5df0c 100644 --- a/snippets/guides/query-suggestions-snippets.json +++ b/snippets/guides/query-suggestions-snippets.json @@ -33,6 +33,9 @@ "getLogFile": { "default": "var response = await client.GetLogFileAsync(\"\");" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "updateConfig": { "default": "var response = await client.UpdateConfigAsync(\n \"\",\n new Configuration\n {\n SourceIndices = new List\n {\n new SourceIndex\n {\n IndexName = \"\",\n Facets = new List { new Facet { Attribute = \"test\", } },\n Generate = new List>\n {\n new List { \"facetA\", \"facetB\" },\n new List { \"facetC\" }\n },\n }\n },\n Languages = new Languages(new List { \"french\" }),\n Exclude = new List { \"test\" },\n }\n);" }, @@ -46,37 +49,43 @@ "default": "import suggestions \"github.com/algolia/algoliasearch-client-go/v4/algolia/query-suggestions\"" }, "createConfig": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CreateConfig(client.NewApiCreateConfigRequest(\n\n suggestions.NewEmptyConfigurationWithIndex().SetIndexName(\"\").SetSourceIndices(\n []suggestions.SourceIndex{*suggestions.NewEmptySourceIndex().SetIndexName(\"\").SetFacets(\n []suggestions.Facet{*suggestions.NewEmptyFacet().SetAttribute(\"test\")}).SetGenerate(\n [][]string{\n []string{\"facetA\", \"facetB\"},\n []string{\"facetC\"}})}).SetLanguages(suggestions.ArrayOfStringAsLanguages(\n []string{\"french\"})).SetExclude(\n []string{\"test\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CreateConfig(client.NewApiCreateConfigRequest(\n\n suggestions.NewEmptyConfigurationWithIndex().SetIndexName(\"\").SetSourceIndices(\n []suggestions.SourceIndex{*suggestions.NewEmptySourceIndex().SetIndexName(\"\").SetFacets(\n []suggestions.Facet{*suggestions.NewEmptyFacet().SetAttribute(\"test\")}).SetGenerate(\n [][]string{\n []string{\"facetA\", \"facetB\"},\n []string{\"facetC\"}})}).SetLanguages(suggestions.ArrayOfStringAsLanguages(\n []string{\"french\"})).SetExclude(\n []string{\"test\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customDelete": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteConfig": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.DeleteConfig(client.NewApiDeleteConfigRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.DeleteConfig(client.NewApiDeleteConfigRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getAllConfigs": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetAllConfigs()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetAllConfigs()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getConfig": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetConfig(client.NewApiGetConfigRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetConfig(client.NewApiGetConfigRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getConfigStatus": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetConfigStatus(client.NewApiGetConfigStatusRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetConfigStatus(client.NewApiGetConfigStatusRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getLogFile": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.GetLogFile(client.NewApiGetLogFileRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.GetLogFile(client.NewApiGetLogFileRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "updateConfig": { - "default": "// Initialize the client with your application region, eg. suggestions.YOUR_APP_ID_REGION\nclient, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)\nif err != nil {\n // The client can fail to initialize if you pass an invalid parameter.\n panic(err)\n}\n\n// Call the API\nresponse, err := client.UpdateConfig(client.NewApiUpdateConfigRequest(\n \"\",\n suggestions.NewEmptyConfiguration().SetSourceIndices(\n []suggestions.SourceIndex{*suggestions.NewEmptySourceIndex().SetIndexName(\"\").SetFacets(\n []suggestions.Facet{*suggestions.NewEmptyFacet().SetAttribute(\"test\")}).SetGenerate(\n [][]string{\n []string{\"facetA\", \"facetB\"},\n []string{\"facetC\"}})}).SetLanguages(suggestions.ArrayOfStringAsLanguages(\n []string{\"french\"})).SetExclude(\n []string{\"test\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)\n" + "default": "response, err := client.UpdateConfig(client.NewApiUpdateConfigRequest(\n \"\",\n suggestions.NewEmptyConfiguration().SetSourceIndices(\n []suggestions.SourceIndex{*suggestions.NewEmptySourceIndex().SetIndexName(\"\").SetFacets(\n []suggestions.Facet{*suggestions.NewEmptyFacet().SetAttribute(\"test\")}).SetGenerate(\n [][]string{\n []string{\"facetA\", \"facetB\"},\n []string{\"facetC\"}})}).SetLanguages(suggestions.ArrayOfStringAsLanguages(\n []string{\"french\"})).SetExclude(\n []string{\"test\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "init": { + "default": "client, err := suggestions.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\", suggestions.US)" } }, "java": { @@ -113,6 +122,9 @@ "getLogFile": { "default": "client.getLogFile(\"\");" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "updateConfig": { "default": "client.updateConfig(\n \"\",\n new Configuration()\n .setSourceIndices(\n Arrays.asList(\n new SourceIndex()\n .setIndexName(\"\")\n .setFacets(Arrays.asList(new Facet().setAttribute(\"test\")))\n .setGenerate(Arrays.asList(Arrays.asList(\"facetA\", \"facetB\"), Arrays.asList(\"facetC\")))\n )\n )\n .setLanguages(Languages.of(Arrays.asList(\"french\")))\n .setExclude(Arrays.asList(\"test\"))\n);" }, @@ -125,37 +137,40 @@ "default": "import { querySuggestionsClient } from '@algolia/client-query-suggestions';" }, "createConfig": { - "default": "const response = await client.createConfig({\n indexName: 'theIndexName',\n sourceIndices: [\n { indexName: 'testIndex', facets: [{ attribute: 'test' }], generate: [['facetA', 'facetB'], ['facetC']] },\n ],\n languages: ['french'],\n exclude: ['test'],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.createConfig({\n indexName: 'theIndexName',\n sourceIndices: [\n { indexName: 'testIndex', facets: [{ attribute: 'test' }], generate: [['facetA', 'facetB'], ['facetC']] },\n ],\n languages: ['french'],\n exclude: ['test'],\n});" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "deleteConfig": { - "default": "const response = await client.deleteConfig({ indexName: 'theIndexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteConfig({ indexName: 'theIndexName' });" }, "getAllConfigs": { - "default": "const response = await client.getAllConfigs();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getAllConfigs();" }, "getConfig": { - "default": "const response = await client.getConfig({ indexName: 'cts_e2e_browse_query_suggestions' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getConfig({ indexName: 'cts_e2e_browse_query_suggestions' });" }, "getConfigStatus": { - "default": "const response = await client.getConfigStatus({ indexName: 'theIndexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getConfigStatus({ indexName: 'theIndexName' });" }, "getLogFile": { - "default": "const response = await client.getLogFile({ indexName: 'theIndexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getLogFile({ indexName: 'theIndexName' });" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "updateConfig": { - "default": "const response = await client.updateConfig({\n indexName: 'theIndexName',\n configuration: {\n sourceIndices: [\n { indexName: 'testIndex', facets: [{ attribute: 'test' }], generate: [['facetA', 'facetB'], ['facetC']] },\n ],\n languages: ['french'],\n exclude: ['test'],\n },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.updateConfig({\n indexName: 'theIndexName',\n configuration: {\n sourceIndices: [\n { indexName: 'testIndex', facets: [{ attribute: 'test' }], generate: [['facetA', 'facetB'], ['facetC']] },\n ],\n languages: ['french'],\n exclude: ['test'],\n },\n});" }, "init": { "default": "const client = querySuggestionsClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION');" @@ -166,37 +181,40 @@ "default": "import com.algolia.client.api.QuerySuggestionsClient" }, "createConfig": { - "default": "var response = client.createConfig(\n configurationWithIndex = ConfigurationWithIndex(\n indexName = \"\",\n sourceIndices = listOf(\n SourceIndex(\n indexName = \"\",\n facets = listOf(\n Facet(\n attribute = \"test\",\n ),\n ),\n generate = listOf(listOf(\"facetA\", \"facetB\"), listOf(\"facetC\")),\n ),\n ),\n languages = Languages.of(listOf(\"french\")),\n exclude = listOf(\"test\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.createConfig(\n configurationWithIndex = ConfigurationWithIndex(\n indexName = \"\",\n sourceIndices = listOf(\n SourceIndex(\n indexName = \"\",\n facets = listOf(\n Facet(\n attribute = \"test\",\n ),\n ),\n generate = listOf(listOf(\"facetA\", \"facetB\"), listOf(\"facetC\")),\n ),\n ),\n languages = Languages.of(listOf(\"french\")),\n exclude = listOf(\"test\"),\n ),\n)" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "deleteConfig": { - "default": "var response = client.deleteConfig(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteConfig(\n indexName = \"\",\n)" }, "getAllConfigs": { - "default": "var response = client.getAllConfigs()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getAllConfigs()" }, "getConfig": { - "default": "var response = client.getConfig(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getConfig(\n indexName = \"\",\n)" }, "getConfigStatus": { - "default": "var response = client.getConfigStatus(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getConfigStatus(\n indexName = \"\",\n)" }, "getLogFile": { - "default": "var response = client.getLogFile(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getLogFile(\n indexName = \"\",\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "updateConfig": { - "default": "var response = client.updateConfig(\n indexName = \"\",\n configuration = Configuration(\n sourceIndices = listOf(\n SourceIndex(\n indexName = \"\",\n facets = listOf(\n Facet(\n attribute = \"test\",\n ),\n ),\n generate = listOf(listOf(\"facetA\", \"facetB\"), listOf(\"facetC\")),\n ),\n ),\n languages = Languages.of(listOf(\"french\")),\n exclude = listOf(\"test\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.updateConfig(\n indexName = \"\",\n configuration = Configuration(\n sourceIndices = listOf(\n SourceIndex(\n indexName = \"\",\n facets = listOf(\n Facet(\n attribute = \"test\",\n ),\n ),\n generate = listOf(listOf(\"facetA\", \"facetB\"), listOf(\"facetC\")),\n ),\n ),\n languages = Languages.of(listOf(\"french\")),\n exclude = listOf(\"test\"),\n ),\n)" }, "init": { "default": "val client = QuerySuggestionsClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -207,37 +225,40 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\QuerySuggestionsClient;" }, "createConfig": { - "default": "$response = $client->createConfig(\n ['indexName' => '',\n 'sourceIndices' => [\n ['indexName' => '',\n 'facets' => [\n ['attribute' => 'test',\n ],\n ],\n 'generate' => [\n [\n 'facetA',\n\n 'facetB',\n ],\n\n [\n 'facetC',\n ],\n ],\n ],\n ],\n 'languages' => [\n 'french',\n ],\n 'exclude' => [\n 'test',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->createConfig(\n ['indexName' => '',\n 'sourceIndices' => [\n ['indexName' => '',\n 'facets' => [\n ['attribute' => 'test',\n ],\n ],\n 'generate' => [\n [\n 'facetA',\n\n 'facetB',\n ],\n\n [\n 'facetC',\n ],\n ],\n ],\n ],\n 'languages' => [\n 'french',\n ],\n 'exclude' => [\n 'test',\n ],\n ],\n);" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "deleteConfig": { - "default": "$response = $client->deleteConfig(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteConfig(\n '',\n);" }, "getAllConfigs": { - "default": "$response = $client->getAllConfigs();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getAllConfigs();" }, "getConfig": { - "default": "$response = $client->getConfig(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getConfig(\n '',\n);" }, "getConfigStatus": { - "default": "$response = $client->getConfigStatus(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getConfigStatus(\n '',\n);" }, "getLogFile": { - "default": "$response = $client->getLogFile(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getLogFile(\n '',\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "updateConfig": { - "default": "$response = $client->updateConfig(\n '',\n ['sourceIndices' => [\n ['indexName' => '',\n 'facets' => [\n ['attribute' => 'test',\n ],\n ],\n 'generate' => [\n [\n 'facetA',\n\n 'facetB',\n ],\n\n [\n 'facetC',\n ],\n ],\n ],\n ],\n 'languages' => [\n 'french',\n ],\n 'exclude' => [\n 'test',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->updateConfig(\n '',\n ['sourceIndices' => [\n ['indexName' => '',\n 'facets' => [\n ['attribute' => 'test',\n ],\n ],\n 'generate' => [\n [\n 'facetA',\n\n 'facetB',\n ],\n\n [\n 'facetC',\n ],\n ],\n ],\n ],\n 'languages' => [\n 'french',\n ],\n 'exclude' => [\n 'test',\n ],\n ],\n);" }, "init": { "default": "$client = QuerySuggestionsClient::create('', '', 'YOUR_APP_ID_REGION');" @@ -248,37 +269,40 @@ "default": "from algoliasearch.query_suggestions.client import QuerySuggestionsClient" }, "createConfig": { - "default": "response = await _client.create_config(\n configuration_with_index={\n \"indexName\": \"\",\n \"sourceIndices\": [\n {\n \"indexName\": \"\",\n \"facets\": [\n {\n \"attribute\": \"test\",\n },\n ],\n \"generate\": [\n [\n \"facetA\",\n \"facetB\",\n ],\n [\n \"facetC\",\n ],\n ],\n },\n ],\n \"languages\": [\n \"french\",\n ],\n \"exclude\": [\n \"test\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.create_config(\n configuration_with_index={\n \"indexName\": \"\",\n \"sourceIndices\": [\n {\n \"indexName\": \"\",\n \"facets\": [\n {\n \"attribute\": \"test\",\n },\n ],\n \"generate\": [\n [\n \"facetA\",\n \"facetB\",\n ],\n [\n \"facetC\",\n ],\n ],\n },\n ],\n \"languages\": [\n \"french\",\n ],\n \"exclude\": [\n \"test\",\n ],\n },\n)" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "deleteConfig": { - "default": "response = await _client.delete_config(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_config(\n index_name=\"\",\n)" }, "getAllConfigs": { - "default": "response = await _client.get_all_configs()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_all_configs()" }, "getConfig": { - "default": "response = await _client.get_config(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_config(\n index_name=\"\",\n)" }, "getConfigStatus": { - "default": "response = await _client.get_config_status(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_config_status(\n index_name=\"\",\n)" }, "getLogFile": { - "default": "response = await _client.get_log_file(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_log_file(\n index_name=\"\",\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "updateConfig": { - "default": "response = await _client.update_config(\n index_name=\"\",\n configuration={\n \"sourceIndices\": [\n {\n \"indexName\": \"\",\n \"facets\": [\n {\n \"attribute\": \"test\",\n },\n ],\n \"generate\": [\n [\n \"facetA\",\n \"facetB\",\n ],\n [\n \"facetC\",\n ],\n ],\n },\n ],\n \"languages\": [\n \"french\",\n ],\n \"exclude\": [\n \"test\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.update_config(\n index_name=\"\",\n configuration={\n \"sourceIndices\": [\n {\n \"indexName\": \"\",\n \"facets\": [\n {\n \"attribute\": \"test\",\n },\n ],\n \"generate\": [\n [\n \"facetA\",\n \"facetB\",\n ],\n [\n \"facetC\",\n ],\n ],\n },\n ],\n \"languages\": [\n \"french\",\n ],\n \"exclude\": [\n \"test\",\n ],\n },\n)" }, "init": { "default": "_client = QuerySuggestionsClient(" @@ -289,37 +313,40 @@ "default": "require \"algolia\"" }, "createConfig": { - "default": "response = client.create_config(\n ConfigurationWithIndex.new(\n index_name: \"\",\n source_indices: [\n SourceIndex.new(\n index_name: \"\",\n facets: [Facet.new(attribute: \"test\")],\n generate: [[\"facetA\", \"facetB\"], [\"facetC\"]]\n )\n ],\n languages: [\"french\"],\n exclude: [\"test\"]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.create_config(\n ConfigurationWithIndex.new(\n index_name: \"\",\n source_indices: [\n SourceIndex.new(\n index_name: \"\",\n facets: [Facet.new(attribute: \"test\")],\n generate: [[\"facetA\", \"facetB\"], [\"facetC\"]]\n )\n ],\n languages: [\"french\"],\n exclude: [\"test\"]\n )\n)" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "deleteConfig": { - "default": "response = client.delete_config(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_config(\"\")" }, "getAllConfigs": { - "default": "response = client.get_all_configs\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_all_configs" }, "getConfig": { - "default": "response = client.get_config(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_config(\"\")" }, "getConfigStatus": { - "default": "response = client.get_config_status(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_config_status(\"\")" }, "getLogFile": { - "default": "response = client.get_log_file(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_log_file(\"\")" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "updateConfig": { - "default": "response = client.update_config(\n \"\",\n Configuration.new(\n source_indices: [\n SourceIndex.new(\n index_name: \"\",\n facets: [Facet.new(attribute: \"test\")],\n generate: [[\"facetA\", \"facetB\"], [\"facetC\"]]\n )\n ],\n languages: [\"french\"],\n exclude: [\"test\"]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.update_config(\n \"\",\n Configuration.new(\n source_indices: [\n SourceIndex.new(\n index_name: \"\",\n facets: [Facet.new(attribute: \"test\")],\n generate: [[\"facetA\", \"facetB\"], [\"facetC\"]]\n )\n ],\n languages: [\"french\"],\n exclude: [\"test\"]\n )\n)" }, "init": { "default": "client = Algolia::QuerySuggestionsClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\", \"YOUR_APP_ID_REGION\")" @@ -330,37 +357,37 @@ "default": "import algoliasearch.api.QuerySuggestionsClient" }, "createConfig": { - "default": "val response = client.createConfig(\n configurationWithIndex = ConfigurationWithIndex(\n indexName = \"\",\n sourceIndices = Seq(\n SourceIndex(\n indexName = \"\",\n facets = Some(\n Seq(\n Facet(\n attribute = Some(\"test\")\n )\n )\n ),\n generate = Some(Seq(Seq(\"facetA\", \"facetB\"), Seq(\"facetC\")))\n )\n ),\n languages = Some(Languages(Seq(\"french\"))),\n exclude = Some(Seq(\"test\"))\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.createConfig(\n configurationWithIndex = ConfigurationWithIndex(\n indexName = \"\",\n sourceIndices = Seq(\n SourceIndex(\n indexName = \"\",\n facets = Some(\n Seq(\n Facet(\n attribute = Some(\"test\")\n )\n )\n ),\n generate = Some(Seq(Seq(\"facetA\", \"facetB\"), Seq(\"facetC\")))\n )\n ),\n languages = Some(Languages(Seq(\"french\"))),\n exclude = Some(Seq(\"test\"))\n )\n)" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "deleteConfig": { - "default": "val response = client.deleteConfig(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteConfig(\n indexName = \"\"\n)" }, "getAllConfigs": { - "default": "val response = client.getAllConfigs(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getAllConfigs(\n)" }, "getConfig": { - "default": "val response = client.getConfig(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getConfig(\n indexName = \"\"\n)" }, "getConfigStatus": { - "default": "val response = client.getConfigStatus(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getConfigStatus(\n indexName = \"\"\n)" }, "getLogFile": { - "default": "val response = client.getLogFile(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getLogFile(\n indexName = \"\"\n)" }, "updateConfig": { - "default": "val response = client.updateConfig(\n indexName = \"\",\n configuration = Configuration(\n sourceIndices = Seq(\n SourceIndex(\n indexName = \"\",\n facets = Some(\n Seq(\n Facet(\n attribute = Some(\"test\")\n )\n )\n ),\n generate = Some(Seq(Seq(\"facetA\", \"facetB\"), Seq(\"facetC\")))\n )\n ),\n languages = Some(Languages(Seq(\"french\"))),\n exclude = Some(Seq(\"test\"))\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.updateConfig(\n indexName = \"\",\n configuration = Configuration(\n sourceIndices = Seq(\n SourceIndex(\n indexName = \"\",\n facets = Some(\n Seq(\n Facet(\n attribute = Some(\"test\")\n )\n )\n ),\n generate = Some(Seq(Seq(\"facetA\", \"facetB\"), Seq(\"facetC\")))\n )\n ),\n languages = Some(Languages(Seq(\"french\"))),\n exclude = Some(Seq(\"test\"))\n )\n)" }, "init": { "default": "val client = QuerySuggestionsClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\", region = \"YOUR_APP_ID_REGION\")" @@ -400,6 +427,9 @@ "getLogFile": { "default": "let response = try await client.getLogFile(indexName: \"\")" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "updateConfig": { "default": "let response = try await client.updateConfig(\n indexName: \"\",\n configuration: QuerySuggestionsConfiguration(\n sourceIndices: [SourceIndex(\n indexName: \"\",\n facets: [Facet(attribute: \"test\")],\n generate: [[\"facetA\", \"facetB\"], [\"facetC\"]]\n )],\n languages: QuerySuggestionsLanguages.arrayOfString([\"french\"]),\n exclude: [\"test\"]\n )\n)" }, diff --git a/snippets/guides/recommend-snippets.json b/snippets/guides/recommend-snippets.json index 34b70f28c5..6d8ef693fe 100644 --- a/snippets/guides/recommend-snippets.json +++ b/snippets/guides/recommend-snippets.json @@ -30,6 +30,9 @@ "searchRecommendRules": { "default": "var response = await client.SearchRecommendRulesAsync(\n \"\",\n Enum.Parse(\"RelatedProducts\")\n);" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "init": { "default": "var client = new RecommendClient(new RecommendConfig(\"YOUR_APP_ID\", \"YOUR_API_KEY\"));" } @@ -65,6 +68,9 @@ "searchRecommendRules": { "default": "final response = await client.searchRecommendRules(\n indexName: \"\",\n model: RecommendModels.fromJson(\"related-products\"),\n);" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey: \"updated-api-key\",\n);" + }, "init": { "default": "final client = RecommendClient(appId: 'YOUR_APP_ID', apiKey: 'YOUR_API_KEY');" } @@ -74,31 +80,34 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/recommend\"" }, "customDelete": { - "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteRecommendRule": { - "default": "response, err := client.DeleteRecommendRule(client.NewApiDeleteRecommendRuleRequest(\n \"\", recommend.RecommendModels(\"related-products\"), \"objectID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteRecommendRule(client.NewApiDeleteRecommendRuleRequest(\n \"\", recommend.RecommendModels(\"related-products\"), \"objectID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getRecommendRule": { - "default": "response, err := client.GetRecommendRule(client.NewApiGetRecommendRuleRequest(\n \"\", recommend.RecommendModels(\"related-products\"), \"objectID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetRecommendRule(client.NewApiGetRecommendRuleRequest(\n \"\", recommend.RecommendModels(\"related-products\"), \"objectID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getRecommendStatus": { - "default": "response, err := client.GetRecommendStatus(client.NewApiGetRecommendStatusRequest(\n \"\", recommend.RecommendModels(\"related-products\"), 12345,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetRecommendStatus(client.NewApiGetRecommendStatusRequest(\n \"\", recommend.RecommendModels(\"related-products\"), 12345,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getRecommendations": { - "default": "response, err := client.GetRecommendations(client.NewApiGetRecommendationsRequest(\n\n recommend.NewEmptyGetRecommendationsParams().SetRequests(\n []recommend.RecommendationsRequest{*recommend.RelatedQueryAsRecommendationsRequest(\n recommend.NewEmptyRelatedQuery().SetIndexName(\"\").SetObjectID(\"objectID\").SetModel(recommend.RelatedModel(\"related-products\")).SetThreshold(42.1))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetRecommendations(client.NewApiGetRecommendationsRequest(\n\n recommend.NewEmptyGetRecommendationsParams().SetRequests(\n []recommend.RecommendationsRequest{*recommend.RelatedQueryAsRecommendationsRequest(\n recommend.NewEmptyRelatedQuery().SetIndexName(\"\").SetObjectID(\"objectID\").SetModel(recommend.RelatedModel(\"related-products\")).SetThreshold(42.1))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchRecommendRules": { - "default": "response, err := client.SearchRecommendRules(client.NewApiSearchRecommendRulesRequest(\n \"\", recommend.RecommendModels(\"related-products\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SearchRecommendRules(client.NewApiSearchRecommendRulesRequest(\n \"\", recommend.RecommendModels(\"related-products\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "init": { "default": "client, err := recommend.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -135,6 +144,9 @@ "searchRecommendRules": { "default": "client.searchRecommendRules(\"\", RecommendModels.RELATED_PRODUCTS);" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "init": { "default": "RecommendClient client = new RecommendClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\");" } @@ -144,31 +156,34 @@ "default": "import { recommendClient } from '@algolia/recommend';" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "deleteRecommendRule": { - "default": "const response = await client.deleteRecommendRule({\n indexName: 'indexName',\n model: 'related-products',\n objectID: 'objectID',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteRecommendRule({\n indexName: 'indexName',\n model: 'related-products',\n objectID: 'objectID',\n});" }, "getRecommendRule": { - "default": "const response = await client.getRecommendRule({\n indexName: 'indexName',\n model: 'related-products',\n objectID: 'objectID',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getRecommendRule({\n indexName: 'indexName',\n model: 'related-products',\n objectID: 'objectID',\n});" }, "getRecommendStatus": { - "default": "const response = await client.getRecommendStatus({\n indexName: 'indexName',\n model: 'related-products',\n taskID: 12345,\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getRecommendStatus({\n indexName: 'indexName',\n model: 'related-products',\n taskID: 12345,\n});" }, "getRecommendations": { - "default": "const response = await client.getRecommendations({\n requests: [{ indexName: 'indexName', objectID: 'objectID', model: 'related-products', threshold: 42.1 }],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getRecommendations({\n requests: [{ indexName: 'indexName', objectID: 'objectID', model: 'related-products', threshold: 42.1 }],\n});" }, "searchRecommendRules": { - "default": "const response = await client.searchRecommendRules({ indexName: 'indexName', model: 'related-products' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchRecommendRules({ indexName: 'indexName', model: 'related-products' });" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "init": { "default": "const client = recommendClient('YOUR_APP_ID', 'YOUR_API_KEY');" @@ -179,31 +194,34 @@ "default": "import com.algolia.client.api.RecommendClient" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "deleteRecommendRule": { - "default": "var response = client.deleteRecommendRule(\n indexName = \"\",\n model = RecommendModels.entries.first { it.value == \"related-products\" },\n objectID = \"objectID\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteRecommendRule(\n indexName = \"\",\n model = RecommendModels.entries.first { it.value == \"related-products\" },\n objectID = \"objectID\",\n)" }, "getRecommendRule": { - "default": "var response = client.getRecommendRule(\n indexName = \"\",\n model = RecommendModels.entries.first { it.value == \"related-products\" },\n objectID = \"objectID\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getRecommendRule(\n indexName = \"\",\n model = RecommendModels.entries.first { it.value == \"related-products\" },\n objectID = \"objectID\",\n)" }, "getRecommendStatus": { - "default": "var response = client.getRecommendStatus(\n indexName = \"\",\n model = RecommendModels.entries.first { it.value == \"related-products\" },\n taskID = 12345L,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getRecommendStatus(\n indexName = \"\",\n model = RecommendModels.entries.first { it.value == \"related-products\" },\n taskID = 12345L,\n)" }, "getRecommendations": { - "default": "var response = client.getRecommendations(\n getRecommendationsParams = GetRecommendationsParams(\n requests = listOf(\n RelatedQuery(\n indexName = \"\",\n objectID = \"objectID\",\n model = RelatedModel.entries.first { it.value == \"related-products\" },\n threshold = 42.1,\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getRecommendations(\n getRecommendationsParams = GetRecommendationsParams(\n requests = listOf(\n RelatedQuery(\n indexName = \"\",\n objectID = \"objectID\",\n model = RelatedModel.entries.first { it.value == \"related-products\" },\n threshold = 42.1,\n ),\n ),\n ),\n)" }, "searchRecommendRules": { - "default": "var response = client.searchRecommendRules(\n indexName = \"\",\n model = RecommendModels.entries.first { it.value == \"related-products\" },\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchRecommendRules(\n indexName = \"\",\n model = RecommendModels.entries.first { it.value == \"related-products\" },\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "init": { "default": "val client = RecommendClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\")" @@ -214,31 +232,34 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\RecommendClient;" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "deleteRecommendRule": { - "default": "$response = $client->deleteRecommendRule(\n '',\n 'related-products',\n 'objectID',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteRecommendRule(\n '',\n 'related-products',\n 'objectID',\n);" }, "getRecommendRule": { - "default": "$response = $client->getRecommendRule(\n '',\n 'related-products',\n 'objectID',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getRecommendRule(\n '',\n 'related-products',\n 'objectID',\n);" }, "getRecommendStatus": { - "default": "$response = $client->getRecommendStatus(\n '',\n 'related-products',\n 12345,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getRecommendStatus(\n '',\n 'related-products',\n 12345,\n);" }, "getRecommendations": { - "default": "$response = $client->getRecommendations(\n ['requests' => [\n ['indexName' => '',\n 'objectID' => 'objectID',\n 'model' => 'related-products',\n 'threshold' => 42.1,\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getRecommendations(\n ['requests' => [\n ['indexName' => '',\n 'objectID' => 'objectID',\n 'model' => 'related-products',\n 'threshold' => 42.1,\n ],\n ],\n ],\n);" }, "searchRecommendRules": { - "default": "$response = $client->searchRecommendRules(\n '',\n 'related-products',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchRecommendRules(\n '',\n 'related-products',\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "init": { "default": "$client = RecommendClient::create('', '');" @@ -249,31 +270,34 @@ "default": "from algoliasearch.recommend.client import RecommendClient" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "deleteRecommendRule": { - "default": "response = await _client.delete_recommend_rule(\n index_name=\"\",\n model=\"related-products\",\n object_id=\"objectID\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_recommend_rule(\n index_name=\"\",\n model=\"related-products\",\n object_id=\"objectID\",\n)" }, "getRecommendRule": { - "default": "response = await _client.get_recommend_rule(\n index_name=\"\",\n model=\"related-products\",\n object_id=\"objectID\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_recommend_rule(\n index_name=\"\",\n model=\"related-products\",\n object_id=\"objectID\",\n)" }, "getRecommendStatus": { - "default": "response = await _client.get_recommend_status(\n index_name=\"\",\n model=\"related-products\",\n task_id=12345,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_recommend_status(\n index_name=\"\",\n model=\"related-products\",\n task_id=12345,\n)" }, "getRecommendations": { - "default": "response = await _client.get_recommendations(\n get_recommendations_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"objectID\": \"objectID\",\n \"model\": \"related-products\",\n \"threshold\": 42.1,\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_recommendations(\n get_recommendations_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"objectID\": \"objectID\",\n \"model\": \"related-products\",\n \"threshold\": 42.1,\n },\n ],\n },\n)" }, "searchRecommendRules": { - "default": "response = await _client.search_recommend_rules(\n index_name=\"\",\n model=\"related-products\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_recommend_rules(\n index_name=\"\",\n model=\"related-products\",\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "init": { "default": "_client = RecommendClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -284,31 +308,34 @@ "default": "require \"algolia\"" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "deleteRecommendRule": { - "default": "response = client.delete_recommend_rule(\"\", \"related-products\", \"objectID\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_recommend_rule(\"\", \"related-products\", \"objectID\")" }, "getRecommendRule": { - "default": "response = client.get_recommend_rule(\"\", \"related-products\", \"objectID\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_recommend_rule(\"\", \"related-products\", \"objectID\")" }, "getRecommendStatus": { - "default": "response = client.get_recommend_status(\"\", \"related-products\", 12345)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_recommend_status(\"\", \"related-products\", 12345)" }, "getRecommendations": { - "default": "response = client.get_recommendations(\n GetRecommendationsParams.new(\n requests: [\n RelatedQuery.new(\n index_name: \"\",\n object_id: \"objectID\",\n model: \"related-products\",\n threshold: 42.1\n )\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_recommendations(\n GetRecommendationsParams.new(\n requests: [\n RelatedQuery.new(\n index_name: \"\",\n object_id: \"objectID\",\n model: \"related-products\",\n threshold: 42.1\n )\n ]\n )\n)" }, "searchRecommendRules": { - "default": "response = client.search_recommend_rules(\"\", \"related-products\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_recommend_rules(\"\", \"related-products\")" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "init": { "default": "client = Algolia::RecommendClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -319,31 +346,31 @@ "default": "import algoliasearch.api.RecommendClient" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "deleteRecommendRule": { - "default": "val response = client.deleteRecommendRule(\n indexName = \"\",\n model = RecommendModels.withName(\"related-products\"),\n objectID = \"objectID\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteRecommendRule(\n indexName = \"\",\n model = RecommendModels.withName(\"related-products\"),\n objectID = \"objectID\"\n)" }, "getRecommendRule": { - "default": "val response = client.getRecommendRule(\n indexName = \"\",\n model = RecommendModels.withName(\"related-products\"),\n objectID = \"objectID\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getRecommendRule(\n indexName = \"\",\n model = RecommendModels.withName(\"related-products\"),\n objectID = \"objectID\"\n)" }, "getRecommendStatus": { - "default": "val response = client.getRecommendStatus(\n indexName = \"\",\n model = RecommendModels.withName(\"related-products\"),\n taskID = 12345L\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getRecommendStatus(\n indexName = \"\",\n model = RecommendModels.withName(\"related-products\"),\n taskID = 12345L\n)" }, "getRecommendations": { - "default": "val response = client.getRecommendations(\n getRecommendationsParams = GetRecommendationsParams(\n requests = Seq(\n RelatedQuery(\n indexName = \"\",\n objectID = \"objectID\",\n model = RelatedModel.withName(\"related-products\"),\n threshold = 42.1\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getRecommendations(\n getRecommendationsParams = GetRecommendationsParams(\n requests = Seq(\n RelatedQuery(\n indexName = \"\",\n objectID = \"objectID\",\n model = RelatedModel.withName(\"related-products\"),\n threshold = 42.1\n )\n )\n )\n)" }, "searchRecommendRules": { - "default": "val response = client.searchRecommendRules(\n indexName = \"\",\n model = RecommendModels.withName(\"related-products\")\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchRecommendRules(\n indexName = \"\",\n model = RecommendModels.withName(\"related-products\")\n)" }, "init": { "default": "val client = RecommendClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\")" @@ -380,6 +407,9 @@ "searchRecommendRules": { "default": "let response = try await client.searchRecommendRules(\n indexName: \"\",\n model: RecommendModels.relatedProducts\n)" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "init": { "default": "let client = try RecommendClient(appID: \"YOUR_APP_ID\", apiKey: \"YOUR_API_KEY\")" } diff --git a/snippets/guides/search-snippets.json b/snippets/guides/search-snippets.json index 856c5383b2..29cfaa207d 100644 --- a/snippets/guides/search-snippets.json +++ b/snippets/guides/search-snippets.json @@ -218,6 +218,9 @@ "searchUserIds": { "default": "var response = await client.SearchUserIdsAsync(\n new SearchUserIdsParams\n {\n Query = \"test\",\n ClusterName = \"theClusterName\",\n Page = 5,\n HitsPerPage = 10,\n }\n);" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "setDictionarySettings": { "default": "var response = await client.SetDictionarySettingsAsync(\n new DictionarySettingsParams\n {\n DisableStandardEntries = new StandardEntries\n {\n Plurals = new Dictionary\n {\n { \"fr\", false },\n { \"en\", false },\n { \"ru\", true }\n },\n },\n }\n);" }, @@ -324,8 +327,8 @@ "default": "final response = await client.deleteSynonym(\n indexName: \"\",\n objectID: \"id1\",\n);" }, "generateSecuredApiKey": { - "generate secured api key basic": "final response = await client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n validUntil: 2524604400,\n restrictIndices: [\n \"Movies\",\n ],\n ),\n);", - "generate secured api key with searchParams": "final response = await client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n validUntil: 2524604400,\n restrictIndices: [\n \"Movies\",\n \"cts_e2e_settings\",\n ],\n restrictSources: \"192.168.1.0/24\",\n filters: \"category:Book OR category:Ebook AND _tags:published\",\n userToken: \"user123\",\n searchParams: SearchParamsObject(\n query: \"batman\",\n typoTolerance: TypoToleranceEnum.fromJson(\"strict\"),\n aroundRadius: AroundRadiusAll.fromJson(\"all\"),\n mode: Mode.fromJson(\"neuralSearch\"),\n hitsPerPage: 10,\n optionalWords: [\n \"one\",\n \"two\",\n ],\n ),\n ),\n);" + "generate secured api key basic": "final response = client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n validUntil: 2524604400,\n restrictIndices: [\n \"Movies\",\n ],\n ),\n);", + "generate secured api key with searchParams": "final response = client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n validUntil: 2524604400,\n restrictIndices: [\n \"Movies\",\n \"cts_e2e_settings\",\n ],\n restrictSources: \"192.168.1.0/24\",\n filters: \"category:Book OR category:Ebook AND _tags:published\",\n userToken: \"user123\",\n searchParams: SearchParamsObject(\n query: \"batman\",\n typoTolerance: TypoToleranceEnum.fromJson(\"strict\"),\n aroundRadius: AroundRadiusAll.fromJson(\"all\"),\n mode: Mode.fromJson(\"neuralSearch\"),\n hitsPerPage: 10,\n optionalWords: [\n \"one\",\n \"two\",\n ],\n ),\n ),\n);" }, "getApiKey": { "default": "final response = await client.getApiKey(\n key: \"myTestApiKey\",\n);" @@ -461,6 +464,9 @@ "searchUserIds": { "default": "final response = await client.searchUserIds(\n searchUserIdsParams: SearchUserIdsParams(\n query: \"test\",\n clusterName: \"theClusterName\",\n page: 5,\n hitsPerPage: 10,\n ),\n);" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey: \"updated-api-key\",\n);" + }, "setDictionarySettings": { "default": "final response = await client.setDictionarySettings(\n dictionarySettingsParams: DictionarySettingsParams(\n disableStandardEntries: StandardEntries(\n plurals: {\n 'fr': false,\n 'en': false,\n 'ru': true,\n },\n ),\n ),\n);" }, @@ -490,239 +496,242 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/search\"" }, "addApiKey": { - "default": "response, err := client.AddApiKey(client.NewApiAddApiKeyRequest(\n\n search.NewEmptyApiKey().SetAcl(\n []search.Acl{search.Acl(\"search\"), search.Acl(\"addObject\")}).SetDescription(\"my new api key\").SetValidity(300).SetMaxQueriesPerIPPerHour(100).SetMaxHitsPerQuery(20),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.AddApiKey(client.NewApiAddApiKeyRequest(\n\n search.NewEmptyApiKey().SetAcl(\n []search.Acl{search.Acl(\"search\"), search.Acl(\"addObject\")}).SetDescription(\"my new api key\").SetValidity(300).SetMaxQueriesPerIPPerHour(100).SetMaxHitsPerQuery(20),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "addOrUpdateObject": { - "default": "response, err := client.AddOrUpdateObject(client.NewApiAddOrUpdateObjectRequest(\n \"\", \"uniqueID\", map[string]any{\"key\": \"value\"},\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.AddOrUpdateObject(client.NewApiAddOrUpdateObjectRequest(\n \"\", \"uniqueID\", map[string]any{\"key\": \"value\"},\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "appendSource": { - "default": "response, err := client.AppendSource(client.NewApiAppendSourceRequest(\n\n search.NewEmptySource().SetSource(\"theSource\").SetDescription(\"theDescription\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.AppendSource(client.NewApiAppendSourceRequest(\n\n search.NewEmptySource().SetSource(\"theSource\").SetDescription(\"theDescription\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "assignUserId": { - "default": "response, err := client.AssignUserId(client.NewApiAssignUserIdRequest(\n \"userID\",\n search.NewEmptyAssignUserIdParams().SetCluster(\"theCluster\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.AssignUserId(client.NewApiAssignUserIdRequest(\n \"userID\",\n search.NewEmptyAssignUserIdParams().SetCluster(\"theCluster\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "batch": { - "addObject": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"addObject\")).SetBody(map[string]any{\"key\": \"bar\", \"foo\": \"1\"}), *search.NewEmptyBatchRequest().SetAction(search.Action(\"addObject\")).SetBody(map[string]any{\"key\": \"baz\", \"foo\": \"2\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "clear": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"clear\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "delete": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"delete\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "deleteObject": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"deleteObject\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "partialUpdateObject": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"partialUpdateObject\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "partialUpdateObjectNoCreate": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"partialUpdateObjectNoCreate\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "updateObject": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"updateObject\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "addObject": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"addObject\")).SetBody(map[string]any{\"key\": \"bar\", \"foo\": \"1\"}), *search.NewEmptyBatchRequest().SetAction(search.Action(\"addObject\")).SetBody(map[string]any{\"key\": \"baz\", \"foo\": \"2\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "clear": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"clear\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "delete": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"delete\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "deleteObject": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"deleteObject\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "partialUpdateObject": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"partialUpdateObject\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "partialUpdateObjectNoCreate": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"partialUpdateObjectNoCreate\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "updateObject": "response, err := client.Batch(client.NewApiBatchRequest(\n \"\",\n search.NewEmptyBatchWriteParams().SetRequests(\n []search.BatchRequest{*search.NewEmptyBatchRequest().SetAction(search.Action(\"updateObject\")).SetBody(map[string]any{\"key\": \"value\"})}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "batchAssignUserIds": { - "default": "response, err := client.BatchAssignUserIds(client.NewApiBatchAssignUserIdsRequest(\n \"userID\",\n search.NewEmptyBatchAssignUserIdsParams().SetCluster(\"theCluster\").SetUsers(\n []string{\"user1\", \"user2\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.BatchAssignUserIds(client.NewApiBatchAssignUserIdsRequest(\n \"userID\",\n search.NewEmptyBatchAssignUserIdsParams().SetCluster(\"theCluster\").SetUsers(\n []string{\"user1\", \"user2\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "batchDictionaryEntries": { - "replace": "response, err := client.BatchDictionaryEntries(client.NewApiBatchDictionaryEntriesRequest(\n search.DictionaryType(\"plurals\"),\n search.NewEmptyBatchDictionaryEntriesParams().SetClearExistingDictionaryEntries(true).SetRequests(\n []search.BatchDictionaryEntriesRequest{*search.NewEmptyBatchDictionaryEntriesRequest().SetAction(search.DictionaryAction(\"addEntry\")).SetBody(\n search.NewEmptyDictionaryEntry().SetObjectID(\"1\").SetLanguage(search.SupportedLanguage(\"en\")).SetWord(\"fancy\").SetWords(\n []string{\"believe\", \"algolia\"}).SetDecomposition(\n []string{\"trust\", \"algolia\"}).SetState(search.DictionaryEntryState(\"enabled\")))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "delete": "response, err := client.BatchDictionaryEntries(client.NewApiBatchDictionaryEntriesRequest(\n search.DictionaryType(\"plurals\"),\n search.NewEmptyBatchDictionaryEntriesParams().SetClearExistingDictionaryEntries(true).SetRequests(\n []search.BatchDictionaryEntriesRequest{*search.NewEmptyBatchDictionaryEntriesRequest().SetAction(search.DictionaryAction(\"deleteEntry\")).SetBody(\n search.NewEmptyDictionaryEntry().SetObjectID(\"1\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "append": "response, err := client.BatchDictionaryEntries(client.NewApiBatchDictionaryEntriesRequest(\n search.DictionaryType(\"stopwords\"),\n search.NewEmptyBatchDictionaryEntriesParams().SetRequests(\n []search.BatchDictionaryEntriesRequest{*search.NewEmptyBatchDictionaryEntriesRequest().SetAction(search.DictionaryAction(\"addEntry\")).SetBody(\n search.NewEmptyDictionaryEntry().SetObjectID(\"1\").SetLanguage(search.SupportedLanguage(\"en\")).SetAdditionalProperty(\"additional\", \"try me\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "replace": "response, err := client.BatchDictionaryEntries(client.NewApiBatchDictionaryEntriesRequest(\n search.DictionaryType(\"plurals\"),\n search.NewEmptyBatchDictionaryEntriesParams().SetClearExistingDictionaryEntries(true).SetRequests(\n []search.BatchDictionaryEntriesRequest{*search.NewEmptyBatchDictionaryEntriesRequest().SetAction(search.DictionaryAction(\"addEntry\")).SetBody(\n search.NewEmptyDictionaryEntry().SetObjectID(\"1\").SetLanguage(search.SupportedLanguage(\"en\")).SetWord(\"fancy\").SetWords(\n []string{\"believe\", \"algolia\"}).SetDecomposition(\n []string{\"trust\", \"algolia\"}).SetState(search.DictionaryEntryState(\"enabled\")))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "delete": "response, err := client.BatchDictionaryEntries(client.NewApiBatchDictionaryEntriesRequest(\n search.DictionaryType(\"plurals\"),\n search.NewEmptyBatchDictionaryEntriesParams().SetClearExistingDictionaryEntries(true).SetRequests(\n []search.BatchDictionaryEntriesRequest{*search.NewEmptyBatchDictionaryEntriesRequest().SetAction(search.DictionaryAction(\"deleteEntry\")).SetBody(\n search.NewEmptyDictionaryEntry().SetObjectID(\"1\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "append": "response, err := client.BatchDictionaryEntries(client.NewApiBatchDictionaryEntriesRequest(\n search.DictionaryType(\"stopwords\"),\n search.NewEmptyBatchDictionaryEntriesParams().SetRequests(\n []search.BatchDictionaryEntriesRequest{*search.NewEmptyBatchDictionaryEntriesRequest().SetAction(search.DictionaryAction(\"addEntry\")).SetBody(\n search.NewEmptyDictionaryEntry().SetObjectID(\"1\").SetLanguage(search.SupportedLanguage(\"en\")).SetAdditionalProperty(\"additional\", \"try me\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "browse": { - "default": "response, err := client.Browse(client.NewApiBrowseRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.Browse(client.NewApiBrowseRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "clearObjects": { - "default": "response, err := client.ClearObjects(client.NewApiClearObjectsRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ClearObjects(client.NewApiClearObjectsRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "clearRules": { - "default": "response, err := client.ClearRules(client.NewApiClearRulesRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ClearRules(client.NewApiClearRulesRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "clearSynonyms": { - "default": "response, err := client.ClearSynonyms(client.NewApiClearSynonymsRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ClearSynonyms(client.NewApiClearSynonymsRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customDelete": { - "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteApiKey": { - "default": "response, err := client.DeleteApiKey(client.NewApiDeleteApiKeyRequest(\n \"myTestApiKey\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteApiKey(client.NewApiDeleteApiKeyRequest(\n \"myTestApiKey\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteBy": { - "default": "response, err := client.DeleteBy(client.NewApiDeleteByRequest(\n \"\",\n search.NewEmptyDeleteByParams().SetFilters(\"brand:brandName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteBy(client.NewApiDeleteByRequest(\n \"\",\n search.NewEmptyDeleteByParams().SetFilters(\"brand:brandName\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteIndex": { - "default": "response, err := client.DeleteIndex(client.NewApiDeleteIndexRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteIndex(client.NewApiDeleteIndexRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteObject": { - "default": "response, err := client.DeleteObject(client.NewApiDeleteObjectRequest(\n \"\", \"uniqueID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteObject(client.NewApiDeleteObjectRequest(\n \"\", \"uniqueID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteObjects": { - "default": "response, err := client.DeleteObjects(\n \"\",\n []string{\"1\", \"2\"},\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteObjects(\n \"\",\n []string{\"1\", \"2\"},\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteRule": { - "default": "response, err := client.DeleteRule(client.NewApiDeleteRuleRequest(\n \"\", \"id1\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteRule(client.NewApiDeleteRuleRequest(\n \"\", \"id1\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteSource": { - "default": "response, err := client.DeleteSource(client.NewApiDeleteSourceRequest(\n \"theSource\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteSource(client.NewApiDeleteSourceRequest(\n \"theSource\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "deleteSynonym": { - "default": "response, err := client.DeleteSynonym(client.NewApiDeleteSynonymRequest(\n \"\", \"id1\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.DeleteSynonym(client.NewApiDeleteSynonymRequest(\n \"\", \"id1\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "generateSecuredApiKey": { - "generate secured api key basic": "response, err := client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices(\n []string{\"Movies\"}),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "generate secured api key with searchParams": "response, err := client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices(\n []string{\"Movies\", \"cts_e2e_settings\"}).SetRestrictSources(\"192.168.1.0/24\").SetFilters(\"category:Book OR category:Ebook AND _tags:published\").SetUserToken(\"user123\").SetSearchParams(\n search.NewEmptySearchParamsObject().SetQuery(\"batman\").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum(\"strict\"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll(\"all\"))).SetMode(search.Mode(\"neuralSearch\")).SetHitsPerPage(10).SetOptionalWords(\n []string{\"one\", \"two\"})),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "generate secured api key basic": "response, err := client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices(\n []string{\"Movies\"}),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "generate secured api key with searchParams": "response, err := client.GenerateSecuredApiKey(\n \"2640659426d5107b6e47d75db9cbaef8\",\n search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices(\n []string{\"Movies\", \"cts_e2e_settings\"}).SetRestrictSources(\"192.168.1.0/24\").SetFilters(\"category:Book OR category:Ebook AND _tags:published\").SetUserToken(\"user123\").SetSearchParams(\n search.NewEmptySearchParamsObject().SetQuery(\"batman\").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum(\"strict\"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll(\"all\"))).SetMode(search.Mode(\"neuralSearch\")).SetHitsPerPage(10).SetOptionalWords(\n []string{\"one\", \"two\"})),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getApiKey": { - "default": "response, err := client.GetApiKey(client.NewApiGetApiKeyRequest(\n \"myTestApiKey\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetApiKey(client.NewApiGetApiKeyRequest(\n \"myTestApiKey\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getAppTask": { - "default": "response, err := client.GetAppTask(client.NewApiGetAppTaskRequest(\n 123,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetAppTask(client.NewApiGetAppTaskRequest(\n 123,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getDictionaryLanguages": { - "default": "response, err := client.GetDictionaryLanguages()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetDictionaryLanguages()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getDictionarySettings": { - "default": "response, err := client.GetDictionarySettings()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetDictionarySettings()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getLogs": { - "default": "response, err := client.GetLogs(client.NewApiGetLogsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetLogs(client.NewApiGetLogsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getObject": { - "default": "response, err := client.GetObject(client.NewApiGetObjectRequest(\n \"\", \"uniqueID\",\n).WithAttributesToRetrieve(\n []string{\"attr1\", \"attr2\"}))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetObject(client.NewApiGetObjectRequest(\n \"\", \"uniqueID\",\n).WithAttributesToRetrieve(\n []string{\"attr1\", \"attr2\"}))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getObjects": { - "default": "response, err := client.GetObjects(client.NewApiGetObjectsRequest(\n\n search.NewEmptyGetObjectsParams().SetRequests(\n []search.GetObjectsRequest{*search.NewEmptyGetObjectsRequest().SetAttributesToRetrieve(\n []string{\"attr1\", \"attr2\"}).SetObjectID(\"uniqueID\").SetIndexName(\"\")}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetObjects(client.NewApiGetObjectsRequest(\n\n search.NewEmptyGetObjectsParams().SetRequests(\n []search.GetObjectsRequest{*search.NewEmptyGetObjectsRequest().SetAttributesToRetrieve(\n []string{\"attr1\", \"attr2\"}).SetObjectID(\"uniqueID\").SetIndexName(\"\")}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getRule": { - "default": "response, err := client.GetRule(client.NewApiGetRuleRequest(\n \"\", \"qr-1725004648916\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetRule(client.NewApiGetRuleRequest(\n \"\", \"qr-1725004648916\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getSettings": { - "default": "response, err := client.GetSettings(client.NewApiGetSettingsRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetSettings(client.NewApiGetSettingsRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getSources": { - "default": "response, err := client.GetSources()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetSources()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getSynonym": { - "default": "response, err := client.GetSynonym(client.NewApiGetSynonymRequest(\n \"\", \"id1\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetSynonym(client.NewApiGetSynonymRequest(\n \"\", \"id1\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTask": { - "default": "response, err := client.GetTask(client.NewApiGetTaskRequest(\n \"\", 123,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetTask(client.NewApiGetTaskRequest(\n \"\", 123,\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getTopUserIds": { - "default": "response, err := client.GetTopUserIds()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetTopUserIds()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getUserId": { - "default": "response, err := client.GetUserId(client.NewApiGetUserIdRequest(\n \"uniqueID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetUserId(client.NewApiGetUserIdRequest(\n \"uniqueID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "hasPendingMappings": { - "default": "response, err := client.HasPendingMappings(client.NewApiHasPendingMappingsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.HasPendingMappings(client.NewApiHasPendingMappingsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "indexExists": { - "indexExists": "response, err := client.IndexExists(\n \"\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "indexNotExists": "response, err := client.IndexExists(\n \"\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "indexExistsWithError": "response, err := client.IndexExists(\n \"\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "indexExists": "response, err := client.IndexExists(\n \"\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "indexNotExists": "response, err := client.IndexExists(\n \"\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "indexExistsWithError": "response, err := client.IndexExists(\n \"\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listApiKeys": { - "default": "response, err := client.ListApiKeys()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ListApiKeys()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listClusters": { - "default": "response, err := client.ListClusters()\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ListClusters()\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listIndices": { - "default": "response, err := client.ListIndices(client.NewApiListIndicesRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ListIndices(client.NewApiListIndicesRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "listUserIds": { - "default": "response, err := client.ListUserIds(client.NewApiListUserIdsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ListUserIds(client.NewApiListUserIdsRequest())\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "multipleBatch": { - "default": "response, err := client.MultipleBatch(client.NewApiMultipleBatchRequest(\n\n search.NewEmptyBatchParams().SetRequests(\n []search.MultipleBatchRequest{*search.NewEmptyMultipleBatchRequest().SetAction(search.Action(\"addObject\")).SetBody(map[string]any{\"key\": \"value\"}).SetIndexName(\"\")}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.MultipleBatch(client.NewApiMultipleBatchRequest(\n\n search.NewEmptyBatchParams().SetRequests(\n []search.MultipleBatchRequest{*search.NewEmptyMultipleBatchRequest().SetAction(search.Action(\"addObject\")).SetBody(map[string]any{\"key\": \"value\"}).SetIndexName(\"\")}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "operationIndex": { - "scopes": "response, err := client.OperationIndex(client.NewApiOperationIndexRequest(\n \"\",\n search.NewEmptyOperationIndexParams().SetOperation(search.OperationType(\"move\")).SetDestination(\"\").SetScope(\n []search.ScopeType{search.ScopeType(\"rules\"), search.ScopeType(\"settings\")}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "copy": "response, err := client.OperationIndex(client.NewApiOperationIndexRequest(\n \"\",\n search.NewEmptyOperationIndexParams().SetOperation(search.OperationType(\"copy\")).SetDestination(\"\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "move": "response, err := client.OperationIndex(client.NewApiOperationIndexRequest(\n \"\",\n search.NewEmptyOperationIndexParams().SetOperation(search.OperationType(\"move\")).SetDestination(\"\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "scopes": "response, err := client.OperationIndex(client.NewApiOperationIndexRequest(\n \"\",\n search.NewEmptyOperationIndexParams().SetOperation(search.OperationType(\"move\")).SetDestination(\"\").SetScope(\n []search.ScopeType{search.ScopeType(\"rules\"), search.ScopeType(\"settings\")}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "copy": "response, err := client.OperationIndex(client.NewApiOperationIndexRequest(\n \"\",\n search.NewEmptyOperationIndexParams().SetOperation(search.OperationType(\"copy\")).SetDestination(\"\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "move": "response, err := client.OperationIndex(client.NewApiOperationIndexRequest(\n \"\",\n search.NewEmptyOperationIndexParams().SetOperation(search.OperationType(\"move\")).SetDestination(\"\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "partialUpdateObject": { - "default": "response, err := client.PartialUpdateObject(client.NewApiPartialUpdateObjectRequest(\n \"\", \"uniqueID\", map[string]any{\"attributeId\": \"new value\"},\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.PartialUpdateObject(client.NewApiPartialUpdateObjectRequest(\n \"\", \"uniqueID\", map[string]any{\"attributeId\": \"new value\"},\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "partialUpdateObjects": { - "call partialUpdateObjects with createIfNotExists=true": "response, err := client.PartialUpdateObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"1\", \"name\": \"Adam\"}, map[string]any{\"objectID\": \"2\", \"name\": \"Benoit\"}},\n search.WithCreateIfNotExists(true))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "call partialUpdateObjects with createIfNotExists=false": "response, err := client.PartialUpdateObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"3\", \"name\": \"Cyril\"}, map[string]any{\"objectID\": \"4\", \"name\": \"David\"}},\n search.WithCreateIfNotExists(false))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "call partialUpdateObjects with createIfNotExists=true": "response, err := client.PartialUpdateObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"1\", \"name\": \"Adam\"}, map[string]any{\"objectID\": \"2\", \"name\": \"Benoit\"}},\n search.WithCreateIfNotExists(true))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "call partialUpdateObjects with createIfNotExists=false": "response, err := client.PartialUpdateObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"3\", \"name\": \"Cyril\"}, map[string]any{\"objectID\": \"4\", \"name\": \"David\"}},\n search.WithCreateIfNotExists(false))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "removeUserId": { - "default": "response, err := client.RemoveUserId(client.NewApiRemoveUserIdRequest(\n \"uniqueID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.RemoveUserId(client.NewApiRemoveUserIdRequest(\n \"uniqueID\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "replaceAllObjects": { - "default": "response, err := client.ReplaceAllObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"1\", \"name\": \"Adam\"}, map[string]any{\"objectID\": \"2\", \"name\": \"Benoit\"}, map[string]any{\"objectID\": \"3\", \"name\": \"Cyril\"}, map[string]any{\"objectID\": \"4\", \"name\": \"David\"}, map[string]any{\"objectID\": \"5\", \"name\": \"Eva\"}, map[string]any{\"objectID\": \"6\", \"name\": \"Fiona\"}, map[string]any{\"objectID\": \"7\", \"name\": \"Gael\"}, map[string]any{\"objectID\": \"8\", \"name\": \"Hugo\"}, map[string]any{\"objectID\": \"9\", \"name\": \"Igor\"}, map[string]any{\"objectID\": \"10\", \"name\": \"Julia\"}},\n search.WithBatchSize(3))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ReplaceAllObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"1\", \"name\": \"Adam\"}, map[string]any{\"objectID\": \"2\", \"name\": \"Benoit\"}, map[string]any{\"objectID\": \"3\", \"name\": \"Cyril\"}, map[string]any{\"objectID\": \"4\", \"name\": \"David\"}, map[string]any{\"objectID\": \"5\", \"name\": \"Eva\"}, map[string]any{\"objectID\": \"6\", \"name\": \"Fiona\"}, map[string]any{\"objectID\": \"7\", \"name\": \"Gael\"}, map[string]any{\"objectID\": \"8\", \"name\": \"Hugo\"}, map[string]any{\"objectID\": \"9\", \"name\": \"Igor\"}, map[string]any{\"objectID\": \"10\", \"name\": \"Julia\"}},\n search.WithBatchSize(3))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "replaceSources": { - "default": "response, err := client.ReplaceSources(client.NewApiReplaceSourcesRequest(\n\n []search.Source{*search.NewEmptySource().SetSource(\"theSource\").SetDescription(\"theDescription\")},\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.ReplaceSources(client.NewApiReplaceSourcesRequest(\n\n []search.Source{*search.NewEmptySource().SetSource(\"theSource\").SetDescription(\"theDescription\")},\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "restoreApiKey": { - "default": "response, err := client.RestoreApiKey(client.NewApiRestoreApiKeyRequest(\n \"myApiKey\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.RestoreApiKey(client.NewApiRestoreApiKeyRequest(\n \"myApiKey\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "saveObject": { - "default": "response, err := client.SaveObject(client.NewApiSaveObjectRequest(\n \"\", map[string]any{\"objectID\": \"id\", \"test\": \"val\"},\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SaveObject(client.NewApiSaveObjectRequest(\n \"\", map[string]any{\"objectID\": \"id\", \"test\": \"val\"},\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "saveObjects": { - "call saveObjects without error": "response, err := client.SaveObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"1\", \"name\": \"Adam\"}, map[string]any{\"objectID\": \"2\", \"name\": \"Benoit\"}},\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "saveObjects should report errors": "response, err := client.SaveObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"1\", \"name\": \"Adam\"}, map[string]any{\"objectID\": \"2\", \"name\": \"Benoit\"}},\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "call saveObjects without error": "response, err := client.SaveObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"1\", \"name\": \"Adam\"}, map[string]any{\"objectID\": \"2\", \"name\": \"Benoit\"}},\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "saveObjects should report errors": "response, err := client.SaveObjects(\n \"\",\n []map[string]any{map[string]any{\"objectID\": \"1\", \"name\": \"Adam\"}, map[string]any{\"objectID\": \"2\", \"name\": \"Benoit\"}},\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "saveRule": { - "default": "response, err := client.SaveRule(client.NewApiSaveRuleRequest(\n \"\", \"id1\",\n search.NewEmptyRule().SetObjectID(\"id1\").SetConditions(\n []search.Condition{*search.NewEmptyCondition().SetPattern(\"apple\").SetAnchoring(search.Anchoring(\"contains\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SaveRule(client.NewApiSaveRuleRequest(\n \"\", \"id1\",\n search.NewEmptyRule().SetObjectID(\"id1\").SetConditions(\n []search.Condition{*search.NewEmptyCondition().SetPattern(\"apple\").SetAnchoring(search.Anchoring(\"contains\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "saveRules": { - "default": "response, err := client.SaveRules(client.NewApiSaveRulesRequest(\n \"\",\n []search.Rule{*search.NewEmptyRule().SetObjectID(\"a-rule-id\").SetConditions(\n []search.Condition{*search.NewEmptyCondition().SetPattern(\"smartphone\").SetAnchoring(search.Anchoring(\"contains\"))}), *search.NewEmptyRule().SetObjectID(\"a-second-rule-id\").SetConditions(\n []search.Condition{*search.NewEmptyCondition().SetPattern(\"apple\").SetAnchoring(search.Anchoring(\"contains\"))})},\n).WithForwardToReplicas(false).WithClearExistingRules(true))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SaveRules(client.NewApiSaveRulesRequest(\n \"\",\n []search.Rule{*search.NewEmptyRule().SetObjectID(\"a-rule-id\").SetConditions(\n []search.Condition{*search.NewEmptyCondition().SetPattern(\"smartphone\").SetAnchoring(search.Anchoring(\"contains\"))}), *search.NewEmptyRule().SetObjectID(\"a-second-rule-id\").SetConditions(\n []search.Condition{*search.NewEmptyCondition().SetPattern(\"apple\").SetAnchoring(search.Anchoring(\"contains\"))})},\n).WithForwardToReplicas(false).WithClearExistingRules(true))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "saveSynonym": { - "default": "response, err := client.SaveSynonym(client.NewApiSaveSynonymRequest(\n \"\", \"id1\",\n search.NewEmptySynonymHit().SetObjectID(\"id1\").SetType(search.SynonymType(\"synonym\")).SetSynonyms(\n []string{\"car\", \"vehicule\", \"auto\"}),\n).WithForwardToReplicas(true))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SaveSynonym(client.NewApiSaveSynonymRequest(\n \"\", \"id1\",\n search.NewEmptySynonymHit().SetObjectID(\"id1\").SetType(search.SynonymType(\"synonym\")).SetSynonyms(\n []string{\"car\", \"vehicule\", \"auto\"}),\n).WithForwardToReplicas(true))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "saveSynonyms": { - "default": "response, err := client.SaveSynonyms(client.NewApiSaveSynonymsRequest(\n \"\",\n []search.SynonymHit{*search.NewEmptySynonymHit().SetObjectID(\"id1\").SetType(search.SynonymType(\"synonym\")).SetSynonyms(\n []string{\"car\", \"vehicule\", \"auto\"}), *search.NewEmptySynonymHit().SetObjectID(\"id2\").SetType(search.SynonymType(\"onewaysynonym\")).SetInput(\"iphone\").SetSynonyms(\n []string{\"ephone\", \"aphone\", \"yphone\"})},\n).WithForwardToReplicas(true).WithReplaceExistingSynonyms(true))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SaveSynonyms(client.NewApiSaveSynonymsRequest(\n \"\",\n []search.SynonymHit{*search.NewEmptySynonymHit().SetObjectID(\"id1\").SetType(search.SynonymType(\"synonym\")).SetSynonyms(\n []string{\"car\", \"vehicule\", \"auto\"}), *search.NewEmptySynonymHit().SetObjectID(\"id2\").SetType(search.SynonymType(\"onewaysynonym\")).SetInput(\"iphone\").SetSynonyms(\n []string{\"ephone\", \"aphone\", \"yphone\"})},\n).WithForwardToReplicas(true).WithReplaceExistingSynonyms(true))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "search": { - "withHitsPerPage": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetHitsPerPage(50))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "filterOnly": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFilters(\"actor:Scarlett Johansson\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "filterOr": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFilters(\"actor:Tom Cruise OR actor:Scarlett Johansson\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "filterNot": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFilters(\"NOT actor:Nicolas Cage\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "retrieveFacets": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFacets(\n []string{\"author\", \"genre\"}))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "retrieveFacetsWildcard": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFacets(\n []string{\"*\"}))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "withHitsPerPage": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetHitsPerPage(50))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "filterOnly": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFilters(\"actor:Scarlett Johansson\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "filterOr": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFilters(\"actor:Tom Cruise OR actor:Scarlett Johansson\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "filterNot": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFilters(\"NOT actor:Nicolas Cage\"))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "retrieveFacets": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFacets(\n []string{\"author\", \"genre\"}))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "retrieveFacetsWildcard": "response, err := client.Search(client.NewApiSearchRequest(\n\n search.NewEmptySearchMethodParams().SetRequests(\n []search.SearchQuery{*search.SearchForHitsAsSearchQuery(\n search.NewEmptySearchForHits().SetIndexName(\"\").SetQuery(\"\").SetFacets(\n []string{\"*\"}))}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchDictionaryEntries": { - "default": "response, err := client.SearchDictionaryEntries(client.NewApiSearchDictionaryEntriesRequest(\n search.DictionaryType(\"stopwords\"),\n search.NewEmptySearchDictionaryEntriesParams().SetQuery(\"about\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SearchDictionaryEntries(client.NewApiSearchDictionaryEntriesRequest(\n search.DictionaryType(\"stopwords\"),\n search.NewEmptySearchDictionaryEntriesParams().SetQuery(\"about\"),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchForFacetValues": { - "default": "response, err := client.SearchForFacetValues(client.NewApiSearchForFacetValuesRequest(\n \"\", \"facetName\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SearchForFacetValues(client.NewApiSearchForFacetValuesRequest(\n \"\", \"facetName\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchRules": { - "default": "response, err := client.SearchRules(client.NewApiSearchRulesRequest(\n \"\",\n).WithSearchRulesParams(\n search.NewEmptySearchRulesParams().SetQuery(\"zorro\")))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SearchRules(client.NewApiSearchRulesRequest(\n \"\",\n).WithSearchRulesParams(\n search.NewEmptySearchRulesParams().SetQuery(\"zorro\")))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchSingleIndex": { - "default": "response, err := client.SearchSingleIndex(client.NewApiSearchSingleIndexRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SearchSingleIndex(client.NewApiSearchSingleIndexRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchSynonyms": { - "default": "response, err := client.SearchSynonyms(client.NewApiSearchSynonymsRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SearchSynonyms(client.NewApiSearchSynonymsRequest(\n \"\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "searchUserIds": { - "default": "response, err := client.SearchUserIds(client.NewApiSearchUserIdsRequest(\n\n search.NewEmptySearchUserIdsParams().SetQuery(\"test\").SetClusterName(\"theClusterName\").SetPage(5).SetHitsPerPage(10),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SearchUserIds(client.NewApiSearchUserIdsRequest(\n\n search.NewEmptySearchUserIdsParams().SetQuery(\"test\").SetClusterName(\"theClusterName\").SetPage(5).SetHitsPerPage(10),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "setDictionarySettings": { - "default": "response, err := client.SetDictionarySettings(client.NewApiSetDictionarySettingsRequest(\n\n search.NewEmptyDictionarySettingsParams().SetDisableStandardEntries(\n search.NewEmptyStandardEntries().SetPlurals(map[string]bool{\"fr\": false, \"en\": false, \"ru\": true})),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SetDictionarySettings(client.NewApiSetDictionarySettingsRequest(\n\n search.NewEmptyDictionarySettingsParams().SetDisableStandardEntries(\n search.NewEmptyStandardEntries().SetPlurals(map[string]bool{\"fr\": false, \"en\": false, \"ru\": true})),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "setSettings": { - "default": "response, err := client.SetSettings(client.NewApiSetSettingsRequest(\n \"\",\n search.NewEmptyIndexSettings().SetAttributesForFaceting(\n []string{\"actor\", \"filterOnly(category)\", \"searchable(publisher)\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.SetSettings(client.NewApiSetSettingsRequest(\n \"\",\n search.NewEmptyIndexSettings().SetAttributesForFaceting(\n []string{\"actor\", \"filterOnly(category)\", \"searchable(publisher)\"}),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "updateApiKey": { - "default": "response, err := client.UpdateApiKey(client.NewApiUpdateApiKeyRequest(\n \"myApiKey\",\n search.NewEmptyApiKey().SetAcl(\n []search.Acl{search.Acl(\"search\"), search.Acl(\"addObject\")}).SetValidity(300).SetMaxQueriesPerIPPerHour(100).SetMaxHitsPerQuery(20),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.UpdateApiKey(client.NewApiUpdateApiKeyRequest(\n \"myApiKey\",\n search.NewEmptyApiKey().SetAcl(\n []search.Acl{search.Acl(\"search\"), search.Acl(\"addObject\")}).SetValidity(300).SetMaxQueriesPerIPPerHour(100).SetMaxHitsPerQuery(20),\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "waitForApiKey": { - "wait for api key helper - add": "response, err := client.WaitForApiKey(\n \"api-key-add-operation-test-go\", search.ApiKeyOperation(\"add\"),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "wait for api key - update": "response, err := client.WaitForApiKey(\n \"api-key-update-operation-test-go\", search.ApiKeyOperation(\"update\"),\n search.WithApiKey(\n search.NewEmptyApiKey().SetDescription(\"my updated api key\").SetAcl(\n []search.Acl{search.Acl(\"search\"), search.Acl(\"addObject\"), search.Acl(\"deleteObject\")}).SetIndexes(\n []string{\"Movies\", \"Books\"}).SetReferers(\n []string{\"*google.com\", \"*algolia.com\"}).SetValidity(305).SetMaxQueriesPerIPPerHour(95).SetMaxHitsPerQuery(20)))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)", - "wait for api key - delete": "response, err := client.WaitForApiKey(\n \"api-key-delete-operation-test-go\", search.ApiKeyOperation(\"delete\"),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "wait for api key helper - add": "response, err := client.WaitForApiKey(\n \"api-key-add-operation-test-go\", search.ApiKeyOperation(\"add\"),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "wait for api key - update": "response, err := client.WaitForApiKey(\n \"api-key-update-operation-test-go\", search.ApiKeyOperation(\"update\"),\n search.WithApiKey(\n search.NewEmptyApiKey().SetDescription(\"my updated api key\").SetAcl(\n []search.Acl{search.Acl(\"search\"), search.Acl(\"addObject\"), search.Acl(\"deleteObject\")}).SetIndexes(\n []string{\"Movies\", \"Books\"}).SetReferers(\n []string{\"*google.com\", \"*algolia.com\"}).SetValidity(305).SetMaxQueriesPerIPPerHour(95).SetMaxHitsPerQuery(20)))\nif err != nil {\n // handle the eventual error\n panic(err)\n}", + "wait for api key - delete": "response, err := client.WaitForApiKey(\n \"api-key-delete-operation-test-go\", search.ApiKeyOperation(\"delete\"),\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "waitForAppTask": { - "default": "response, err := client.WaitForAppTask(\n 123,\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.WaitForAppTask(\n 123,\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "waitForTask": { - "default": "response, err := client.WaitForTask(\n \"\", 123,\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.WaitForTask(\n \"\", 123,\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "init": { "default": "client, err := search.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -947,6 +956,9 @@ "searchUserIds": { "default": "client.searchUserIds(new SearchUserIdsParams().setQuery(\"test\").setClusterName(\"theClusterName\").setPage(5).setHitsPerPage(10));" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "setDictionarySettings": { "default": "client.setDictionarySettings(\n new DictionarySettingsParams()\n .setDisableStandardEntries(\n new StandardEntries()\n .setPlurals(\n new HashMap() {\n {\n put(\"fr\", false);\n put(\"en\", false);\n put(\"ru\", true);\n }\n }\n )\n )\n);" }, @@ -976,239 +988,242 @@ "default": "import { searchClient } from '@algolia/client-search';" }, "addApiKey": { - "default": "const response = await client.addApiKey({\n acl: ['search', 'addObject'],\n description: 'my new api key',\n validity: 300,\n maxQueriesPerIPPerHour: 100,\n maxHitsPerQuery: 20,\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.addApiKey({\n acl: ['search', 'addObject'],\n description: 'my new api key',\n validity: 300,\n maxQueriesPerIPPerHour: 100,\n maxHitsPerQuery: 20,\n});" }, "addOrUpdateObject": { - "default": "const response = await client.addOrUpdateObject({\n indexName: 'indexName',\n objectID: 'uniqueID',\n body: { key: 'value' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.addOrUpdateObject({\n indexName: 'indexName',\n objectID: 'uniqueID',\n body: { key: 'value' },\n});" }, "appendSource": { - "default": "const response = await client.appendSource({ source: 'theSource', description: 'theDescription' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.appendSource({ source: 'theSource', description: 'theDescription' });" }, "assignUserId": { - "default": "const response = await client.assignUserId({\n xAlgoliaUserID: 'userID',\n assignUserIdParams: { cluster: 'theCluster' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.assignUserId({\n xAlgoliaUserID: 'userID',\n assignUserIdParams: { cluster: 'theCluster' },\n});" }, "batch": { - "addObject": "const response = await client.batch({\n indexName: '',\n batchWriteParams: {\n requests: [\n { action: 'addObject', body: { key: 'bar', foo: '1' } },\n { action: 'addObject', body: { key: 'baz', foo: '2' } },\n ],\n },\n});\n\n// use typed response\nconsole.log(response);", - "clear": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'clear', body: { key: 'value' } }] },\n});\n\n// use typed response\nconsole.log(response);", - "delete": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'delete', body: { key: 'value' } }] },\n});\n\n// use typed response\nconsole.log(response);", - "deleteObject": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'deleteObject', body: { key: 'value' } }] },\n});\n\n// use typed response\nconsole.log(response);", - "partialUpdateObject": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'partialUpdateObject', body: { key: 'value' } }] },\n});\n\n// use typed response\nconsole.log(response);", - "partialUpdateObjectNoCreate": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'partialUpdateObjectNoCreate', body: { key: 'value' } }] },\n});\n\n// use typed response\nconsole.log(response);", - "updateObject": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'updateObject', body: { key: 'value' } }] },\n});\n\n// use typed response\nconsole.log(response);" + "addObject": "const response = await client.batch({\n indexName: '',\n batchWriteParams: {\n requests: [\n { action: 'addObject', body: { key: 'bar', foo: '1' } },\n { action: 'addObject', body: { key: 'baz', foo: '2' } },\n ],\n },\n});", + "clear": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'clear', body: { key: 'value' } }] },\n});", + "delete": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'delete', body: { key: 'value' } }] },\n});", + "deleteObject": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'deleteObject', body: { key: 'value' } }] },\n});", + "partialUpdateObject": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'partialUpdateObject', body: { key: 'value' } }] },\n});", + "partialUpdateObjectNoCreate": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'partialUpdateObjectNoCreate', body: { key: 'value' } }] },\n});", + "updateObject": "const response = await client.batch({\n indexName: '',\n batchWriteParams: { requests: [{ action: 'updateObject', body: { key: 'value' } }] },\n});" }, "batchAssignUserIds": { - "default": "const response = await client.batchAssignUserIds({\n xAlgoliaUserID: 'userID',\n batchAssignUserIdsParams: { cluster: 'theCluster', users: ['user1', 'user2'] },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.batchAssignUserIds({\n xAlgoliaUserID: 'userID',\n batchAssignUserIdsParams: { cluster: 'theCluster', users: ['user1', 'user2'] },\n});" }, "batchDictionaryEntries": { - "replace": "const response = await client.batchDictionaryEntries({\n dictionaryName: 'plurals',\n batchDictionaryEntriesParams: {\n clearExistingDictionaryEntries: true,\n requests: [\n {\n action: 'addEntry',\n body: {\n objectID: '1',\n language: 'en',\n word: 'fancy',\n words: ['believe', 'algolia'],\n decomposition: ['trust', 'algolia'],\n state: 'enabled',\n },\n },\n ],\n },\n});\n\n// use typed response\nconsole.log(response);", - "delete": "const response = await client.batchDictionaryEntries({\n dictionaryName: 'plurals',\n batchDictionaryEntriesParams: {\n clearExistingDictionaryEntries: true,\n requests: [{ action: 'deleteEntry', body: { objectID: '1' } }],\n },\n});\n\n// use typed response\nconsole.log(response);", - "append": "const response = await client.batchDictionaryEntries({\n dictionaryName: 'stopwords',\n batchDictionaryEntriesParams: {\n requests: [{ action: 'addEntry', body: { objectID: '1', language: 'en', additional: 'try me' } }],\n },\n});\n\n// use typed response\nconsole.log(response);" + "replace": "const response = await client.batchDictionaryEntries({\n dictionaryName: 'plurals',\n batchDictionaryEntriesParams: {\n clearExistingDictionaryEntries: true,\n requests: [\n {\n action: 'addEntry',\n body: {\n objectID: '1',\n language: 'en',\n word: 'fancy',\n words: ['believe', 'algolia'],\n decomposition: ['trust', 'algolia'],\n state: 'enabled',\n },\n },\n ],\n },\n});", + "delete": "const response = await client.batchDictionaryEntries({\n dictionaryName: 'plurals',\n batchDictionaryEntriesParams: {\n clearExistingDictionaryEntries: true,\n requests: [{ action: 'deleteEntry', body: { objectID: '1' } }],\n },\n});", + "append": "const response = await client.batchDictionaryEntries({\n dictionaryName: 'stopwords',\n batchDictionaryEntriesParams: {\n requests: [{ action: 'addEntry', body: { objectID: '1', language: 'en', additional: 'try me' } }],\n },\n});" }, "browse": { - "default": "const response = await client.browse({ indexName: 'cts_e2e_browse' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.browse({ indexName: 'cts_e2e_browse' });" }, "clearObjects": { - "default": "const response = await client.clearObjects({ indexName: 'theIndexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.clearObjects({ indexName: 'theIndexName' });" }, "clearRules": { - "default": "const response = await client.clearRules({ indexName: 'indexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.clearRules({ indexName: 'indexName' });" }, "clearSynonyms": { - "default": "const response = await client.clearSynonyms({ indexName: 'indexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.clearSynonyms({ indexName: 'indexName' });" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "deleteApiKey": { - "default": "const response = await client.deleteApiKey({ key: 'myTestApiKey' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteApiKey({ key: 'myTestApiKey' });" }, "deleteBy": { - "default": "const response = await client.deleteBy({ indexName: 'theIndexName', deleteByParams: { filters: 'brand:brandName' } });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteBy({ indexName: 'theIndexName', deleteByParams: { filters: 'brand:brandName' } });" }, "deleteIndex": { - "default": "const response = await client.deleteIndex({ indexName: 'theIndexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteIndex({ indexName: 'theIndexName' });" }, "deleteObject": { - "default": "const response = await client.deleteObject({ indexName: '', objectID: 'uniqueID' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteObject({ indexName: '', objectID: 'uniqueID' });" }, "deleteObjects": { - "default": "const response = await client.deleteObjects({ indexName: 'cts_e2e_deleteObjects_javascript', objectIDs: ['1', '2'] });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteObjects({ indexName: 'cts_e2e_deleteObjects_javascript', objectIDs: ['1', '2'] });" }, "deleteRule": { - "default": "const response = await client.deleteRule({ indexName: 'indexName', objectID: 'id1' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteRule({ indexName: 'indexName', objectID: 'id1' });" }, "deleteSource": { - "default": "const response = await client.deleteSource({ source: 'theSource' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteSource({ source: 'theSource' });" }, "deleteSynonym": { - "default": "const response = await client.deleteSynonym({ indexName: 'indexName', objectID: 'id1' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.deleteSynonym({ indexName: 'indexName', objectID: 'id1' });" }, "generateSecuredApiKey": { - "generate secured api key basic": "const response = client.generateSecuredApiKey({\n parentApiKey: '2640659426d5107b6e47d75db9cbaef8',\n restrictions: { validUntil: 2524604400, restrictIndices: ['Movies'] },\n});\n\n// use typed response\nconsole.log(response);", - "generate secured api key with searchParams": "const response = client.generateSecuredApiKey({\n parentApiKey: '2640659426d5107b6e47d75db9cbaef8',\n restrictions: {\n validUntil: 2524604400,\n restrictIndices: ['Movies', 'cts_e2e_settings'],\n restrictSources: '192.168.1.0/24',\n filters: 'category:Book OR category:Ebook AND _tags:published',\n userToken: 'user123',\n searchParams: {\n query: 'batman',\n typoTolerance: 'strict',\n aroundRadius: 'all',\n mode: 'neuralSearch',\n hitsPerPage: 10,\n optionalWords: ['one', 'two'],\n },\n },\n});\n\n// use typed response\nconsole.log(response);" + "generate secured api key basic": "const response = client.generateSecuredApiKey({\n parentApiKey: '2640659426d5107b6e47d75db9cbaef8',\n restrictions: { validUntil: 2524604400, restrictIndices: ['Movies'] },\n});", + "generate secured api key with searchParams": "const response = client.generateSecuredApiKey({\n parentApiKey: '2640659426d5107b6e47d75db9cbaef8',\n restrictions: {\n validUntil: 2524604400,\n restrictIndices: ['Movies', 'cts_e2e_settings'],\n restrictSources: '192.168.1.0/24',\n filters: 'category:Book OR category:Ebook AND _tags:published',\n userToken: 'user123',\n searchParams: {\n query: 'batman',\n typoTolerance: 'strict',\n aroundRadius: 'all',\n mode: 'neuralSearch',\n hitsPerPage: 10,\n optionalWords: ['one', 'two'],\n },\n },\n});" }, "getApiKey": { - "default": "const response = await client.getApiKey({ key: 'myTestApiKey' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getApiKey({ key: 'myTestApiKey' });" }, "getAppTask": { - "default": "const response = await client.getAppTask({ taskID: 123 });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getAppTask({ taskID: 123 });" }, "getDictionaryLanguages": { - "default": "const response = await client.getDictionaryLanguages();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getDictionaryLanguages();" }, "getDictionarySettings": { - "default": "const response = await client.getDictionarySettings();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getDictionarySettings();" }, "getLogs": { - "default": "const response = await client.getLogs();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getLogs();" }, "getObject": { - "default": "const response = await client.getObject({\n indexName: 'theIndexName',\n objectID: 'uniqueID',\n attributesToRetrieve: ['attr1', 'attr2'],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getObject({\n indexName: 'theIndexName',\n objectID: 'uniqueID',\n attributesToRetrieve: ['attr1', 'attr2'],\n});" }, "getObjects": { - "default": "const response = await client.getObjects({\n requests: [{ attributesToRetrieve: ['attr1', 'attr2'], objectID: 'uniqueID', indexName: 'theIndexName' }],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getObjects({\n requests: [{ attributesToRetrieve: ['attr1', 'attr2'], objectID: 'uniqueID', indexName: 'theIndexName' }],\n});" }, "getRule": { - "default": "const response = await client.getRule({ indexName: 'cts_e2e_browse', objectID: 'qr-1725004648916' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getRule({ indexName: 'cts_e2e_browse', objectID: 'qr-1725004648916' });" }, "getSettings": { - "default": "const response = await client.getSettings({ indexName: 'cts_e2e_settings' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getSettings({ indexName: 'cts_e2e_settings' });" }, "getSources": { - "default": "const response = await client.getSources();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getSources();" }, "getSynonym": { - "default": "const response = await client.getSynonym({ indexName: 'indexName', objectID: 'id1' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getSynonym({ indexName: 'indexName', objectID: 'id1' });" }, "getTask": { - "default": "const response = await client.getTask({ indexName: 'theIndexName', taskID: 123 });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTask({ indexName: 'theIndexName', taskID: 123 });" }, "getTopUserIds": { - "default": "const response = await client.getTopUserIds();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getTopUserIds();" }, "getUserId": { - "default": "const response = await client.getUserId({ userID: 'uniqueID' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getUserId({ userID: 'uniqueID' });" }, "hasPendingMappings": { - "default": "const response = await client.hasPendingMappings();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.hasPendingMappings();" }, "indexExists": { - "indexExists": "const response = await client.indexExists({ indexName: 'indexExistsYES' });\n\n// use typed response\nconsole.log(response);", - "indexNotExists": "const response = await client.indexExists({ indexName: 'indexExistsNO' });\n\n// use typed response\nconsole.log(response);", - "indexExistsWithError": "const response = await client.indexExists({ indexName: 'indexExistsERROR' });\n\n// use typed response\nconsole.log(response);" + "indexExists": "const response = await client.indexExists({ indexName: 'indexExistsYES' });", + "indexNotExists": "const response = await client.indexExists({ indexName: 'indexExistsNO' });", + "indexExistsWithError": "const response = await client.indexExists({ indexName: 'indexExistsERROR' });" }, "listApiKeys": { - "default": "const response = await client.listApiKeys();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listApiKeys();" }, "listClusters": { - "default": "const response = await client.listClusters();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listClusters();" }, "listIndices": { - "default": "const response = await client.listIndices();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listIndices();" }, "listUserIds": { - "default": "const response = await client.listUserIds();\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.listUserIds();" }, "multipleBatch": { - "default": "const response = await client.multipleBatch({\n requests: [{ action: 'addObject', body: { key: 'value' }, indexName: 'theIndexName' }],\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.multipleBatch({\n requests: [{ action: 'addObject', body: { key: 'value' }, indexName: 'theIndexName' }],\n});" }, "operationIndex": { - "scopes": "const response = await client.operationIndex({\n indexName: '',\n operationIndexParams: { operation: 'move', destination: '', scope: ['rules', 'settings'] },\n});\n\n// use typed response\nconsole.log(response);", - "copy": "const response = await client.operationIndex({\n indexName: '',\n operationIndexParams: { operation: 'copy', destination: '' },\n});\n\n// use typed response\nconsole.log(response);", - "move": "const response = await client.operationIndex({\n indexName: '',\n operationIndexParams: { operation: 'move', destination: '' },\n});\n\n// use typed response\nconsole.log(response);" + "scopes": "const response = await client.operationIndex({\n indexName: '',\n operationIndexParams: { operation: 'move', destination: '', scope: ['rules', 'settings'] },\n});", + "copy": "const response = await client.operationIndex({\n indexName: '',\n operationIndexParams: { operation: 'copy', destination: '' },\n});", + "move": "const response = await client.operationIndex({\n indexName: '',\n operationIndexParams: { operation: 'move', destination: '' },\n});" }, "partialUpdateObject": { - "default": "const response = await client.partialUpdateObject({\n indexName: 'theIndexName',\n objectID: 'uniqueID',\n attributesToUpdate: { attributeId: 'new value' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.partialUpdateObject({\n indexName: 'theIndexName',\n objectID: 'uniqueID',\n attributesToUpdate: { attributeId: 'new value' },\n});" }, "partialUpdateObjects": { - "call partialUpdateObjects with createIfNotExists=true": "const response = await client.partialUpdateObjects({\n indexName: 'cts_e2e_partialUpdateObjects_javascript',\n objects: [\n { objectID: '1', name: 'Adam' },\n { objectID: '2', name: 'Benoit' },\n ],\n createIfNotExists: true,\n});\n\n// use typed response\nconsole.log(response);", - "call partialUpdateObjects with createIfNotExists=false": "const response = await client.partialUpdateObjects({\n indexName: 'cts_e2e_partialUpdateObjects_javascript',\n objects: [\n { objectID: '3', name: 'Cyril' },\n { objectID: '4', name: 'David' },\n ],\n createIfNotExists: false,\n});\n\n// use typed response\nconsole.log(response);" + "call partialUpdateObjects with createIfNotExists=true": "const response = await client.partialUpdateObjects({\n indexName: 'cts_e2e_partialUpdateObjects_javascript',\n objects: [\n { objectID: '1', name: 'Adam' },\n { objectID: '2', name: 'Benoit' },\n ],\n createIfNotExists: true,\n});", + "call partialUpdateObjects with createIfNotExists=false": "const response = await client.partialUpdateObjects({\n indexName: 'cts_e2e_partialUpdateObjects_javascript',\n objects: [\n { objectID: '3', name: 'Cyril' },\n { objectID: '4', name: 'David' },\n ],\n createIfNotExists: false,\n});" }, "removeUserId": { - "default": "const response = await client.removeUserId({ userID: 'uniqueID' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.removeUserId({ userID: 'uniqueID' });" }, "replaceAllObjects": { - "default": "const response = await client.replaceAllObjects({\n indexName: 'cts_e2e_replace_all_objects_javascript',\n objects: [\n { objectID: '1', name: 'Adam' },\n { objectID: '2', name: 'Benoit' },\n { objectID: '3', name: 'Cyril' },\n { objectID: '4', name: 'David' },\n { objectID: '5', name: 'Eva' },\n { objectID: '6', name: 'Fiona' },\n { objectID: '7', name: 'Gael' },\n { objectID: '8', name: 'Hugo' },\n { objectID: '9', name: 'Igor' },\n { objectID: '10', name: 'Julia' },\n ],\n batchSize: 3,\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.replaceAllObjects({\n indexName: 'cts_e2e_replace_all_objects_javascript',\n objects: [\n { objectID: '1', name: 'Adam' },\n { objectID: '2', name: 'Benoit' },\n { objectID: '3', name: 'Cyril' },\n { objectID: '4', name: 'David' },\n { objectID: '5', name: 'Eva' },\n { objectID: '6', name: 'Fiona' },\n { objectID: '7', name: 'Gael' },\n { objectID: '8', name: 'Hugo' },\n { objectID: '9', name: 'Igor' },\n { objectID: '10', name: 'Julia' },\n ],\n batchSize: 3,\n});" }, "replaceSources": { - "default": "const response = await client.replaceSources({ source: [{ source: 'theSource', description: 'theDescription' }] });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.replaceSources({ source: [{ source: 'theSource', description: 'theDescription' }] });" }, "restoreApiKey": { - "default": "const response = await client.restoreApiKey({ key: 'myApiKey' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.restoreApiKey({ key: 'myApiKey' });" }, "saveObject": { - "default": "const response = await client.saveObject({ indexName: '', body: { objectID: 'id', test: 'val' } });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.saveObject({ indexName: '', body: { objectID: 'id', test: 'val' } });" }, "saveObjects": { - "call saveObjects without error": "const response = await client.saveObjects({\n indexName: 'cts_e2e_saveObjects_javascript',\n objects: [\n { objectID: '1', name: 'Adam' },\n { objectID: '2', name: 'Benoit' },\n ],\n});\n\n// use typed response\nconsole.log(response);", - "saveObjects should report errors": "const response = await client.saveObjects({\n indexName: 'cts_e2e_saveObjects_javascript',\n objects: [\n { objectID: '1', name: 'Adam' },\n { objectID: '2', name: 'Benoit' },\n ],\n});\n\n// use typed response\nconsole.log(response);" + "call saveObjects without error": "const response = await client.saveObjects({\n indexName: 'cts_e2e_saveObjects_javascript',\n objects: [\n { objectID: '1', name: 'Adam' },\n { objectID: '2', name: 'Benoit' },\n ],\n});", + "saveObjects should report errors": "const response = await client.saveObjects({\n indexName: 'cts_e2e_saveObjects_javascript',\n objects: [\n { objectID: '1', name: 'Adam' },\n { objectID: '2', name: 'Benoit' },\n ],\n});" }, "saveRule": { - "default": "const response = await client.saveRule({\n indexName: 'indexName',\n objectID: 'id1',\n rule: { objectID: 'id1', conditions: [{ pattern: 'apple', anchoring: 'contains' }] },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.saveRule({\n indexName: 'indexName',\n objectID: 'id1',\n rule: { objectID: 'id1', conditions: [{ pattern: 'apple', anchoring: 'contains' }] },\n});" }, "saveRules": { - "default": "const response = await client.saveRules({\n indexName: '',\n rules: [\n { objectID: 'a-rule-id', conditions: [{ pattern: 'smartphone', anchoring: 'contains' }] },\n { objectID: 'a-second-rule-id', conditions: [{ pattern: 'apple', anchoring: 'contains' }] },\n ],\n forwardToReplicas: false,\n clearExistingRules: true,\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.saveRules({\n indexName: '',\n rules: [\n { objectID: 'a-rule-id', conditions: [{ pattern: 'smartphone', anchoring: 'contains' }] },\n { objectID: 'a-second-rule-id', conditions: [{ pattern: 'apple', anchoring: 'contains' }] },\n ],\n forwardToReplicas: false,\n clearExistingRules: true,\n});" }, "saveSynonym": { - "default": "const response = await client.saveSynonym({\n indexName: 'indexName',\n objectID: 'id1',\n synonymHit: { objectID: 'id1', type: 'synonym', synonyms: ['car', 'vehicule', 'auto'] },\n forwardToReplicas: true,\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.saveSynonym({\n indexName: 'indexName',\n objectID: 'id1',\n synonymHit: { objectID: 'id1', type: 'synonym', synonyms: ['car', 'vehicule', 'auto'] },\n forwardToReplicas: true,\n});" }, "saveSynonyms": { - "default": "const response = await client.saveSynonyms({\n indexName: '',\n synonymHit: [\n { objectID: 'id1', type: 'synonym', synonyms: ['car', 'vehicule', 'auto'] },\n { objectID: 'id2', type: 'onewaysynonym', input: 'iphone', synonyms: ['ephone', 'aphone', 'yphone'] },\n ],\n forwardToReplicas: true,\n replaceExistingSynonyms: true,\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.saveSynonyms({\n indexName: '',\n synonymHit: [\n { objectID: 'id1', type: 'synonym', synonyms: ['car', 'vehicule', 'auto'] },\n { objectID: 'id2', type: 'onewaysynonym', input: 'iphone', synonyms: ['ephone', 'aphone', 'yphone'] },\n ],\n forwardToReplicas: true,\n replaceExistingSynonyms: true,\n});" }, "search": { - "withHitsPerPage": "const response = await client.search({\n requests: [{ indexName: '', query: '', hitsPerPage: 50 }],\n});\n\n// use typed response\nconsole.log(response);", - "filterOnly": "const response = await client.search({\n requests: [{ indexName: '', query: '', filters: 'actor:Scarlett Johansson' }],\n});\n\n// use typed response\nconsole.log(response);", - "filterOr": "const response = await client.search({\n requests: [\n {\n indexName: '',\n query: '',\n filters: 'actor:Tom Cruise OR actor:Scarlett Johansson',\n },\n ],\n});\n\n// use typed response\nconsole.log(response);", - "filterNot": "const response = await client.search({\n requests: [{ indexName: '', query: '', filters: 'NOT actor:Nicolas Cage' }],\n});\n\n// use typed response\nconsole.log(response);", - "retrieveFacets": "const response = await client.search({\n requests: [{ indexName: '', query: '', facets: ['author', 'genre'] }],\n});\n\n// use typed response\nconsole.log(response);", - "retrieveFacetsWildcard": "const response = await client.search({\n requests: [{ indexName: '', query: '', facets: ['*'] }],\n});\n\n// use typed response\nconsole.log(response);" + "withHitsPerPage": "const response = await client.search({\n requests: [{ indexName: '', query: '', hitsPerPage: 50 }],\n});", + "filterOnly": "const response = await client.search({\n requests: [{ indexName: '', query: '', filters: 'actor:Scarlett Johansson' }],\n});", + "filterOr": "const response = await client.search({\n requests: [\n {\n indexName: '',\n query: '',\n filters: 'actor:Tom Cruise OR actor:Scarlett Johansson',\n },\n ],\n});", + "filterNot": "const response = await client.search({\n requests: [{ indexName: '', query: '', filters: 'NOT actor:Nicolas Cage' }],\n});", + "retrieveFacets": "const response = await client.search({\n requests: [{ indexName: '', query: '', facets: ['author', 'genre'] }],\n});", + "retrieveFacetsWildcard": "const response = await client.search({\n requests: [{ indexName: '', query: '', facets: ['*'] }],\n});" }, "searchDictionaryEntries": { - "default": "const response = await client.searchDictionaryEntries({\n dictionaryName: 'stopwords',\n searchDictionaryEntriesParams: { query: 'about' },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchDictionaryEntries({\n dictionaryName: 'stopwords',\n searchDictionaryEntriesParams: { query: 'about' },\n});" }, "searchForFacetValues": { - "default": "const response = await client.searchForFacetValues({ indexName: 'indexName', facetName: 'facetName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchForFacetValues({ indexName: 'indexName', facetName: 'facetName' });" }, "searchRules": { - "default": "const response = await client.searchRules({ indexName: 'cts_e2e_browse', searchRulesParams: { query: 'zorro' } });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchRules({ indexName: 'cts_e2e_browse', searchRulesParams: { query: 'zorro' } });" }, "searchSingleIndex": { - "default": "const response = await client.searchSingleIndex({ indexName: 'indexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchSingleIndex({ indexName: 'indexName' });" }, "searchSynonyms": { - "default": "const response = await client.searchSynonyms({ indexName: 'indexName' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchSynonyms({ indexName: 'indexName' });" }, "searchUserIds": { - "default": "const response = await client.searchUserIds({\n query: 'test',\n clusterName: 'theClusterName',\n page: 5,\n hitsPerPage: 10,\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.searchUserIds({\n query: 'test',\n clusterName: 'theClusterName',\n page: 5,\n hitsPerPage: 10,\n});" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "setDictionarySettings": { - "default": "const response = await client.setDictionarySettings({\n disableStandardEntries: { plurals: { fr: false, en: false, ru: true } },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.setDictionarySettings({\n disableStandardEntries: { plurals: { fr: false, en: false, ru: true } },\n});" }, "setSettings": { - "default": "const response = await client.setSettings({\n indexName: '',\n indexSettings: { attributesForFaceting: ['actor', 'filterOnly(category)', 'searchable(publisher)'] },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.setSettings({\n indexName: '',\n indexSettings: { attributesForFaceting: ['actor', 'filterOnly(category)', 'searchable(publisher)'] },\n});" }, "updateApiKey": { - "default": "const response = await client.updateApiKey({\n key: 'myApiKey',\n apiKey: { acl: ['search', 'addObject'], validity: 300, maxQueriesPerIPPerHour: 100, maxHitsPerQuery: 20 },\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.updateApiKey({\n key: 'myApiKey',\n apiKey: { acl: ['search', 'addObject'], validity: 300, maxQueriesPerIPPerHour: 100, maxHitsPerQuery: 20 },\n});" }, "waitForApiKey": { - "wait for api key helper - add": "const response = await client.waitForApiKey({ key: 'api-key-add-operation-test-javascript', operation: 'add' });\n\n// use typed response\nconsole.log(response);", - "wait for api key - update": "const response = await client.waitForApiKey({\n key: 'api-key-update-operation-test-javascript',\n operation: 'update',\n apiKey: {\n description: 'my updated api key',\n acl: ['search', 'addObject', 'deleteObject'],\n indexes: ['Movies', 'Books'],\n referers: ['*google.com', '*algolia.com'],\n validity: 305,\n maxQueriesPerIPPerHour: 95,\n maxHitsPerQuery: 20,\n },\n});\n\n// use typed response\nconsole.log(response);", - "wait for api key - delete": "const response = await client.waitForApiKey({ key: 'api-key-delete-operation-test-javascript', operation: 'delete' });\n\n// use typed response\nconsole.log(response);" + "wait for api key helper - add": "const response = await client.waitForApiKey({ key: 'api-key-add-operation-test-javascript', operation: 'add' });", + "wait for api key - update": "const response = await client.waitForApiKey({\n key: 'api-key-update-operation-test-javascript',\n operation: 'update',\n apiKey: {\n description: 'my updated api key',\n acl: ['search', 'addObject', 'deleteObject'],\n indexes: ['Movies', 'Books'],\n referers: ['*google.com', '*algolia.com'],\n validity: 305,\n maxQueriesPerIPPerHour: 95,\n maxHitsPerQuery: 20,\n },\n});", + "wait for api key - delete": "const response = await client.waitForApiKey({ key: 'api-key-delete-operation-test-javascript', operation: 'delete' });" }, "waitForAppTask": { - "default": "const response = await client.waitForAppTask({ taskID: 123 });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.waitForAppTask({ taskID: 123 });" }, "waitForTask": { - "default": "const response = await client.waitForTask({ indexName: 'wait-task-javascript', taskID: 123 });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.waitForTask({ indexName: 'wait-task-javascript', taskID: 123 });" }, "init": { "default": "const client = searchClient('YOUR_APP_ID', 'YOUR_API_KEY');" @@ -1219,239 +1234,242 @@ "default": "import com.algolia.client.api.SearchClient\nimport com.algolia.client.extensions.*" }, "addApiKey": { - "default": "var response = client.addApiKey(\n apiKey = ApiKey(\n acl = listOf(Acl.entries.first { it.value == \"search\" }, Acl.entries.first { it.value == \"addObject\" }),\n description = \"my new api key\",\n validity = 300,\n maxQueriesPerIPPerHour = 100,\n maxHitsPerQuery = 20,\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.addApiKey(\n apiKey = ApiKey(\n acl = listOf(Acl.entries.first { it.value == \"search\" }, Acl.entries.first { it.value == \"addObject\" }),\n description = \"my new api key\",\n validity = 300,\n maxQueriesPerIPPerHour = 100,\n maxHitsPerQuery = 20,\n ),\n)" }, "addOrUpdateObject": { - "default": "var response = client.addOrUpdateObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.addOrUpdateObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n)" }, "appendSource": { - "default": "var response = client.appendSource(\n source = Source(\n source = \"theSource\",\n description = \"theDescription\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.appendSource(\n source = Source(\n source = \"theSource\",\n description = \"theDescription\",\n ),\n)" }, "assignUserId": { - "default": "var response = client.assignUserId(\n xAlgoliaUserID = \"userID\",\n assignUserIdParams = AssignUserIdParams(\n cluster = \"theCluster\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.assignUserId(\n xAlgoliaUserID = \"userID\",\n assignUserIdParams = AssignUserIdParams(\n cluster = \"theCluster\",\n ),\n)" }, "batch": { - "addObject": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"addObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"bar\"),\n )\n put(\n \"foo\",\n JsonPrimitive(\"1\"),\n )\n },\n ),\n BatchRequest(\n action = Action.entries.first { it.value == \"addObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"baz\"),\n )\n put(\n \"foo\",\n JsonPrimitive(\"2\"),\n )\n },\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "clear": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"clear\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "delete": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"delete\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "deleteObject": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"deleteObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "partialUpdateObject": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"partialUpdateObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "partialUpdateObjectNoCreate": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"partialUpdateObjectNoCreate\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "updateObject": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"updateObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "addObject": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"addObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"bar\"),\n )\n put(\n \"foo\",\n JsonPrimitive(\"1\"),\n )\n },\n ),\n BatchRequest(\n action = Action.entries.first { it.value == \"addObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"baz\"),\n )\n put(\n \"foo\",\n JsonPrimitive(\"2\"),\n )\n },\n ),\n ),\n ),\n)", + "clear": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"clear\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)", + "delete": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"delete\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)", + "deleteObject": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"deleteObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)", + "partialUpdateObject": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"partialUpdateObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)", + "partialUpdateObjectNoCreate": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"partialUpdateObjectNoCreate\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)", + "updateObject": "var response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = listOf(\n BatchRequest(\n action = Action.entries.first { it.value == \"updateObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n ),\n ),\n ),\n)" }, "batchAssignUserIds": { - "default": "var response = client.batchAssignUserIds(\n xAlgoliaUserID = \"userID\",\n batchAssignUserIdsParams = BatchAssignUserIdsParams(\n cluster = \"theCluster\",\n users = listOf(\"user1\", \"user2\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.batchAssignUserIds(\n xAlgoliaUserID = \"userID\",\n batchAssignUserIdsParams = BatchAssignUserIdsParams(\n cluster = \"theCluster\",\n users = listOf(\"user1\", \"user2\"),\n ),\n)" }, "batchDictionaryEntries": { - "replace": "var response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.entries.first { it.value == \"plurals\" },\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n clearExistingDictionaryEntries = true,\n requests = listOf(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.entries.first { it.value == \"addEntry\" },\n body = DictionaryEntry(\n objectID = \"1\",\n language = SupportedLanguage.entries.first { it.value == \"en\" },\n word = \"fancy\",\n words = listOf(\"believe\", \"algolia\"),\n decomposition = listOf(\"trust\", \"algolia\"),\n state = DictionaryEntryState.entries.first { it.value == \"enabled\" },\n ),\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "delete": "var response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.entries.first { it.value == \"plurals\" },\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n clearExistingDictionaryEntries = true,\n requests = listOf(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.entries.first { it.value == \"deleteEntry\" },\n body = DictionaryEntry(\n objectID = \"1\",\n ),\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "append": "var response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.entries.first { it.value == \"stopwords\" },\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n requests = listOf(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.entries.first { it.value == \"addEntry\" },\n body = DictionaryEntry(\n objectID = \"1\",\n language = SupportedLanguage.entries.first { it.value == \"en\" },\n additionalProperties = mapOf(\n \"additional\" to JsonPrimitive(\"try me\"),\n ),\n ),\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "replace": "var response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.entries.first { it.value == \"plurals\" },\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n clearExistingDictionaryEntries = true,\n requests = listOf(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.entries.first { it.value == \"addEntry\" },\n body = DictionaryEntry(\n objectID = \"1\",\n language = SupportedLanguage.entries.first { it.value == \"en\" },\n word = \"fancy\",\n words = listOf(\"believe\", \"algolia\"),\n decomposition = listOf(\"trust\", \"algolia\"),\n state = DictionaryEntryState.entries.first { it.value == \"enabled\" },\n ),\n ),\n ),\n ),\n)", + "delete": "var response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.entries.first { it.value == \"plurals\" },\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n clearExistingDictionaryEntries = true,\n requests = listOf(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.entries.first { it.value == \"deleteEntry\" },\n body = DictionaryEntry(\n objectID = \"1\",\n ),\n ),\n ),\n ),\n)", + "append": "var response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.entries.first { it.value == \"stopwords\" },\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n requests = listOf(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.entries.first { it.value == \"addEntry\" },\n body = DictionaryEntry(\n objectID = \"1\",\n language = SupportedLanguage.entries.first { it.value == \"en\" },\n additionalProperties = mapOf(\n \"additional\" to JsonPrimitive(\"try me\"),\n ),\n ),\n ),\n ),\n ),\n)" }, "browse": { - "default": "var response = client.browse(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.browse(\n indexName = \"\",\n)" }, "clearObjects": { - "default": "var response = client.clearObjects(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.clearObjects(\n indexName = \"\",\n)" }, "clearRules": { - "default": "var response = client.clearRules(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.clearRules(\n indexName = \"\",\n)" }, "clearSynonyms": { - "default": "var response = client.clearSynonyms(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.clearSynonyms(\n indexName = \"\",\n)" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "deleteApiKey": { - "default": "var response = client.deleteApiKey(\n key = \"myTestApiKey\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteApiKey(\n key = \"myTestApiKey\",\n)" }, "deleteBy": { - "default": "var response = client.deleteBy(\n indexName = \"\",\n deleteByParams = DeleteByParams(\n filters = \"brand:brandName\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteBy(\n indexName = \"\",\n deleteByParams = DeleteByParams(\n filters = \"brand:brandName\",\n ),\n)" }, "deleteIndex": { - "default": "var response = client.deleteIndex(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteIndex(\n indexName = \"\",\n)" }, "deleteObject": { - "default": "var response = client.deleteObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n)" }, "deleteObjects": { - "default": "var response = client.deleteObjects(\n indexName = \"\",\n objectIDs = listOf(\"1\", \"2\"),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteObjects(\n indexName = \"\",\n objectIDs = listOf(\"1\", \"2\"),\n)" }, "deleteRule": { - "default": "var response = client.deleteRule(\n indexName = \"\",\n objectID = \"id1\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteRule(\n indexName = \"\",\n objectID = \"id1\",\n)" }, "deleteSource": { - "default": "var response = client.deleteSource(\n source = \"theSource\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteSource(\n source = \"theSource\",\n)" }, "deleteSynonym": { - "default": "var response = client.deleteSynonym(\n indexName = \"\",\n objectID = \"id1\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.deleteSynonym(\n indexName = \"\",\n objectID = \"id1\",\n)" }, "generateSecuredApiKey": { - "generate secured api key basic": "var response = client.generateSecuredApiKey(\n parentApiKey = \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions = SecuredApiKeyRestrictions(\n validUntil = 2524604400L,\n restrictIndices = listOf(\"Movies\"),\n ),\n)\n\n// Use the response\nprintln(response)", - "generate secured api key with searchParams": "var response = client.generateSecuredApiKey(\n parentApiKey = \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions = SecuredApiKeyRestrictions(\n validUntil = 2524604400L,\n restrictIndices = listOf(\"Movies\", \"cts_e2e_settings\"),\n restrictSources = \"192.168.1.0/24\",\n filters = \"category:Book OR category:Ebook AND _tags:published\",\n userToken = \"user123\",\n searchParams = SearchParamsObject(\n query = \"batman\",\n typoTolerance = TypoToleranceEnum.entries.first { it.value == \"strict\" },\n aroundRadius = AroundRadiusAll.entries.first { it.value == \"all\" },\n mode = Mode.entries.first { it.value == \"neuralSearch\" },\n hitsPerPage = 10,\n optionalWords = listOf(\"one\", \"two\"),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "generate secured api key basic": "var response = client.generateSecuredApiKey(\n parentApiKey = \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions = SecuredApiKeyRestrictions(\n validUntil = 2524604400L,\n restrictIndices = listOf(\"Movies\"),\n ),\n)", + "generate secured api key with searchParams": "var response = client.generateSecuredApiKey(\n parentApiKey = \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions = SecuredApiKeyRestrictions(\n validUntil = 2524604400L,\n restrictIndices = listOf(\"Movies\", \"cts_e2e_settings\"),\n restrictSources = \"192.168.1.0/24\",\n filters = \"category:Book OR category:Ebook AND _tags:published\",\n userToken = \"user123\",\n searchParams = SearchParamsObject(\n query = \"batman\",\n typoTolerance = TypoToleranceEnum.entries.first { it.value == \"strict\" },\n aroundRadius = AroundRadiusAll.entries.first { it.value == \"all\" },\n mode = Mode.entries.first { it.value == \"neuralSearch\" },\n hitsPerPage = 10,\n optionalWords = listOf(\"one\", \"two\"),\n ),\n ),\n)" }, "getApiKey": { - "default": "var response = client.getApiKey(\n key = \"myTestApiKey\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getApiKey(\n key = \"myTestApiKey\",\n)" }, "getAppTask": { - "default": "var response = client.getAppTask(\n taskID = 123L,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getAppTask(\n taskID = 123L,\n)" }, "getDictionaryLanguages": { - "default": "var response = client.getDictionaryLanguages()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getDictionaryLanguages()" }, "getDictionarySettings": { - "default": "var response = client.getDictionarySettings()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getDictionarySettings()" }, "getLogs": { - "default": "var response = client.getLogs()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getLogs()" }, "getObject": { - "default": "var response = client.getObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n attributesToRetrieve = listOf(\"attr1\", \"attr2\"),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n attributesToRetrieve = listOf(\"attr1\", \"attr2\"),\n)" }, "getObjects": { - "default": "var response = client.getObjects(\n getObjectsParams = GetObjectsParams(\n requests = listOf(\n GetObjectsRequest(\n attributesToRetrieve = listOf(\"attr1\", \"attr2\"),\n objectID = \"uniqueID\",\n indexName = \"\",\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getObjects(\n getObjectsParams = GetObjectsParams(\n requests = listOf(\n GetObjectsRequest(\n attributesToRetrieve = listOf(\"attr1\", \"attr2\"),\n objectID = \"uniqueID\",\n indexName = \"\",\n ),\n ),\n ),\n)" }, "getRule": { - "default": "var response = client.getRule(\n indexName = \"\",\n objectID = \"qr-1725004648916\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getRule(\n indexName = \"\",\n objectID = \"qr-1725004648916\",\n)" }, "getSettings": { - "default": "var response = client.getSettings(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getSettings(\n indexName = \"\",\n)" }, "getSources": { - "default": "var response = client.getSources()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getSources()" }, "getSynonym": { - "default": "var response = client.getSynonym(\n indexName = \"\",\n objectID = \"id1\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getSynonym(\n indexName = \"\",\n objectID = \"id1\",\n)" }, "getTask": { - "default": "var response = client.getTask(\n indexName = \"\",\n taskID = 123L,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTask(\n indexName = \"\",\n taskID = 123L,\n)" }, "getTopUserIds": { - "default": "var response = client.getTopUserIds()\n\n// Use the response\nprintln(response)" + "default": "var response = client.getTopUserIds()" }, "getUserId": { - "default": "var response = client.getUserId(\n userID = \"uniqueID\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getUserId(\n userID = \"uniqueID\",\n)" }, "hasPendingMappings": { - "default": "var response = client.hasPendingMappings()\n\n// Use the response\nprintln(response)" + "default": "var response = client.hasPendingMappings()" }, "indexExists": { - "indexExists": "var response = client.indexExists(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)", - "indexNotExists": "var response = client.indexExists(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)", - "indexExistsWithError": "var response = client.indexExists(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "indexExists": "var response = client.indexExists(\n indexName = \"\",\n)", + "indexNotExists": "var response = client.indexExists(\n indexName = \"\",\n)", + "indexExistsWithError": "var response = client.indexExists(\n indexName = \"\",\n)" }, "listApiKeys": { - "default": "var response = client.listApiKeys()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listApiKeys()" }, "listClusters": { - "default": "var response = client.listClusters()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listClusters()" }, "listIndices": { - "default": "var response = client.listIndices()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listIndices()" }, "listUserIds": { - "default": "var response = client.listUserIds()\n\n// Use the response\nprintln(response)" + "default": "var response = client.listUserIds()" }, "multipleBatch": { - "default": "var response = client.multipleBatch(\n batchParams = BatchParams(\n requests = listOf(\n MultipleBatchRequest(\n action = Action.entries.first { it.value == \"addObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n indexName = \"\",\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.multipleBatch(\n batchParams = BatchParams(\n requests = listOf(\n MultipleBatchRequest(\n action = Action.entries.first { it.value == \"addObject\" },\n body = buildJsonObject {\n put(\n \"key\",\n JsonPrimitive(\"value\"),\n )\n },\n indexName = \"\",\n ),\n ),\n ),\n)" }, "operationIndex": { - "scopes": "var response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.entries.first { it.value == \"move\" },\n destination = \"\",\n scope = listOf(ScopeType.entries.first { it.value == \"rules\" }, ScopeType.entries.first { it.value == \"settings\" }),\n ),\n)\n\n// Use the response\nprintln(response)", - "copy": "var response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.entries.first { it.value == \"copy\" },\n destination = \"\",\n ),\n)\n\n// Use the response\nprintln(response)", - "move": "var response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.entries.first { it.value == \"move\" },\n destination = \"\",\n ),\n)\n\n// Use the response\nprintln(response)" + "scopes": "var response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.entries.first { it.value == \"move\" },\n destination = \"\",\n scope = listOf(ScopeType.entries.first { it.value == \"rules\" }, ScopeType.entries.first { it.value == \"settings\" }),\n ),\n)", + "copy": "var response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.entries.first { it.value == \"copy\" },\n destination = \"\",\n ),\n)", + "move": "var response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.entries.first { it.value == \"move\" },\n destination = \"\",\n ),\n)" }, "partialUpdateObject": { - "default": "var response = client.partialUpdateObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n attributesToUpdate = buildJsonObject {\n put(\n \"attributeId\",\n JsonPrimitive(\"new value\"),\n )\n },\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.partialUpdateObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n attributesToUpdate = buildJsonObject {\n put(\n \"attributeId\",\n JsonPrimitive(\"new value\"),\n )\n },\n)" }, "partialUpdateObjects": { - "call partialUpdateObjects with createIfNotExists=true": "var response = client.partialUpdateObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"1\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Adam\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"2\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Benoit\"),\n )\n },\n ),\n createIfNotExists = true,\n)\n\n// Use the response\nprintln(response)", - "call partialUpdateObjects with createIfNotExists=false": "var response = client.partialUpdateObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"3\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Cyril\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"4\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"David\"),\n )\n },\n ),\n createIfNotExists = false,\n)\n\n// Use the response\nprintln(response)" + "call partialUpdateObjects with createIfNotExists=true": "var response = client.partialUpdateObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"1\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Adam\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"2\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Benoit\"),\n )\n },\n ),\n createIfNotExists = true,\n)", + "call partialUpdateObjects with createIfNotExists=false": "var response = client.partialUpdateObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"3\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Cyril\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"4\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"David\"),\n )\n },\n ),\n createIfNotExists = false,\n)" }, "removeUserId": { - "default": "var response = client.removeUserId(\n userID = \"uniqueID\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.removeUserId(\n userID = \"uniqueID\",\n)" }, "replaceAllObjects": { - "default": "var response = client.replaceAllObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"1\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Adam\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"2\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Benoit\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"3\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Cyril\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"4\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"David\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"5\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Eva\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"6\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Fiona\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"7\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Gael\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"8\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Hugo\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"9\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Igor\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"10\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Julia\"),\n )\n },\n ),\n batchSize = 3,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.replaceAllObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"1\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Adam\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"2\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Benoit\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"3\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Cyril\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"4\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"David\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"5\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Eva\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"6\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Fiona\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"7\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Gael\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"8\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Hugo\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"9\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Igor\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"10\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Julia\"),\n )\n },\n ),\n batchSize = 3,\n)" }, "replaceSources": { - "default": "var response = client.replaceSources(\n source = listOf(\n Source(\n source = \"theSource\",\n description = \"theDescription\",\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.replaceSources(\n source = listOf(\n Source(\n source = \"theSource\",\n description = \"theDescription\",\n ),\n ),\n)" }, "restoreApiKey": { - "default": "var response = client.restoreApiKey(\n key = \"myApiKey\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.restoreApiKey(\n key = \"myApiKey\",\n)" }, "saveObject": { - "default": "var response = client.saveObject(\n indexName = \"\",\n body = buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"id\"),\n )\n put(\n \"test\",\n JsonPrimitive(\"val\"),\n )\n },\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.saveObject(\n indexName = \"\",\n body = buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"id\"),\n )\n put(\n \"test\",\n JsonPrimitive(\"val\"),\n )\n },\n)" }, "saveObjects": { - "call saveObjects without error": "var response = client.saveObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"1\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Adam\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"2\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Benoit\"),\n )\n },\n ),\n)\n\n// Use the response\nprintln(response)", - "saveObjects should report errors": "var response = client.saveObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"1\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Adam\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"2\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Benoit\"),\n )\n },\n ),\n)\n\n// Use the response\nprintln(response)" + "call saveObjects without error": "var response = client.saveObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"1\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Adam\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"2\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Benoit\"),\n )\n },\n ),\n)", + "saveObjects should report errors": "var response = client.saveObjects(\n indexName = \"\",\n objects = listOf(\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"1\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Adam\"),\n )\n },\n buildJsonObject {\n put(\n \"objectID\",\n JsonPrimitive(\"2\"),\n )\n put(\n \"name\",\n JsonPrimitive(\"Benoit\"),\n )\n },\n ),\n)" }, "saveRule": { - "default": "var response = client.saveRule(\n indexName = \"\",\n objectID = \"id1\",\n rule = Rule(\n objectID = \"id1\",\n conditions = listOf(\n Condition(\n pattern = \"apple\",\n anchoring = Anchoring.entries.first { it.value == \"contains\" },\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.saveRule(\n indexName = \"\",\n objectID = \"id1\",\n rule = Rule(\n objectID = \"id1\",\n conditions = listOf(\n Condition(\n pattern = \"apple\",\n anchoring = Anchoring.entries.first { it.value == \"contains\" },\n ),\n ),\n ),\n)" }, "saveRules": { - "default": "var response = client.saveRules(\n indexName = \"\",\n rules = listOf(\n Rule(\n objectID = \"a-rule-id\",\n conditions = listOf(\n Condition(\n pattern = \"smartphone\",\n anchoring = Anchoring.entries.first { it.value == \"contains\" },\n ),\n ),\n ),\n Rule(\n objectID = \"a-second-rule-id\",\n conditions = listOf(\n Condition(\n pattern = \"apple\",\n anchoring = Anchoring.entries.first { it.value == \"contains\" },\n ),\n ),\n ),\n ),\n forwardToReplicas = false,\n clearExistingRules = true,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.saveRules(\n indexName = \"\",\n rules = listOf(\n Rule(\n objectID = \"a-rule-id\",\n conditions = listOf(\n Condition(\n pattern = \"smartphone\",\n anchoring = Anchoring.entries.first { it.value == \"contains\" },\n ),\n ),\n ),\n Rule(\n objectID = \"a-second-rule-id\",\n conditions = listOf(\n Condition(\n pattern = \"apple\",\n anchoring = Anchoring.entries.first { it.value == \"contains\" },\n ),\n ),\n ),\n ),\n forwardToReplicas = false,\n clearExistingRules = true,\n)" }, "saveSynonym": { - "default": "var response = client.saveSynonym(\n indexName = \"\",\n objectID = \"id1\",\n synonymHit = SynonymHit(\n objectID = \"id1\",\n type = SynonymType.entries.first { it.value == \"synonym\" },\n synonyms = listOf(\"car\", \"vehicule\", \"auto\"),\n ),\n forwardToReplicas = true,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.saveSynonym(\n indexName = \"\",\n objectID = \"id1\",\n synonymHit = SynonymHit(\n objectID = \"id1\",\n type = SynonymType.entries.first { it.value == \"synonym\" },\n synonyms = listOf(\"car\", \"vehicule\", \"auto\"),\n ),\n forwardToReplicas = true,\n)" }, "saveSynonyms": { - "default": "var response = client.saveSynonyms(\n indexName = \"\",\n synonymHit = listOf(\n SynonymHit(\n objectID = \"id1\",\n type = SynonymType.entries.first { it.value == \"synonym\" },\n synonyms = listOf(\"car\", \"vehicule\", \"auto\"),\n ),\n SynonymHit(\n objectID = \"id2\",\n type = SynonymType.entries.first { it.value == \"onewaysynonym\" },\n input = \"iphone\",\n synonyms = listOf(\"ephone\", \"aphone\", \"yphone\"),\n ),\n ),\n forwardToReplicas = true,\n replaceExistingSynonyms = true,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.saveSynonyms(\n indexName = \"\",\n synonymHit = listOf(\n SynonymHit(\n objectID = \"id1\",\n type = SynonymType.entries.first { it.value == \"synonym\" },\n synonyms = listOf(\"car\", \"vehicule\", \"auto\"),\n ),\n SynonymHit(\n objectID = \"id2\",\n type = SynonymType.entries.first { it.value == \"onewaysynonym\" },\n input = \"iphone\",\n synonyms = listOf(\"ephone\", \"aphone\", \"yphone\"),\n ),\n ),\n forwardToReplicas = true,\n replaceExistingSynonyms = true,\n)" }, "search": { - "withHitsPerPage": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n hitsPerPage = 50,\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "filterOnly": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n filters = \"actor:Scarlett Johansson\",\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "filterOr": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n filters = \"actor:Tom Cruise OR actor:Scarlett Johansson\",\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "filterNot": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n filters = \"NOT actor:Nicolas Cage\",\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "retrieveFacets": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n facets = listOf(\"author\", \"genre\"),\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)", - "retrieveFacetsWildcard": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n facets = listOf(\"*\"),\n ),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "withHitsPerPage": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n hitsPerPage = 50,\n ),\n ),\n ),\n)", + "filterOnly": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n filters = \"actor:Scarlett Johansson\",\n ),\n ),\n ),\n)", + "filterOr": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n filters = \"actor:Tom Cruise OR actor:Scarlett Johansson\",\n ),\n ),\n ),\n)", + "filterNot": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n filters = \"NOT actor:Nicolas Cage\",\n ),\n ),\n ),\n)", + "retrieveFacets": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n facets = listOf(\"author\", \"genre\"),\n ),\n ),\n ),\n)", + "retrieveFacetsWildcard": "var response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = listOf(\n SearchForHits(\n indexName = \"\",\n query = \"\",\n facets = listOf(\"*\"),\n ),\n ),\n ),\n)" }, "searchDictionaryEntries": { - "default": "var response = client.searchDictionaryEntries(\n dictionaryName = DictionaryType.entries.first { it.value == \"stopwords\" },\n searchDictionaryEntriesParams = SearchDictionaryEntriesParams(\n query = \"about\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchDictionaryEntries(\n dictionaryName = DictionaryType.entries.first { it.value == \"stopwords\" },\n searchDictionaryEntriesParams = SearchDictionaryEntriesParams(\n query = \"about\",\n ),\n)" }, "searchForFacetValues": { - "default": "var response = client.searchForFacetValues(\n indexName = \"\",\n facetName = \"facetName\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchForFacetValues(\n indexName = \"\",\n facetName = \"facetName\",\n)" }, "searchRules": { - "default": "var response = client.searchRules(\n indexName = \"\",\n searchRulesParams = SearchRulesParams(\n query = \"zorro\",\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchRules(\n indexName = \"\",\n searchRulesParams = SearchRulesParams(\n query = \"zorro\",\n ),\n)" }, "searchSingleIndex": { - "default": "var response = client.searchSingleIndex(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchSingleIndex(\n indexName = \"\",\n)" }, "searchSynonyms": { - "default": "var response = client.searchSynonyms(\n indexName = \"\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchSynonyms(\n indexName = \"\",\n)" }, "searchUserIds": { - "default": "var response = client.searchUserIds(\n searchUserIdsParams = SearchUserIdsParams(\n query = \"test\",\n clusterName = \"theClusterName\",\n page = 5,\n hitsPerPage = 10,\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.searchUserIds(\n searchUserIdsParams = SearchUserIdsParams(\n query = \"test\",\n clusterName = \"theClusterName\",\n page = 5,\n hitsPerPage = 10,\n ),\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "setDictionarySettings": { - "default": "var response = client.setDictionarySettings(\n dictionarySettingsParams = DictionarySettingsParams(\n disableStandardEntries = StandardEntries(\n plurals = mapOf(\"fr\" to false, \"en\" to false, \"ru\" to true),\n ),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.setDictionarySettings(\n dictionarySettingsParams = DictionarySettingsParams(\n disableStandardEntries = StandardEntries(\n plurals = mapOf(\"fr\" to false, \"en\" to false, \"ru\" to true),\n ),\n ),\n)" }, "setSettings": { - "default": "var response = client.setSettings(\n indexName = \"\",\n indexSettings = IndexSettings(\n attributesForFaceting = listOf(\"actor\", \"filterOnly(category)\", \"searchable(publisher)\"),\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.setSettings(\n indexName = \"\",\n indexSettings = IndexSettings(\n attributesForFaceting = listOf(\"actor\", \"filterOnly(category)\", \"searchable(publisher)\"),\n ),\n)" }, "updateApiKey": { - "default": "var response = client.updateApiKey(\n key = \"myApiKey\",\n apiKey = ApiKey(\n acl = listOf(Acl.entries.first { it.value == \"search\" }, Acl.entries.first { it.value == \"addObject\" }),\n validity = 300,\n maxQueriesPerIPPerHour = 100,\n maxHitsPerQuery = 20,\n ),\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.updateApiKey(\n key = \"myApiKey\",\n apiKey = ApiKey(\n acl = listOf(Acl.entries.first { it.value == \"search\" }, Acl.entries.first { it.value == \"addObject\" }),\n validity = 300,\n maxQueriesPerIPPerHour = 100,\n maxHitsPerQuery = 20,\n ),\n)" }, "waitForApiKey": { - "wait for api key helper - add": "var response = client.waitForApiKey(\n key = \"api-key-add-operation-test-kotlin\",\n operation = ApiKeyOperation.entries.first { it.value == \"add\" },\n)\n\n// Use the response\nprintln(response)", - "wait for api key - update": "var response = client.waitForApiKey(\n key = \"api-key-update-operation-test-kotlin\",\n operation = ApiKeyOperation.entries.first { it.value == \"update\" },\n apiKey = ApiKey(\n description = \"my updated api key\",\n acl = listOf(Acl.entries.first { it.value == \"search\" }, Acl.entries.first { it.value == \"addObject\" }, Acl.entries.first { it.value == \"deleteObject\" }),\n indexes = listOf(\"Movies\", \"Books\"),\n referers = listOf(\"*google.com\", \"*algolia.com\"),\n validity = 305,\n maxQueriesPerIPPerHour = 95,\n maxHitsPerQuery = 20,\n ),\n)\n\n// Use the response\nprintln(response)", - "wait for api key - delete": "var response = client.waitForApiKey(\n key = \"api-key-delete-operation-test-kotlin\",\n operation = ApiKeyOperation.entries.first { it.value == \"delete\" },\n)\n\n// Use the response\nprintln(response)" + "wait for api key helper - add": "var response = client.waitForApiKey(\n key = \"api-key-add-operation-test-kotlin\",\n operation = ApiKeyOperation.entries.first { it.value == \"add\" },\n)", + "wait for api key - update": "var response = client.waitForApiKey(\n key = \"api-key-update-operation-test-kotlin\",\n operation = ApiKeyOperation.entries.first { it.value == \"update\" },\n apiKey = ApiKey(\n description = \"my updated api key\",\n acl = listOf(Acl.entries.first { it.value == \"search\" }, Acl.entries.first { it.value == \"addObject\" }, Acl.entries.first { it.value == \"deleteObject\" }),\n indexes = listOf(\"Movies\", \"Books\"),\n referers = listOf(\"*google.com\", \"*algolia.com\"),\n validity = 305,\n maxQueriesPerIPPerHour = 95,\n maxHitsPerQuery = 20,\n ),\n)", + "wait for api key - delete": "var response = client.waitForApiKey(\n key = \"api-key-delete-operation-test-kotlin\",\n operation = ApiKeyOperation.entries.first { it.value == \"delete\" },\n)" }, "waitForAppTask": { - "default": "var response = client.waitForAppTask(\n taskID = 123L,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.waitForAppTask(\n taskID = 123L,\n)" }, "waitForTask": { - "default": "var response = client.waitForTask(\n indexName = \"\",\n taskID = 123L,\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.waitForTask(\n indexName = \"\",\n taskID = 123L,\n)" }, "init": { "default": "val client = SearchClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\")" @@ -1462,239 +1480,242 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\SearchClient;" }, "addApiKey": { - "default": "$response = $client->addApiKey(\n ['acl' => [\n 'search',\n\n 'addObject',\n ],\n 'description' => 'my new api key',\n 'validity' => 300,\n 'maxQueriesPerIPPerHour' => 100,\n 'maxHitsPerQuery' => 20,\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->addApiKey(\n ['acl' => [\n 'search',\n\n 'addObject',\n ],\n 'description' => 'my new api key',\n 'validity' => 300,\n 'maxQueriesPerIPPerHour' => 100,\n 'maxHitsPerQuery' => 20,\n ],\n);" }, "addOrUpdateObject": { - "default": "$response = $client->addOrUpdateObject(\n '',\n 'uniqueID',\n ['key' => 'value',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->addOrUpdateObject(\n '',\n 'uniqueID',\n ['key' => 'value',\n ],\n);" }, "appendSource": { - "default": "$response = $client->appendSource(\n ['source' => 'theSource',\n 'description' => 'theDescription',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->appendSource(\n ['source' => 'theSource',\n 'description' => 'theDescription',\n ],\n);" }, "assignUserId": { - "default": "$response = $client->assignUserId(\n 'userID',\n ['cluster' => 'theCluster',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->assignUserId(\n 'userID',\n ['cluster' => 'theCluster',\n ],\n);" }, "batch": { - "addObject": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'addObject',\n 'body' => ['key' => 'bar',\n 'foo' => '1',\n ],\n ],\n\n ['action' => 'addObject',\n 'body' => ['key' => 'baz',\n 'foo' => '2',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "clear": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'clear',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "delete": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'delete',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "deleteObject": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'deleteObject',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "partialUpdateObject": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'partialUpdateObject',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "partialUpdateObjectNoCreate": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'partialUpdateObjectNoCreate',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "updateObject": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'updateObject',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "addObject": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'addObject',\n 'body' => ['key' => 'bar',\n 'foo' => '1',\n ],\n ],\n\n ['action' => 'addObject',\n 'body' => ['key' => 'baz',\n 'foo' => '2',\n ],\n ],\n ],\n ],\n);", + "clear": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'clear',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);", + "delete": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'delete',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);", + "deleteObject": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'deleteObject',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);", + "partialUpdateObject": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'partialUpdateObject',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);", + "partialUpdateObjectNoCreate": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'partialUpdateObjectNoCreate',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);", + "updateObject": "$response = $client->batch(\n '',\n ['requests' => [\n ['action' => 'updateObject',\n 'body' => ['key' => 'value',\n ],\n ],\n ],\n ],\n);" }, "batchAssignUserIds": { - "default": "$response = $client->batchAssignUserIds(\n 'userID',\n ['cluster' => 'theCluster',\n 'users' => [\n 'user1',\n\n 'user2',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->batchAssignUserIds(\n 'userID',\n ['cluster' => 'theCluster',\n 'users' => [\n 'user1',\n\n 'user2',\n ],\n ],\n);" }, "batchDictionaryEntries": { - "replace": "$response = $client->batchDictionaryEntries(\n 'plurals',\n ['clearExistingDictionaryEntries' => true,\n 'requests' => [\n ['action' => 'addEntry',\n 'body' => ['objectID' => '1',\n 'language' => 'en',\n 'word' => 'fancy',\n 'words' => [\n 'believe',\n\n 'algolia',\n ],\n 'decomposition' => [\n 'trust',\n\n 'algolia',\n ],\n 'state' => 'enabled',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "delete": "$response = $client->batchDictionaryEntries(\n 'plurals',\n ['clearExistingDictionaryEntries' => true,\n 'requests' => [\n ['action' => 'deleteEntry',\n 'body' => ['objectID' => '1',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "append": "$response = $client->batchDictionaryEntries(\n 'stopwords',\n ['requests' => [\n ['action' => 'addEntry',\n 'body' => ['objectID' => '1',\n 'language' => 'en',\n 'additional' => 'try me',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "replace": "$response = $client->batchDictionaryEntries(\n 'plurals',\n ['clearExistingDictionaryEntries' => true,\n 'requests' => [\n ['action' => 'addEntry',\n 'body' => ['objectID' => '1',\n 'language' => 'en',\n 'word' => 'fancy',\n 'words' => [\n 'believe',\n\n 'algolia',\n ],\n 'decomposition' => [\n 'trust',\n\n 'algolia',\n ],\n 'state' => 'enabled',\n ],\n ],\n ],\n ],\n);", + "delete": "$response = $client->batchDictionaryEntries(\n 'plurals',\n ['clearExistingDictionaryEntries' => true,\n 'requests' => [\n ['action' => 'deleteEntry',\n 'body' => ['objectID' => '1',\n ],\n ],\n ],\n ],\n);", + "append": "$response = $client->batchDictionaryEntries(\n 'stopwords',\n ['requests' => [\n ['action' => 'addEntry',\n 'body' => ['objectID' => '1',\n 'language' => 'en',\n 'additional' => 'try me',\n ],\n ],\n ],\n ],\n);" }, "browse": { - "default": "$response = $client->browse(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->browse(\n '',\n);" }, "clearObjects": { - "default": "$response = $client->clearObjects(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->clearObjects(\n '',\n);" }, "clearRules": { - "default": "$response = $client->clearRules(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->clearRules(\n '',\n);" }, "clearSynonyms": { - "default": "$response = $client->clearSynonyms(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->clearSynonyms(\n '',\n);" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "deleteApiKey": { - "default": "$response = $client->deleteApiKey(\n 'myTestApiKey',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteApiKey(\n 'myTestApiKey',\n);" }, "deleteBy": { - "default": "$response = $client->deleteBy(\n '',\n ['filters' => 'brand:brandName',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteBy(\n '',\n ['filters' => 'brand:brandName',\n ],\n);" }, "deleteIndex": { - "default": "$response = $client->deleteIndex(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteIndex(\n '',\n);" }, "deleteObject": { - "default": "$response = $client->deleteObject(\n '',\n 'uniqueID',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteObject(\n '',\n 'uniqueID',\n);" }, "deleteObjects": { - "default": "$response = $client->deleteObjects(\n '',\n [\n '1',\n\n '2',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteObjects(\n '',\n [\n '1',\n\n '2',\n ],\n);" }, "deleteRule": { - "default": "$response = $client->deleteRule(\n '',\n 'id1',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteRule(\n '',\n 'id1',\n);" }, "deleteSource": { - "default": "$response = $client->deleteSource(\n 'theSource',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteSource(\n 'theSource',\n);" }, "deleteSynonym": { - "default": "$response = $client->deleteSynonym(\n '',\n 'id1',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->deleteSynonym(\n '',\n 'id1',\n);" }, "generateSecuredApiKey": { - "generate secured api key basic": "$response = $client->generateSecuredApiKey(\n '2640659426d5107b6e47d75db9cbaef8',\n ['validUntil' => 2524604400,\n 'restrictIndices' => [\n 'Movies',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "generate secured api key with searchParams": "$response = $client->generateSecuredApiKey(\n '2640659426d5107b6e47d75db9cbaef8',\n ['validUntil' => 2524604400,\n 'restrictIndices' => [\n 'Movies',\n\n 'cts_e2e_settings',\n ],\n 'restrictSources' => '192.168.1.0/24',\n 'filters' => 'category:Book OR category:Ebook AND _tags:published',\n 'userToken' => 'user123',\n 'searchParams' => ['query' => 'batman',\n 'typoTolerance' => 'strict',\n 'aroundRadius' => 'all',\n 'mode' => 'neuralSearch',\n 'hitsPerPage' => 10,\n 'optionalWords' => [\n 'one',\n\n 'two',\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "generate secured api key basic": "$response = $client->generateSecuredApiKey(\n '2640659426d5107b6e47d75db9cbaef8',\n ['validUntil' => 2524604400,\n 'restrictIndices' => [\n 'Movies',\n ],\n ],\n);", + "generate secured api key with searchParams": "$response = $client->generateSecuredApiKey(\n '2640659426d5107b6e47d75db9cbaef8',\n ['validUntil' => 2524604400,\n 'restrictIndices' => [\n 'Movies',\n\n 'cts_e2e_settings',\n ],\n 'restrictSources' => '192.168.1.0/24',\n 'filters' => 'category:Book OR category:Ebook AND _tags:published',\n 'userToken' => 'user123',\n 'searchParams' => ['query' => 'batman',\n 'typoTolerance' => 'strict',\n 'aroundRadius' => 'all',\n 'mode' => 'neuralSearch',\n 'hitsPerPage' => 10,\n 'optionalWords' => [\n 'one',\n\n 'two',\n ],\n ],\n ],\n);" }, "getApiKey": { - "default": "$response = $client->getApiKey(\n 'myTestApiKey',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getApiKey(\n 'myTestApiKey',\n);" }, "getAppTask": { - "default": "$response = $client->getAppTask(\n 123,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getAppTask(\n 123,\n);" }, "getDictionaryLanguages": { - "default": "$response = $client->getDictionaryLanguages();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getDictionaryLanguages();" }, "getDictionarySettings": { - "default": "$response = $client->getDictionarySettings();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getDictionarySettings();" }, "getLogs": { - "default": "$response = $client->getLogs();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getLogs();" }, "getObject": { - "default": "$response = $client->getObject(\n '',\n 'uniqueID',\n [\n 'attr1',\n\n 'attr2',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getObject(\n '',\n 'uniqueID',\n [\n 'attr1',\n\n 'attr2',\n ],\n);" }, "getObjects": { - "default": "$response = $client->getObjects(\n ['requests' => [\n ['attributesToRetrieve' => [\n 'attr1',\n\n 'attr2',\n ],\n 'objectID' => 'uniqueID',\n 'indexName' => '',\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getObjects(\n ['requests' => [\n ['attributesToRetrieve' => [\n 'attr1',\n\n 'attr2',\n ],\n 'objectID' => 'uniqueID',\n 'indexName' => '',\n ],\n ],\n ],\n);" }, "getRule": { - "default": "$response = $client->getRule(\n '',\n 'qr-1725004648916',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getRule(\n '',\n 'qr-1725004648916',\n);" }, "getSettings": { - "default": "$response = $client->getSettings(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getSettings(\n '',\n);" }, "getSources": { - "default": "$response = $client->getSources();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getSources();" }, "getSynonym": { - "default": "$response = $client->getSynonym(\n '',\n 'id1',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getSynonym(\n '',\n 'id1',\n);" }, "getTask": { - "default": "$response = $client->getTask(\n '',\n 123,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTask(\n '',\n 123,\n);" }, "getTopUserIds": { - "default": "$response = $client->getTopUserIds();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getTopUserIds();" }, "getUserId": { - "default": "$response = $client->getUserId(\n 'uniqueID',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getUserId(\n 'uniqueID',\n);" }, "hasPendingMappings": { - "default": "$response = $client->hasPendingMappings();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->hasPendingMappings();" }, "indexExists": { - "indexExists": "$response = $client->indexExists(\n '',\n);\n\n// play with the response\nvar_dump($response);", - "indexNotExists": "$response = $client->indexExists(\n '',\n);\n\n// play with the response\nvar_dump($response);", - "indexExistsWithError": "$response = $client->indexExists(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "indexExists": "$response = $client->indexExists(\n '',\n);", + "indexNotExists": "$response = $client->indexExists(\n '',\n);", + "indexExistsWithError": "$response = $client->indexExists(\n '',\n);" }, "listApiKeys": { - "default": "$response = $client->listApiKeys();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listApiKeys();" }, "listClusters": { - "default": "$response = $client->listClusters();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listClusters();" }, "listIndices": { - "default": "$response = $client->listIndices();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listIndices();" }, "listUserIds": { - "default": "$response = $client->listUserIds();\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->listUserIds();" }, "multipleBatch": { - "default": "$response = $client->multipleBatch(\n ['requests' => [\n ['action' => 'addObject',\n 'body' => ['key' => 'value',\n ],\n 'indexName' => '',\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->multipleBatch(\n ['requests' => [\n ['action' => 'addObject',\n 'body' => ['key' => 'value',\n ],\n 'indexName' => '',\n ],\n ],\n ],\n);" }, "operationIndex": { - "scopes": "$response = $client->operationIndex(\n '',\n ['operation' => 'move',\n 'destination' => '',\n 'scope' => [\n 'rules',\n\n 'settings',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "copy": "$response = $client->operationIndex(\n '',\n ['operation' => 'copy',\n 'destination' => '',\n ],\n);\n\n// play with the response\nvar_dump($response);", - "move": "$response = $client->operationIndex(\n '',\n ['operation' => 'move',\n 'destination' => '',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "scopes": "$response = $client->operationIndex(\n '',\n ['operation' => 'move',\n 'destination' => '',\n 'scope' => [\n 'rules',\n\n 'settings',\n ],\n ],\n);", + "copy": "$response = $client->operationIndex(\n '',\n ['operation' => 'copy',\n 'destination' => '',\n ],\n);", + "move": "$response = $client->operationIndex(\n '',\n ['operation' => 'move',\n 'destination' => '',\n ],\n);" }, "partialUpdateObject": { - "default": "$response = $client->partialUpdateObject(\n '',\n 'uniqueID',\n ['attributeId' => 'new value',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->partialUpdateObject(\n '',\n 'uniqueID',\n ['attributeId' => 'new value',\n ],\n);" }, "partialUpdateObjects": { - "call partialUpdateObjects with createIfNotExists=true": "$response = $client->partialUpdateObjects(\n '',\n [\n ['objectID' => '1',\n 'name' => 'Adam',\n ],\n\n ['objectID' => '2',\n 'name' => 'Benoit',\n ],\n ],\n true,\n);\n\n// play with the response\nvar_dump($response);", - "call partialUpdateObjects with createIfNotExists=false": "$response = $client->partialUpdateObjects(\n '',\n [\n ['objectID' => '3',\n 'name' => 'Cyril',\n ],\n\n ['objectID' => '4',\n 'name' => 'David',\n ],\n ],\n false,\n);\n\n// play with the response\nvar_dump($response);" + "call partialUpdateObjects with createIfNotExists=true": "$response = $client->partialUpdateObjects(\n '',\n [\n ['objectID' => '1',\n 'name' => 'Adam',\n ],\n\n ['objectID' => '2',\n 'name' => 'Benoit',\n ],\n ],\n true,\n);", + "call partialUpdateObjects with createIfNotExists=false": "$response = $client->partialUpdateObjects(\n '',\n [\n ['objectID' => '3',\n 'name' => 'Cyril',\n ],\n\n ['objectID' => '4',\n 'name' => 'David',\n ],\n ],\n false,\n);" }, "removeUserId": { - "default": "$response = $client->removeUserId(\n 'uniqueID',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->removeUserId(\n 'uniqueID',\n);" }, "replaceAllObjects": { - "default": "$response = $client->replaceAllObjects(\n '',\n [\n ['objectID' => '1',\n 'name' => 'Adam',\n ],\n\n ['objectID' => '2',\n 'name' => 'Benoit',\n ],\n\n ['objectID' => '3',\n 'name' => 'Cyril',\n ],\n\n ['objectID' => '4',\n 'name' => 'David',\n ],\n\n ['objectID' => '5',\n 'name' => 'Eva',\n ],\n\n ['objectID' => '6',\n 'name' => 'Fiona',\n ],\n\n ['objectID' => '7',\n 'name' => 'Gael',\n ],\n\n ['objectID' => '8',\n 'name' => 'Hugo',\n ],\n\n ['objectID' => '9',\n 'name' => 'Igor',\n ],\n\n ['objectID' => '10',\n 'name' => 'Julia',\n ],\n ],\n 3,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->replaceAllObjects(\n '',\n [\n ['objectID' => '1',\n 'name' => 'Adam',\n ],\n\n ['objectID' => '2',\n 'name' => 'Benoit',\n ],\n\n ['objectID' => '3',\n 'name' => 'Cyril',\n ],\n\n ['objectID' => '4',\n 'name' => 'David',\n ],\n\n ['objectID' => '5',\n 'name' => 'Eva',\n ],\n\n ['objectID' => '6',\n 'name' => 'Fiona',\n ],\n\n ['objectID' => '7',\n 'name' => 'Gael',\n ],\n\n ['objectID' => '8',\n 'name' => 'Hugo',\n ],\n\n ['objectID' => '9',\n 'name' => 'Igor',\n ],\n\n ['objectID' => '10',\n 'name' => 'Julia',\n ],\n ],\n 3,\n);" }, "replaceSources": { - "default": "$response = $client->replaceSources(\n [\n ['source' => 'theSource',\n 'description' => 'theDescription',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->replaceSources(\n [\n ['source' => 'theSource',\n 'description' => 'theDescription',\n ],\n ],\n);" }, "restoreApiKey": { - "default": "$response = $client->restoreApiKey(\n 'myApiKey',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->restoreApiKey(\n 'myApiKey',\n);" }, "saveObject": { - "default": "$response = $client->saveObject(\n '',\n ['objectID' => 'id',\n 'test' => 'val',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->saveObject(\n '',\n ['objectID' => 'id',\n 'test' => 'val',\n ],\n);" }, "saveObjects": { - "call saveObjects without error": "$response = $client->saveObjects(\n '',\n [\n ['objectID' => '1',\n 'name' => 'Adam',\n ],\n\n ['objectID' => '2',\n 'name' => 'Benoit',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "saveObjects should report errors": "$response = $client->saveObjects(\n '',\n [\n ['objectID' => '1',\n 'name' => 'Adam',\n ],\n\n ['objectID' => '2',\n 'name' => 'Benoit',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "call saveObjects without error": "$response = $client->saveObjects(\n '',\n [\n ['objectID' => '1',\n 'name' => 'Adam',\n ],\n\n ['objectID' => '2',\n 'name' => 'Benoit',\n ],\n ],\n);", + "saveObjects should report errors": "$response = $client->saveObjects(\n '',\n [\n ['objectID' => '1',\n 'name' => 'Adam',\n ],\n\n ['objectID' => '2',\n 'name' => 'Benoit',\n ],\n ],\n);" }, "saveRule": { - "default": "$response = $client->saveRule(\n '',\n 'id1',\n ['objectID' => 'id1',\n 'conditions' => [\n ['pattern' => 'apple',\n 'anchoring' => 'contains',\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->saveRule(\n '',\n 'id1',\n ['objectID' => 'id1',\n 'conditions' => [\n ['pattern' => 'apple',\n 'anchoring' => 'contains',\n ],\n ],\n ],\n);" }, "saveRules": { - "default": "$response = $client->saveRules(\n '',\n [\n ['objectID' => 'a-rule-id',\n 'conditions' => [\n ['pattern' => 'smartphone',\n 'anchoring' => 'contains',\n ],\n ],\n ],\n\n ['objectID' => 'a-second-rule-id',\n 'conditions' => [\n ['pattern' => 'apple',\n 'anchoring' => 'contains',\n ],\n ],\n ],\n ],\n false,\n true,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->saveRules(\n '',\n [\n ['objectID' => 'a-rule-id',\n 'conditions' => [\n ['pattern' => 'smartphone',\n 'anchoring' => 'contains',\n ],\n ],\n ],\n\n ['objectID' => 'a-second-rule-id',\n 'conditions' => [\n ['pattern' => 'apple',\n 'anchoring' => 'contains',\n ],\n ],\n ],\n ],\n false,\n true,\n);" }, "saveSynonym": { - "default": "$response = $client->saveSynonym(\n '',\n 'id1',\n ['objectID' => 'id1',\n 'type' => 'synonym',\n 'synonyms' => [\n 'car',\n\n 'vehicule',\n\n 'auto',\n ],\n ],\n true,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->saveSynonym(\n '',\n 'id1',\n ['objectID' => 'id1',\n 'type' => 'synonym',\n 'synonyms' => [\n 'car',\n\n 'vehicule',\n\n 'auto',\n ],\n ],\n true,\n);" }, "saveSynonyms": { - "default": "$response = $client->saveSynonyms(\n '',\n [\n ['objectID' => 'id1',\n 'type' => 'synonym',\n 'synonyms' => [\n 'car',\n\n 'vehicule',\n\n 'auto',\n ],\n ],\n\n ['objectID' => 'id2',\n 'type' => 'onewaysynonym',\n 'input' => 'iphone',\n 'synonyms' => [\n 'ephone',\n\n 'aphone',\n\n 'yphone',\n ],\n ],\n ],\n true,\n true,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->saveSynonyms(\n '',\n [\n ['objectID' => 'id1',\n 'type' => 'synonym',\n 'synonyms' => [\n 'car',\n\n 'vehicule',\n\n 'auto',\n ],\n ],\n\n ['objectID' => 'id2',\n 'type' => 'onewaysynonym',\n 'input' => 'iphone',\n 'synonyms' => [\n 'ephone',\n\n 'aphone',\n\n 'yphone',\n ],\n ],\n ],\n true,\n true,\n);" }, "search": { - "withHitsPerPage": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'hitsPerPage' => 50,\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "filterOnly": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'filters' => 'actor:Scarlett Johansson',\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "filterOr": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'filters' => 'actor:Tom Cruise OR actor:Scarlett Johansson',\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "filterNot": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'filters' => 'NOT actor:Nicolas Cage',\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "retrieveFacets": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'facets' => [\n 'author',\n\n 'genre',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);", - "retrieveFacetsWildcard": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'facets' => [\n '*',\n ],\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "withHitsPerPage": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'hitsPerPage' => 50,\n ],\n ],\n ],\n);", + "filterOnly": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'filters' => 'actor:Scarlett Johansson',\n ],\n ],\n ],\n);", + "filterOr": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'filters' => 'actor:Tom Cruise OR actor:Scarlett Johansson',\n ],\n ],\n ],\n);", + "filterNot": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'filters' => 'NOT actor:Nicolas Cage',\n ],\n ],\n ],\n);", + "retrieveFacets": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'facets' => [\n 'author',\n\n 'genre',\n ],\n ],\n ],\n ],\n);", + "retrieveFacetsWildcard": "$response = $client->search(\n ['requests' => [\n ['indexName' => '',\n 'query' => '',\n 'facets' => [\n '*',\n ],\n ],\n ],\n ],\n);" }, "searchDictionaryEntries": { - "default": "$response = $client->searchDictionaryEntries(\n 'stopwords',\n ['query' => 'about',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchDictionaryEntries(\n 'stopwords',\n ['query' => 'about',\n ],\n);" }, "searchForFacetValues": { - "default": "$response = $client->searchForFacetValues(\n '',\n 'facetName',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchForFacetValues(\n '',\n 'facetName',\n);" }, "searchRules": { - "default": "$response = $client->searchRules(\n '',\n ['query' => 'zorro',\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchRules(\n '',\n ['query' => 'zorro',\n ],\n);" }, "searchSingleIndex": { - "default": "$response = $client->searchSingleIndex(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchSingleIndex(\n '',\n);" }, "searchSynonyms": { - "default": "$response = $client->searchSynonyms(\n '',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchSynonyms(\n '',\n);" }, "searchUserIds": { - "default": "$response = $client->searchUserIds(\n ['query' => 'test',\n 'clusterName' => 'theClusterName',\n 'page' => 5,\n 'hitsPerPage' => 10,\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->searchUserIds(\n ['query' => 'test',\n 'clusterName' => 'theClusterName',\n 'page' => 5,\n 'hitsPerPage' => 10,\n ],\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "setDictionarySettings": { - "default": "$response = $client->setDictionarySettings(\n ['disableStandardEntries' => ['plurals' => ['fr' => false,\n 'en' => false,\n 'ru' => true,\n ],\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->setDictionarySettings(\n ['disableStandardEntries' => ['plurals' => ['fr' => false,\n 'en' => false,\n 'ru' => true,\n ],\n ],\n ],\n);" }, "setSettings": { - "default": "$response = $client->setSettings(\n '',\n ['attributesForFaceting' => [\n 'actor',\n\n 'filterOnly(category)',\n\n 'searchable(publisher)',\n ],\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->setSettings(\n '',\n ['attributesForFaceting' => [\n 'actor',\n\n 'filterOnly(category)',\n\n 'searchable(publisher)',\n ],\n ],\n);" }, "updateApiKey": { - "default": "$response = $client->updateApiKey(\n 'myApiKey',\n ['acl' => [\n 'search',\n\n 'addObject',\n ],\n 'validity' => 300,\n 'maxQueriesPerIPPerHour' => 100,\n 'maxHitsPerQuery' => 20,\n ],\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->updateApiKey(\n 'myApiKey',\n ['acl' => [\n 'search',\n\n 'addObject',\n ],\n 'validity' => 300,\n 'maxQueriesPerIPPerHour' => 100,\n 'maxHitsPerQuery' => 20,\n ],\n);" }, "waitForApiKey": { - "wait for api key helper - add": "$response = $client->waitForApiKey(\n 'api-key-add-operation-test-php',\n 'add',\n);\n\n// play with the response\nvar_dump($response);", - "wait for api key - update": "$response = $client->waitForApiKey(\n 'api-key-update-operation-test-php',\n 'update',\n ['description' => 'my updated api key',\n 'acl' => [\n 'search',\n\n 'addObject',\n\n 'deleteObject',\n ],\n 'indexes' => [\n 'Movies',\n\n 'Books',\n ],\n 'referers' => [\n '*google.com',\n\n '*algolia.com',\n ],\n 'validity' => 305,\n 'maxQueriesPerIPPerHour' => 95,\n 'maxHitsPerQuery' => 20,\n ],\n);\n\n// play with the response\nvar_dump($response);", - "wait for api key - delete": "$response = $client->waitForApiKey(\n 'api-key-delete-operation-test-php',\n 'delete',\n);\n\n// play with the response\nvar_dump($response);" + "wait for api key helper - add": "$response = $client->waitForApiKey(\n 'api-key-add-operation-test-php',\n 'add',\n);", + "wait for api key - update": "$response = $client->waitForApiKey(\n 'api-key-update-operation-test-php',\n 'update',\n ['description' => 'my updated api key',\n 'acl' => [\n 'search',\n\n 'addObject',\n\n 'deleteObject',\n ],\n 'indexes' => [\n 'Movies',\n\n 'Books',\n ],\n 'referers' => [\n '*google.com',\n\n '*algolia.com',\n ],\n 'validity' => 305,\n 'maxQueriesPerIPPerHour' => 95,\n 'maxHitsPerQuery' => 20,\n ],\n);", + "wait for api key - delete": "$response = $client->waitForApiKey(\n 'api-key-delete-operation-test-php',\n 'delete',\n);" }, "waitForAppTask": { - "default": "$response = $client->waitForAppTask(\n 123,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->waitForAppTask(\n 123,\n);" }, "waitForTask": { - "default": "$response = $client->waitForTask(\n '',\n 123,\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->waitForTask(\n '',\n 123,\n);" }, "init": { "default": "$client = SearchClient::create('', '');" @@ -1705,239 +1726,242 @@ "default": "from algoliasearch.search.client import SearchClient" }, "addApiKey": { - "default": "response = await _client.add_api_key(\n api_key={\n \"acl\": [\n \"search\",\n \"addObject\",\n ],\n \"description\": \"my new api key\",\n \"validity\": 300,\n \"maxQueriesPerIPPerHour\": 100,\n \"maxHitsPerQuery\": 20,\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.add_api_key(\n api_key={\n \"acl\": [\n \"search\",\n \"addObject\",\n ],\n \"description\": \"my new api key\",\n \"validity\": 300,\n \"maxQueriesPerIPPerHour\": 100,\n \"maxHitsPerQuery\": 20,\n },\n)" }, "addOrUpdateObject": { - "default": "response = await _client.add_or_update_object(\n index_name=\"\",\n object_id=\"uniqueID\",\n body={\n \"key\": \"value\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.add_or_update_object(\n index_name=\"\",\n object_id=\"uniqueID\",\n body={\n \"key\": \"value\",\n },\n)" }, "appendSource": { - "default": "response = await _client.append_source(\n source={\n \"source\": \"theSource\",\n \"description\": \"theDescription\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.append_source(\n source={\n \"source\": \"theSource\",\n \"description\": \"theDescription\",\n },\n)" }, "assignUserId": { - "default": "response = await _client.assign_user_id(\n x_algolia_user_id=\"userID\",\n assign_user_id_params={\n \"cluster\": \"theCluster\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.assign_user_id(\n x_algolia_user_id=\"userID\",\n assign_user_id_params={\n \"cluster\": \"theCluster\",\n },\n)" }, "batch": { - "addObject": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"addObject\",\n \"body\": {\n \"key\": \"bar\",\n \"foo\": \"1\",\n },\n },\n {\n \"action\": \"addObject\",\n \"body\": {\n \"key\": \"baz\",\n \"foo\": \"2\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "clear": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"clear\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "delete": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"delete\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "deleteObject": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"deleteObject\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "partialUpdateObject": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"partialUpdateObject\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "partialUpdateObjectNoCreate": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"partialUpdateObjectNoCreate\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "updateObject": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"updateObject\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "addObject": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"addObject\",\n \"body\": {\n \"key\": \"bar\",\n \"foo\": \"1\",\n },\n },\n {\n \"action\": \"addObject\",\n \"body\": {\n \"key\": \"baz\",\n \"foo\": \"2\",\n },\n },\n ],\n },\n)", + "clear": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"clear\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)", + "delete": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"delete\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)", + "deleteObject": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"deleteObject\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)", + "partialUpdateObject": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"partialUpdateObject\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)", + "partialUpdateObjectNoCreate": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"partialUpdateObjectNoCreate\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)", + "updateObject": "response = await _client.batch(\n index_name=\"\",\n batch_write_params={\n \"requests\": [\n {\n \"action\": \"updateObject\",\n \"body\": {\n \"key\": \"value\",\n },\n },\n ],\n },\n)" }, "batchAssignUserIds": { - "default": "response = await _client.batch_assign_user_ids(\n x_algolia_user_id=\"userID\",\n batch_assign_user_ids_params={\n \"cluster\": \"theCluster\",\n \"users\": [\n \"user1\",\n \"user2\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.batch_assign_user_ids(\n x_algolia_user_id=\"userID\",\n batch_assign_user_ids_params={\n \"cluster\": \"theCluster\",\n \"users\": [\n \"user1\",\n \"user2\",\n ],\n },\n)" }, "batchDictionaryEntries": { - "replace": "response = await _client.batch_dictionary_entries(\n dictionary_name=\"plurals\",\n batch_dictionary_entries_params={\n \"clearExistingDictionaryEntries\": True,\n \"requests\": [\n {\n \"action\": \"addEntry\",\n \"body\": {\n \"objectID\": \"1\",\n \"language\": \"en\",\n \"word\": \"fancy\",\n \"words\": [\n \"believe\",\n \"algolia\",\n ],\n \"decomposition\": [\n \"trust\",\n \"algolia\",\n ],\n \"state\": \"enabled\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "delete": "response = await _client.batch_dictionary_entries(\n dictionary_name=\"plurals\",\n batch_dictionary_entries_params={\n \"clearExistingDictionaryEntries\": True,\n \"requests\": [\n {\n \"action\": \"deleteEntry\",\n \"body\": {\n \"objectID\": \"1\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "append": "response = await _client.batch_dictionary_entries(\n dictionary_name=\"stopwords\",\n batch_dictionary_entries_params={\n \"requests\": [\n {\n \"action\": \"addEntry\",\n \"body\": {\n \"objectID\": \"1\",\n \"language\": \"en\",\n \"additional\": \"try me\",\n },\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "replace": "response = await _client.batch_dictionary_entries(\n dictionary_name=\"plurals\",\n batch_dictionary_entries_params={\n \"clearExistingDictionaryEntries\": True,\n \"requests\": [\n {\n \"action\": \"addEntry\",\n \"body\": {\n \"objectID\": \"1\",\n \"language\": \"en\",\n \"word\": \"fancy\",\n \"words\": [\n \"believe\",\n \"algolia\",\n ],\n \"decomposition\": [\n \"trust\",\n \"algolia\",\n ],\n \"state\": \"enabled\",\n },\n },\n ],\n },\n)", + "delete": "response = await _client.batch_dictionary_entries(\n dictionary_name=\"plurals\",\n batch_dictionary_entries_params={\n \"clearExistingDictionaryEntries\": True,\n \"requests\": [\n {\n \"action\": \"deleteEntry\",\n \"body\": {\n \"objectID\": \"1\",\n },\n },\n ],\n },\n)", + "append": "response = await _client.batch_dictionary_entries(\n dictionary_name=\"stopwords\",\n batch_dictionary_entries_params={\n \"requests\": [\n {\n \"action\": \"addEntry\",\n \"body\": {\n \"objectID\": \"1\",\n \"language\": \"en\",\n \"additional\": \"try me\",\n },\n },\n ],\n },\n)" }, "browse": { - "default": "response = await _client.browse(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.browse(\n index_name=\"\",\n)" }, "clearObjects": { - "default": "response = await _client.clear_objects(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.clear_objects(\n index_name=\"\",\n)" }, "clearRules": { - "default": "response = await _client.clear_rules(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.clear_rules(\n index_name=\"\",\n)" }, "clearSynonyms": { - "default": "response = await _client.clear_synonyms(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.clear_synonyms(\n index_name=\"\",\n)" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "deleteApiKey": { - "default": "response = await _client.delete_api_key(\n key=\"myTestApiKey\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_api_key(\n key=\"myTestApiKey\",\n)" }, "deleteBy": { - "default": "response = await _client.delete_by(\n index_name=\"\",\n delete_by_params={\n \"filters\": \"brand:brandName\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_by(\n index_name=\"\",\n delete_by_params={\n \"filters\": \"brand:brandName\",\n },\n)" }, "deleteIndex": { - "default": "response = await _client.delete_index(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_index(\n index_name=\"\",\n)" }, "deleteObject": { - "default": "response = await _client.delete_object(\n index_name=\"\",\n object_id=\"uniqueID\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_object(\n index_name=\"\",\n object_id=\"uniqueID\",\n)" }, "deleteObjects": { - "default": "response = await _client.delete_objects(\n index_name=\"\",\n object_ids=[\n \"1\",\n \"2\",\n ],\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_objects(\n index_name=\"\",\n object_ids=[\n \"1\",\n \"2\",\n ],\n)" }, "deleteRule": { - "default": "response = await _client.delete_rule(\n index_name=\"\",\n object_id=\"id1\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_rule(\n index_name=\"\",\n object_id=\"id1\",\n)" }, "deleteSource": { - "default": "response = await _client.delete_source(\n source=\"theSource\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_source(\n source=\"theSource\",\n)" }, "deleteSynonym": { - "default": "response = await _client.delete_synonym(\n index_name=\"\",\n object_id=\"id1\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.delete_synonym(\n index_name=\"\",\n object_id=\"id1\",\n)" }, "generateSecuredApiKey": { - "generate secured api key basic": "response = await _client.generate_secured_api_key(\n parent_api_key=\"2640659426d5107b6e47d75db9cbaef8\",\n restrictions={\n \"validUntil\": 2524604400,\n \"restrictIndices\": [\n \"Movies\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "generate secured api key with searchParams": "response = await _client.generate_secured_api_key(\n parent_api_key=\"2640659426d5107b6e47d75db9cbaef8\",\n restrictions={\n \"validUntil\": 2524604400,\n \"restrictIndices\": [\n \"Movies\",\n \"cts_e2e_settings\",\n ],\n \"restrictSources\": \"192.168.1.0/24\",\n \"filters\": \"category:Book OR category:Ebook AND _tags:published\",\n \"userToken\": \"user123\",\n \"searchParams\": {\n \"query\": \"batman\",\n \"typoTolerance\": \"strict\",\n \"aroundRadius\": \"all\",\n \"mode\": \"neuralSearch\",\n \"hitsPerPage\": 10,\n \"optionalWords\": [\n \"one\",\n \"two\",\n ],\n },\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "generate secured api key basic": "response = _client.generate_secured_api_key(\n parent_api_key=\"2640659426d5107b6e47d75db9cbaef8\",\n restrictions={\n \"validUntil\": 2524604400,\n \"restrictIndices\": [\n \"Movies\",\n ],\n },\n)", + "generate secured api key with searchParams": "response = _client.generate_secured_api_key(\n parent_api_key=\"2640659426d5107b6e47d75db9cbaef8\",\n restrictions={\n \"validUntil\": 2524604400,\n \"restrictIndices\": [\n \"Movies\",\n \"cts_e2e_settings\",\n ],\n \"restrictSources\": \"192.168.1.0/24\",\n \"filters\": \"category:Book OR category:Ebook AND _tags:published\",\n \"userToken\": \"user123\",\n \"searchParams\": {\n \"query\": \"batman\",\n \"typoTolerance\": \"strict\",\n \"aroundRadius\": \"all\",\n \"mode\": \"neuralSearch\",\n \"hitsPerPage\": 10,\n \"optionalWords\": [\n \"one\",\n \"two\",\n ],\n },\n },\n)" }, "getApiKey": { - "default": "response = await _client.get_api_key(\n key=\"myTestApiKey\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_api_key(\n key=\"myTestApiKey\",\n)" }, "getAppTask": { - "default": "response = await _client.get_app_task(\n task_id=123,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_app_task(\n task_id=123,\n)" }, "getDictionaryLanguages": { - "default": "response = await _client.get_dictionary_languages()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_dictionary_languages()" }, "getDictionarySettings": { - "default": "response = await _client.get_dictionary_settings()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_dictionary_settings()" }, "getLogs": { - "default": "response = await _client.get_logs()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_logs()" }, "getObject": { - "default": "response = await _client.get_object(\n index_name=\"\",\n object_id=\"uniqueID\",\n attributes_to_retrieve=[\n \"attr1\",\n \"attr2\",\n ],\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_object(\n index_name=\"\",\n object_id=\"uniqueID\",\n attributes_to_retrieve=[\n \"attr1\",\n \"attr2\",\n ],\n)" }, "getObjects": { - "default": "response = await _client.get_objects(\n get_objects_params={\n \"requests\": [\n {\n \"attributesToRetrieve\": [\n \"attr1\",\n \"attr2\",\n ],\n \"objectID\": \"uniqueID\",\n \"indexName\": \"\",\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_objects(\n get_objects_params={\n \"requests\": [\n {\n \"attributesToRetrieve\": [\n \"attr1\",\n \"attr2\",\n ],\n \"objectID\": \"uniqueID\",\n \"indexName\": \"\",\n },\n ],\n },\n)" }, "getRule": { - "default": "response = await _client.get_rule(\n index_name=\"\",\n object_id=\"qr-1725004648916\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_rule(\n index_name=\"\",\n object_id=\"qr-1725004648916\",\n)" }, "getSettings": { - "default": "response = await _client.get_settings(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_settings(\n index_name=\"\",\n)" }, "getSources": { - "default": "response = await _client.get_sources()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_sources()" }, "getSynonym": { - "default": "response = await _client.get_synonym(\n index_name=\"\",\n object_id=\"id1\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_synonym(\n index_name=\"\",\n object_id=\"id1\",\n)" }, "getTask": { - "default": "response = await _client.get_task(\n index_name=\"\",\n task_id=123,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_task(\n index_name=\"\",\n task_id=123,\n)" }, "getTopUserIds": { - "default": "response = await _client.get_top_user_ids()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_top_user_ids()" }, "getUserId": { - "default": "response = await _client.get_user_id(\n user_id=\"uniqueID\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_user_id(\n user_id=\"uniqueID\",\n)" }, "hasPendingMappings": { - "default": "response = await _client.has_pending_mappings()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.has_pending_mappings()" }, "indexExists": { - "indexExists": "response = await _client.index_exists(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "indexNotExists": "response = await _client.index_exists(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "indexExistsWithError": "response = await _client.index_exists(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "indexExists": "response = await _client.index_exists(\n index_name=\"\",\n)", + "indexNotExists": "response = await _client.index_exists(\n index_name=\"\",\n)", + "indexExistsWithError": "response = await _client.index_exists(\n index_name=\"\",\n)" }, "listApiKeys": { - "default": "response = await _client.list_api_keys()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_api_keys()" }, "listClusters": { - "default": "response = await _client.list_clusters()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_clusters()" }, "listIndices": { - "default": "response = await _client.list_indices()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_indices()" }, "listUserIds": { - "default": "response = await _client.list_user_ids()\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.list_user_ids()" }, "multipleBatch": { - "default": "response = await _client.multiple_batch(\n batch_params={\n \"requests\": [\n {\n \"action\": \"addObject\",\n \"body\": {\n \"key\": \"value\",\n },\n \"indexName\": \"\",\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.multiple_batch(\n batch_params={\n \"requests\": [\n {\n \"action\": \"addObject\",\n \"body\": {\n \"key\": \"value\",\n },\n \"indexName\": \"\",\n },\n ],\n },\n)" }, "operationIndex": { - "scopes": "response = await _client.operation_index(\n index_name=\"\",\n operation_index_params={\n \"operation\": \"move\",\n \"destination\": \"\",\n \"scope\": [\n \"rules\",\n \"settings\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "copy": "response = await _client.operation_index(\n index_name=\"\",\n operation_index_params={\n \"operation\": \"copy\",\n \"destination\": \"\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "move": "response = await _client.operation_index(\n index_name=\"\",\n operation_index_params={\n \"operation\": \"move\",\n \"destination\": \"\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "scopes": "response = await _client.operation_index(\n index_name=\"\",\n operation_index_params={\n \"operation\": \"move\",\n \"destination\": \"\",\n \"scope\": [\n \"rules\",\n \"settings\",\n ],\n },\n)", + "copy": "response = await _client.operation_index(\n index_name=\"\",\n operation_index_params={\n \"operation\": \"copy\",\n \"destination\": \"\",\n },\n)", + "move": "response = await _client.operation_index(\n index_name=\"\",\n operation_index_params={\n \"operation\": \"move\",\n \"destination\": \"\",\n },\n)" }, "partialUpdateObject": { - "default": "response = await _client.partial_update_object(\n index_name=\"\",\n object_id=\"uniqueID\",\n attributes_to_update={\n \"attributeId\": \"new value\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.partial_update_object(\n index_name=\"\",\n object_id=\"uniqueID\",\n attributes_to_update={\n \"attributeId\": \"new value\",\n },\n)" }, "partialUpdateObjects": { - "call partialUpdateObjects with createIfNotExists=true": "response = await _client.partial_update_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"1\",\n \"name\": \"Adam\",\n },\n {\n \"objectID\": \"2\",\n \"name\": \"Benoit\",\n },\n ],\n create_if_not_exists=True,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "call partialUpdateObjects with createIfNotExists=false": "response = await _client.partial_update_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"3\",\n \"name\": \"Cyril\",\n },\n {\n \"objectID\": \"4\",\n \"name\": \"David\",\n },\n ],\n create_if_not_exists=False,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "call partialUpdateObjects with createIfNotExists=true": "response = await _client.partial_update_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"1\",\n \"name\": \"Adam\",\n },\n {\n \"objectID\": \"2\",\n \"name\": \"Benoit\",\n },\n ],\n create_if_not_exists=True,\n)", + "call partialUpdateObjects with createIfNotExists=false": "response = await _client.partial_update_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"3\",\n \"name\": \"Cyril\",\n },\n {\n \"objectID\": \"4\",\n \"name\": \"David\",\n },\n ],\n create_if_not_exists=False,\n)" }, "removeUserId": { - "default": "response = await _client.remove_user_id(\n user_id=\"uniqueID\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.remove_user_id(\n user_id=\"uniqueID\",\n)" }, "replaceAllObjects": { - "default": "response = await _client.replace_all_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"1\",\n \"name\": \"Adam\",\n },\n {\n \"objectID\": \"2\",\n \"name\": \"Benoit\",\n },\n {\n \"objectID\": \"3\",\n \"name\": \"Cyril\",\n },\n {\n \"objectID\": \"4\",\n \"name\": \"David\",\n },\n {\n \"objectID\": \"5\",\n \"name\": \"Eva\",\n },\n {\n \"objectID\": \"6\",\n \"name\": \"Fiona\",\n },\n {\n \"objectID\": \"7\",\n \"name\": \"Gael\",\n },\n {\n \"objectID\": \"8\",\n \"name\": \"Hugo\",\n },\n {\n \"objectID\": \"9\",\n \"name\": \"Igor\",\n },\n {\n \"objectID\": \"10\",\n \"name\": \"Julia\",\n },\n ],\n batch_size=3,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.replace_all_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"1\",\n \"name\": \"Adam\",\n },\n {\n \"objectID\": \"2\",\n \"name\": \"Benoit\",\n },\n {\n \"objectID\": \"3\",\n \"name\": \"Cyril\",\n },\n {\n \"objectID\": \"4\",\n \"name\": \"David\",\n },\n {\n \"objectID\": \"5\",\n \"name\": \"Eva\",\n },\n {\n \"objectID\": \"6\",\n \"name\": \"Fiona\",\n },\n {\n \"objectID\": \"7\",\n \"name\": \"Gael\",\n },\n {\n \"objectID\": \"8\",\n \"name\": \"Hugo\",\n },\n {\n \"objectID\": \"9\",\n \"name\": \"Igor\",\n },\n {\n \"objectID\": \"10\",\n \"name\": \"Julia\",\n },\n ],\n batch_size=3,\n)" }, "replaceSources": { - "default": "response = await _client.replace_sources(\n source=[\n {\n \"source\": \"theSource\",\n \"description\": \"theDescription\",\n },\n ],\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.replace_sources(\n source=[\n {\n \"source\": \"theSource\",\n \"description\": \"theDescription\",\n },\n ],\n)" }, "restoreApiKey": { - "default": "response = await _client.restore_api_key(\n key=\"myApiKey\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.restore_api_key(\n key=\"myApiKey\",\n)" }, "saveObject": { - "default": "response = await _client.save_object(\n index_name=\"\",\n body={\n \"objectID\": \"id\",\n \"test\": \"val\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.save_object(\n index_name=\"\",\n body={\n \"objectID\": \"id\",\n \"test\": \"val\",\n },\n)" }, "saveObjects": { - "call saveObjects without error": "response = await _client.save_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"1\",\n \"name\": \"Adam\",\n },\n {\n \"objectID\": \"2\",\n \"name\": \"Benoit\",\n },\n ],\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "saveObjects should report errors": "response = await _client.save_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"1\",\n \"name\": \"Adam\",\n },\n {\n \"objectID\": \"2\",\n \"name\": \"Benoit\",\n },\n ],\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "call saveObjects without error": "response = await _client.save_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"1\",\n \"name\": \"Adam\",\n },\n {\n \"objectID\": \"2\",\n \"name\": \"Benoit\",\n },\n ],\n)", + "saveObjects should report errors": "response = await _client.save_objects(\n index_name=\"\",\n objects=[\n {\n \"objectID\": \"1\",\n \"name\": \"Adam\",\n },\n {\n \"objectID\": \"2\",\n \"name\": \"Benoit\",\n },\n ],\n)" }, "saveRule": { - "default": "response = await _client.save_rule(\n index_name=\"\",\n object_id=\"id1\",\n rule={\n \"objectID\": \"id1\",\n \"conditions\": [\n {\n \"pattern\": \"apple\",\n \"anchoring\": \"contains\",\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.save_rule(\n index_name=\"\",\n object_id=\"id1\",\n rule={\n \"objectID\": \"id1\",\n \"conditions\": [\n {\n \"pattern\": \"apple\",\n \"anchoring\": \"contains\",\n },\n ],\n },\n)" }, "saveRules": { - "default": "response = await _client.save_rules(\n index_name=\"\",\n rules=[\n {\n \"objectID\": \"a-rule-id\",\n \"conditions\": [\n {\n \"pattern\": \"smartphone\",\n \"anchoring\": \"contains\",\n },\n ],\n },\n {\n \"objectID\": \"a-second-rule-id\",\n \"conditions\": [\n {\n \"pattern\": \"apple\",\n \"anchoring\": \"contains\",\n },\n ],\n },\n ],\n forward_to_replicas=False,\n clear_existing_rules=True,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.save_rules(\n index_name=\"\",\n rules=[\n {\n \"objectID\": \"a-rule-id\",\n \"conditions\": [\n {\n \"pattern\": \"smartphone\",\n \"anchoring\": \"contains\",\n },\n ],\n },\n {\n \"objectID\": \"a-second-rule-id\",\n \"conditions\": [\n {\n \"pattern\": \"apple\",\n \"anchoring\": \"contains\",\n },\n ],\n },\n ],\n forward_to_replicas=False,\n clear_existing_rules=True,\n)" }, "saveSynonym": { - "default": "response = await _client.save_synonym(\n index_name=\"\",\n object_id=\"id1\",\n synonym_hit={\n \"objectID\": \"id1\",\n \"type\": \"synonym\",\n \"synonyms\": [\n \"car\",\n \"vehicule\",\n \"auto\",\n ],\n },\n forward_to_replicas=True,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.save_synonym(\n index_name=\"\",\n object_id=\"id1\",\n synonym_hit={\n \"objectID\": \"id1\",\n \"type\": \"synonym\",\n \"synonyms\": [\n \"car\",\n \"vehicule\",\n \"auto\",\n ],\n },\n forward_to_replicas=True,\n)" }, "saveSynonyms": { - "default": "response = await _client.save_synonyms(\n index_name=\"\",\n synonym_hit=[\n {\n \"objectID\": \"id1\",\n \"type\": \"synonym\",\n \"synonyms\": [\n \"car\",\n \"vehicule\",\n \"auto\",\n ],\n },\n {\n \"objectID\": \"id2\",\n \"type\": \"onewaysynonym\",\n \"input\": \"iphone\",\n \"synonyms\": [\n \"ephone\",\n \"aphone\",\n \"yphone\",\n ],\n },\n ],\n forward_to_replicas=True,\n replace_existing_synonyms=True,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.save_synonyms(\n index_name=\"\",\n synonym_hit=[\n {\n \"objectID\": \"id1\",\n \"type\": \"synonym\",\n \"synonyms\": [\n \"car\",\n \"vehicule\",\n \"auto\",\n ],\n },\n {\n \"objectID\": \"id2\",\n \"type\": \"onewaysynonym\",\n \"input\": \"iphone\",\n \"synonyms\": [\n \"ephone\",\n \"aphone\",\n \"yphone\",\n ],\n },\n ],\n forward_to_replicas=True,\n replace_existing_synonyms=True,\n)" }, "search": { - "withHitsPerPage": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"hitsPerPage\": 50,\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "filterOnly": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"filters\": \"actor:Scarlett Johansson\",\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "filterOr": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"filters\": \"actor:Tom Cruise OR actor:Scarlett Johansson\",\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "filterNot": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"filters\": \"NOT actor:Nicolas Cage\",\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "retrieveFacets": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"facets\": [\n \"author\",\n \"genre\",\n ],\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "retrieveFacetsWildcard": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"facets\": [\n \"*\",\n ],\n },\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "withHitsPerPage": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"hitsPerPage\": 50,\n },\n ],\n },\n)", + "filterOnly": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"filters\": \"actor:Scarlett Johansson\",\n },\n ],\n },\n)", + "filterOr": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"filters\": \"actor:Tom Cruise OR actor:Scarlett Johansson\",\n },\n ],\n },\n)", + "filterNot": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"filters\": \"NOT actor:Nicolas Cage\",\n },\n ],\n },\n)", + "retrieveFacets": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"facets\": [\n \"author\",\n \"genre\",\n ],\n },\n ],\n },\n)", + "retrieveFacetsWildcard": "response = await _client.search(\n search_method_params={\n \"requests\": [\n {\n \"indexName\": \"\",\n \"query\": \"\",\n \"facets\": [\n \"*\",\n ],\n },\n ],\n },\n)" }, "searchDictionaryEntries": { - "default": "response = await _client.search_dictionary_entries(\n dictionary_name=\"stopwords\",\n search_dictionary_entries_params={\n \"query\": \"about\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_dictionary_entries(\n dictionary_name=\"stopwords\",\n search_dictionary_entries_params={\n \"query\": \"about\",\n },\n)" }, "searchForFacetValues": { - "default": "response = await _client.search_for_facet_values(\n index_name=\"\",\n facet_name=\"facetName\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_for_facet_values(\n index_name=\"\",\n facet_name=\"facetName\",\n)" }, "searchRules": { - "default": "response = await _client.search_rules(\n index_name=\"\",\n search_rules_params={\n \"query\": \"zorro\",\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_rules(\n index_name=\"\",\n search_rules_params={\n \"query\": \"zorro\",\n },\n)" }, "searchSingleIndex": { - "default": "response = await _client.search_single_index(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_single_index(\n index_name=\"\",\n)" }, "searchSynonyms": { - "default": "response = await _client.search_synonyms(\n index_name=\"\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_synonyms(\n index_name=\"\",\n)" }, "searchUserIds": { - "default": "response = await _client.search_user_ids(\n search_user_ids_params={\n \"query\": \"test\",\n \"clusterName\": \"theClusterName\",\n \"page\": 5,\n \"hitsPerPage\": 10,\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.search_user_ids(\n search_user_ids_params={\n \"query\": \"test\",\n \"clusterName\": \"theClusterName\",\n \"page\": 5,\n \"hitsPerPage\": 10,\n },\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "setDictionarySettings": { - "default": "response = await _client.set_dictionary_settings(\n dictionary_settings_params={\n \"disableStandardEntries\": {\n \"plurals\": {\n \"fr\": False,\n \"en\": False,\n \"ru\": True,\n },\n },\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.set_dictionary_settings(\n dictionary_settings_params={\n \"disableStandardEntries\": {\n \"plurals\": {\n \"fr\": False,\n \"en\": False,\n \"ru\": True,\n },\n },\n },\n)" }, "setSettings": { - "default": "response = await _client.set_settings(\n index_name=\"\",\n index_settings={\n \"attributesForFaceting\": [\n \"actor\",\n \"filterOnly(category)\",\n \"searchable(publisher)\",\n ],\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.set_settings(\n index_name=\"\",\n index_settings={\n \"attributesForFaceting\": [\n \"actor\",\n \"filterOnly(category)\",\n \"searchable(publisher)\",\n ],\n },\n)" }, "updateApiKey": { - "default": "response = await _client.update_api_key(\n key=\"myApiKey\",\n api_key={\n \"acl\": [\n \"search\",\n \"addObject\",\n ],\n \"validity\": 300,\n \"maxQueriesPerIPPerHour\": 100,\n \"maxHitsPerQuery\": 20,\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.update_api_key(\n key=\"myApiKey\",\n api_key={\n \"acl\": [\n \"search\",\n \"addObject\",\n ],\n \"validity\": 300,\n \"maxQueriesPerIPPerHour\": 100,\n \"maxHitsPerQuery\": 20,\n },\n)" }, "waitForApiKey": { - "wait for api key helper - add": "response = await _client.wait_for_api_key(\n key=\"api-key-add-operation-test-python\",\n operation=\"add\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "wait for api key - update": "response = await _client.wait_for_api_key(\n key=\"api-key-update-operation-test-python\",\n operation=\"update\",\n api_key={\n \"description\": \"my updated api key\",\n \"acl\": [\n \"search\",\n \"addObject\",\n \"deleteObject\",\n ],\n \"indexes\": [\n \"Movies\",\n \"Books\",\n ],\n \"referers\": [\n \"*google.com\",\n \"*algolia.com\",\n ],\n \"validity\": 305,\n \"maxQueriesPerIPPerHour\": 95,\n \"maxHitsPerQuery\": 20,\n },\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())", - "wait for api key - delete": "response = await _client.wait_for_api_key(\n key=\"api-key-delete-operation-test-python\",\n operation=\"delete\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "wait for api key helper - add": "response = await _client.wait_for_api_key(\n key=\"api-key-add-operation-test-python\",\n operation=\"add\",\n)", + "wait for api key - update": "response = await _client.wait_for_api_key(\n key=\"api-key-update-operation-test-python\",\n operation=\"update\",\n api_key={\n \"description\": \"my updated api key\",\n \"acl\": [\n \"search\",\n \"addObject\",\n \"deleteObject\",\n ],\n \"indexes\": [\n \"Movies\",\n \"Books\",\n ],\n \"referers\": [\n \"*google.com\",\n \"*algolia.com\",\n ],\n \"validity\": 305,\n \"maxQueriesPerIPPerHour\": 95,\n \"maxHitsPerQuery\": 20,\n },\n)", + "wait for api key - delete": "response = await _client.wait_for_api_key(\n key=\"api-key-delete-operation-test-python\",\n operation=\"delete\",\n)" }, "waitForAppTask": { - "default": "response = await _client.wait_for_app_task(\n task_id=123,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.wait_for_app_task(\n task_id=123,\n)" }, "waitForTask": { - "default": "response = await _client.wait_for_task(\n index_name=\"\",\n task_id=123,\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.wait_for_task(\n index_name=\"\",\n task_id=123,\n)" }, "init": { "default": "_client = SearchClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -1948,239 +1972,242 @@ "default": "require \"algolia\"" }, "addApiKey": { - "default": "response = client.add_api_key(\n ApiKey.new(\n acl: [\"search\", \"addObject\"],\n description: \"my new api key\",\n validity: 300,\n max_queries_per_ip_per_hour: 100,\n max_hits_per_query: 20\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.add_api_key(\n ApiKey.new(\n acl: [\"search\", \"addObject\"],\n description: \"my new api key\",\n validity: 300,\n max_queries_per_ip_per_hour: 100,\n max_hits_per_query: 20\n )\n)" }, "addOrUpdateObject": { - "default": "response = client.add_or_update_object(\"\", \"uniqueID\", {key: \"value\"})\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.add_or_update_object(\"\", \"uniqueID\", {key: \"value\"})" }, "appendSource": { - "default": "response = client.append_source(Source.new(source: \"theSource\", description: \"theDescription\"))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.append_source(Source.new(source: \"theSource\", description: \"theDescription\"))" }, "assignUserId": { - "default": "response = client.assign_user_id(\"userID\", AssignUserIdParams.new(cluster: \"theCluster\"))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.assign_user_id(\"userID\", AssignUserIdParams.new(cluster: \"theCluster\"))" }, "batch": { - "addObject": "response = client.batch(\n \"\",\n BatchWriteParams.new(\n requests: [\n BatchRequest.new(action: \"addObject\", body: {key: \"bar\", foo: \"1\"}),\n BatchRequest.new(action: \"addObject\", body: {key: \"baz\", foo: \"2\"})\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "clear": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"clear\", body: {key: \"value\"})])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "delete": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"delete\", body: {key: \"value\"})])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "deleteObject": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"deleteObject\", body: {key: \"value\"})])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "partialUpdateObject": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"partialUpdateObject\", body: {key: \"value\"})])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "partialUpdateObjectNoCreate": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"partialUpdateObjectNoCreate\", body: {key: \"value\"})])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "updateObject": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"updateObject\", body: {key: \"value\"})])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "addObject": "response = client.batch(\n \"\",\n BatchWriteParams.new(\n requests: [\n BatchRequest.new(action: \"addObject\", body: {key: \"bar\", foo: \"1\"}),\n BatchRequest.new(action: \"addObject\", body: {key: \"baz\", foo: \"2\"})\n ]\n )\n)", + "clear": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"clear\", body: {key: \"value\"})])\n)", + "delete": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"delete\", body: {key: \"value\"})])\n)", + "deleteObject": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"deleteObject\", body: {key: \"value\"})])\n)", + "partialUpdateObject": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"partialUpdateObject\", body: {key: \"value\"})])\n)", + "partialUpdateObjectNoCreate": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"partialUpdateObjectNoCreate\", body: {key: \"value\"})])\n)", + "updateObject": "response = client.batch(\n \"\",\n BatchWriteParams.new(requests: [BatchRequest.new(action: \"updateObject\", body: {key: \"value\"})])\n)" }, "batchAssignUserIds": { - "default": "response = client.batch_assign_user_ids(\n \"userID\",\n BatchAssignUserIdsParams.new(cluster: \"theCluster\", users: [\"user1\", \"user2\"])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.batch_assign_user_ids(\n \"userID\",\n BatchAssignUserIdsParams.new(cluster: \"theCluster\", users: [\"user1\", \"user2\"])\n)" }, "batchDictionaryEntries": { - "replace": "response = client.batch_dictionary_entries(\n \"plurals\",\n BatchDictionaryEntriesParams.new(\n clear_existing_dictionary_entries: true,\n requests: [\n BatchDictionaryEntriesRequest.new(\n action: \"addEntry\",\n body: DictionaryEntry.new(\n object_id: \"1\",\n language: \"en\",\n word: \"fancy\",\n words: [\"believe\", \"algolia\"],\n decomposition: [\"trust\", \"algolia\"],\n state: \"enabled\"\n )\n )\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "delete": "response = client.batch_dictionary_entries(\n \"plurals\",\n BatchDictionaryEntriesParams.new(\n clear_existing_dictionary_entries: true,\n requests: [BatchDictionaryEntriesRequest.new(action: \"deleteEntry\", body: DictionaryEntry.new(object_id: \"1\"))]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "append": "response = client.batch_dictionary_entries(\n \"stopwords\",\n BatchDictionaryEntriesParams.new(\n requests: [\n BatchDictionaryEntriesRequest.new(\n action: \"addEntry\",\n body: DictionaryEntry.new(object_id: \"1\", language: \"en\", additional: \"try me\")\n )\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "replace": "response = client.batch_dictionary_entries(\n \"plurals\",\n BatchDictionaryEntriesParams.new(\n clear_existing_dictionary_entries: true,\n requests: [\n BatchDictionaryEntriesRequest.new(\n action: \"addEntry\",\n body: DictionaryEntry.new(\n object_id: \"1\",\n language: \"en\",\n word: \"fancy\",\n words: [\"believe\", \"algolia\"],\n decomposition: [\"trust\", \"algolia\"],\n state: \"enabled\"\n )\n )\n ]\n )\n)", + "delete": "response = client.batch_dictionary_entries(\n \"plurals\",\n BatchDictionaryEntriesParams.new(\n clear_existing_dictionary_entries: true,\n requests: [BatchDictionaryEntriesRequest.new(action: \"deleteEntry\", body: DictionaryEntry.new(object_id: \"1\"))]\n )\n)", + "append": "response = client.batch_dictionary_entries(\n \"stopwords\",\n BatchDictionaryEntriesParams.new(\n requests: [\n BatchDictionaryEntriesRequest.new(\n action: \"addEntry\",\n body: DictionaryEntry.new(object_id: \"1\", language: \"en\", additional: \"try me\")\n )\n ]\n )\n)" }, "browse": { - "default": "response = client.browse(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.browse(\"\")" }, "clearObjects": { - "default": "response = client.clear_objects(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.clear_objects(\"\")" }, "clearRules": { - "default": "response = client.clear_rules(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.clear_rules(\"\")" }, "clearSynonyms": { - "default": "response = client.clear_synonyms(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.clear_synonyms(\"\")" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "deleteApiKey": { - "default": "response = client.delete_api_key(\"myTestApiKey\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_api_key(\"myTestApiKey\")" }, "deleteBy": { - "default": "response = client.delete_by(\"\", DeleteByParams.new(filters: \"brand:brandName\"))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_by(\"\", DeleteByParams.new(filters: \"brand:brandName\"))" }, "deleteIndex": { - "default": "response = client.delete_index(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_index(\"\")" }, "deleteObject": { - "default": "response = client.delete_object(\"\", \"uniqueID\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_object(\"\", \"uniqueID\")" }, "deleteObjects": { - "default": "response = client.delete_objects(\"\", [\"1\", \"2\"])\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_objects(\"\", [\"1\", \"2\"])" }, "deleteRule": { - "default": "response = client.delete_rule(\"\", \"id1\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_rule(\"\", \"id1\")" }, "deleteSource": { - "default": "response = client.delete_source(\"theSource\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_source(\"theSource\")" }, "deleteSynonym": { - "default": "response = client.delete_synonym(\"\", \"id1\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.delete_synonym(\"\", \"id1\")" }, "generateSecuredApiKey": { - "generate secured api key basic": "response = client.generate_secured_api_key(\n \"2640659426d5107b6e47d75db9cbaef8\",\n SecuredApiKeyRestrictions.new(valid_until: 2524604400, restrict_indices: [\"Movies\"])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "generate secured api key with searchParams": "response = client.generate_secured_api_key(\n \"2640659426d5107b6e47d75db9cbaef8\",\n SecuredApiKeyRestrictions.new(\n valid_until: 2524604400,\n restrict_indices: [\"Movies\", \"cts_e2e_settings\"],\n restrict_sources: \"192.168.1.0/24\",\n filters: \"category:Book OR category:Ebook AND _tags:published\",\n user_token: \"user123\",\n search_params: SearchParamsObject.new(\n query: \"batman\",\n typo_tolerance: \"strict\",\n around_radius: \"all\",\n mode: \"neuralSearch\",\n hits_per_page: 10,\n optional_words: [\"one\", \"two\"]\n )\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "generate secured api key basic": "response = client.generate_secured_api_key(\n \"2640659426d5107b6e47d75db9cbaef8\",\n SecuredApiKeyRestrictions.new(valid_until: 2524604400, restrict_indices: [\"Movies\"])\n)", + "generate secured api key with searchParams": "response = client.generate_secured_api_key(\n \"2640659426d5107b6e47d75db9cbaef8\",\n SecuredApiKeyRestrictions.new(\n valid_until: 2524604400,\n restrict_indices: [\"Movies\", \"cts_e2e_settings\"],\n restrict_sources: \"192.168.1.0/24\",\n filters: \"category:Book OR category:Ebook AND _tags:published\",\n user_token: \"user123\",\n search_params: SearchParamsObject.new(\n query: \"batman\",\n typo_tolerance: \"strict\",\n around_radius: \"all\",\n mode: \"neuralSearch\",\n hits_per_page: 10,\n optional_words: [\"one\", \"two\"]\n )\n )\n)" }, "getApiKey": { - "default": "response = client.get_api_key(\"myTestApiKey\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_api_key(\"myTestApiKey\")" }, "getAppTask": { - "default": "response = client.get_app_task(123)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_app_task(123)" }, "getDictionaryLanguages": { - "default": "response = client.get_dictionary_languages\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_dictionary_languages" }, "getDictionarySettings": { - "default": "response = client.get_dictionary_settings\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_dictionary_settings" }, "getLogs": { - "default": "response = client.get_logs\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_logs" }, "getObject": { - "default": "response = client.get_object(\"\", \"uniqueID\", [\"attr1\", \"attr2\"])\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_object(\"\", \"uniqueID\", [\"attr1\", \"attr2\"])" }, "getObjects": { - "default": "response = client.get_objects(\n GetObjectsParams.new(\n requests: [\n GetObjectsRequest.new(\n attributes_to_retrieve: [\"attr1\", \"attr2\"],\n object_id: \"uniqueID\",\n index_name: \"\"\n )\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_objects(\n GetObjectsParams.new(\n requests: [\n GetObjectsRequest.new(\n attributes_to_retrieve: [\"attr1\", \"attr2\"],\n object_id: \"uniqueID\",\n index_name: \"\"\n )\n ]\n )\n)" }, "getRule": { - "default": "response = client.get_rule(\"\", \"qr-1725004648916\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_rule(\"\", \"qr-1725004648916\")" }, "getSettings": { - "default": "response = client.get_settings(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_settings(\"\")" }, "getSources": { - "default": "response = client.get_sources\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_sources" }, "getSynonym": { - "default": "response = client.get_synonym(\"\", \"id1\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_synonym(\"\", \"id1\")" }, "getTask": { - "default": "response = client.get_task(\"\", 123)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_task(\"\", 123)" }, "getTopUserIds": { - "default": "response = client.get_top_user_ids\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_top_user_ids" }, "getUserId": { - "default": "response = client.get_user_id(\"uniqueID\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_user_id(\"uniqueID\")" }, "hasPendingMappings": { - "default": "response = client.has_pending_mappings\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.has_pending_mappings" }, "indexExists": { - "indexExists": "response = client.index_exists(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "indexNotExists": "response = client.index_exists(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "indexExistsWithError": "response = client.index_exists(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "indexExists": "response = client.index_exists(\"\")", + "indexNotExists": "response = client.index_exists(\"\")", + "indexExistsWithError": "response = client.index_exists(\"\")" }, "listApiKeys": { - "default": "response = client.list_api_keys\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_api_keys" }, "listClusters": { - "default": "response = client.list_clusters\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_clusters" }, "listIndices": { - "default": "response = client.list_indices\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_indices" }, "listUserIds": { - "default": "response = client.list_user_ids\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.list_user_ids" }, "multipleBatch": { - "default": "response = client.multiple_batch(\n BatchParams.new(\n requests: [MultipleBatchRequest.new(action: \"addObject\", body: {key: \"value\"}, index_name: \"\")]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.multiple_batch(\n BatchParams.new(\n requests: [MultipleBatchRequest.new(action: \"addObject\", body: {key: \"value\"}, index_name: \"\")]\n )\n)" }, "operationIndex": { - "scopes": "response = client.operation_index(\n \"\",\n OperationIndexParams.new(operation: \"move\", destination: \"\", scope: [\"rules\", \"settings\"])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "copy": "response = client.operation_index(\n \"\",\n OperationIndexParams.new(operation: \"copy\", destination: \"\")\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "move": "response = client.operation_index(\n \"\",\n OperationIndexParams.new(operation: \"move\", destination: \"\")\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "scopes": "response = client.operation_index(\n \"\",\n OperationIndexParams.new(operation: \"move\", destination: \"\", scope: [\"rules\", \"settings\"])\n)", + "copy": "response = client.operation_index(\n \"\",\n OperationIndexParams.new(operation: \"copy\", destination: \"\")\n)", + "move": "response = client.operation_index(\n \"\",\n OperationIndexParams.new(operation: \"move\", destination: \"\")\n)" }, "partialUpdateObject": { - "default": "response = client.partial_update_object(\"\", \"uniqueID\", {attributeId: \"new value\"})\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.partial_update_object(\"\", \"uniqueID\", {attributeId: \"new value\"})" }, "partialUpdateObjects": { - "call partialUpdateObjects with createIfNotExists=true": "response = client.partial_update_objects(\n \"\",\n [{objectID: \"1\", name: \"Adam\"}, {objectID: \"2\", name: \"Benoit\"}],\n true\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "call partialUpdateObjects with createIfNotExists=false": "response = client.partial_update_objects(\n \"\",\n [{objectID: \"3\", name: \"Cyril\"}, {objectID: \"4\", name: \"David\"}],\n false\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "call partialUpdateObjects with createIfNotExists=true": "response = client.partial_update_objects(\n \"\",\n [{objectID: \"1\", name: \"Adam\"}, {objectID: \"2\", name: \"Benoit\"}],\n true\n)", + "call partialUpdateObjects with createIfNotExists=false": "response = client.partial_update_objects(\n \"\",\n [{objectID: \"3\", name: \"Cyril\"}, {objectID: \"4\", name: \"David\"}],\n false\n)" }, "removeUserId": { - "default": "response = client.remove_user_id(\"uniqueID\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.remove_user_id(\"uniqueID\")" }, "replaceAllObjects": { - "default": "response = client.replace_all_objects(\n \"\",\n [\n {objectID: \"1\", name: \"Adam\"},\n {objectID: \"2\", name: \"Benoit\"},\n {objectID: \"3\", name: \"Cyril\"},\n {objectID: \"4\", name: \"David\"},\n {objectID: \"5\", name: \"Eva\"},\n {objectID: \"6\", name: \"Fiona\"},\n {objectID: \"7\", name: \"Gael\"},\n {objectID: \"8\", name: \"Hugo\"},\n {objectID: \"9\", name: \"Igor\"},\n {objectID: \"10\", name: \"Julia\"}\n ],\n 3\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.replace_all_objects(\n \"\",\n [\n {objectID: \"1\", name: \"Adam\"},\n {objectID: \"2\", name: \"Benoit\"},\n {objectID: \"3\", name: \"Cyril\"},\n {objectID: \"4\", name: \"David\"},\n {objectID: \"5\", name: \"Eva\"},\n {objectID: \"6\", name: \"Fiona\"},\n {objectID: \"7\", name: \"Gael\"},\n {objectID: \"8\", name: \"Hugo\"},\n {objectID: \"9\", name: \"Igor\"},\n {objectID: \"10\", name: \"Julia\"}\n ],\n 3\n)" }, "replaceSources": { - "default": "response = client.replace_sources([Source.new(source: \"theSource\", description: \"theDescription\")])\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.replace_sources([Source.new(source: \"theSource\", description: \"theDescription\")])" }, "restoreApiKey": { - "default": "response = client.restore_api_key(\"myApiKey\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.restore_api_key(\"myApiKey\")" }, "saveObject": { - "default": "response = client.save_object(\"\", {objectID: \"id\", test: \"val\"})\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.save_object(\"\", {objectID: \"id\", test: \"val\"})" }, "saveObjects": { - "call saveObjects without error": "response = client.save_objects(\n \"\",\n [{objectID: \"1\", name: \"Adam\"}, {objectID: \"2\", name: \"Benoit\"}]\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "saveObjects should report errors": "response = client.save_objects(\n \"\",\n [{objectID: \"1\", name: \"Adam\"}, {objectID: \"2\", name: \"Benoit\"}]\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "call saveObjects without error": "response = client.save_objects(\n \"\",\n [{objectID: \"1\", name: \"Adam\"}, {objectID: \"2\", name: \"Benoit\"}]\n)", + "saveObjects should report errors": "response = client.save_objects(\n \"\",\n [{objectID: \"1\", name: \"Adam\"}, {objectID: \"2\", name: \"Benoit\"}]\n)" }, "saveRule": { - "default": "response = client.save_rule(\n \"\",\n \"id1\",\n Rule.new(object_id: \"id1\", conditions: [Condition.new(pattern: \"apple\", anchoring: \"contains\")])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.save_rule(\n \"\",\n \"id1\",\n Rule.new(object_id: \"id1\", conditions: [Condition.new(pattern: \"apple\", anchoring: \"contains\")])\n)" }, "saveRules": { - "default": "response = client.save_rules(\n \"\",\n [\n Rule.new(object_id: \"a-rule-id\", conditions: [Condition.new(pattern: \"smartphone\", anchoring: \"contains\")]),\n Rule.new(object_id: \"a-second-rule-id\", conditions: [Condition.new(pattern: \"apple\", anchoring: \"contains\")])\n ],\n false,\n true\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.save_rules(\n \"\",\n [\n Rule.new(object_id: \"a-rule-id\", conditions: [Condition.new(pattern: \"smartphone\", anchoring: \"contains\")]),\n Rule.new(object_id: \"a-second-rule-id\", conditions: [Condition.new(pattern: \"apple\", anchoring: \"contains\")])\n ],\n false,\n true\n)" }, "saveSynonym": { - "default": "response = client.save_synonym(\n \"\",\n \"id1\",\n SynonymHit.new(object_id: \"id1\", type: \"synonym\", synonyms: [\"car\", \"vehicule\", \"auto\"]),\n true\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.save_synonym(\n \"\",\n \"id1\",\n SynonymHit.new(object_id: \"id1\", type: \"synonym\", synonyms: [\"car\", \"vehicule\", \"auto\"]),\n true\n)" }, "saveSynonyms": { - "default": "response = client.save_synonyms(\n \"\",\n [\n SynonymHit.new(object_id: \"id1\", type: \"synonym\", synonyms: [\"car\", \"vehicule\", \"auto\"]),\n SynonymHit.new(object_id: \"id2\", type: \"onewaysynonym\", input: \"iphone\", synonyms: [\"ephone\", \"aphone\", \"yphone\"])\n ],\n true,\n true\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.save_synonyms(\n \"\",\n [\n SynonymHit.new(object_id: \"id1\", type: \"synonym\", synonyms: [\"car\", \"vehicule\", \"auto\"]),\n SynonymHit.new(object_id: \"id2\", type: \"onewaysynonym\", input: \"iphone\", synonyms: [\"ephone\", \"aphone\", \"yphone\"])\n ],\n true,\n true\n)" }, "search": { - "withHitsPerPage": "response = client.search(\n SearchMethodParams.new(\n requests: [SearchForHits.new(index_name: \"\", query: \"\", hits_per_page: 50)]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "filterOnly": "response = client.search(\n SearchMethodParams.new(\n requests: [\n SearchForHits.new(index_name: \"\", query: \"\", filters: \"actor:Scarlett Johansson\")\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "filterOr": "response = client.search(\n SearchMethodParams.new(\n requests: [\n SearchForHits.new(\n index_name: \"\",\n query: \"\",\n filters: \"actor:Tom Cruise OR actor:Scarlett Johansson\"\n )\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "filterNot": "response = client.search(\n SearchMethodParams.new(\n requests: [\n SearchForHits.new(index_name: \"\", query: \"\", filters: \"NOT actor:Nicolas Cage\")\n ]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "retrieveFacets": "response = client.search(\n SearchMethodParams.new(\n requests: [SearchForHits.new(index_name: \"\", query: \"\", facets: [\"author\", \"genre\"])]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "retrieveFacetsWildcard": "response = client.search(\n SearchMethodParams.new(\n requests: [SearchForHits.new(index_name: \"\", query: \"\", facets: [\"*\"])]\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "withHitsPerPage": "response = client.search(\n SearchMethodParams.new(\n requests: [SearchForHits.new(index_name: \"\", query: \"\", hits_per_page: 50)]\n )\n)", + "filterOnly": "response = client.search(\n SearchMethodParams.new(\n requests: [\n SearchForHits.new(index_name: \"\", query: \"\", filters: \"actor:Scarlett Johansson\")\n ]\n )\n)", + "filterOr": "response = client.search(\n SearchMethodParams.new(\n requests: [\n SearchForHits.new(\n index_name: \"\",\n query: \"\",\n filters: \"actor:Tom Cruise OR actor:Scarlett Johansson\"\n )\n ]\n )\n)", + "filterNot": "response = client.search(\n SearchMethodParams.new(\n requests: [\n SearchForHits.new(index_name: \"\", query: \"\", filters: \"NOT actor:Nicolas Cage\")\n ]\n )\n)", + "retrieveFacets": "response = client.search(\n SearchMethodParams.new(\n requests: [SearchForHits.new(index_name: \"\", query: \"\", facets: [\"author\", \"genre\"])]\n )\n)", + "retrieveFacetsWildcard": "response = client.search(\n SearchMethodParams.new(\n requests: [SearchForHits.new(index_name: \"\", query: \"\", facets: [\"*\"])]\n )\n)" }, "searchDictionaryEntries": { - "default": "response = client.search_dictionary_entries(\"stopwords\", SearchDictionaryEntriesParams.new(query: \"about\"))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_dictionary_entries(\"stopwords\", SearchDictionaryEntriesParams.new(query: \"about\"))" }, "searchForFacetValues": { - "default": "response = client.search_for_facet_values(\"\", \"facetName\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_for_facet_values(\"\", \"facetName\")" }, "searchRules": { - "default": "response = client.search_rules(\"\", SearchRulesParams.new(query: \"zorro\"))\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_rules(\"\", SearchRulesParams.new(query: \"zorro\"))" }, "searchSingleIndex": { - "default": "response = client.search_single_index(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_single_index(\"\")" }, "searchSynonyms": { - "default": "response = client.search_synonyms(\"\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_synonyms(\"\")" }, "searchUserIds": { - "default": "response = client.search_user_ids(\n SearchUserIdsParams.new(query: \"test\", cluster_name: \"theClusterName\", page: 5, hits_per_page: 10)\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.search_user_ids(\n SearchUserIdsParams.new(query: \"test\", cluster_name: \"theClusterName\", page: 5, hits_per_page: 10)\n)" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "setDictionarySettings": { - "default": "response = client.set_dictionary_settings(\n DictionarySettingsParams.new(\n disable_standard_entries: StandardEntries.new(plurals: {fr: false, en: false, ru: true})\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.set_dictionary_settings(\n DictionarySettingsParams.new(\n disable_standard_entries: StandardEntries.new(plurals: {fr: false, en: false, ru: true})\n )\n)" }, "setSettings": { - "default": "response = client.set_settings(\n \"\",\n IndexSettings.new(attributes_for_faceting: [\"actor\", \"filterOnly(category)\", \"searchable(publisher)\"])\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.set_settings(\n \"\",\n IndexSettings.new(attributes_for_faceting: [\"actor\", \"filterOnly(category)\", \"searchable(publisher)\"])\n)" }, "updateApiKey": { - "default": "response = client.update_api_key(\n \"myApiKey\",\n ApiKey.new(acl: [\"search\", \"addObject\"], validity: 300, max_queries_per_ip_per_hour: 100, max_hits_per_query: 20)\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.update_api_key(\n \"myApiKey\",\n ApiKey.new(acl: [\"search\", \"addObject\"], validity: 300, max_queries_per_ip_per_hour: 100, max_hits_per_query: 20)\n)" }, "waitForApiKey": { - "wait for api key helper - add": "response = client.wait_for_api_key(\"api-key-add-operation-test-ruby\", \"add\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "wait for api key - update": "response = client.wait_for_api_key(\n \"api-key-update-operation-test-ruby\",\n \"update\",\n ApiKey.new(\n description: \"my updated api key\",\n acl: [\"search\", \"addObject\", \"deleteObject\"],\n indexes: [\"Movies\", \"Books\"],\n referers: [\"*google.com\", \"*algolia.com\"],\n validity: 305,\n max_queries_per_ip_per_hour: 95,\n max_hits_per_query: 20\n )\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)", - "wait for api key - delete": "response = client.wait_for_api_key(\"api-key-delete-operation-test-ruby\", \"delete\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "wait for api key helper - add": "response = client.wait_for_api_key(\"api-key-add-operation-test-ruby\", \"add\")", + "wait for api key - update": "response = client.wait_for_api_key(\n \"api-key-update-operation-test-ruby\",\n \"update\",\n ApiKey.new(\n description: \"my updated api key\",\n acl: [\"search\", \"addObject\", \"deleteObject\"],\n indexes: [\"Movies\", \"Books\"],\n referers: [\"*google.com\", \"*algolia.com\"],\n validity: 305,\n max_queries_per_ip_per_hour: 95,\n max_hits_per_query: 20\n )\n)", + "wait for api key - delete": "response = client.wait_for_api_key(\"api-key-delete-operation-test-ruby\", \"delete\")" }, "waitForAppTask": { - "default": "response = client.wait_for_app_task(123)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.wait_for_app_task(123)" }, "waitForTask": { - "default": "response = client.wait_for_task(\"\", 123)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.wait_for_task(\"\", 123)" }, "init": { "default": "client = Algolia::SearchClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -2191,205 +2218,205 @@ "default": "import algoliasearch.api.SearchClient\nimport algoliasearch.extension.SearchClientExtensions" }, "addApiKey": { - "default": "val response = client.addApiKey(\n apiKey = ApiKey(\n acl = Seq(Acl.withName(\"search\"), Acl.withName(\"addObject\")),\n description = Some(\"my new api key\"),\n validity = Some(300),\n maxQueriesPerIPPerHour = Some(100),\n maxHitsPerQuery = Some(20)\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.addApiKey(\n apiKey = ApiKey(\n acl = Seq(Acl.withName(\"search\"), Acl.withName(\"addObject\")),\n description = Some(\"my new api key\"),\n validity = Some(300),\n maxQueriesPerIPPerHour = Some(100),\n maxHitsPerQuery = Some(20)\n )\n)" }, "addOrUpdateObject": { - "default": "val response = client.addOrUpdateObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.addOrUpdateObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n)" }, "appendSource": { - "default": "val response = client.appendSource(\n source = Source(\n source = \"theSource\",\n description = Some(\"theDescription\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.appendSource(\n source = Source(\n source = \"theSource\",\n description = Some(\"theDescription\")\n )\n)" }, "assignUserId": { - "default": "val response = client.assignUserId(\n xAlgoliaUserID = \"userID\",\n assignUserIdParams = AssignUserIdParams(\n cluster = \"theCluster\"\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.assignUserId(\n xAlgoliaUserID = \"userID\",\n assignUserIdParams = AssignUserIdParams(\n cluster = \"theCluster\"\n )\n)" }, "batch": { - "addObject": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"addObject\"),\n body = JObject(List(JField(\"key\", JString(\"bar\")), JField(\"foo\", JString(\"1\"))))\n ),\n BatchRequest(\n action = Action.withName(\"addObject\"),\n body = JObject(List(JField(\"key\", JString(\"baz\")), JField(\"foo\", JString(\"2\"))))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "clear": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"clear\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "delete": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"delete\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "deleteObject": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"deleteObject\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "partialUpdateObject": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"partialUpdateObject\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "partialUpdateObjectNoCreate": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"partialUpdateObjectNoCreate\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "updateObject": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"updateObject\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "addObject": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"addObject\"),\n body = JObject(List(JField(\"key\", JString(\"bar\")), JField(\"foo\", JString(\"1\"))))\n ),\n BatchRequest(\n action = Action.withName(\"addObject\"),\n body = JObject(List(JField(\"key\", JString(\"baz\")), JField(\"foo\", JString(\"2\"))))\n )\n )\n )\n)", + "clear": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"clear\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)", + "delete": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"delete\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)", + "deleteObject": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"deleteObject\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)", + "partialUpdateObject": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"partialUpdateObject\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)", + "partialUpdateObjectNoCreate": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"partialUpdateObjectNoCreate\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)", + "updateObject": "val response = client.batch(\n indexName = \"\",\n batchWriteParams = BatchWriteParams(\n requests = Seq(\n BatchRequest(\n action = Action.withName(\"updateObject\"),\n body = JObject(List(JField(\"key\", JString(\"value\"))))\n )\n )\n )\n)" }, "batchAssignUserIds": { - "default": "val response = client.batchAssignUserIds(\n xAlgoliaUserID = \"userID\",\n batchAssignUserIdsParams = BatchAssignUserIdsParams(\n cluster = \"theCluster\",\n users = Seq(\"user1\", \"user2\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.batchAssignUserIds(\n xAlgoliaUserID = \"userID\",\n batchAssignUserIdsParams = BatchAssignUserIdsParams(\n cluster = \"theCluster\",\n users = Seq(\"user1\", \"user2\")\n )\n)" }, "batchDictionaryEntries": { - "replace": "val response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.withName(\"plurals\"),\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n clearExistingDictionaryEntries = Some(true),\n requests = Seq(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.withName(\"addEntry\"),\n body = DictionaryEntry(\n objectID = \"1\",\n language = Some(SupportedLanguage.withName(\"en\")),\n word = Some(\"fancy\"),\n words = Some(Seq(\"believe\", \"algolia\")),\n decomposition = Some(Seq(\"trust\", \"algolia\")),\n state = Some(DictionaryEntryState.withName(\"enabled\"))\n )\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "delete": "val response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.withName(\"plurals\"),\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n clearExistingDictionaryEntries = Some(true),\n requests = Seq(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.withName(\"deleteEntry\"),\n body = DictionaryEntry(\n objectID = \"1\"\n )\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "append": "val response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.withName(\"stopwords\"),\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n requests = Seq(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.withName(\"addEntry\"),\n body = DictionaryEntry(\n objectID = \"1\",\n language = Some(SupportedLanguage.withName(\"en\")),\n additionalProperties = Some(List(JField(\"additional\", JString(\"try me\"))))\n )\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "replace": "val response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.withName(\"plurals\"),\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n clearExistingDictionaryEntries = Some(true),\n requests = Seq(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.withName(\"addEntry\"),\n body = DictionaryEntry(\n objectID = \"1\",\n language = Some(SupportedLanguage.withName(\"en\")),\n word = Some(\"fancy\"),\n words = Some(Seq(\"believe\", \"algolia\")),\n decomposition = Some(Seq(\"trust\", \"algolia\")),\n state = Some(DictionaryEntryState.withName(\"enabled\"))\n )\n )\n )\n )\n)", + "delete": "val response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.withName(\"plurals\"),\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n clearExistingDictionaryEntries = Some(true),\n requests = Seq(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.withName(\"deleteEntry\"),\n body = DictionaryEntry(\n objectID = \"1\"\n )\n )\n )\n )\n)", + "append": "val response = client.batchDictionaryEntries(\n dictionaryName = DictionaryType.withName(\"stopwords\"),\n batchDictionaryEntriesParams = BatchDictionaryEntriesParams(\n requests = Seq(\n BatchDictionaryEntriesRequest(\n action = DictionaryAction.withName(\"addEntry\"),\n body = DictionaryEntry(\n objectID = \"1\",\n language = Some(SupportedLanguage.withName(\"en\")),\n additionalProperties = Some(List(JField(\"additional\", JString(\"try me\"))))\n )\n )\n )\n )\n)" }, "browse": { - "default": "val response = client.browse(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.browse(\n indexName = \"\"\n)" }, "clearObjects": { - "default": "val response = client.clearObjects(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.clearObjects(\n indexName = \"\"\n)" }, "clearRules": { - "default": "val response = client.clearRules(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.clearRules(\n indexName = \"\"\n)" }, "clearSynonyms": { - "default": "val response = client.clearSynonyms(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.clearSynonyms(\n indexName = \"\"\n)" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "deleteApiKey": { - "default": "val response = client.deleteApiKey(\n key = \"myTestApiKey\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteApiKey(\n key = \"myTestApiKey\"\n)" }, "deleteBy": { - "default": "val response = client.deleteBy(\n indexName = \"\",\n deleteByParams = DeleteByParams(\n filters = Some(\"brand:brandName\")\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteBy(\n indexName = \"\",\n deleteByParams = DeleteByParams(\n filters = Some(\"brand:brandName\")\n )\n)" }, "deleteIndex": { - "default": "val response = client.deleteIndex(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteIndex(\n indexName = \"\"\n)" }, "deleteObject": { - "default": "val response = client.deleteObject(\n indexName = \"\",\n objectID = \"uniqueID\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteObject(\n indexName = \"\",\n objectID = \"uniqueID\"\n)" }, "deleteRule": { - "default": "val response = client.deleteRule(\n indexName = \"\",\n objectID = \"id1\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteRule(\n indexName = \"\",\n objectID = \"id1\"\n)" }, "deleteSource": { - "default": "val response = client.deleteSource(\n source = \"theSource\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteSource(\n source = \"theSource\"\n)" }, "deleteSynonym": { - "default": "val response = client.deleteSynonym(\n indexName = \"\",\n objectID = \"id1\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.deleteSynonym(\n indexName = \"\",\n objectID = \"id1\"\n)" }, "getApiKey": { - "default": "val response = client.getApiKey(\n key = \"myTestApiKey\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getApiKey(\n key = \"myTestApiKey\"\n)" }, "getAppTask": { - "default": "val response = client.getAppTask(\n taskID = 123L\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getAppTask(\n taskID = 123L\n)" }, "getDictionaryLanguages": { - "default": "val response = client.getDictionaryLanguages(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getDictionaryLanguages(\n)" }, "getDictionarySettings": { - "default": "val response = client.getDictionarySettings(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getDictionarySettings(\n)" }, "getLogs": { - "default": "val response = client.getLogs(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getLogs(\n)" }, "getObject": { - "default": "val response = client.getObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n attributesToRetrieve = Some(Seq(\"attr1\", \"attr2\"))\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n attributesToRetrieve = Some(Seq(\"attr1\", \"attr2\"))\n)" }, "getObjects": { - "default": "val response = client.getObjects(\n getObjectsParams = GetObjectsParams(\n requests = Seq(\n GetObjectsRequest(\n attributesToRetrieve = Some(Seq(\"attr1\", \"attr2\")),\n objectID = \"uniqueID\",\n indexName = \"\"\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getObjects(\n getObjectsParams = GetObjectsParams(\n requests = Seq(\n GetObjectsRequest(\n attributesToRetrieve = Some(Seq(\"attr1\", \"attr2\")),\n objectID = \"uniqueID\",\n indexName = \"\"\n )\n )\n )\n)" }, "getRule": { - "default": "val response = client.getRule(\n indexName = \"\",\n objectID = \"qr-1725004648916\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getRule(\n indexName = \"\",\n objectID = \"qr-1725004648916\"\n)" }, "getSettings": { - "default": "val response = client.getSettings(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getSettings(\n indexName = \"\"\n)" }, "getSources": { - "default": "val response = client.getSources(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getSources(\n)" }, "getSynonym": { - "default": "val response = client.getSynonym(\n indexName = \"\",\n objectID = \"id1\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getSynonym(\n indexName = \"\",\n objectID = \"id1\"\n)" }, "getTask": { - "default": "val response = client.getTask(\n indexName = \"\",\n taskID = 123L\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTask(\n indexName = \"\",\n taskID = 123L\n)" }, "getTopUserIds": { - "default": "val response = client.getTopUserIds(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getTopUserIds(\n)" }, "getUserId": { - "default": "val response = client.getUserId(\n userID = \"uniqueID\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getUserId(\n userID = \"uniqueID\"\n)" }, "hasPendingMappings": { - "default": "val response = client.hasPendingMappings(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.hasPendingMappings(\n)" }, "listApiKeys": { - "default": "val response = client.listApiKeys(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listApiKeys(\n)" }, "listClusters": { - "default": "val response = client.listClusters(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listClusters(\n)" }, "listIndices": { - "default": "val response = client.listIndices(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listIndices(\n)" }, "listUserIds": { - "default": "val response = client.listUserIds(\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.listUserIds(\n)" }, "multipleBatch": { - "default": "val response = client.multipleBatch(\n batchParams = BatchParams(\n requests = Seq(\n MultipleBatchRequest(\n action = Action.withName(\"addObject\"),\n body = Some(JObject(List(JField(\"key\", JString(\"value\"))))),\n indexName = \"\"\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.multipleBatch(\n batchParams = BatchParams(\n requests = Seq(\n MultipleBatchRequest(\n action = Action.withName(\"addObject\"),\n body = Some(JObject(List(JField(\"key\", JString(\"value\"))))),\n indexName = \"\"\n )\n )\n )\n)" }, "operationIndex": { - "scopes": "val response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.withName(\"move\"),\n destination = \"\",\n scope = Some(Seq(ScopeType.withName(\"rules\"), ScopeType.withName(\"settings\")))\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "copy": "val response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.withName(\"copy\"),\n destination = \"\"\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "move": "val response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.withName(\"move\"),\n destination = \"\"\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "scopes": "val response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.withName(\"move\"),\n destination = \"\",\n scope = Some(Seq(ScopeType.withName(\"rules\"), ScopeType.withName(\"settings\")))\n )\n)", + "copy": "val response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.withName(\"copy\"),\n destination = \"\"\n )\n)", + "move": "val response = client.operationIndex(\n indexName = \"\",\n operationIndexParams = OperationIndexParams(\n operation = OperationType.withName(\"move\"),\n destination = \"\"\n )\n)" }, "partialUpdateObject": { - "default": "val response = client.partialUpdateObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n attributesToUpdate = JObject(List(JField(\"attributeId\", JString(\"new value\"))))\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.partialUpdateObject(\n indexName = \"\",\n objectID = \"uniqueID\",\n attributesToUpdate = JObject(List(JField(\"attributeId\", JString(\"new value\"))))\n)" }, "removeUserId": { - "default": "val response = client.removeUserId(\n userID = \"uniqueID\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.removeUserId(\n userID = \"uniqueID\"\n)" }, "replaceSources": { - "default": "val response = client.replaceSources(\n source = Seq(\n Source(\n source = \"theSource\",\n description = Some(\"theDescription\")\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.replaceSources(\n source = Seq(\n Source(\n source = \"theSource\",\n description = Some(\"theDescription\")\n )\n )\n)" }, "restoreApiKey": { - "default": "val response = client.restoreApiKey(\n key = \"myApiKey\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.restoreApiKey(\n key = \"myApiKey\"\n)" }, "saveObject": { - "default": "val response = client.saveObject(\n indexName = \"\",\n body = JObject(List(JField(\"objectID\", JString(\"id\")), JField(\"test\", JString(\"val\"))))\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.saveObject(\n indexName = \"\",\n body = JObject(List(JField(\"objectID\", JString(\"id\")), JField(\"test\", JString(\"val\"))))\n)" }, "saveRule": { - "default": "val response = client.saveRule(\n indexName = \"\",\n objectID = \"id1\",\n rule = Rule(\n objectID = \"id1\",\n conditions = Some(\n Seq(\n Condition(\n pattern = Some(\"apple\"),\n anchoring = Some(Anchoring.withName(\"contains\"))\n )\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.saveRule(\n indexName = \"\",\n objectID = \"id1\",\n rule = Rule(\n objectID = \"id1\",\n conditions = Some(\n Seq(\n Condition(\n pattern = Some(\"apple\"),\n anchoring = Some(Anchoring.withName(\"contains\"))\n )\n )\n )\n )\n)" }, "saveRules": { - "default": "val response = client.saveRules(\n indexName = \"\",\n rules = Seq(\n Rule(\n objectID = \"a-rule-id\",\n conditions = Some(\n Seq(\n Condition(\n pattern = Some(\"smartphone\"),\n anchoring = Some(Anchoring.withName(\"contains\"))\n )\n )\n )\n ),\n Rule(\n objectID = \"a-second-rule-id\",\n conditions = Some(\n Seq(\n Condition(\n pattern = Some(\"apple\"),\n anchoring = Some(Anchoring.withName(\"contains\"))\n )\n )\n )\n )\n ),\n forwardToReplicas = Some(false),\n clearExistingRules = Some(true)\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.saveRules(\n indexName = \"\",\n rules = Seq(\n Rule(\n objectID = \"a-rule-id\",\n conditions = Some(\n Seq(\n Condition(\n pattern = Some(\"smartphone\"),\n anchoring = Some(Anchoring.withName(\"contains\"))\n )\n )\n )\n ),\n Rule(\n objectID = \"a-second-rule-id\",\n conditions = Some(\n Seq(\n Condition(\n pattern = Some(\"apple\"),\n anchoring = Some(Anchoring.withName(\"contains\"))\n )\n )\n )\n )\n ),\n forwardToReplicas = Some(false),\n clearExistingRules = Some(true)\n)" }, "saveSynonym": { - "default": "val response = client.saveSynonym(\n indexName = \"\",\n objectID = \"id1\",\n synonymHit = SynonymHit(\n objectID = \"id1\",\n `type` = SynonymType.withName(\"synonym\"),\n synonyms = Some(Seq(\"car\", \"vehicule\", \"auto\"))\n ),\n forwardToReplicas = Some(true)\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.saveSynonym(\n indexName = \"\",\n objectID = \"id1\",\n synonymHit = SynonymHit(\n objectID = \"id1\",\n `type` = SynonymType.withName(\"synonym\"),\n synonyms = Some(Seq(\"car\", \"vehicule\", \"auto\"))\n ),\n forwardToReplicas = Some(true)\n)" }, "saveSynonyms": { - "default": "val response = client.saveSynonyms(\n indexName = \"\",\n synonymHit = Seq(\n SynonymHit(\n objectID = \"id1\",\n `type` = SynonymType.withName(\"synonym\"),\n synonyms = Some(Seq(\"car\", \"vehicule\", \"auto\"))\n ),\n SynonymHit(\n objectID = \"id2\",\n `type` = SynonymType.withName(\"onewaysynonym\"),\n input = Some(\"iphone\"),\n synonyms = Some(Seq(\"ephone\", \"aphone\", \"yphone\"))\n )\n ),\n forwardToReplicas = Some(true),\n replaceExistingSynonyms = Some(true)\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.saveSynonyms(\n indexName = \"\",\n synonymHit = Seq(\n SynonymHit(\n objectID = \"id1\",\n `type` = SynonymType.withName(\"synonym\"),\n synonyms = Some(Seq(\"car\", \"vehicule\", \"auto\"))\n ),\n SynonymHit(\n objectID = \"id2\",\n `type` = SynonymType.withName(\"onewaysynonym\"),\n input = Some(\"iphone\"),\n synonyms = Some(Seq(\"ephone\", \"aphone\", \"yphone\"))\n )\n ),\n forwardToReplicas = Some(true),\n replaceExistingSynonyms = Some(true)\n)" }, "search": { - "withHitsPerPage": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n hitsPerPage = Some(50)\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "filterOnly": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n filters = Some(\"actor:Scarlett Johansson\")\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "filterOr": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n filters = Some(\"actor:Tom Cruise OR actor:Scarlett Johansson\")\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "filterNot": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n filters = Some(\"NOT actor:Nicolas Cage\")\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "retrieveFacets": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n facets = Some(Seq(\"author\", \"genre\"))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))", - "retrieveFacetsWildcard": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n facets = Some(Seq(\"*\"))\n )\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "withHitsPerPage": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n hitsPerPage = Some(50)\n )\n )\n )\n)", + "filterOnly": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n filters = Some(\"actor:Scarlett Johansson\")\n )\n )\n )\n)", + "filterOr": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n filters = Some(\"actor:Tom Cruise OR actor:Scarlett Johansson\")\n )\n )\n )\n)", + "filterNot": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n filters = Some(\"NOT actor:Nicolas Cage\")\n )\n )\n )\n)", + "retrieveFacets": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n facets = Some(Seq(\"author\", \"genre\"))\n )\n )\n )\n)", + "retrieveFacetsWildcard": "val response = client.search(\n searchMethodParams = SearchMethodParams(\n requests = Seq(\n SearchForHits(\n indexName = \"\",\n query = Some(\"\"),\n facets = Some(Seq(\"*\"))\n )\n )\n )\n)" }, "searchDictionaryEntries": { - "default": "val response = client.searchDictionaryEntries(\n dictionaryName = DictionaryType.withName(\"stopwords\"),\n searchDictionaryEntriesParams = SearchDictionaryEntriesParams(\n query = \"about\"\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchDictionaryEntries(\n dictionaryName = DictionaryType.withName(\"stopwords\"),\n searchDictionaryEntriesParams = SearchDictionaryEntriesParams(\n query = \"about\"\n )\n)" }, "searchForFacetValues": { - "default": "val response = client.searchForFacetValues(\n indexName = \"\",\n facetName = \"facetName\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchForFacetValues(\n indexName = \"\",\n facetName = \"facetName\"\n)" }, "searchRules": { - "default": "val response = client.searchRules(\n indexName = \"\",\n searchRulesParams = Some(\n SearchRulesParams(\n query = Some(\"zorro\")\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchRules(\n indexName = \"\",\n searchRulesParams = Some(\n SearchRulesParams(\n query = Some(\"zorro\")\n )\n )\n)" }, "searchSingleIndex": { - "default": "val response = client.searchSingleIndex(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchSingleIndex(\n indexName = \"\"\n)" }, "searchSynonyms": { - "default": "val response = client.searchSynonyms(\n indexName = \"\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchSynonyms(\n indexName = \"\"\n)" }, "searchUserIds": { - "default": "val response = client.searchUserIds(\n searchUserIdsParams = SearchUserIdsParams(\n query = \"test\",\n clusterName = Some(\"theClusterName\"),\n page = Some(5),\n hitsPerPage = Some(10)\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.searchUserIds(\n searchUserIdsParams = SearchUserIdsParams(\n query = \"test\",\n clusterName = Some(\"theClusterName\"),\n page = Some(5),\n hitsPerPage = Some(10)\n )\n)" }, "setDictionarySettings": { - "default": "val response = client.setDictionarySettings(\n dictionarySettingsParams = DictionarySettingsParams(\n disableStandardEntries = StandardEntries(\n plurals = Some(Map(\"fr\" -> false, \"en\" -> false, \"ru\" -> true))\n )\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.setDictionarySettings(\n dictionarySettingsParams = DictionarySettingsParams(\n disableStandardEntries = StandardEntries(\n plurals = Some(Map(\"fr\" -> false, \"en\" -> false, \"ru\" -> true))\n )\n )\n)" }, "setSettings": { - "default": "val response = client.setSettings(\n indexName = \"\",\n indexSettings = IndexSettings(\n attributesForFaceting = Some(Seq(\"actor\", \"filterOnly(category)\", \"searchable(publisher)\"))\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.setSettings(\n indexName = \"\",\n indexSettings = IndexSettings(\n attributesForFaceting = Some(Seq(\"actor\", \"filterOnly(category)\", \"searchable(publisher)\"))\n )\n)" }, "updateApiKey": { - "default": "val response = client.updateApiKey(\n key = \"myApiKey\",\n apiKey = ApiKey(\n acl = Seq(Acl.withName(\"search\"), Acl.withName(\"addObject\")),\n validity = Some(300),\n maxQueriesPerIPPerHour = Some(100),\n maxHitsPerQuery = Some(20)\n )\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.updateApiKey(\n key = \"myApiKey\",\n apiKey = ApiKey(\n acl = Seq(Acl.withName(\"search\"), Acl.withName(\"addObject\")),\n validity = Some(300),\n maxQueriesPerIPPerHour = Some(100),\n maxHitsPerQuery = Some(20)\n )\n)" }, "init": { "default": "val client = SearchClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\")" @@ -2614,6 +2641,9 @@ "searchUserIds": { "default": "let response = try await client.searchUserIds(searchUserIdsParams: SearchUserIdsParams(\n query: \"test\",\n clusterName: \"theClusterName\",\n page: 5,\n hitsPerPage: 10\n))" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "setDictionarySettings": { "default": "let response = try await client\n .setDictionarySettings(\n dictionarySettingsParams: DictionarySettingsParams(disableStandardEntries: StandardEntries(plurals: [\n \"fr\": false,\n \"en\": false,\n \"ru\": true,\n ]))\n )" }, diff --git a/snippets/guides/usage-snippets.json b/snippets/guides/usage-snippets.json index 1881b3d398..db014e4161 100644 --- a/snippets/guides/usage-snippets.json +++ b/snippets/guides/usage-snippets.json @@ -21,6 +21,9 @@ "getUsage": { "default": "var response = await client.GetUsageAsync(\n Enum.Parse(\"QueriesOperations\"),\n \"2024-04-03T12:46:43Z\",\n \"2024-04-05T12:46:43Z\"\n);" }, + "setClientApiKey": { + "default": "client.SetClientApiKey(\"updated-api-key\");" + }, "init": { "default": "var client = new UsageClient(new UsageConfig(\"YOUR_APP_ID\", \"YOUR_API_KEY\"));" } @@ -31,22 +34,25 @@ "default": "import \"github.com/algolia/algoliasearch-client-go/v4/algolia/usage\"" }, "customDelete": { - "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomDelete(client.NewApiCustomDeleteRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customGet": { - "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomGet(client.NewApiCustomGetRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPost": { - "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomPost(client.NewApiCustomPostRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "customPut": { - "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.CustomPut(client.NewApiCustomPutRequest(\n \"test/minimal\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getIndexUsage": { - "default": "response, err := client.GetIndexUsage(client.NewApiGetIndexUsageRequest(\n usage.Statistic(\"queries_operations\"), \"\", \"2024-04-03T12:46:43Z\", \"2024-04-05T12:46:43Z\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetIndexUsage(client.NewApiGetIndexUsageRequest(\n usage.Statistic(\"queries_operations\"), \"\", \"2024-04-03T12:46:43Z\", \"2024-04-05T12:46:43Z\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "getUsage": { - "default": "response, err := client.GetUsage(client.NewApiGetUsageRequest(\n usage.Statistic(\"queries_operations\"), \"2024-04-03T12:46:43Z\", \"2024-04-05T12:46:43Z\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}\n\n// use the model directly\nprint(response)" + "default": "response, err := client.GetUsage(client.NewApiGetUsageRequest(\n usage.Statistic(\"queries_operations\"), \"2024-04-03T12:46:43Z\", \"2024-04-05T12:46:43Z\",\n))\nif err != nil {\n // handle the eventual error\n panic(err)\n}" + }, + "setClientApiKey": { + "default": "err = client.SetClientApiKey(\n \"updated-api-key\",\n)\nif err != nil {\n // handle the eventual error\n panic(err)\n}" }, "init": { "default": "client, err := usage.NewClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -74,6 +80,9 @@ "getUsage": { "default": "client.getUsage(Statistic.QUERIES_OPERATIONS, \"2024-04-03T12:46:43Z\", \"2024-04-05T12:46:43Z\");" }, + "setClientApiKey": { + "default": "client.setClientApiKey(\"updated-api-key\");" + }, "init": { "default": "UsageClient client = new UsageClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\");" } @@ -83,22 +92,25 @@ "default": "import { usageClient } from '@algolia/client-usage';" }, "customDelete": { - "default": "const response = await client.customDelete({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customDelete({ path: 'test/minimal' });" }, "customGet": { - "default": "const response = await client.customGet({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customGet({ path: 'test/minimal' });" }, "customPost": { - "default": "const response = await client.customPost({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPost({ path: 'test/minimal' });" }, "customPut": { - "default": "const response = await client.customPut({ path: 'test/minimal' });\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.customPut({ path: 'test/minimal' });" }, "getIndexUsage": { - "default": "const response = await client.getIndexUsage({\n statistic: 'queries_operations',\n indexName: 'myIndexName',\n startDate: '2024-04-03T12:46:43Z',\n endDate: '2024-04-05T12:46:43Z',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getIndexUsage({\n statistic: 'queries_operations',\n indexName: 'myIndexName',\n startDate: '2024-04-03T12:46:43Z',\n endDate: '2024-04-05T12:46:43Z',\n});" }, "getUsage": { - "default": "const response = await client.getUsage({\n statistic: 'queries_operations',\n startDate: '2024-04-03T12:46:43Z',\n endDate: '2024-04-05T12:46:43Z',\n});\n\n// use typed response\nconsole.log(response);" + "default": "const response = await client.getUsage({\n statistic: 'queries_operations',\n startDate: '2024-04-03T12:46:43Z',\n endDate: '2024-04-05T12:46:43Z',\n});" + }, + "setClientApiKey": { + "default": "client.setClientApiKey({ apiKey: 'updated-api-key' });" }, "init": { "default": "const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY');" @@ -109,22 +121,25 @@ "default": "import com.algolia.client.api.UsageClient" }, "customDelete": { - "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customDelete(\n path = \"test/minimal\",\n)" }, "customGet": { - "default": "var response = client.customGet(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customGet(\n path = \"test/minimal\",\n)" }, "customPost": { - "default": "var response = client.customPost(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPost(\n path = \"test/minimal\",\n)" }, "customPut": { - "default": "var response = client.customPut(\n path = \"test/minimal\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.customPut(\n path = \"test/minimal\",\n)" }, "getIndexUsage": { - "default": "var response = client.getIndexUsage(\n statistic = Statistic.entries.first { it.value == \"queries_operations\" },\n indexName = \"\",\n startDate = \"2024-04-03T12:46:43Z\",\n endDate = \"2024-04-05T12:46:43Z\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getIndexUsage(\n statistic = Statistic.entries.first { it.value == \"queries_operations\" },\n indexName = \"\",\n startDate = \"2024-04-03T12:46:43Z\",\n endDate = \"2024-04-05T12:46:43Z\",\n)" }, "getUsage": { - "default": "var response = client.getUsage(\n statistic = Statistic.entries.first { it.value == \"queries_operations\" },\n startDate = \"2024-04-03T12:46:43Z\",\n endDate = \"2024-04-05T12:46:43Z\",\n)\n\n// Use the response\nprintln(response)" + "default": "var response = client.getUsage(\n statistic = Statistic.entries.first { it.value == \"queries_operations\" },\n startDate = \"2024-04-03T12:46:43Z\",\n endDate = \"2024-04-05T12:46:43Z\",\n)" + }, + "setClientApiKey": { + "default": "client.setClientApiKey(\n apiKey = \"updated-api-key\",\n)" }, "init": { "default": "val client = UsageClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\")" @@ -135,22 +150,25 @@ "default": "use Algolia\\AlgoliaSearch\\Api\\UsageClient;" }, "customDelete": { - "default": "$response = $client->customDelete(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customDelete(\n 'test/minimal',\n);" }, "customGet": { - "default": "$response = $client->customGet(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customGet(\n 'test/minimal',\n);" }, "customPost": { - "default": "$response = $client->customPost(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPost(\n 'test/minimal',\n);" }, "customPut": { - "default": "$response = $client->customPut(\n 'test/minimal',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->customPut(\n 'test/minimal',\n);" }, "getIndexUsage": { - "default": "$response = $client->getIndexUsage(\n 'queries_operations',\n '',\n '2024-04-03T12:46:43Z',\n '2024-04-05T12:46:43Z',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getIndexUsage(\n 'queries_operations',\n '',\n '2024-04-03T12:46:43Z',\n '2024-04-05T12:46:43Z',\n);" }, "getUsage": { - "default": "$response = $client->getUsage(\n 'queries_operations',\n '2024-04-03T12:46:43Z',\n '2024-04-05T12:46:43Z',\n);\n\n// play with the response\nvar_dump($response);" + "default": "$response = $client->getUsage(\n 'queries_operations',\n '2024-04-03T12:46:43Z',\n '2024-04-05T12:46:43Z',\n);" + }, + "setClientApiKey": { + "default": "$client->setClientApiKey(\n 'updated-api-key',\n);" }, "init": { "default": "$client = UsageClient::create('', '');" @@ -161,22 +179,25 @@ "default": "from algoliasearch.usage.client import UsageClient" }, "customDelete": { - "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_delete(\n path=\"test/minimal\",\n)" }, "customGet": { - "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_get(\n path=\"test/minimal\",\n)" }, "customPost": { - "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_post(\n path=\"test/minimal\",\n)" }, "customPut": { - "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.custom_put(\n path=\"test/minimal\",\n)" }, "getIndexUsage": { - "default": "response = await _client.get_index_usage(\n statistic=\"queries_operations\",\n index_name=\"\",\n start_date=\"2024-04-03T12:46:43Z\",\n end_date=\"2024-04-05T12:46:43Z\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_index_usage(\n statistic=\"queries_operations\",\n index_name=\"\",\n start_date=\"2024-04-03T12:46:43Z\",\n end_date=\"2024-04-05T12:46:43Z\",\n)" }, "getUsage": { - "default": "response = await _client.get_usage(\n statistic=\"queries_operations\",\n start_date=\"2024-04-03T12:46:43Z\",\n end_date=\"2024-04-05T12:46:43Z\",\n)\n\n# use the class directly\nprint(response)\n\n# print the JSON response\nprint(response.to_json())" + "default": "response = await _client.get_usage(\n statistic=\"queries_operations\",\n start_date=\"2024-04-03T12:46:43Z\",\n end_date=\"2024-04-05T12:46:43Z\",\n)" + }, + "setClientApiKey": { + "default": "_client.set_client_api_key(\n api_key=\"updated-api-key\",\n)" }, "init": { "default": "_client = UsageClient(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -187,22 +208,25 @@ "default": "require \"algolia\"" }, "customDelete": { - "default": "response = client.custom_delete(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_delete(\"test/minimal\")" }, "customGet": { - "default": "response = client.custom_get(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_get(\"test/minimal\")" }, "customPost": { - "default": "response = client.custom_post(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_post(\"test/minimal\")" }, "customPut": { - "default": "response = client.custom_put(\"test/minimal\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.custom_put(\"test/minimal\")" }, "getIndexUsage": { - "default": "response = client.get_index_usage(\n \"queries_operations\",\n \"\",\n \"2024-04-03T12:46:43Z\",\n \"2024-04-05T12:46:43Z\"\n)\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_index_usage(\n \"queries_operations\",\n \"\",\n \"2024-04-03T12:46:43Z\",\n \"2024-04-05T12:46:43Z\"\n)" }, "getUsage": { - "default": "response = client.get_usage(\"queries_operations\", \"2024-04-03T12:46:43Z\", \"2024-04-05T12:46:43Z\")\n\n# use the class directly\nputs(response)\n\n# print the JSON response\nputs(response.to_json)" + "default": "response = client.get_usage(\"queries_operations\", \"2024-04-03T12:46:43Z\", \"2024-04-05T12:46:43Z\")" + }, + "setClientApiKey": { + "default": "client.set_client_api_key(\"updated-api-key\")" }, "init": { "default": "client = Algolia::UsageClient.create(\"YOUR_APP_ID\", \"YOUR_API_KEY\")" @@ -213,22 +237,22 @@ "default": "import algoliasearch.api.UsageClient" }, "customDelete": { - "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customDelete[JObject](\n path = \"test/minimal\"\n)" }, "customGet": { - "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customGet[JObject](\n path = \"test/minimal\"\n)" }, "customPost": { - "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPost[JObject](\n path = \"test/minimal\"\n)" }, "customPut": { - "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.customPut[JObject](\n path = \"test/minimal\"\n)" }, "getIndexUsage": { - "default": "val response = client.getIndexUsage(\n statistic = Statistic.withName(\"queries_operations\"),\n indexName = \"\",\n startDate = \"2024-04-03T12:46:43Z\",\n endDate = \"2024-04-05T12:46:43Z\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getIndexUsage(\n statistic = Statistic.withName(\"queries_operations\"),\n indexName = \"\",\n startDate = \"2024-04-03T12:46:43Z\",\n endDate = \"2024-04-05T12:46:43Z\"\n)" }, "getUsage": { - "default": "val response = client.getUsage(\n statistic = Statistic.withName(\"queries_operations\"),\n startDate = \"2024-04-03T12:46:43Z\",\n endDate = \"2024-04-05T12:46:43Z\"\n)\n\n// Use the response\nval value = Await.result(response, Duration(100, \"sec\"))" + "default": "val response = client.getUsage(\n statistic = Statistic.withName(\"queries_operations\"),\n startDate = \"2024-04-03T12:46:43Z\",\n endDate = \"2024-04-05T12:46:43Z\"\n)" }, "init": { "default": "val client = UsageClient(appId = \"YOUR_APP_ID\", apiKey = \"YOUR_API_KEY\")" @@ -256,6 +280,9 @@ "getUsage": { "default": "let response = try await client.getUsage(\n statistic: Statistic.queriesOperations,\n startDate: \"2024-04-03T12:46:43Z\",\n endDate: \"2024-04-05T12:46:43Z\"\n)" }, + "setClientApiKey": { + "default": "try client.setClientApiKey(apiKey: \"updated-api-key\")" + }, "init": { "default": "let client = try UsageClient(appID: \"YOUR_APP_ID\", apiKey: \"YOUR_API_KEY\")" } diff --git a/snippets/java/src/test/java/com/algolia/Abtesting.java b/snippets/java/src/test/java/com/algolia/Abtesting.java index 6d7a867f73..532fe3ee08 100644 --- a/snippets/java/src/test/java/com/algolia/Abtesting.java +++ b/snippets/java/src/test/java/com/algolia/Abtesting.java @@ -28,6 +28,7 @@ void snippetForAddABTests() { ) ) ); + // >LOG // SEPARATOR< } @@ -41,6 +42,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -54,6 +56,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -67,6 +70,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -80,6 +84,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -93,6 +98,7 @@ void snippetForDeleteABTest() { // Call the API client.deleteABTest(42); + // >LOG // SEPARATOR< } @@ -106,6 +112,7 @@ void snippetForGetABTest() { // Call the API client.getABTest(42); + // >LOG // SEPARATOR< } @@ -119,6 +126,7 @@ void snippetForListABTests() { // Call the API client.listABTests(); + // >LOG // SEPARATOR< } @@ -143,6 +151,21 @@ void snippetForScheduleABTest() { ) ) ); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + AbtestingClient client = new AbtestingClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -156,6 +179,7 @@ void snippetForStopABTest() { // Call the API client.stopABTest(42); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/Analytics.java b/snippets/java/src/test/java/com/algolia/Analytics.java index 69fa8ee3c0..d977a648d1 100644 --- a/snippets/java/src/test/java/com/algolia/Analytics.java +++ b/snippets/java/src/test/java/com/algolia/Analytics.java @@ -18,6 +18,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -31,6 +32,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -44,6 +46,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -57,6 +60,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -70,6 +74,7 @@ void snippetForGetAddToCartRate() { // Call the API client.getAddToCartRate("index"); + // >LOG // SEPARATOR< } @@ -83,6 +88,7 @@ void snippetForGetAverageClickPosition() { // Call the API client.getAverageClickPosition("index"); + // >LOG // SEPARATOR< } @@ -96,6 +102,7 @@ void snippetForGetClickPositions() { // Call the API client.getClickPositions("index"); + // >LOG // SEPARATOR< } @@ -109,6 +116,7 @@ void snippetForGetClickThroughRate() { // Call the API client.getClickThroughRate("index"); + // >LOG // SEPARATOR< } @@ -122,6 +130,7 @@ void snippetForGetConversionRate() { // Call the API client.getConversionRate("index"); + // >LOG // SEPARATOR< } @@ -135,6 +144,7 @@ void snippetForGetNoClickRate() { // Call the API client.getNoClickRate("index"); + // >LOG // SEPARATOR< } @@ -148,6 +158,7 @@ void snippetForGetNoResultsRate() { // Call the API client.getNoResultsRate("index"); + // >LOG // SEPARATOR< } @@ -161,6 +172,7 @@ void snippetForGetPurchaseRate() { // Call the API client.getPurchaseRate("index"); + // >LOG // SEPARATOR< } @@ -174,6 +186,7 @@ void snippetForGetRevenue() { // Call the API client.getRevenue("index"); + // >LOG // SEPARATOR< } @@ -187,6 +200,7 @@ void snippetForGetSearchesCount() { // Call the API client.getSearchesCount("index"); + // >LOG // SEPARATOR< } @@ -200,6 +214,7 @@ void snippetForGetSearchesNoClicks() { // Call the API client.getSearchesNoClicks("index"); + // >LOG // SEPARATOR< } @@ -213,6 +228,7 @@ void snippetForGetSearchesNoResults() { // Call the API client.getSearchesNoResults("index"); + // >LOG // SEPARATOR< } @@ -226,6 +242,7 @@ void snippetForGetStatus() { // Call the API client.getStatus("index"); + // >LOG // SEPARATOR< } @@ -239,6 +256,7 @@ void snippetForGetTopCountries() { // Call the API client.getTopCountries("index"); + // >LOG // SEPARATOR< } @@ -252,6 +270,7 @@ void snippetForGetTopFilterAttributes() { // Call the API client.getTopFilterAttributes("index"); + // >LOG // SEPARATOR< } @@ -265,6 +284,7 @@ void snippetForGetTopFilterForAttribute() { // Call the API client.getTopFilterForAttribute("myAttribute", "index"); + // >LOG // SEPARATOR< } @@ -278,6 +298,7 @@ void snippetForGetTopFiltersNoResults() { // Call the API client.getTopFiltersNoResults("index"); + // >LOG // SEPARATOR< } @@ -291,6 +312,7 @@ void snippetForGetTopHits() { // Call the API client.getTopHits("index"); + // >LOG // SEPARATOR< } @@ -304,6 +326,7 @@ void snippetForGetTopSearches() { // Call the API client.getTopSearches("index"); + // >LOG // SEPARATOR< } @@ -317,6 +340,21 @@ void snippetForGetUsersCount() { // Call the API client.getUsersCount("index"); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + AnalyticsClient client = new AnalyticsClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/Ingestion.java b/snippets/java/src/test/java/com/algolia/Ingestion.java index 8bfd8fc0b6..c248cc6b99 100644 --- a/snippets/java/src/test/java/com/algolia/Ingestion.java +++ b/snippets/java/src/test/java/com/algolia/Ingestion.java @@ -23,6 +23,7 @@ void snippetForCreateAuthentication() { .setName("authName") .setInput(new AuthOAuth().setUrl("http://test.oauth").setClientId("myID").setClientSecret("mySecret")) ); + // >LOG // SEPARATOR< } @@ -42,6 +43,7 @@ void snippetForCreateDestination() { .setInput(new DestinationIndexName().setIndexName("")) .setAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f") ); + // >LOG // SEPARATOR< } @@ -67,6 +69,7 @@ void snippetForCreateSource() { ) .setAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f") ); + // >LOG // SEPARATOR< } @@ -80,6 +83,7 @@ void snippetForCreateTask() { // Call the API client.createTask(new TaskCreate().setSourceID("search").setDestinationID("destinationName").setAction(ActionType.REPLACE)); + // >LOG // SEPARATOR< } @@ -99,6 +103,7 @@ void snippetForCreateTaskV1() { .setTrigger(new OnDemandTriggerInput().setType(OnDemandTriggerType.ON_DEMAND)) .setAction(ActionType.REPLACE) ); + // >LOG // SEPARATOR< } @@ -112,6 +117,7 @@ void snippetForCreateTransformation() { // Call the API client.createTransformation(new TransformationCreate().setCode("foo").setName("bar").setDescription("baz")); + // >LOG // SEPARATOR< } @@ -125,6 +131,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -138,6 +145,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -151,6 +159,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -164,6 +173,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -177,6 +187,7 @@ void snippetForDeleteAuthentication() { // Call the API client.deleteAuthentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -190,6 +201,7 @@ void snippetForDeleteDestination() { // Call the API client.deleteDestination("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -203,6 +215,7 @@ void snippetForDeleteSource() { // Call the API client.deleteSource("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -216,6 +229,7 @@ void snippetForDeleteTask() { // Call the API client.deleteTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -229,6 +243,7 @@ void snippetForDeleteTaskV1() { // Call the API client.deleteTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -242,6 +257,7 @@ void snippetForDeleteTransformation() { // Call the API client.deleteTransformation("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -255,6 +271,7 @@ void snippetForDisableTask() { // Call the API client.disableTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -268,6 +285,7 @@ void snippetForDisableTaskV1() { // Call the API client.disableTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -281,6 +299,7 @@ void snippetForEnableTask() { // Call the API client.enableTask("76ab4c2a-ce17-496f-b7a6-506dc59ee498"); + // >LOG // SEPARATOR< } @@ -294,6 +313,7 @@ void snippetForEnableTaskV1() { // Call the API client.enableTaskV1("76ab4c2a-ce17-496f-b7a6-506dc59ee498"); + // >LOG // SEPARATOR< } @@ -311,6 +331,7 @@ void snippetForGenerateTransformationCode() { .setId("foo") .setUserPrompt("fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE" + " of code is doing") ); + // >LOG // SEPARATOR< } @@ -324,6 +345,7 @@ void snippetForGetAuthentication() { // Call the API client.getAuthentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -337,6 +359,7 @@ void snippetForGetDestination() { // Call the API client.getDestination("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -350,6 +373,7 @@ void snippetForGetEvent() { // Call the API client.getEvent("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "6c02aeb1-775e-418e-870b-1faccd4b2c0c"); + // >LOG // SEPARATOR< } @@ -363,6 +387,7 @@ void snippetForGetRun() { // Call the API client.getRun("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -376,6 +401,7 @@ void snippetForGetSource() { // Call the API client.getSource("75eeb306-51d3-4e5e-a279-3c92bd8893ac"); + // >LOG // SEPARATOR< } @@ -389,6 +415,7 @@ void snippetForGetTask() { // Call the API client.getTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -402,6 +429,7 @@ void snippetForGetTaskV1() { // Call the API client.getTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -415,6 +443,7 @@ void snippetForGetTransformation() { // Call the API client.getTransformation("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -428,6 +457,7 @@ void snippetForListAuthentications() { // Call the API client.listAuthentications(); + // >LOG // SEPARATOR< } @@ -441,6 +471,7 @@ void snippetForListDestinations() { // Call the API client.listDestinations(); + // >LOG // SEPARATOR< } @@ -454,6 +485,7 @@ void snippetForListEvents() { // Call the API client.listEvents("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -467,6 +499,7 @@ void snippetForListRuns() { // Call the API client.listRuns(); + // >LOG // SEPARATOR< } @@ -480,6 +513,7 @@ void snippetForListSources() { // Call the API client.listSources(); + // >LOG // SEPARATOR< } @@ -493,6 +527,7 @@ void snippetForListTasks() { // Call the API client.listTasks(); + // >LOG // SEPARATOR< } @@ -506,6 +541,7 @@ void snippetForListTasksV1() { // Call the API client.listTasksV1(); + // >LOG // SEPARATOR< } @@ -519,6 +555,7 @@ void snippetForListTransformationModels() { // Call the API client.listTransformationModels(); + // >LOG // SEPARATOR< } @@ -532,6 +569,7 @@ void snippetForListTransformations() { // Call the API client.listTransformations(); + // >LOG // SEPARATOR< } @@ -555,6 +593,7 @@ void snippetForPushTask() { ) ) ); + // >LOG // SEPARATOR< } @@ -574,6 +613,7 @@ void snippetForRunSource() { .setEntityIDs(Arrays.asList("1234", "5678")) .setEntityType(EntityType.PRODUCT) ); + // >LOG // SEPARATOR< } @@ -587,6 +627,7 @@ void snippetForRunTask() { // Call the API client.runTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -600,6 +641,7 @@ void snippetForRunTaskV1() { // Call the API client.runTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -616,6 +658,7 @@ void snippetForSearchAuthentications() { new AuthenticationSearch() .setAuthenticationIDs(Arrays.asList("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a")) ); + // >LOG // SEPARATOR< } @@ -632,6 +675,7 @@ void snippetForSearchDestinations() { new DestinationSearch() .setDestinationIDs(Arrays.asList("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a")) ); + // >LOG // SEPARATOR< } @@ -647,6 +691,7 @@ void snippetForSearchSources() { client.searchSources( new SourceSearch().setSourceIDs(Arrays.asList("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a")) ); + // >LOG // SEPARATOR< } @@ -669,6 +714,7 @@ void snippetForSearchTasks() { ) ) ); + // >LOG // SEPARATOR< } @@ -691,6 +737,7 @@ void snippetForSearchTasksV1() { ) ) ); + // >LOG // SEPARATOR< } @@ -713,6 +760,21 @@ void snippetForSearchTransformations() { ) ) ); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + IngestionClient client = new IngestionClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -726,6 +788,7 @@ void snippetForTriggerDockerSourceDiscover() { // Call the API client.triggerDockerSourceDiscover("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + // >LOG // SEPARATOR< } @@ -749,6 +812,7 @@ void snippetForTryTransformation() { } ) ); + // >LOG // SEPARATOR< } @@ -773,6 +837,7 @@ void snippetForTryTransformationBeforeUpdate() { } ) ); + // >LOG // SEPARATOR< } @@ -786,6 +851,7 @@ void snippetForUpdateAuthentication() { // Call the API client.updateAuthentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new AuthenticationUpdate().setName("newName")); + // >LOG // SEPARATOR< } @@ -799,6 +865,7 @@ void snippetForUpdateDestination() { // Call the API client.updateDestination("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new DestinationUpdate().setName("newName")); + // >LOG // SEPARATOR< } @@ -812,6 +879,7 @@ void snippetForUpdateSource() { // Call the API client.updateSource("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new SourceUpdate().setName("newName")); + // >LOG // SEPARATOR< } @@ -825,6 +893,7 @@ void snippetForUpdateTask() { // Call the API client.updateTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TaskUpdate().setEnabled(false).setCron("* * * * *")); + // >LOG // SEPARATOR< } @@ -838,6 +907,7 @@ void snippetForUpdateTaskV1() { // Call the API client.updateTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TaskUpdateV1().setEnabled(false)); + // >LOG // SEPARATOR< } @@ -854,6 +924,7 @@ void snippetForUpdateTransformation() { "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TransformationCreate().setCode("foo").setName("bar").setDescription("baz") ); + // >LOG // SEPARATOR< } @@ -879,6 +950,7 @@ void snippetForValidateSource() { ) .setAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f") ); + // >LOG // SEPARATOR< } @@ -892,6 +964,7 @@ void snippetForValidateSourceBeforeUpdate() { // Call the API client.validateSourceBeforeUpdate("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new SourceUpdate().setName("newName")); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/Insights.java b/snippets/java/src/test/java/com/algolia/Insights.java index bcf203d0f8..9558188da3 100644 --- a/snippets/java/src/test/java/com/algolia/Insights.java +++ b/snippets/java/src/test/java/com/algolia/Insights.java @@ -18,6 +18,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -31,6 +32,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -44,6 +46,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -57,6 +60,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -70,6 +74,7 @@ void snippetForDeleteUserToken() { // Call the API client.deleteUserToken("test-user-1"); + // >LOG // SEPARATOR< } @@ -99,6 +104,21 @@ void snippetForPushEvents() { ) ) ); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + InsightsClient client = new InsightsClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/Monitoring.java b/snippets/java/src/test/java/com/algolia/Monitoring.java index 7bbd75bb69..1c2f35e613 100644 --- a/snippets/java/src/test/java/com/algolia/Monitoring.java +++ b/snippets/java/src/test/java/com/algolia/Monitoring.java @@ -18,6 +18,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -31,6 +32,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -44,6 +46,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -57,6 +60,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -70,6 +74,7 @@ void snippetForGetClusterIncidents() { // Call the API client.getClusterIncidents("c1-de"); + // >LOG // SEPARATOR< } @@ -83,6 +88,7 @@ void snippetForGetClusterStatus() { // Call the API client.getClusterStatus("c1-de"); + // >LOG // SEPARATOR< } @@ -96,6 +102,7 @@ void snippetForGetIncidents() { // Call the API client.getIncidents(); + // >LOG // SEPARATOR< } @@ -109,6 +116,7 @@ void snippetForGetIndexingTime() { // Call the API client.getIndexingTime("c1-de"); + // >LOG // SEPARATOR< } @@ -122,6 +130,7 @@ void snippetForGetLatency() { // Call the API client.getLatency("c1-de"); + // >LOG // SEPARATOR< } @@ -135,6 +144,7 @@ void snippetForGetMetrics() { // Call the API client.getMetrics(Metric.AVG_BUILD_TIME, Period.MINUTE); + // >LOG // SEPARATOR< } @@ -148,6 +158,7 @@ void snippetForGetReachability() { // Call the API client.getReachability("c1-de"); + // >LOG // SEPARATOR< } @@ -161,6 +172,7 @@ void snippetForGetServers() { // Call the API client.getServers(); + // >LOG // SEPARATOR< } @@ -174,6 +186,21 @@ void snippetForGetStatus() { // Call the API client.getStatus(); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + MonitoringClient client = new MonitoringClient("YOUR_APP_ID", "YOUR_API_KEY"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/Personalization.java b/snippets/java/src/test/java/com/algolia/Personalization.java index be77e7a975..af5dd3a83c 100644 --- a/snippets/java/src/test/java/com/algolia/Personalization.java +++ b/snippets/java/src/test/java/com/algolia/Personalization.java @@ -18,6 +18,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -31,6 +32,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -44,6 +46,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -57,6 +60,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -70,6 +74,7 @@ void snippetForDeleteUserProfile() { // Call the API client.deleteUserProfile("UserToken"); + // >LOG // SEPARATOR< } @@ -83,6 +88,7 @@ void snippetForGetPersonalizationStrategy() { // Call the API client.getPersonalizationStrategy(); + // >LOG // SEPARATOR< } @@ -96,6 +102,21 @@ void snippetForGetUserTokenProfile() { // Call the API client.getUserTokenProfile("UserToken"); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + PersonalizationClient client = new PersonalizationClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -114,6 +135,7 @@ void snippetForSetPersonalizationStrategy() { .setFacetScoring(Arrays.asList(new FacetScoring().setScore(42).setFacetName("Event"))) .setPersonalizationImpact(42) ); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/QuerySuggestions.java b/snippets/java/src/test/java/com/algolia/QuerySuggestions.java index 79fccfb6b8..85967c36e0 100644 --- a/snippets/java/src/test/java/com/algolia/QuerySuggestions.java +++ b/snippets/java/src/test/java/com/algolia/QuerySuggestions.java @@ -31,6 +31,7 @@ void snippetForCreateConfig() { .setLanguages(Languages.of(Arrays.asList("french"))) .setExclude(Arrays.asList("test")) ); + // >LOG // SEPARATOR< } @@ -44,6 +45,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -57,6 +59,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -70,6 +73,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -83,6 +87,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -96,6 +101,7 @@ void snippetForDeleteConfig() { // Call the API client.deleteConfig(""); + // >LOG // SEPARATOR< } @@ -109,6 +115,7 @@ void snippetForGetAllConfigs() { // Call the API client.getAllConfigs(); + // >LOG // SEPARATOR< } @@ -122,6 +129,7 @@ void snippetForGetConfig() { // Call the API client.getConfig(""); + // >LOG // SEPARATOR< } @@ -135,6 +143,7 @@ void snippetForGetConfigStatus() { // Call the API client.getConfigStatus(""); + // >LOG // SEPARATOR< } @@ -148,6 +157,21 @@ void snippetForGetLogFile() { // Call the API client.getLogFile(""); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + QuerySuggestionsClient client = new QuerySuggestionsClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -174,6 +198,7 @@ void snippetForUpdateConfig() { .setLanguages(Languages.of(Arrays.asList("french"))) .setExclude(Arrays.asList("test")) ); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/Recommend.java b/snippets/java/src/test/java/com/algolia/Recommend.java index 1a0c8c53c4..7844b220eb 100644 --- a/snippets/java/src/test/java/com/algolia/Recommend.java +++ b/snippets/java/src/test/java/com/algolia/Recommend.java @@ -18,6 +18,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -31,6 +32,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -44,6 +46,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -57,6 +60,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -70,6 +74,7 @@ void snippetForDeleteRecommendRule() { // Call the API client.deleteRecommendRule("", RecommendModels.RELATED_PRODUCTS, "objectID"); + // >LOG // SEPARATOR< } @@ -83,6 +88,7 @@ void snippetForGetRecommendRule() { // Call the API client.getRecommendRule("", RecommendModels.RELATED_PRODUCTS, "objectID"); + // >LOG // SEPARATOR< } @@ -96,6 +102,7 @@ void snippetForGetRecommendStatus() { // Call the API client.getRecommendStatus("", RecommendModels.RELATED_PRODUCTS, 12345L); + // >LOG // SEPARATOR< } @@ -120,6 +127,7 @@ void snippetForGetRecommendations() { ) ) ); + // >LOG // SEPARATOR< } @@ -133,6 +141,21 @@ void snippetForSearchRecommendRules() { // Call the API client.searchRecommendRules("", RecommendModels.RELATED_PRODUCTS); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + RecommendClient client = new RecommendClient("YOUR_APP_ID", "YOUR_API_KEY"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/Search.java b/snippets/java/src/test/java/com/algolia/Search.java index d5de4c4ab2..b0f1c73ec7 100644 --- a/snippets/java/src/test/java/com/algolia/Search.java +++ b/snippets/java/src/test/java/com/algolia/Search.java @@ -25,6 +25,7 @@ void snippetForAddApiKey() { .setMaxQueriesPerIPPerHour(100) .setMaxHitsPerQuery(20) ); + // >LOG // SEPARATOR< } @@ -46,6 +47,7 @@ void snippetForAddOrUpdateObject() { } } ); + // >LOG // SEPARATOR< } @@ -59,6 +61,7 @@ void snippetForAppendSource() { // Call the API client.appendSource(new Source().setSource("theSource").setDescription("theDescription")); + // >LOG // SEPARATOR< } @@ -72,6 +75,7 @@ void snippetForAssignUserId() { // Call the API client.assignUserId("userID", new AssignUserIdParams().setCluster("theCluster")); + // >LOG // SEPARATOR< } @@ -112,6 +116,7 @@ void snippetForBatch() { ) ) ); + // >LOG // SEPARATOR< } @@ -141,6 +146,7 @@ void snippetForBatch1() { ) ) ); + // >LOG // SEPARATOR< } @@ -170,6 +176,7 @@ void snippetForBatch2() { ) ) ); + // >LOG // SEPARATOR< } @@ -199,6 +206,7 @@ void snippetForBatch3() { ) ) ); + // >LOG // SEPARATOR< } @@ -228,6 +236,7 @@ void snippetForBatch4() { ) ) ); + // >LOG // SEPARATOR< } @@ -257,6 +266,7 @@ void snippetForBatch5() { ) ) ); + // >LOG // SEPARATOR< } @@ -286,6 +296,7 @@ void snippetForBatch6() { ) ) ); + // >LOG // SEPARATOR< } @@ -299,6 +310,7 @@ void snippetForBatchAssignUserIds() { // Call the API client.batchAssignUserIds("userID", new BatchAssignUserIdsParams().setCluster("theCluster").setUsers(Arrays.asList("user1", "user2"))); + // >LOG // SEPARATOR< } @@ -331,6 +343,7 @@ void snippetForBatchDictionaryEntries() { ) ) ); + // >LOG // SEPARATOR< } @@ -353,6 +366,7 @@ void snippetForBatchDictionaryEntries1() { ) ) ); + // >LOG // SEPARATOR< } @@ -378,6 +392,7 @@ void snippetForBatchDictionaryEntries2() { ) ) ); + // >LOG // SEPARATOR< } @@ -391,6 +406,7 @@ void snippetForBrowse() { // Call the API client.browse("", Hit.class); + // >LOG // SEPARATOR< } @@ -404,6 +420,7 @@ void snippetForClearObjects() { // Call the API client.clearObjects(""); + // >LOG // SEPARATOR< } @@ -417,6 +434,7 @@ void snippetForClearRules() { // Call the API client.clearRules(""); + // >LOG // SEPARATOR< } @@ -430,6 +448,7 @@ void snippetForClearSynonyms() { // Call the API client.clearSynonyms(""); + // >LOG // SEPARATOR< } @@ -443,6 +462,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -456,6 +476,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -469,6 +490,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -482,6 +504,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -495,6 +518,7 @@ void snippetForDeleteApiKey() { // Call the API client.deleteApiKey("myTestApiKey"); + // >LOG // SEPARATOR< } @@ -508,6 +532,7 @@ void snippetForDeleteBy() { // Call the API client.deleteBy("", new DeleteByParams().setFilters("brand:brandName")); + // >LOG // SEPARATOR< } @@ -521,6 +546,7 @@ void snippetForDeleteIndex() { // Call the API client.deleteIndex(""); + // >LOG // SEPARATOR< } @@ -534,6 +560,7 @@ void snippetForDeleteObject() { // Call the API client.deleteObject("", "uniqueID"); + // >LOG // SEPARATOR< } @@ -547,6 +574,7 @@ void snippetForDeleteObjects() { // Call the API client.deleteObjects("", Arrays.asList("1", "2")); + // >LOG // SEPARATOR< } @@ -560,6 +588,7 @@ void snippetForDeleteRule() { // Call the API client.deleteRule("", "id1"); + // >LOG // SEPARATOR< } @@ -573,6 +602,7 @@ void snippetForDeleteSource() { // Call the API client.deleteSource("theSource"); + // >LOG // SEPARATOR< } @@ -586,6 +616,7 @@ void snippetForDeleteSynonym() { // Call the API client.deleteSynonym("", "id1"); + // >LOG // SEPARATOR< } @@ -602,6 +633,7 @@ void snippetForGenerateSecuredApiKey() { "2640659426d5107b6e47d75db9cbaef8", new SecuredApiKeyRestrictions().setValidUntil(2524604400L).setRestrictIndices(Arrays.asList("Movies")) ); + // >LOG // SEPARATOR< } @@ -632,6 +664,7 @@ void snippetForGenerateSecuredApiKey1() { .setOptionalWords(Arrays.asList("one", "two")) ) ); + // >LOG // SEPARATOR< } @@ -645,6 +678,7 @@ void snippetForGetApiKey() { // Call the API client.getApiKey("myTestApiKey"); + // >LOG // SEPARATOR< } @@ -658,6 +692,7 @@ void snippetForGetAppTask() { // Call the API client.getAppTask(123L); + // >LOG // SEPARATOR< } @@ -671,6 +706,7 @@ void snippetForGetDictionaryLanguages() { // Call the API client.getDictionaryLanguages(); + // >LOG // SEPARATOR< } @@ -684,6 +720,7 @@ void snippetForGetDictionarySettings() { // Call the API client.getDictionarySettings(); + // >LOG // SEPARATOR< } @@ -697,6 +734,7 @@ void snippetForGetLogs() { // Call the API client.getLogs(); + // >LOG // SEPARATOR< } @@ -710,6 +748,7 @@ void snippetForGetObject() { // Call the API client.getObject("", "uniqueID", Arrays.asList("attr1", "attr2")); + // >LOG // SEPARATOR< } @@ -734,6 +773,7 @@ void snippetForGetObjects() { ), Hit.class ); + // >LOG // SEPARATOR< } @@ -747,6 +787,7 @@ void snippetForGetRule() { // Call the API client.getRule("", "qr-1725004648916"); + // >LOG // SEPARATOR< } @@ -760,6 +801,7 @@ void snippetForGetSettings() { // Call the API client.getSettings(""); + // >LOG // SEPARATOR< } @@ -773,6 +815,7 @@ void snippetForGetSources() { // Call the API client.getSources(); + // >LOG // SEPARATOR< } @@ -786,6 +829,7 @@ void snippetForGetSynonym() { // Call the API client.getSynonym("", "id1"); + // >LOG // SEPARATOR< } @@ -799,6 +843,7 @@ void snippetForGetTask() { // Call the API client.getTask("", 123L); + // >LOG // SEPARATOR< } @@ -812,6 +857,7 @@ void snippetForGetTopUserIds() { // Call the API client.getTopUserIds(); + // >LOG // SEPARATOR< } @@ -825,6 +871,7 @@ void snippetForGetUserId() { // Call the API client.getUserId("uniqueID"); + // >LOG // SEPARATOR< } @@ -838,6 +885,7 @@ void snippetForHasPendingMappings() { // Call the API client.hasPendingMappings(); + // >LOG // SEPARATOR< } @@ -851,6 +899,7 @@ void snippetForIndexExists() { // Call the API client.indexExists(""); + // >LOG // SEPARATOR< } @@ -864,6 +913,7 @@ void snippetForIndexExists1() { // Call the API client.indexExists(""); + // >LOG // SEPARATOR< } @@ -877,6 +927,7 @@ void snippetForIndexExists2() { // Call the API client.indexExists(""); + // >LOG // SEPARATOR< } @@ -890,6 +941,7 @@ void snippetForListApiKeys() { // Call the API client.listApiKeys(); + // >LOG // SEPARATOR< } @@ -903,6 +955,7 @@ void snippetForListClusters() { // Call the API client.listClusters(); + // >LOG // SEPARATOR< } @@ -916,6 +969,7 @@ void snippetForListIndices() { // Call the API client.listIndices(); + // >LOG // SEPARATOR< } @@ -929,6 +983,7 @@ void snippetForListUserIds() { // Call the API client.listUserIds(); + // >LOG // SEPARATOR< } @@ -958,6 +1013,7 @@ void snippetForMultipleBatch() { ) ) ); + // >LOG // SEPARATOR< } @@ -977,6 +1033,7 @@ void snippetForOperationIndex() { .setDestination("") .setScope(Arrays.asList(ScopeType.RULES, ScopeType.SETTINGS)) ); + // >LOG // SEPARATOR< } @@ -993,6 +1050,7 @@ void snippetForOperationIndex1() { "", new OperationIndexParams().setOperation(OperationType.COPY).setDestination("") ); + // >LOG // SEPARATOR< } @@ -1009,6 +1067,7 @@ void snippetForOperationIndex2() { "", new OperationIndexParams().setOperation(OperationType.MOVE).setDestination("") ); + // >LOG // SEPARATOR< } @@ -1030,6 +1089,7 @@ void snippetForPartialUpdateObject() { } } ); + // >LOG // SEPARATOR< } @@ -1060,6 +1120,7 @@ void snippetForPartialUpdateObjects() { ), true ); + // >LOG // SEPARATOR< } @@ -1090,6 +1151,7 @@ void snippetForPartialUpdateObjects1() { ), false ); + // >LOG // SEPARATOR< } @@ -1103,6 +1165,7 @@ void snippetForRemoveUserId() { // Call the API client.removeUserId("uniqueID"); + // >LOG // SEPARATOR< } @@ -1181,6 +1244,7 @@ void snippetForReplaceAllObjects() { ), 3 ); + // >LOG // SEPARATOR< } @@ -1194,6 +1258,7 @@ void snippetForReplaceSources() { // Call the API client.replaceSources(Arrays.asList(new Source().setSource("theSource").setDescription("theDescription"))); + // >LOG // SEPARATOR< } @@ -1207,6 +1272,7 @@ void snippetForRestoreApiKey() { // Call the API client.restoreApiKey("myApiKey"); + // >LOG // SEPARATOR< } @@ -1228,6 +1294,7 @@ void snippetForSaveObject() { } } ); + // >LOG // SEPARATOR< } @@ -1257,6 +1324,7 @@ void snippetForSaveObjects() { } ) ); + // >LOG // SEPARATOR< } @@ -1286,6 +1354,7 @@ void snippetForSaveObjects1() { } ) ); + // >LOG // SEPARATOR< } @@ -1303,6 +1372,7 @@ void snippetForSaveRule() { "id1", new Rule().setObjectID("id1").setConditions(Arrays.asList(new Condition().setPattern("apple").setAnchoring(Anchoring.CONTAINS))) ); + // >LOG // SEPARATOR< } @@ -1328,6 +1398,7 @@ void snippetForSaveRules() { false, true ); + // >LOG // SEPARATOR< } @@ -1346,6 +1417,7 @@ void snippetForSaveSynonym() { new SynonymHit().setObjectID("id1").setType(SynonymType.SYNONYM).setSynonyms(Arrays.asList("car", "vehicule", "auto")), true ); + // >LOG // SEPARATOR< } @@ -1371,6 +1443,7 @@ void snippetForSaveSynonyms() { true, true ); + // >LOG // SEPARATOR< } @@ -1388,6 +1461,7 @@ void snippetForSearch() { .setRequests(Arrays.asList(new SearchForHits().setIndexName("").setQuery("").setHitsPerPage(50))), Hit.class ); + // >LOG // SEPARATOR< } @@ -1409,6 +1483,7 @@ void snippetForSearch1() { ), Hit.class ); + // >LOG // SEPARATOR< } @@ -1433,6 +1508,7 @@ void snippetForSearch2() { ), Hit.class ); + // >LOG // SEPARATOR< } @@ -1452,6 +1528,7 @@ void snippetForSearch3() { ), Hit.class ); + // >LOG // SEPARATOR< } @@ -1473,6 +1550,7 @@ void snippetForSearch4() { ), Hit.class ); + // >LOG // SEPARATOR< } @@ -1492,6 +1570,7 @@ void snippetForSearch5() { ), Hit.class ); + // >LOG // SEPARATOR< } @@ -1505,6 +1584,7 @@ void snippetForSearchDictionaryEntries() { // Call the API client.searchDictionaryEntries(DictionaryType.STOPWORDS, new SearchDictionaryEntriesParams().setQuery("about")); + // >LOG // SEPARATOR< } @@ -1518,6 +1598,7 @@ void snippetForSearchForFacetValues() { // Call the API client.searchForFacetValues("", "facetName"); + // >LOG // SEPARATOR< } @@ -1531,6 +1612,7 @@ void snippetForSearchRules() { // Call the API client.searchRules("", new SearchRulesParams().setQuery("zorro")); + // >LOG // SEPARATOR< } @@ -1544,6 +1626,7 @@ void snippetForSearchSingleIndex() { // Call the API client.searchSingleIndex("", Hit.class); + // >LOG // SEPARATOR< } @@ -1557,6 +1640,7 @@ void snippetForSearchSynonyms() { // Call the API client.searchSynonyms(""); + // >LOG // SEPARATOR< } @@ -1570,6 +1654,21 @@ void snippetForSearchUserIds() { // Call the API client.searchUserIds(new SearchUserIdsParams().setQuery("test").setClusterName("theClusterName").setPage(5).setHitsPerPage(10)); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + SearchClient client = new SearchClient("YOUR_APP_ID", "YOUR_API_KEY"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } @@ -1597,6 +1696,7 @@ void snippetForSetDictionarySettings() { ) ) ); + // >LOG // SEPARATOR< } @@ -1613,6 +1713,7 @@ void snippetForSetSettings() { "", new IndexSettings().setAttributesForFaceting(Arrays.asList("actor", "filterOnly(category)", "searchable(publisher)")) ); + // >LOG // SEPARATOR< } @@ -1629,6 +1730,7 @@ void snippetForUpdateApiKey() { "myApiKey", new ApiKey().setAcl(Arrays.asList(Acl.SEARCH, Acl.ADD_OBJECT)).setValidity(300).setMaxQueriesPerIPPerHour(100).setMaxHitsPerQuery(20) ); + // >LOG // SEPARATOR< } @@ -1642,6 +1744,7 @@ void snippetForWaitForApiKey() { // Call the API client.waitForApiKey("api-key-add-operation-test-java", ApiKeyOperation.ADD); + // >LOG // SEPARATOR< } @@ -1666,6 +1769,7 @@ void snippetForWaitForApiKey1() { .setMaxQueriesPerIPPerHour(95) .setMaxHitsPerQuery(20) ); + // >LOG // SEPARATOR< } @@ -1679,6 +1783,7 @@ void snippetForWaitForApiKey2() { // Call the API client.waitForApiKey("api-key-delete-operation-test-java", ApiKeyOperation.DELETE); + // >LOG // SEPARATOR< } @@ -1692,6 +1797,7 @@ void snippetForWaitForAppTask() { // Call the API client.waitForAppTask(123L); + // >LOG // SEPARATOR< } @@ -1705,6 +1811,7 @@ void snippetForWaitForTask() { // Call the API client.waitForTask("", 123L); + // >LOG // SEPARATOR< } } diff --git a/snippets/java/src/test/java/com/algolia/Usage.java b/snippets/java/src/test/java/com/algolia/Usage.java index 25613fc173..b0ae9cd314 100644 --- a/snippets/java/src/test/java/com/algolia/Usage.java +++ b/snippets/java/src/test/java/com/algolia/Usage.java @@ -18,6 +18,7 @@ void snippetForCustomDelete() { // Call the API client.customDelete("test/minimal"); + // >LOG // SEPARATOR< } @@ -31,6 +32,7 @@ void snippetForCustomGet() { // Call the API client.customGet("test/minimal"); + // >LOG // SEPARATOR< } @@ -44,6 +46,7 @@ void snippetForCustomPost() { // Call the API client.customPost("test/minimal"); + // >LOG // SEPARATOR< } @@ -57,6 +60,7 @@ void snippetForCustomPut() { // Call the API client.customPut("test/minimal"); + // >LOG // SEPARATOR< } @@ -70,6 +74,7 @@ void snippetForGetIndexUsage() { // Call the API client.getIndexUsage(Statistic.QUERIES_OPERATIONS, "", "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z"); + // >LOG // SEPARATOR< } @@ -83,6 +88,21 @@ void snippetForGetUsage() { // Call the API client.getUsage(Statistic.QUERIES_OPERATIONS, "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z"); + // >LOG + // SEPARATOR< + } + + // Snippet for the setClientApiKey method. + // + // switch API key + void snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); + + // Call the API + client.setClientApiKey("updated-api-key"); + // >LOG // SEPARATOR< } } diff --git a/snippets/javascript/src/abtesting.ts b/snippets/javascript/src/abtesting.ts index 0ec0edeacf..b117a17540 100644 --- a/snippets/javascript/src/abtesting.ts +++ b/snippets/javascript/src/abtesting.ts @@ -23,6 +23,7 @@ export async function snippetForAddABTests(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -39,6 +40,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -55,6 +57,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -71,6 +74,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -87,6 +91,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -103,6 +108,7 @@ export async function snippetForDeleteABTest(): Promise { // Call the API const response = await client.deleteABTest({ id: 42 }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -119,6 +125,7 @@ export async function snippetForGetABTest(): Promise { // Call the API const response = await client.getABTest({ id: 42 }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -135,6 +142,7 @@ export async function snippetForListABTests(): Promise { // Call the API const response = await client.listABTests(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -159,11 +167,27 @@ export async function snippetForScheduleABTest(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< } +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = abtestingClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} + // Snippet for the stopABTest method. // // stopABTest @@ -175,6 +199,7 @@ export async function snippetForStopABTest(): Promise { // Call the API const response = await client.stopABTest({ id: 42 }); + // >LOG // use typed response console.log(response); // SEPARATOR< diff --git a/snippets/javascript/src/algoliasearch.ts b/snippets/javascript/src/algoliasearch.ts index 54c952d573..082dcdbd8f 100644 --- a/snippets/javascript/src/algoliasearch.ts +++ b/snippets/javascript/src/algoliasearch.ts @@ -16,6 +16,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -34,6 +35,7 @@ export async function snippetForGetRecommendations(): Promise { requests: [{ indexName: 'indexName', objectID: 'objectID', model: 'related-products', threshold: 42.1 }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -52,6 +54,7 @@ export async function snippetForSearch(): Promise { requests: [{ indexName: '', query: '', hitsPerPage: 50 }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -70,6 +73,7 @@ export async function snippetForSearch1(): Promise { requests: [{ indexName: '', query: '', filters: 'actor:Scarlett Johansson' }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -94,6 +98,7 @@ export async function snippetForSearch2(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -112,6 +117,7 @@ export async function snippetForSearch3(): Promise { requests: [{ indexName: '', query: '', filters: 'NOT actor:Nicolas Cage' }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -130,6 +136,7 @@ export async function snippetForSearch4(): Promise { requests: [{ indexName: '', query: '', facets: ['author', 'genre'] }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -148,6 +155,7 @@ export async function snippetForSearch5(): Promise { requests: [{ indexName: '', query: '', facets: ['*'] }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< diff --git a/snippets/javascript/src/analytics.ts b/snippets/javascript/src/analytics.ts index 709fa0b0d0..992df57840 100644 --- a/snippets/javascript/src/analytics.ts +++ b/snippets/javascript/src/analytics.ts @@ -16,6 +16,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -32,6 +33,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -48,6 +50,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -64,6 +67,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -80,6 +84,7 @@ export async function snippetForGetAddToCartRate(): Promise { // Call the API const response = await client.getAddToCartRate({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -96,6 +101,7 @@ export async function snippetForGetAverageClickPosition(): Promise { // Call the API const response = await client.getAverageClickPosition({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -112,6 +118,7 @@ export async function snippetForGetClickPositions(): Promise { // Call the API const response = await client.getClickPositions({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -128,6 +135,7 @@ export async function snippetForGetClickThroughRate(): Promise { // Call the API const response = await client.getClickThroughRate({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -144,6 +152,7 @@ export async function snippetForGetConversionRate(): Promise { // Call the API const response = await client.getConversionRate({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -160,6 +169,7 @@ export async function snippetForGetNoClickRate(): Promise { // Call the API const response = await client.getNoClickRate({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -176,6 +186,7 @@ export async function snippetForGetNoResultsRate(): Promise { // Call the API const response = await client.getNoResultsRate({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -192,6 +203,7 @@ export async function snippetForGetPurchaseRate(): Promise { // Call the API const response = await client.getPurchaseRate({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -208,6 +220,7 @@ export async function snippetForGetRevenue(): Promise { // Call the API const response = await client.getRevenue({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -224,6 +237,7 @@ export async function snippetForGetSearchesCount(): Promise { // Call the API const response = await client.getSearchesCount({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -240,6 +254,7 @@ export async function snippetForGetSearchesNoClicks(): Promise { // Call the API const response = await client.getSearchesNoClicks({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -256,6 +271,7 @@ export async function snippetForGetSearchesNoResults(): Promise { // Call the API const response = await client.getSearchesNoResults({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -272,6 +288,7 @@ export async function snippetForGetStatus(): Promise { // Call the API const response = await client.getStatus({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -288,6 +305,7 @@ export async function snippetForGetTopCountries(): Promise { // Call the API const response = await client.getTopCountries({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -304,6 +322,7 @@ export async function snippetForGetTopFilterAttributes(): Promise { // Call the API const response = await client.getTopFilterAttributes({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -320,6 +339,7 @@ export async function snippetForGetTopFilterForAttribute(): Promise { // Call the API const response = await client.getTopFilterForAttribute({ attribute: 'myAttribute', index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -336,6 +356,7 @@ export async function snippetForGetTopFiltersNoResults(): Promise { // Call the API const response = await client.getTopFiltersNoResults({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -352,6 +373,7 @@ export async function snippetForGetTopHits(): Promise { // Call the API const response = await client.getTopHits({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -368,6 +390,7 @@ export async function snippetForGetTopSearches(): Promise { // Call the API const response = await client.getTopSearches({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -384,7 +407,23 @@ export async function snippetForGetUsersCount(): Promise { // Call the API const response = await client.getUsersCount({ index: 'index' }); + // >LOG // use typed response console.log(response); // SEPARATOR< } + +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = analyticsClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} diff --git a/snippets/javascript/src/ingestion.ts b/snippets/javascript/src/ingestion.ts index dbf87a2f9c..43b7951848 100644 --- a/snippets/javascript/src/ingestion.ts +++ b/snippets/javascript/src/ingestion.ts @@ -20,6 +20,7 @@ export async function snippetForCreateAuthentication(): Promise { input: { url: 'http://test.oauth', client_id: 'myID', client_secret: 'mySecret' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -41,6 +42,7 @@ export async function snippetForCreateDestination(): Promise { authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -62,6 +64,7 @@ export async function snippetForCreateSource(): Promise { authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -78,6 +81,7 @@ export async function snippetForCreateTask(): Promise { // Call the API const response = await client.createTask({ sourceID: 'search', destinationID: 'destinationName', action: 'replace' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -99,6 +103,7 @@ export async function snippetForCreateTaskV1(): Promise { action: 'replace', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -115,6 +120,7 @@ export async function snippetForCreateTransformation(): Promise { // Call the API const response = await client.createTransformation({ code: 'foo', name: 'bar', description: 'baz' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -131,6 +137,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -147,6 +154,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -163,6 +171,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -179,6 +188,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -195,6 +205,7 @@ export async function snippetForDeleteAuthentication(): Promise { // Call the API const response = await client.deleteAuthentication({ authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -211,6 +222,7 @@ export async function snippetForDeleteDestination(): Promise { // Call the API const response = await client.deleteDestination({ destinationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -227,6 +239,7 @@ export async function snippetForDeleteSource(): Promise { // Call the API const response = await client.deleteSource({ sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -243,6 +256,7 @@ export async function snippetForDeleteTask(): Promise { // Call the API const response = await client.deleteTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -259,6 +273,7 @@ export async function snippetForDeleteTaskV1(): Promise { // Call the API const response = await client.deleteTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -275,6 +290,7 @@ export async function snippetForDeleteTransformation(): Promise { // Call the API const response = await client.deleteTransformation({ transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -291,6 +307,7 @@ export async function snippetForDisableTask(): Promise { // Call the API const response = await client.disableTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -307,6 +324,7 @@ export async function snippetForDisableTaskV1(): Promise { // Call the API const response = await client.disableTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -323,6 +341,7 @@ export async function snippetForEnableTask(): Promise { // Call the API const response = await client.enableTask({ taskID: '76ab4c2a-ce17-496f-b7a6-506dc59ee498' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -339,6 +358,7 @@ export async function snippetForEnableTaskV1(): Promise { // Call the API const response = await client.enableTaskV1({ taskID: '76ab4c2a-ce17-496f-b7a6-506dc59ee498' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -358,6 +378,7 @@ export async function snippetForGenerateTransformationCode(): Promise { userPrompt: 'fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -374,6 +395,7 @@ export async function snippetForGetAuthentication(): Promise { // Call the API const response = await client.getAuthentication({ authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -390,6 +412,7 @@ export async function snippetForGetDestination(): Promise { // Call the API const response = await client.getDestination({ destinationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -409,6 +432,7 @@ export async function snippetForGetEvent(): Promise { eventID: '6c02aeb1-775e-418e-870b-1faccd4b2c0c', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -425,6 +449,7 @@ export async function snippetForGetRun(): Promise { // Call the API const response = await client.getRun({ runID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -441,6 +466,7 @@ export async function snippetForGetSource(): Promise { // Call the API const response = await client.getSource({ sourceID: '75eeb306-51d3-4e5e-a279-3c92bd8893ac' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -457,6 +483,7 @@ export async function snippetForGetTask(): Promise { // Call the API const response = await client.getTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -473,6 +500,7 @@ export async function snippetForGetTaskV1(): Promise { // Call the API const response = await client.getTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -489,6 +517,7 @@ export async function snippetForGetTransformation(): Promise { // Call the API const response = await client.getTransformation({ transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -505,6 +534,7 @@ export async function snippetForListAuthentications(): Promise { // Call the API const response = await client.listAuthentications(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -521,6 +551,7 @@ export async function snippetForListDestinations(): Promise { // Call the API const response = await client.listDestinations(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -537,6 +568,7 @@ export async function snippetForListEvents(): Promise { // Call the API const response = await client.listEvents({ runID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -553,6 +585,7 @@ export async function snippetForListRuns(): Promise { // Call the API const response = await client.listRuns(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -569,6 +602,7 @@ export async function snippetForListSources(): Promise { // Call the API const response = await client.listSources(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -585,6 +619,7 @@ export async function snippetForListTasks(): Promise { // Call the API const response = await client.listTasks(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -601,6 +636,7 @@ export async function snippetForListTasksV1(): Promise { // Call the API const response = await client.listTasksV1(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -617,6 +653,7 @@ export async function snippetForListTransformationModels(): Promise { // Call the API const response = await client.listTransformationModels(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -633,6 +670,7 @@ export async function snippetForListTransformations(): Promise { // Call the API const response = await client.listTransformations(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -658,6 +696,7 @@ export async function snippetForPushTask(): Promise { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -681,6 +720,7 @@ export async function snippetForRunSource(): Promise { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -697,6 +737,7 @@ export async function snippetForRunTask(): Promise { // Call the API const response = await client.runTask({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -713,6 +754,7 @@ export async function snippetForRunTaskV1(): Promise { // Call the API const response = await client.runTaskV1({ taskID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -731,6 +773,7 @@ export async function snippetForSearchAuthentications(): Promise { authenticationIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -749,6 +792,7 @@ export async function snippetForSearchDestinations(): Promise { destinationIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -767,6 +811,7 @@ export async function snippetForSearchSources(): Promise { sourceIDs: ['6c02aeb1-775e-418e-870b-1faccd4b2c0f', '947ac9c4-7e58-4c87-b1e7-14a68e99699a'], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -789,6 +834,7 @@ export async function snippetForSearchTasks(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -811,6 +857,7 @@ export async function snippetForSearchTasksV1(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -833,11 +880,27 @@ export async function snippetForSearchTransformations(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< } +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = ingestionClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} + // Snippet for the triggerDockerSourceDiscover method. // // triggerDockerSourceDiscover @@ -849,6 +912,7 @@ export async function snippetForTriggerDockerSourceDiscover(): Promise { // Call the API const response = await client.triggerDockerSourceDiscover({ sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -865,6 +929,7 @@ export async function snippetForTryTransformation(): Promise { // Call the API const response = await client.tryTransformation({ code: 'foo', sampleRecord: { bar: 'baz' } }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -884,6 +949,7 @@ export async function snippetForTryTransformationBeforeUpdate(): Promise { transformationTry: { code: 'foo', sampleRecord: { bar: 'baz' } }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -903,6 +969,7 @@ export async function snippetForUpdateAuthentication(): Promise { authenticationUpdate: { name: 'newName' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -922,6 +989,7 @@ export async function snippetForUpdateDestination(): Promise { destinationUpdate: { name: 'newName' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -941,6 +1009,7 @@ export async function snippetForUpdateSource(): Promise { sourceUpdate: { name: 'newName' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -960,6 +1029,7 @@ export async function snippetForUpdateTask(): Promise { taskUpdate: { enabled: false, cron: '* * * * *' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -979,6 +1049,7 @@ export async function snippetForUpdateTaskV1(): Promise { taskUpdate: { enabled: false }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -998,6 +1069,7 @@ export async function snippetForUpdateTransformation(): Promise { transformationCreate: { code: 'foo', name: 'bar', description: 'baz' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1019,6 +1091,7 @@ export async function snippetForValidateSource(): Promise { authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1038,6 +1111,7 @@ export async function snippetForValidateSourceBeforeUpdate(): Promise { sourceUpdate: { name: 'newName' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< diff --git a/snippets/javascript/src/insights.ts b/snippets/javascript/src/insights.ts index ca9f37bd0f..d41d355f54 100644 --- a/snippets/javascript/src/insights.ts +++ b/snippets/javascript/src/insights.ts @@ -16,6 +16,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -32,6 +33,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -48,6 +50,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -64,6 +67,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -78,10 +82,9 @@ export async function snippetForDeleteUserToken(): Promise { const client = insightsClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION'); // Call the API - const response = await client.deleteUserToken({ userToken: 'test-user-1' }); + await client.deleteUserToken({ userToken: 'test-user-1' }); - // use typed response - console.log(response); + // >LOG // SEPARATOR< } @@ -110,7 +113,23 @@ export async function snippetForPushEvents(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< } + +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = insightsClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} diff --git a/snippets/javascript/src/monitoring.ts b/snippets/javascript/src/monitoring.ts index 7e2016dba7..d45bf2c243 100644 --- a/snippets/javascript/src/monitoring.ts +++ b/snippets/javascript/src/monitoring.ts @@ -16,6 +16,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -32,6 +33,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -48,6 +50,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -64,6 +67,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -80,6 +84,7 @@ export async function snippetForGetClusterIncidents(): Promise { // Call the API const response = await client.getClusterIncidents({ clusters: 'c1-de' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -96,6 +101,7 @@ export async function snippetForGetClusterStatus(): Promise { // Call the API const response = await client.getClusterStatus({ clusters: 'c1-de' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -112,6 +118,7 @@ export async function snippetForGetIncidents(): Promise { // Call the API const response = await client.getIncidents(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -128,6 +135,7 @@ export async function snippetForGetIndexingTime(): Promise { // Call the API const response = await client.getIndexingTime({ clusters: 'c1-de' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -144,6 +152,7 @@ export async function snippetForGetLatency(): Promise { // Call the API const response = await client.getLatency({ clusters: 'c1-de' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -160,6 +169,7 @@ export async function snippetForGetMetrics(): Promise { // Call the API const response = await client.getMetrics({ metric: 'avg_build_time', period: 'minute' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -176,6 +186,7 @@ export async function snippetForGetReachability(): Promise { // Call the API const response = await client.getReachability({ clusters: 'c1-de' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -192,6 +203,7 @@ export async function snippetForGetServers(): Promise { // Call the API const response = await client.getServers(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -208,7 +220,23 @@ export async function snippetForGetStatus(): Promise { // Call the API const response = await client.getStatus(); + // >LOG // use typed response console.log(response); // SEPARATOR< } + +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = monitoringClient('YOUR_APP_ID', 'YOUR_API_KEY'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} diff --git a/snippets/javascript/src/personalization.ts b/snippets/javascript/src/personalization.ts index dceb543137..02c0b8387e 100644 --- a/snippets/javascript/src/personalization.ts +++ b/snippets/javascript/src/personalization.ts @@ -16,6 +16,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -32,6 +33,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -48,6 +50,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -64,6 +67,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -80,6 +84,7 @@ export async function snippetForDeleteUserProfile(): Promise { // Call the API const response = await client.deleteUserProfile({ userToken: 'UserToken' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -96,6 +101,7 @@ export async function snippetForGetPersonalizationStrategy(): Promise { // Call the API const response = await client.getPersonalizationStrategy(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -112,11 +118,27 @@ export async function snippetForGetUserTokenProfile(): Promise { // Call the API const response = await client.getUserTokenProfile({ userToken: 'UserToken' }); + // >LOG // use typed response console.log(response); // SEPARATOR< } +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = personalizationClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} + // Snippet for the setPersonalizationStrategy method. // // set setPersonalizationStrategy @@ -132,6 +154,7 @@ export async function snippetForSetPersonalizationStrategy(): Promise { personalizationImpact: 42, }); + // >LOG // use typed response console.log(response); // SEPARATOR< diff --git a/snippets/javascript/src/querySuggestions.ts b/snippets/javascript/src/querySuggestions.ts index 2dee98f7b9..7581b5bcb6 100644 --- a/snippets/javascript/src/querySuggestions.ts +++ b/snippets/javascript/src/querySuggestions.ts @@ -23,6 +23,7 @@ export async function snippetForCreateConfig(): Promise { exclude: ['test'], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -39,6 +40,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -55,6 +57,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -71,6 +74,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -87,6 +91,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -103,6 +108,7 @@ export async function snippetForDeleteConfig(): Promise { // Call the API const response = await client.deleteConfig({ indexName: 'theIndexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -119,6 +125,7 @@ export async function snippetForGetAllConfigs(): Promise { // Call the API const response = await client.getAllConfigs(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -135,6 +142,7 @@ export async function snippetForGetConfig(): Promise { // Call the API const response = await client.getConfig({ indexName: 'cts_e2e_browse_query_suggestions' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -151,6 +159,7 @@ export async function snippetForGetConfigStatus(): Promise { // Call the API const response = await client.getConfigStatus({ indexName: 'theIndexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -167,11 +176,27 @@ export async function snippetForGetLogFile(): Promise { // Call the API const response = await client.getLogFile({ indexName: 'theIndexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< } +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = querySuggestionsClient('YOUR_APP_ID', 'YOUR_API_KEY', 'YOUR_APP_ID_REGION'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} + // Snippet for the updateConfig method. // // updateConfig @@ -192,6 +217,7 @@ export async function snippetForUpdateConfig(): Promise { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< diff --git a/snippets/javascript/src/recommend.ts b/snippets/javascript/src/recommend.ts index 4560f912c2..7b4364ea27 100644 --- a/snippets/javascript/src/recommend.ts +++ b/snippets/javascript/src/recommend.ts @@ -16,6 +16,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -32,6 +33,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -48,6 +50,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -64,6 +67,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -84,6 +88,7 @@ export async function snippetForDeleteRecommendRule(): Promise { objectID: 'objectID', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -104,6 +109,7 @@ export async function snippetForGetRecommendRule(): Promise { objectID: 'objectID', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -124,6 +130,7 @@ export async function snippetForGetRecommendStatus(): Promise { taskID: 12345, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -142,6 +149,7 @@ export async function snippetForGetRecommendations(): Promise { requests: [{ indexName: 'indexName', objectID: 'objectID', model: 'related-products', threshold: 42.1 }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -158,7 +166,23 @@ export async function snippetForSearchRecommendRules(): Promise { // Call the API const response = await client.searchRecommendRules({ indexName: 'indexName', model: 'related-products' }); + // >LOG // use typed response console.log(response); // SEPARATOR< } + +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = recommendClient('YOUR_APP_ID', 'YOUR_API_KEY'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} diff --git a/snippets/javascript/src/search.ts b/snippets/javascript/src/search.ts index b0f50d73dd..0facf1e00d 100644 --- a/snippets/javascript/src/search.ts +++ b/snippets/javascript/src/search.ts @@ -22,6 +22,7 @@ export async function snippetForAddApiKey(): Promise { maxHitsPerQuery: 20, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -42,6 +43,7 @@ export async function snippetForAddOrUpdateObject(): Promise { body: { key: 'value' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -58,6 +60,7 @@ export async function snippetForAppendSource(): Promise { // Call the API const response = await client.appendSource({ source: 'theSource', description: 'theDescription' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -77,6 +80,7 @@ export async function snippetForAssignUserId(): Promise { assignUserIdParams: { cluster: 'theCluster' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -101,6 +105,7 @@ export async function snippetForBatch(): Promise { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -120,6 +125,7 @@ export async function snippetForBatch1(): Promise { batchWriteParams: { requests: [{ action: 'clear', body: { key: 'value' } }] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -139,6 +145,7 @@ export async function snippetForBatch2(): Promise { batchWriteParams: { requests: [{ action: 'delete', body: { key: 'value' } }] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -158,6 +165,7 @@ export async function snippetForBatch3(): Promise { batchWriteParams: { requests: [{ action: 'deleteObject', body: { key: 'value' } }] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -177,6 +185,7 @@ export async function snippetForBatch4(): Promise { batchWriteParams: { requests: [{ action: 'partialUpdateObject', body: { key: 'value' } }] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -196,6 +205,7 @@ export async function snippetForBatch5(): Promise { batchWriteParams: { requests: [{ action: 'partialUpdateObjectNoCreate', body: { key: 'value' } }] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -215,6 +225,7 @@ export async function snippetForBatch6(): Promise { batchWriteParams: { requests: [{ action: 'updateObject', body: { key: 'value' } }] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -234,6 +245,7 @@ export async function snippetForBatchAssignUserIds(): Promise { batchAssignUserIdsParams: { cluster: 'theCluster', users: ['user1', 'user2'] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -268,6 +280,7 @@ export async function snippetForBatchDictionaryEntries(): Promise { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -290,6 +303,7 @@ export async function snippetForBatchDictionaryEntries1(): Promise { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -311,6 +325,7 @@ export async function snippetForBatchDictionaryEntries2(): Promise { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -327,6 +342,7 @@ export async function snippetForBrowse(): Promise { // Call the API const response = await client.browse({ indexName: 'cts_e2e_browse' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -343,6 +359,7 @@ export async function snippetForClearObjects(): Promise { // Call the API const response = await client.clearObjects({ indexName: 'theIndexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -359,6 +376,7 @@ export async function snippetForClearRules(): Promise { // Call the API const response = await client.clearRules({ indexName: 'indexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -375,6 +393,7 @@ export async function snippetForClearSynonyms(): Promise { // Call the API const response = await client.clearSynonyms({ indexName: 'indexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -391,6 +410,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -407,6 +427,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -423,6 +444,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -439,6 +461,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -455,6 +478,7 @@ export async function snippetForDeleteApiKey(): Promise { // Call the API const response = await client.deleteApiKey({ key: 'myTestApiKey' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -471,6 +495,7 @@ export async function snippetForDeleteBy(): Promise { // Call the API const response = await client.deleteBy({ indexName: 'theIndexName', deleteByParams: { filters: 'brand:brandName' } }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -487,6 +512,7 @@ export async function snippetForDeleteIndex(): Promise { // Call the API const response = await client.deleteIndex({ indexName: 'theIndexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -503,6 +529,7 @@ export async function snippetForDeleteObject(): Promise { // Call the API const response = await client.deleteObject({ indexName: '', objectID: 'uniqueID' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -519,6 +546,7 @@ export async function snippetForDeleteObjects(): Promise { // Call the API const response = await client.deleteObjects({ indexName: 'cts_e2e_deleteObjects_javascript', objectIDs: ['1', '2'] }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -535,6 +563,7 @@ export async function snippetForDeleteRule(): Promise { // Call the API const response = await client.deleteRule({ indexName: 'indexName', objectID: 'id1' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -551,6 +580,7 @@ export async function snippetForDeleteSource(): Promise { // Call the API const response = await client.deleteSource({ source: 'theSource' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -567,6 +597,7 @@ export async function snippetForDeleteSynonym(): Promise { // Call the API const response = await client.deleteSynonym({ indexName: 'indexName', objectID: 'id1' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -586,6 +617,7 @@ export function snippetForGenerateSecuredApiKey(): void { restrictions: { validUntil: 2524604400, restrictIndices: ['Movies'] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -619,6 +651,7 @@ export function snippetForGenerateSecuredApiKey1(): void { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -635,6 +668,7 @@ export async function snippetForGetApiKey(): Promise { // Call the API const response = await client.getApiKey({ key: 'myTestApiKey' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -651,6 +685,7 @@ export async function snippetForGetAppTask(): Promise { // Call the API const response = await client.getAppTask({ taskID: 123 }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -667,6 +702,7 @@ export async function snippetForGetDictionaryLanguages(): Promise { // Call the API const response = await client.getDictionaryLanguages(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -683,6 +719,7 @@ export async function snippetForGetDictionarySettings(): Promise { // Call the API const response = await client.getDictionarySettings(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -699,6 +736,7 @@ export async function snippetForGetLogs(): Promise { // Call the API const response = await client.getLogs(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -719,6 +757,7 @@ export async function snippetForGetObject(): Promise { attributesToRetrieve: ['attr1', 'attr2'], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -737,6 +776,7 @@ export async function snippetForGetObjects(): Promise { requests: [{ attributesToRetrieve: ['attr1', 'attr2'], objectID: 'uniqueID', indexName: 'theIndexName' }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -753,6 +793,7 @@ export async function snippetForGetRule(): Promise { // Call the API const response = await client.getRule({ indexName: 'cts_e2e_browse', objectID: 'qr-1725004648916' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -769,6 +810,7 @@ export async function snippetForGetSettings(): Promise { // Call the API const response = await client.getSettings({ indexName: 'cts_e2e_settings' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -785,6 +827,7 @@ export async function snippetForGetSources(): Promise { // Call the API const response = await client.getSources(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -801,6 +844,7 @@ export async function snippetForGetSynonym(): Promise { // Call the API const response = await client.getSynonym({ indexName: 'indexName', objectID: 'id1' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -817,6 +861,7 @@ export async function snippetForGetTask(): Promise { // Call the API const response = await client.getTask({ indexName: 'theIndexName', taskID: 123 }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -833,6 +878,7 @@ export async function snippetForGetTopUserIds(): Promise { // Call the API const response = await client.getTopUserIds(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -849,6 +895,7 @@ export async function snippetForGetUserId(): Promise { // Call the API const response = await client.getUserId({ userID: 'uniqueID' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -865,6 +912,7 @@ export async function snippetForHasPendingMappings(): Promise { // Call the API const response = await client.hasPendingMappings(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -881,6 +929,7 @@ export async function snippetForIndexExists(): Promise { // Call the API const response = await client.indexExists({ indexName: 'indexExistsYES' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -897,6 +946,7 @@ export async function snippetForIndexExists1(): Promise { // Call the API const response = await client.indexExists({ indexName: 'indexExistsNO' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -913,6 +963,7 @@ export async function snippetForIndexExists2(): Promise { // Call the API const response = await client.indexExists({ indexName: 'indexExistsERROR' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -929,6 +980,7 @@ export async function snippetForListApiKeys(): Promise { // Call the API const response = await client.listApiKeys(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -945,6 +997,7 @@ export async function snippetForListClusters(): Promise { // Call the API const response = await client.listClusters(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -961,6 +1014,7 @@ export async function snippetForListIndices(): Promise { // Call the API const response = await client.listIndices(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -977,6 +1031,7 @@ export async function snippetForListUserIds(): Promise { // Call the API const response = await client.listUserIds(); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -995,6 +1050,7 @@ export async function snippetForMultipleBatch(): Promise { requests: [{ action: 'addObject', body: { key: 'value' }, indexName: 'theIndexName' }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1014,6 +1070,7 @@ export async function snippetForOperationIndex(): Promise { operationIndexParams: { operation: 'move', destination: '', scope: ['rules', 'settings'] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1033,6 +1090,7 @@ export async function snippetForOperationIndex1(): Promise { operationIndexParams: { operation: 'copy', destination: '' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1052,6 +1110,7 @@ export async function snippetForOperationIndex2(): Promise { operationIndexParams: { operation: 'move', destination: '' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1072,6 +1131,7 @@ export async function snippetForPartialUpdateObject(): Promise { attributesToUpdate: { attributeId: 'new value' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1095,6 +1155,7 @@ export async function snippetForPartialUpdateObjects(): Promise { createIfNotExists: true, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1118,6 +1179,7 @@ export async function snippetForPartialUpdateObjects1(): Promise { createIfNotExists: false, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1134,6 +1196,7 @@ export async function snippetForRemoveUserId(): Promise { // Call the API const response = await client.removeUserId({ userID: 'uniqueID' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1165,6 +1228,7 @@ export async function snippetForReplaceAllObjects(): Promise { batchSize: 3, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1181,6 +1245,7 @@ export async function snippetForReplaceSources(): Promise { // Call the API const response = await client.replaceSources({ source: [{ source: 'theSource', description: 'theDescription' }] }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1197,6 +1262,7 @@ export async function snippetForRestoreApiKey(): Promise { // Call the API const response = await client.restoreApiKey({ key: 'myApiKey' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1213,6 +1279,7 @@ export async function snippetForSaveObject(): Promise { // Call the API const response = await client.saveObject({ indexName: '', body: { objectID: 'id', test: 'val' } }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1235,6 +1302,7 @@ export async function snippetForSaveObjects(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1257,6 +1325,7 @@ export async function snippetForSaveObjects1(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1277,6 +1346,7 @@ export async function snippetForSaveRule(): Promise { rule: { objectID: 'id1', conditions: [{ pattern: 'apple', anchoring: 'contains' }] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1301,6 +1371,7 @@ export async function snippetForSaveRules(): Promise { clearExistingRules: true, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1322,6 +1393,7 @@ export async function snippetForSaveSynonym(): Promise { forwardToReplicas: true, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1346,6 +1418,7 @@ export async function snippetForSaveSynonyms(): Promise { replaceExistingSynonyms: true, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1364,6 +1437,7 @@ export async function snippetForSearch(): Promise { requests: [{ indexName: '', query: '', hitsPerPage: 50 }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1382,6 +1456,7 @@ export async function snippetForSearch1(): Promise { requests: [{ indexName: '', query: '', filters: 'actor:Scarlett Johansson' }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1406,6 +1481,7 @@ export async function snippetForSearch2(): Promise { ], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1424,6 +1500,7 @@ export async function snippetForSearch3(): Promise { requests: [{ indexName: '', query: '', filters: 'NOT actor:Nicolas Cage' }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1442,6 +1519,7 @@ export async function snippetForSearch4(): Promise { requests: [{ indexName: '', query: '', facets: ['author', 'genre'] }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1460,6 +1538,7 @@ export async function snippetForSearch5(): Promise { requests: [{ indexName: '', query: '', facets: ['*'] }], }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1479,6 +1558,7 @@ export async function snippetForSearchDictionaryEntries(): Promise { searchDictionaryEntriesParams: { query: 'about' }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1495,6 +1575,7 @@ export async function snippetForSearchForFacetValues(): Promise { // Call the API const response = await client.searchForFacetValues({ indexName: 'indexName', facetName: 'facetName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1511,6 +1592,7 @@ export async function snippetForSearchRules(): Promise { // Call the API const response = await client.searchRules({ indexName: 'cts_e2e_browse', searchRulesParams: { query: 'zorro' } }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1527,6 +1609,7 @@ export async function snippetForSearchSingleIndex(): Promise { // Call the API const response = await client.searchSingleIndex({ indexName: 'indexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1543,6 +1626,7 @@ export async function snippetForSearchSynonyms(): Promise { // Call the API const response = await client.searchSynonyms({ indexName: 'indexName' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1564,11 +1648,27 @@ export async function snippetForSearchUserIds(): Promise { hitsPerPage: 10, }); + // >LOG // use typed response console.log(response); // SEPARATOR< } +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = searchClient('YOUR_APP_ID', 'YOUR_API_KEY'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} + // Snippet for the setDictionarySettings method. // // get setDictionarySettings results with minimal parameters @@ -1582,6 +1682,7 @@ export async function snippetForSetDictionarySettings(): Promise { disableStandardEntries: { plurals: { fr: false, en: false, ru: true } }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1601,6 +1702,7 @@ export async function snippetForSetSettings(): Promise { indexSettings: { attributesForFaceting: ['actor', 'filterOnly(category)', 'searchable(publisher)'] }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1620,6 +1722,7 @@ export async function snippetForUpdateApiKey(): Promise { apiKey: { acl: ['search', 'addObject'], validity: 300, maxQueriesPerIPPerHour: 100, maxHitsPerQuery: 20 }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1636,6 +1739,7 @@ export async function snippetForWaitForApiKey(): Promise { // Call the API const response = await client.waitForApiKey({ key: 'api-key-add-operation-test-javascript', operation: 'add' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1664,6 +1768,7 @@ export async function snippetForWaitForApiKey1(): Promise { }, }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1680,6 +1785,7 @@ export async function snippetForWaitForApiKey2(): Promise { // Call the API const response = await client.waitForApiKey({ key: 'api-key-delete-operation-test-javascript', operation: 'delete' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1696,6 +1802,7 @@ export async function snippetForWaitForAppTask(): Promise { // Call the API const response = await client.waitForAppTask({ taskID: 123 }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -1712,6 +1819,7 @@ export async function snippetForWaitForTask(): Promise { // Call the API const response = await client.waitForTask({ indexName: 'wait-task-javascript', taskID: 123 }); + // >LOG // use typed response console.log(response); // SEPARATOR< diff --git a/snippets/javascript/src/usage.ts b/snippets/javascript/src/usage.ts index 998ce863a0..28a56883b2 100644 --- a/snippets/javascript/src/usage.ts +++ b/snippets/javascript/src/usage.ts @@ -16,6 +16,7 @@ export async function snippetForCustomDelete(): Promise { // Call the API const response = await client.customDelete({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -32,6 +33,7 @@ export async function snippetForCustomGet(): Promise { // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -48,6 +50,7 @@ export async function snippetForCustomPost(): Promise { // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -64,6 +67,7 @@ export async function snippetForCustomPut(): Promise { // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -85,6 +89,7 @@ export async function snippetForGetIndexUsage(): Promise { endDate: '2024-04-05T12:46:43Z', }); + // >LOG // use typed response console.log(response); // SEPARATOR< @@ -105,7 +110,23 @@ export async function snippetForGetUsage(): Promise { endDate: '2024-04-05T12:46:43Z', }); + // >LOG // use typed response console.log(response); // SEPARATOR< } + +// Snippet for the setClientApiKey method. +// +// switch API key +export function snippetForSetClientApiKey(): void { + // >SEPARATOR setClientApiKey default + // Initialize the client + const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); + + // Call the API + client.setClientApiKey({ apiKey: 'updated-api-key' }); + + // >LOG + // SEPARATOR< +} diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Abtesting.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Abtesting.kt index c46d8dfc22..c33556653c 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Abtesting.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Abtesting.kt @@ -32,6 +32,7 @@ class SnippetAbtestingClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -49,6 +50,7 @@ class SnippetAbtestingClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -66,6 +68,7 @@ class SnippetAbtestingClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -83,6 +86,7 @@ class SnippetAbtestingClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -100,6 +104,7 @@ class SnippetAbtestingClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -117,6 +122,7 @@ class SnippetAbtestingClient { id = 42, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -134,6 +140,7 @@ class SnippetAbtestingClient { id = 42, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -149,6 +156,7 @@ class SnippetAbtestingClient { // Call the API var response = client.listABTests() + // >LOG // Use the response println(response) // SEPARATOR< @@ -180,6 +188,7 @@ class SnippetAbtestingClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -187,6 +196,22 @@ class SnippetAbtestingClient { exitProcess(0) } + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = AbtestingClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY", region = "YOUR_APP_ID_REGION") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } + suspend fun snippetForStopABTest() { // >SEPARATOR stopABTest default // Initialize the client @@ -197,6 +222,7 @@ class SnippetAbtestingClient { id = 42, ) + // >LOG // Use the response println(response) // SEPARATOR< diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Analytics.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Analytics.kt index 3324552783..68ad1b0c34 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Analytics.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Analytics.kt @@ -19,6 +19,7 @@ class SnippetAnalyticsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -36,6 +37,7 @@ class SnippetAnalyticsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -53,6 +55,7 @@ class SnippetAnalyticsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -70,6 +73,7 @@ class SnippetAnalyticsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -87,6 +91,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -104,6 +109,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -121,6 +127,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -138,6 +145,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -155,6 +163,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -172,6 +181,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -189,6 +199,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -206,6 +217,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -223,6 +235,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -240,6 +253,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -257,6 +271,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -274,6 +289,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -291,6 +307,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -308,6 +325,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -325,6 +343,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -343,6 +362,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -360,6 +380,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -377,6 +398,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -394,6 +416,7 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -411,10 +434,27 @@ class SnippetAnalyticsClient { index = "index", ) + // >LOG // Use the response println(response) // SEPARATOR< exitProcess(0) } + + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = AnalyticsClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY", region = "YOUR_APP_ID_REGION") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } } diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Ingestion.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Ingestion.kt index c766806f52..df9baa2819 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Ingestion.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Ingestion.kt @@ -27,6 +27,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -51,6 +52,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -78,6 +80,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -99,6 +102,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -123,6 +127,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -144,6 +149,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -161,6 +167,7 @@ class SnippetIngestionClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -178,6 +185,7 @@ class SnippetIngestionClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -195,6 +203,7 @@ class SnippetIngestionClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -212,6 +221,7 @@ class SnippetIngestionClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -229,6 +239,7 @@ class SnippetIngestionClient { authenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -246,6 +257,7 @@ class SnippetIngestionClient { destinationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -263,6 +275,7 @@ class SnippetIngestionClient { sourceID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -280,6 +293,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -297,6 +311,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -314,6 +329,7 @@ class SnippetIngestionClient { transformationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -331,6 +347,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -348,6 +365,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -365,6 +383,7 @@ class SnippetIngestionClient { taskID = "76ab4c2a-ce17-496f-b7a6-506dc59ee498", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -382,6 +401,7 @@ class SnippetIngestionClient { taskID = "76ab4c2a-ce17-496f-b7a6-506dc59ee498", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -402,6 +422,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -419,6 +440,7 @@ class SnippetIngestionClient { authenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -436,6 +458,7 @@ class SnippetIngestionClient { destinationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -454,6 +477,7 @@ class SnippetIngestionClient { eventID = "6c02aeb1-775e-418e-870b-1faccd4b2c0c", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -471,6 +495,7 @@ class SnippetIngestionClient { runID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -488,6 +513,7 @@ class SnippetIngestionClient { sourceID = "75eeb306-51d3-4e5e-a279-3c92bd8893ac", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -505,6 +531,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -522,6 +549,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -539,6 +567,7 @@ class SnippetIngestionClient { transformationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -554,6 +583,7 @@ class SnippetIngestionClient { // Call the API var response = client.listAuthentications() + // >LOG // Use the response println(response) // SEPARATOR< @@ -569,6 +599,7 @@ class SnippetIngestionClient { // Call the API var response = client.listDestinations() + // >LOG // Use the response println(response) // SEPARATOR< @@ -586,6 +617,7 @@ class SnippetIngestionClient { runID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -601,6 +633,7 @@ class SnippetIngestionClient { // Call the API var response = client.listRuns() + // >LOG // Use the response println(response) // SEPARATOR< @@ -616,6 +649,7 @@ class SnippetIngestionClient { // Call the API var response = client.listSources() + // >LOG // Use the response println(response) // SEPARATOR< @@ -631,6 +665,7 @@ class SnippetIngestionClient { // Call the API var response = client.listTasks() + // >LOG // Use the response println(response) // SEPARATOR< @@ -646,6 +681,7 @@ class SnippetIngestionClient { // Call the API var response = client.listTasksV1() + // >LOG // Use the response println(response) // SEPARATOR< @@ -661,6 +697,7 @@ class SnippetIngestionClient { // Call the API var response = client.listTransformationModels() + // >LOG // Use the response println(response) // SEPARATOR< @@ -676,6 +713,7 @@ class SnippetIngestionClient { // Call the API var response = client.listTransformations() + // >LOG // Use the response println(response) // SEPARATOR< @@ -712,6 +750,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -734,6 +773,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -751,6 +791,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -768,6 +809,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -787,6 +829,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -806,6 +849,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -825,6 +869,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -844,6 +889,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -863,6 +909,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -882,6 +929,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -889,6 +937,22 @@ class SnippetIngestionClient { exitProcess(0) } + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = IngestionClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY", region = "YOUR_APP_ID_REGION") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } + suspend fun snippetForTriggerDockerSourceDiscover() { // >SEPARATOR triggerDockerSourceDiscover default // Initialize the client @@ -899,6 +963,7 @@ class SnippetIngestionClient { sourceID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -924,6 +989,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -950,6 +1016,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -970,6 +1037,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -990,6 +1058,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1010,6 +1079,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1031,6 +1101,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1051,6 +1122,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1073,6 +1145,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1100,6 +1173,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1120,6 +1194,7 @@ class SnippetIngestionClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Insights.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Insights.kt index e25c190aa9..f7592a9326 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Insights.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Insights.kt @@ -19,6 +19,7 @@ class SnippetInsightsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -36,6 +37,7 @@ class SnippetInsightsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -53,6 +55,7 @@ class SnippetInsightsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -70,6 +73,7 @@ class SnippetInsightsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -83,12 +87,11 @@ class SnippetInsightsClient { val client = InsightsClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY", region = "YOUR_APP_ID_REGION") // Call the API - var response = client.deleteUserToken( + client.deleteUserToken( userToken = "test-user-1", ) - // Use the response - println(response) + // >LOG // SEPARATOR< exitProcess(0) @@ -118,10 +121,27 @@ class SnippetInsightsClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< exitProcess(0) } + + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = InsightsClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY", region = "YOUR_APP_ID_REGION") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } } diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Monitoring.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Monitoring.kt index 7f9166a708..d46e4dfc24 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Monitoring.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Monitoring.kt @@ -19,6 +19,7 @@ class SnippetMonitoringClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -36,6 +37,7 @@ class SnippetMonitoringClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -53,6 +55,7 @@ class SnippetMonitoringClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -70,6 +73,7 @@ class SnippetMonitoringClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -87,6 +91,7 @@ class SnippetMonitoringClient { clusters = "c1-de", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -104,6 +109,7 @@ class SnippetMonitoringClient { clusters = "c1-de", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -119,6 +125,7 @@ class SnippetMonitoringClient { // Call the API var response = client.getIncidents() + // >LOG // Use the response println(response) // SEPARATOR< @@ -136,6 +143,7 @@ class SnippetMonitoringClient { clusters = "c1-de", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -153,6 +161,7 @@ class SnippetMonitoringClient { clusters = "c1-de", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -171,6 +180,7 @@ class SnippetMonitoringClient { period = Period.entries.first { it.value == "minute" }, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -188,6 +198,7 @@ class SnippetMonitoringClient { clusters = "c1-de", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -203,6 +214,7 @@ class SnippetMonitoringClient { // Call the API var response = client.getServers() + // >LOG // Use the response println(response) // SEPARATOR< @@ -218,10 +230,27 @@ class SnippetMonitoringClient { // Call the API var response = client.getStatus() + // >LOG // Use the response println(response) // SEPARATOR< exitProcess(0) } + + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = MonitoringClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } } diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Personalization.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Personalization.kt index 7f360a7357..77105f0fa4 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Personalization.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Personalization.kt @@ -19,6 +19,7 @@ class SnippetPersonalizationClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -36,6 +37,7 @@ class SnippetPersonalizationClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -53,6 +55,7 @@ class SnippetPersonalizationClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -70,6 +73,7 @@ class SnippetPersonalizationClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -87,6 +91,7 @@ class SnippetPersonalizationClient { userToken = "UserToken", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -102,6 +107,7 @@ class SnippetPersonalizationClient { // Call the API var response = client.getPersonalizationStrategy() + // >LOG // Use the response println(response) // SEPARATOR< @@ -119,6 +125,7 @@ class SnippetPersonalizationClient { userToken = "UserToken", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -126,6 +133,22 @@ class SnippetPersonalizationClient { exitProcess(0) } + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = PersonalizationClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY", region = "YOUR_APP_ID_REGION") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } + suspend fun snippetForSetPersonalizationStrategy() { // >SEPARATOR setPersonalizationStrategy default // Initialize the client @@ -151,6 +174,7 @@ class SnippetPersonalizationClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/QuerySuggestions.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/QuerySuggestions.kt index e771e7ef04..bfaca10134 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/QuerySuggestions.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/QuerySuggestions.kt @@ -34,6 +34,7 @@ class SnippetQuerySuggestionsClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -51,6 +52,7 @@ class SnippetQuerySuggestionsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -68,6 +70,7 @@ class SnippetQuerySuggestionsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -85,6 +88,7 @@ class SnippetQuerySuggestionsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -102,6 +106,7 @@ class SnippetQuerySuggestionsClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -119,6 +124,7 @@ class SnippetQuerySuggestionsClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -134,6 +140,7 @@ class SnippetQuerySuggestionsClient { // Call the API var response = client.getAllConfigs() + // >LOG // Use the response println(response) // SEPARATOR< @@ -151,6 +158,7 @@ class SnippetQuerySuggestionsClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -168,6 +176,7 @@ class SnippetQuerySuggestionsClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -185,6 +194,7 @@ class SnippetQuerySuggestionsClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -192,6 +202,22 @@ class SnippetQuerySuggestionsClient { exitProcess(0) } + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = QuerySuggestionsClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY", region = "YOUR_APP_ID_REGION") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } + suspend fun snippetForUpdateConfig() { // >SEPARATOR updateConfig default // Initialize the client @@ -217,6 +243,7 @@ class SnippetQuerySuggestionsClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Recommend.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Recommend.kt index ff91c16a2d..f05789061e 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Recommend.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Recommend.kt @@ -19,6 +19,7 @@ class SnippetRecommendClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -36,6 +37,7 @@ class SnippetRecommendClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -53,6 +55,7 @@ class SnippetRecommendClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -70,6 +73,7 @@ class SnippetRecommendClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -89,6 +93,7 @@ class SnippetRecommendClient { objectID = "objectID", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -108,6 +113,7 @@ class SnippetRecommendClient { objectID = "objectID", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -127,6 +133,7 @@ class SnippetRecommendClient { taskID = 12345L, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -153,6 +160,7 @@ class SnippetRecommendClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -171,10 +179,27 @@ class SnippetRecommendClient { model = RecommendModels.entries.first { it.value == "related-products" }, ) + // >LOG // Use the response println(response) // SEPARATOR< exitProcess(0) } + + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = RecommendClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } } diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Search.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Search.kt index 87b7c3fdeb..cf53f96d18 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Search.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Search.kt @@ -26,6 +26,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -50,6 +51,7 @@ class SnippetSearchClient { }, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -70,6 +72,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -90,6 +93,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -137,6 +141,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -167,6 +172,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -197,6 +203,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -227,6 +234,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -257,6 +265,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -287,6 +296,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -317,6 +327,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -338,6 +349,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -371,6 +383,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -399,6 +412,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -430,6 +444,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -447,6 +462,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -464,6 +480,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -481,6 +498,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -498,6 +516,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -515,6 +534,7 @@ class SnippetSearchClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -532,6 +552,7 @@ class SnippetSearchClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -549,6 +570,7 @@ class SnippetSearchClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -566,6 +588,7 @@ class SnippetSearchClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -583,6 +606,7 @@ class SnippetSearchClient { key = "myTestApiKey", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -603,6 +627,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -620,6 +645,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -638,6 +664,7 @@ class SnippetSearchClient { objectID = "uniqueID", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -656,6 +683,7 @@ class SnippetSearchClient { objectIDs = listOf("1", "2"), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -674,6 +702,7 @@ class SnippetSearchClient { objectID = "id1", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -691,6 +720,7 @@ class SnippetSearchClient { source = "theSource", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -709,6 +739,7 @@ class SnippetSearchClient { objectID = "id1", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -730,6 +761,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -762,6 +794,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -779,6 +812,7 @@ class SnippetSearchClient { key = "myTestApiKey", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -796,6 +830,7 @@ class SnippetSearchClient { taskID = 123L, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -811,6 +846,7 @@ class SnippetSearchClient { // Call the API var response = client.getDictionaryLanguages() + // >LOG // Use the response println(response) // SEPARATOR< @@ -826,6 +862,7 @@ class SnippetSearchClient { // Call the API var response = client.getDictionarySettings() + // >LOG // Use the response println(response) // SEPARATOR< @@ -841,6 +878,7 @@ class SnippetSearchClient { // Call the API var response = client.getLogs() + // >LOG // Use the response println(response) // SEPARATOR< @@ -860,6 +898,7 @@ class SnippetSearchClient { attributesToRetrieve = listOf("attr1", "attr2"), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -885,6 +924,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -903,6 +943,7 @@ class SnippetSearchClient { objectID = "qr-1725004648916", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -920,6 +961,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -935,6 +977,7 @@ class SnippetSearchClient { // Call the API var response = client.getSources() + // >LOG // Use the response println(response) // SEPARATOR< @@ -953,6 +996,7 @@ class SnippetSearchClient { objectID = "id1", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -971,6 +1015,7 @@ class SnippetSearchClient { taskID = 123L, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -986,6 +1031,7 @@ class SnippetSearchClient { // Call the API var response = client.getTopUserIds() + // >LOG // Use the response println(response) // SEPARATOR< @@ -1003,6 +1049,7 @@ class SnippetSearchClient { userID = "uniqueID", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1018,6 +1065,7 @@ class SnippetSearchClient { // Call the API var response = client.hasPendingMappings() + // >LOG // Use the response println(response) // SEPARATOR< @@ -1035,6 +1083,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1052,6 +1101,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1069,6 +1119,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1084,6 +1135,7 @@ class SnippetSearchClient { // Call the API var response = client.listApiKeys() + // >LOG // Use the response println(response) // SEPARATOR< @@ -1099,6 +1151,7 @@ class SnippetSearchClient { // Call the API var response = client.listClusters() + // >LOG // Use the response println(response) // SEPARATOR< @@ -1114,6 +1167,7 @@ class SnippetSearchClient { // Call the API var response = client.listIndices() + // >LOG // Use the response println(response) // SEPARATOR< @@ -1129,6 +1183,7 @@ class SnippetSearchClient { // Call the API var response = client.listUserIds() + // >LOG // Use the response println(response) // SEPARATOR< @@ -1159,6 +1214,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1181,6 +1237,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1202,6 +1259,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1223,6 +1281,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1247,6 +1306,7 @@ class SnippetSearchClient { }, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1287,6 +1347,7 @@ class SnippetSearchClient { createIfNotExists = true, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1327,6 +1388,7 @@ class SnippetSearchClient { createIfNotExists = false, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1344,6 +1406,7 @@ class SnippetSearchClient { userID = "uniqueID", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1464,6 +1527,7 @@ class SnippetSearchClient { batchSize = 3, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1486,6 +1550,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1503,6 +1568,7 @@ class SnippetSearchClient { key = "myApiKey", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1530,6 +1596,7 @@ class SnippetSearchClient { }, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1569,6 +1636,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1608,6 +1676,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1635,6 +1704,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1674,6 +1744,7 @@ class SnippetSearchClient { clearExistingRules = true, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1698,6 +1769,7 @@ class SnippetSearchClient { forwardToReplicas = true, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1730,6 +1802,7 @@ class SnippetSearchClient { replaceExistingSynonyms = true, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1755,6 +1828,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1780,6 +1854,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1805,6 +1880,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1830,6 +1906,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1855,6 +1932,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1880,6 +1958,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1900,6 +1979,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1918,6 +1998,7 @@ class SnippetSearchClient { facetName = "facetName", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1938,6 +2019,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1955,6 +2037,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1972,6 +2055,7 @@ class SnippetSearchClient { indexName = "", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -1994,6 +2078,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -2001,6 +2086,22 @@ class SnippetSearchClient { exitProcess(0) } + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = SearchClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } + suspend fun snippetForSetDictionarySettings() { // >SEPARATOR setDictionarySettings default // Initialize the client @@ -2015,6 +2116,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -2035,6 +2137,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -2058,6 +2161,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -2076,6 +2180,7 @@ class SnippetSearchClient { operation = ApiKeyOperation.entries.first { it.value == "add" }, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -2103,6 +2208,7 @@ class SnippetSearchClient { ), ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -2121,6 +2227,7 @@ class SnippetSearchClient { operation = ApiKeyOperation.entries.first { it.value == "delete" }, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -2138,6 +2245,7 @@ class SnippetSearchClient { taskID = 123L, ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -2156,6 +2264,7 @@ class SnippetSearchClient { taskID = 123L, ) + // >LOG // Use the response println(response) // SEPARATOR< diff --git a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Usage.kt b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Usage.kt index 88ea0e4455..aeafbd756f 100644 --- a/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Usage.kt +++ b/snippets/kotlin/src/main/kotlin/com/algolia/snippets/Usage.kt @@ -19,6 +19,7 @@ class SnippetUsageClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -36,6 +37,7 @@ class SnippetUsageClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -53,6 +55,7 @@ class SnippetUsageClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -70,6 +73,7 @@ class SnippetUsageClient { path = "test/minimal", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -90,6 +94,7 @@ class SnippetUsageClient { endDate = "2024-04-05T12:46:43Z", ) + // >LOG // Use the response println(response) // SEPARATOR< @@ -109,10 +114,27 @@ class SnippetUsageClient { endDate = "2024-04-05T12:46:43Z", ) + // >LOG // Use the response println(response) // SEPARATOR< exitProcess(0) } + + suspend fun snippetForSetClientApiKey() { + // >SEPARATOR setClientApiKey default + // Initialize the client + val client = UsageClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY") + + // Call the API + client.setClientApiKey( + apiKey = "updated-api-key", + ) + + // >LOG + // SEPARATOR< + + exitProcess(0) + } } diff --git a/snippets/php/src/Abtesting.php b/snippets/php/src/Abtesting.php index 7187f1c204..30da74f121 100644 --- a/snippets/php/src/Abtesting.php +++ b/snippets/php/src/Abtesting.php @@ -38,6 +38,7 @@ public function snippetForAddABTests(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -59,6 +60,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -80,6 +82,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -101,6 +104,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -122,6 +126,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -143,6 +148,7 @@ public function snippetForDeleteABTest(): void 42, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -164,6 +170,7 @@ public function snippetForGetABTest(): void 42, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -183,6 +190,7 @@ public function snippetForListABTests(): void // Call the API $response = $client->listABTests(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -216,11 +224,32 @@ public function snippetForScheduleABTest(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = AbtestingClient::create('', '', 'YOUR_APP_ID_REGION'); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } + /** * Snippet for the StopABTest method. * @@ -237,6 +266,7 @@ public function snippetForStopABTest(): void 42, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< diff --git a/snippets/php/src/Analytics.php b/snippets/php/src/Analytics.php index aacf921fc3..6f3ae0cf7e 100644 --- a/snippets/php/src/Analytics.php +++ b/snippets/php/src/Analytics.php @@ -27,6 +27,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -48,6 +49,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -69,6 +71,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -90,6 +93,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -111,6 +115,7 @@ public function snippetForGetAddToCartRate(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -132,6 +137,7 @@ public function snippetForGetAverageClickPosition(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -153,6 +159,7 @@ public function snippetForGetClickPositions(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -174,6 +181,7 @@ public function snippetForGetClickThroughRate(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -195,6 +203,7 @@ public function snippetForGetConversionRate(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -216,6 +225,7 @@ public function snippetForGetNoClickRate(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -237,6 +247,7 @@ public function snippetForGetNoResultsRate(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -258,6 +269,7 @@ public function snippetForGetPurchaseRate(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -279,6 +291,7 @@ public function snippetForGetRevenue(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -300,6 +313,7 @@ public function snippetForGetSearchesCount(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -321,6 +335,7 @@ public function snippetForGetSearchesNoClicks(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -342,6 +357,7 @@ public function snippetForGetSearchesNoResults(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -363,6 +379,7 @@ public function snippetForGetStatus(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -384,6 +401,7 @@ public function snippetForGetTopCountries(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -405,6 +423,7 @@ public function snippetForGetTopFilterAttributes(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -427,6 +446,7 @@ public function snippetForGetTopFilterForAttribute(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -448,6 +468,7 @@ public function snippetForGetTopFiltersNoResults(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -469,6 +490,7 @@ public function snippetForGetTopHits(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -490,6 +512,7 @@ public function snippetForGetTopSearches(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -511,8 +534,29 @@ public function snippetForGetUsersCount(): void 'index', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = AnalyticsClient::create('', '', 'YOUR_APP_ID_REGION'); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } } diff --git a/snippets/php/src/Ingestion.php b/snippets/php/src/Ingestion.php index 247f709072..37975c575d 100644 --- a/snippets/php/src/Ingestion.php +++ b/snippets/php/src/Ingestion.php @@ -33,6 +33,7 @@ public function snippetForCreateAuthentication(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -59,6 +60,7 @@ public function snippetForCreateDestination(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -92,6 +94,7 @@ public function snippetForCreateSource(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -116,6 +119,7 @@ public function snippetForCreateTask(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -142,6 +146,7 @@ public function snippetForCreateTaskV1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -166,6 +171,7 @@ public function snippetForCreateTransformation(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -187,6 +193,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -208,6 +215,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -229,6 +237,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -250,6 +259,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -271,6 +281,7 @@ public function snippetForDeleteAuthentication(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -292,6 +303,7 @@ public function snippetForDeleteDestination(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -313,6 +325,7 @@ public function snippetForDeleteSource(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -334,6 +347,7 @@ public function snippetForDeleteTask(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -355,6 +369,7 @@ public function snippetForDeleteTaskV1(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -376,6 +391,7 @@ public function snippetForDeleteTransformation(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -397,6 +413,7 @@ public function snippetForDisableTask(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -418,6 +435,7 @@ public function snippetForDisableTaskV1(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -439,6 +457,7 @@ public function snippetForEnableTask(): void '76ab4c2a-ce17-496f-b7a6-506dc59ee498', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -460,6 +479,7 @@ public function snippetForEnableTaskV1(): void '76ab4c2a-ce17-496f-b7a6-506dc59ee498', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -483,6 +503,7 @@ public function snippetForGenerateTransformationCode(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -504,6 +525,7 @@ public function snippetForGetAuthentication(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -525,6 +547,7 @@ public function snippetForGetDestination(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -547,6 +570,7 @@ public function snippetForGetEvent(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0c', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -568,6 +592,7 @@ public function snippetForGetRun(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -589,6 +614,7 @@ public function snippetForGetSource(): void '75eeb306-51d3-4e5e-a279-3c92bd8893ac', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -610,6 +636,7 @@ public function snippetForGetTask(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -631,6 +658,7 @@ public function snippetForGetTaskV1(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -652,6 +680,7 @@ public function snippetForGetTransformation(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -671,6 +700,7 @@ public function snippetForListAuthentications(): void // Call the API $response = $client->listAuthentications(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -690,6 +720,7 @@ public function snippetForListDestinations(): void // Call the API $response = $client->listDestinations(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -711,6 +742,7 @@ public function snippetForListEvents(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -730,6 +762,7 @@ public function snippetForListRuns(): void // Call the API $response = $client->listRuns(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -749,6 +782,7 @@ public function snippetForListSources(): void // Call the API $response = $client->listSources(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -768,6 +802,7 @@ public function snippetForListTasks(): void // Call the API $response = $client->listTasks(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -787,6 +822,7 @@ public function snippetForListTasksV1(): void // Call the API $response = $client->listTasksV1(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -806,6 +842,7 @@ public function snippetForListTransformationModels(): void // Call the API $response = $client->listTransformationModels(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -825,6 +862,7 @@ public function snippetForListTransformations(): void // Call the API $response = $client->listTransformations(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -859,6 +897,7 @@ public function snippetForPushTask(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -892,6 +931,7 @@ public function snippetForRunSource(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -913,6 +953,7 @@ public function snippetForRunTask(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -934,6 +975,7 @@ public function snippetForRunTaskV1(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -960,6 +1002,7 @@ public function snippetForSearchAuthentications(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -986,6 +1029,7 @@ public function snippetForSearchDestinations(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1012,6 +1056,7 @@ public function snippetForSearchSources(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1040,6 +1085,7 @@ public function snippetForSearchTasks(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1068,6 +1114,7 @@ public function snippetForSearchTasksV1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1096,11 +1143,32 @@ public function snippetForSearchTransformations(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = IngestionClient::create('', '', 'YOUR_APP_ID_REGION'); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } + /** * Snippet for the TriggerDockerSourceDiscover method. * @@ -1117,6 +1185,7 @@ public function snippetForTriggerDockerSourceDiscover(): void '6c02aeb1-775e-418e-870b-1faccd4b2c0f', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1141,6 +1210,7 @@ public function snippetForTryTransformation(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1166,6 +1236,7 @@ public function snippetForTryTransformationBeforeUpdate(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1189,6 +1260,7 @@ public function snippetForUpdateAuthentication(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1212,6 +1284,7 @@ public function snippetForUpdateDestination(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1235,6 +1308,7 @@ public function snippetForUpdateSource(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1259,6 +1333,7 @@ public function snippetForUpdateTask(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1282,6 +1357,7 @@ public function snippetForUpdateTaskV1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1307,6 +1383,7 @@ public function snippetForUpdateTransformation(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1340,6 +1417,7 @@ public function snippetForValidateSource(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1363,6 +1441,7 @@ public function snippetForValidateSourceBeforeUpdate(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< diff --git a/snippets/php/src/Insights.php b/snippets/php/src/Insights.php index 4b51bb2e12..406b72161b 100644 --- a/snippets/php/src/Insights.php +++ b/snippets/php/src/Insights.php @@ -27,6 +27,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -48,6 +49,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -69,6 +71,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -90,6 +93,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -107,12 +111,11 @@ public function snippetForDeleteUserToken(): void $client = InsightsClient::create('', '', 'YOUR_APP_ID_REGION'); // Call the API - $response = $client->deleteUserToken( + $client->deleteUserToken( 'test-user-1', ); - // play with the response - var_dump($response); + // >LOG // SEPARATOR< } @@ -152,8 +155,29 @@ public function snippetForPushEvents(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = InsightsClient::create('', '', 'YOUR_APP_ID_REGION'); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } } diff --git a/snippets/php/src/Monitoring.php b/snippets/php/src/Monitoring.php index 2ce79545bd..f2eb37b95b 100644 --- a/snippets/php/src/Monitoring.php +++ b/snippets/php/src/Monitoring.php @@ -27,6 +27,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -48,6 +49,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -69,6 +71,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -90,6 +93,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -111,6 +115,7 @@ public function snippetForGetClusterIncidents(): void 'c1-de', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -132,6 +137,7 @@ public function snippetForGetClusterStatus(): void 'c1-de', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -151,6 +157,7 @@ public function snippetForGetIncidents(): void // Call the API $response = $client->getIncidents(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -172,6 +179,7 @@ public function snippetForGetIndexingTime(): void 'c1-de', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -193,6 +201,7 @@ public function snippetForGetLatency(): void 'c1-de', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -215,6 +224,7 @@ public function snippetForGetMetrics(): void 'minute', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -236,6 +246,7 @@ public function snippetForGetReachability(): void 'c1-de', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -255,6 +266,7 @@ public function snippetForGetServers(): void // Call the API $response = $client->getServers(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -274,8 +286,29 @@ public function snippetForGetStatus(): void // Call the API $response = $client->getStatus(); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = MonitoringClient::create('', ''); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } } diff --git a/snippets/php/src/Personalization.php b/snippets/php/src/Personalization.php index 1f2d5d1b45..48ba964157 100644 --- a/snippets/php/src/Personalization.php +++ b/snippets/php/src/Personalization.php @@ -27,6 +27,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -48,6 +49,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -69,6 +71,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -90,6 +93,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -111,6 +115,7 @@ public function snippetForDeleteUserProfile(): void 'UserToken', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -130,6 +135,7 @@ public function snippetForGetPersonalizationStrategy(): void // Call the API $response = $client->getPersonalizationStrategy(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -151,11 +157,32 @@ public function snippetForGetUserTokenProfile(): void 'UserToken', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = PersonalizationClient::create('', '', 'YOUR_APP_ID_REGION'); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } + /** * Snippet for the SetPersonalizationStrategy method. * @@ -184,6 +211,7 @@ public function snippetForSetPersonalizationStrategy(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< diff --git a/snippets/php/src/QuerySuggestions.php b/snippets/php/src/QuerySuggestions.php index 212c21cbd7..a1421e066c 100644 --- a/snippets/php/src/QuerySuggestions.php +++ b/snippets/php/src/QuerySuggestions.php @@ -53,6 +53,7 @@ public function snippetForCreateConfig(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -74,6 +75,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -95,6 +97,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -116,6 +119,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -137,6 +141,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -158,6 +163,7 @@ public function snippetForDeleteConfig(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -177,6 +183,7 @@ public function snippetForGetAllConfigs(): void // Call the API $response = $client->getAllConfigs(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -198,6 +205,7 @@ public function snippetForGetConfig(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -219,6 +227,7 @@ public function snippetForGetConfigStatus(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -240,11 +249,32 @@ public function snippetForGetLogFile(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = QuerySuggestionsClient::create('', '', 'YOUR_APP_ID_REGION'); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } + /** * Snippet for the UpdateConfig method. * @@ -287,6 +317,7 @@ public function snippetForUpdateConfig(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< diff --git a/snippets/php/src/Recommend.php b/snippets/php/src/Recommend.php index 000553d018..ba8d6a0bee 100644 --- a/snippets/php/src/Recommend.php +++ b/snippets/php/src/Recommend.php @@ -27,6 +27,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -48,6 +49,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -69,6 +71,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -90,6 +93,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -113,6 +117,7 @@ public function snippetForDeleteRecommendRule(): void 'objectID', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -136,6 +141,7 @@ public function snippetForGetRecommendRule(): void 'objectID', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -159,6 +165,7 @@ public function snippetForGetRecommendStatus(): void 12345, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -187,6 +194,7 @@ public function snippetForGetRecommendations(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -209,8 +217,29 @@ public function snippetForSearchRecommendRules(): void 'related-products', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = RecommendClient::create('', ''); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } } diff --git a/snippets/php/src/Search.php b/snippets/php/src/Search.php index b23a4dd401..8340465ed0 100644 --- a/snippets/php/src/Search.php +++ b/snippets/php/src/Search.php @@ -36,6 +36,7 @@ public function snippetForAddApiKey(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -60,6 +61,7 @@ public function snippetForAddOrUpdateObject(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -83,6 +85,7 @@ public function snippetForAppendSource(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -106,6 +109,7 @@ public function snippetForAssignUserId(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -141,6 +145,7 @@ public function snippetForBatch(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -169,6 +174,7 @@ public function snippetForBatch1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -197,6 +203,7 @@ public function snippetForBatch2(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -225,6 +232,7 @@ public function snippetForBatch3(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -253,6 +261,7 @@ public function snippetForBatch4(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -281,6 +290,7 @@ public function snippetForBatch5(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -309,6 +319,7 @@ public function snippetForBatch6(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -337,6 +348,7 @@ public function snippetForBatchAssignUserIds(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -379,6 +391,7 @@ public function snippetForBatchDictionaryEntries(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -408,6 +421,7 @@ public function snippetForBatchDictionaryEntries1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -438,6 +452,7 @@ public function snippetForBatchDictionaryEntries2(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -459,6 +474,7 @@ public function snippetForBrowse(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -480,6 +496,7 @@ public function snippetForClearObjects(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -501,6 +518,7 @@ public function snippetForClearRules(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -522,6 +540,7 @@ public function snippetForClearSynonyms(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -543,6 +562,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -564,6 +584,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -585,6 +606,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -606,6 +628,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -627,6 +650,7 @@ public function snippetForDeleteApiKey(): void 'myTestApiKey', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -650,6 +674,7 @@ public function snippetForDeleteBy(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -671,6 +696,7 @@ public function snippetForDeleteIndex(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -693,6 +719,7 @@ public function snippetForDeleteObject(): void 'uniqueID', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -719,6 +746,7 @@ public function snippetForDeleteObjects(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -741,6 +769,7 @@ public function snippetForDeleteRule(): void 'id1', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -762,6 +791,7 @@ public function snippetForDeleteSource(): void 'theSource', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -784,6 +814,7 @@ public function snippetForDeleteSynonym(): void 'id1', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -810,6 +841,7 @@ public function snippetForGenerateSecuredApiKey(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -852,6 +884,7 @@ public function snippetForGenerateSecuredApiKey1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -873,6 +906,7 @@ public function snippetForGetApiKey(): void 'myTestApiKey', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -894,6 +928,7 @@ public function snippetForGetAppTask(): void 123, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -913,6 +948,7 @@ public function snippetForGetDictionaryLanguages(): void // Call the API $response = $client->getDictionaryLanguages(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -932,6 +968,7 @@ public function snippetForGetDictionarySettings(): void // Call the API $response = $client->getDictionarySettings(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -951,6 +988,7 @@ public function snippetForGetLogs(): void // Call the API $response = $client->getLogs(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -978,6 +1016,7 @@ public function snippetForGetObject(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1009,6 +1048,7 @@ public function snippetForGetObjects(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1031,6 +1071,7 @@ public function snippetForGetRule(): void 'qr-1725004648916', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1052,6 +1093,7 @@ public function snippetForGetSettings(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1071,6 +1113,7 @@ public function snippetForGetSources(): void // Call the API $response = $client->getSources(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1093,6 +1136,7 @@ public function snippetForGetSynonym(): void 'id1', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1115,6 +1159,7 @@ public function snippetForGetTask(): void 123, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1134,6 +1179,7 @@ public function snippetForGetTopUserIds(): void // Call the API $response = $client->getTopUserIds(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1155,6 +1201,7 @@ public function snippetForGetUserId(): void 'uniqueID', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1174,6 +1221,7 @@ public function snippetForHasPendingMappings(): void // Call the API $response = $client->hasPendingMappings(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1195,6 +1243,7 @@ public function snippetForIndexExists(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1216,6 +1265,7 @@ public function snippetForIndexExists1(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1237,6 +1287,7 @@ public function snippetForIndexExists2(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1256,6 +1307,7 @@ public function snippetForListApiKeys(): void // Call the API $response = $client->listApiKeys(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1275,6 +1327,7 @@ public function snippetForListClusters(): void // Call the API $response = $client->listClusters(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1294,6 +1347,7 @@ public function snippetForListIndices(): void // Call the API $response = $client->listIndices(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1313,6 +1367,7 @@ public function snippetForListUserIds(): void // Call the API $response = $client->listUserIds(); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1341,6 +1396,7 @@ public function snippetForMultipleBatch(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1370,6 +1426,7 @@ public function snippetForOperationIndex(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1394,6 +1451,7 @@ public function snippetForOperationIndex1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1418,6 +1476,7 @@ public function snippetForOperationIndex2(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1442,6 +1501,7 @@ public function snippetForPartialUpdateObject(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1473,6 +1533,7 @@ public function snippetForPartialUpdateObjects(): void true, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1504,6 +1565,7 @@ public function snippetForPartialUpdateObjects1(): void false, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1525,6 +1587,7 @@ public function snippetForRemoveUserId(): void 'uniqueID', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1588,6 +1651,7 @@ public function snippetForReplaceAllObjects(): void 3, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1613,6 +1677,7 @@ public function snippetForReplaceSources(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1634,6 +1699,7 @@ public function snippetForRestoreApiKey(): void 'myApiKey', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1658,6 +1724,7 @@ public function snippetForSaveObject(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1688,6 +1755,7 @@ public function snippetForSaveObjects(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1718,6 +1786,7 @@ public function snippetForSaveObjects1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1747,6 +1816,7 @@ public function snippetForSaveRule(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1787,6 +1857,7 @@ public function snippetForSaveRules(): void true, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1820,6 +1891,7 @@ public function snippetForSaveSynonym(): void true, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1867,6 +1939,7 @@ public function snippetForSaveSynonyms(): void true, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1894,6 +1967,7 @@ public function snippetForSearch(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1921,6 +1995,7 @@ public function snippetForSearch1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1948,6 +2023,7 @@ public function snippetForSearch2(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -1975,6 +2051,7 @@ public function snippetForSearch3(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2006,6 +2083,7 @@ public function snippetForSearch4(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2035,6 +2113,7 @@ public function snippetForSearch5(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2058,6 +2137,7 @@ public function snippetForSearchDictionaryEntries(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2080,6 +2160,7 @@ public function snippetForSearchForFacetValues(): void 'facetName', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2103,6 +2184,7 @@ public function snippetForSearchRules(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2124,6 +2206,7 @@ public function snippetForSearchSingleIndex(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2145,6 +2228,7 @@ public function snippetForSearchSynonyms(): void '', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2170,11 +2254,32 @@ public function snippetForSearchUserIds(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = SearchClient::create('', ''); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } + /** * Snippet for the SetDictionarySettings method. * @@ -2196,6 +2301,7 @@ public function snippetForSetDictionarySettings(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2225,6 +2331,7 @@ public function snippetForSetSettings(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2255,6 +2362,7 @@ public function snippetForUpdateApiKey(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2277,6 +2385,7 @@ public function snippetForWaitForApiKey(): void 'add', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2321,6 +2430,7 @@ public function snippetForWaitForApiKey1(): void ], ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2343,6 +2453,7 @@ public function snippetForWaitForApiKey2(): void 'delete', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2364,6 +2475,7 @@ public function snippetForWaitForAppTask(): void 123, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -2386,6 +2498,7 @@ public function snippetForWaitForTask(): void 123, ); + // >LOG // play with the response var_dump($response); // SEPARATOR< diff --git a/snippets/php/src/Usage.php b/snippets/php/src/Usage.php index 7514fdc464..3389b834aa 100644 --- a/snippets/php/src/Usage.php +++ b/snippets/php/src/Usage.php @@ -27,6 +27,7 @@ public function snippetForCustomDelete(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -48,6 +49,7 @@ public function snippetForCustomGet(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -69,6 +71,7 @@ public function snippetForCustomPost(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -90,6 +93,7 @@ public function snippetForCustomPut(): void 'test/minimal', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -114,6 +118,7 @@ public function snippetForGetIndexUsage(): void '2024-04-05T12:46:43Z', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< @@ -137,8 +142,29 @@ public function snippetForGetUsage(): void '2024-04-05T12:46:43Z', ); + // >LOG // play with the response var_dump($response); // SEPARATOR< } + + /** + * Snippet for the SetClientApiKey method. + * + * switch API key + */ + public function snippetForSetClientApiKey(): void + { + // >SEPARATOR setClientApiKey default + // Initialize the client + $client = UsageClient::create('', ''); + + // Call the API + $client->setClientApiKey( + 'updated-api-key', + ); + + // >LOG + // SEPARATOR< + } } diff --git a/snippets/python/abtesting.py b/snippets/python/abtesting.py index c97ec5566a..bcdefcac7c 100644 --- a/snippets/python/abtesting.py +++ b/snippets/python/abtesting.py @@ -32,6 +32,7 @@ async def snippet_for_add_ab_tests(): }, ) + # >LOG # use the class directly print(response) @@ -55,6 +56,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -78,6 +80,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -101,6 +104,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -124,6 +128,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -147,6 +152,7 @@ async def snippet_for_delete_ab_test(): id=42, ) + # >LOG # use the class directly print(response) @@ -170,6 +176,7 @@ async def snippet_for_get_ab_test(): id=42, ) + # >LOG # use the class directly print(response) @@ -191,6 +198,7 @@ async def snippet_for_list_ab_tests(): # Call the API response = await _client.list_ab_tests() + # >LOG # use the class directly print(response) @@ -228,6 +236,7 @@ async def snippet_for_schedule_ab_test(): }, ) + # >LOG # use the class directly print(response) @@ -236,6 +245,25 @@ async def snippet_for_schedule_ab_test(): # SEPARATOR< +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = AbtestingClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< + + async def snippet_for_stop_ab_test(): """ Snippet for the stopABTest method. @@ -251,6 +279,7 @@ async def snippet_for_stop_ab_test(): id=42, ) + # >LOG # use the class directly print(response) diff --git a/snippets/python/analytics.py b/snippets/python/analytics.py index 74fd262a13..390131fb8e 100644 --- a/snippets/python/analytics.py +++ b/snippets/python/analytics.py @@ -19,6 +19,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -42,6 +43,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -65,6 +67,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -88,6 +91,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -111,6 +115,7 @@ async def snippet_for_get_add_to_cart_rate(): index="index", ) + # >LOG # use the class directly print(response) @@ -134,6 +139,7 @@ async def snippet_for_get_average_click_position(): index="index", ) + # >LOG # use the class directly print(response) @@ -157,6 +163,7 @@ async def snippet_for_get_click_positions(): index="index", ) + # >LOG # use the class directly print(response) @@ -180,6 +187,7 @@ async def snippet_for_get_click_through_rate(): index="index", ) + # >LOG # use the class directly print(response) @@ -203,6 +211,7 @@ async def snippet_for_get_conversion_rate(): index="index", ) + # >LOG # use the class directly print(response) @@ -226,6 +235,7 @@ async def snippet_for_get_no_click_rate(): index="index", ) + # >LOG # use the class directly print(response) @@ -249,6 +259,7 @@ async def snippet_for_get_no_results_rate(): index="index", ) + # >LOG # use the class directly print(response) @@ -272,6 +283,7 @@ async def snippet_for_get_purchase_rate(): index="index", ) + # >LOG # use the class directly print(response) @@ -295,6 +307,7 @@ async def snippet_for_get_revenue(): index="index", ) + # >LOG # use the class directly print(response) @@ -318,6 +331,7 @@ async def snippet_for_get_searches_count(): index="index", ) + # >LOG # use the class directly print(response) @@ -341,6 +355,7 @@ async def snippet_for_get_searches_no_clicks(): index="index", ) + # >LOG # use the class directly print(response) @@ -364,6 +379,7 @@ async def snippet_for_get_searches_no_results(): index="index", ) + # >LOG # use the class directly print(response) @@ -387,6 +403,7 @@ async def snippet_for_get_status(): index="index", ) + # >LOG # use the class directly print(response) @@ -410,6 +427,7 @@ async def snippet_for_get_top_countries(): index="index", ) + # >LOG # use the class directly print(response) @@ -433,6 +451,7 @@ async def snippet_for_get_top_filter_attributes(): index="index", ) + # >LOG # use the class directly print(response) @@ -457,6 +476,7 @@ async def snippet_for_get_top_filter_for_attribute(): index="index", ) + # >LOG # use the class directly print(response) @@ -480,6 +500,7 @@ async def snippet_for_get_top_filters_no_results(): index="index", ) + # >LOG # use the class directly print(response) @@ -503,6 +524,7 @@ async def snippet_for_get_top_hits(): index="index", ) + # >LOG # use the class directly print(response) @@ -526,6 +548,7 @@ async def snippet_for_get_top_searches(): index="index", ) + # >LOG # use the class directly print(response) @@ -549,9 +572,29 @@ async def snippet_for_get_users_count(): index="index", ) + # >LOG # use the class directly print(response) # print the JSON response print(response.to_json()) # SEPARATOR< + + +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = AnalyticsClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< diff --git a/snippets/python/ingestion.py b/snippets/python/ingestion.py index 5d3eecd51b..f890cc6d9d 100644 --- a/snippets/python/ingestion.py +++ b/snippets/python/ingestion.py @@ -27,6 +27,7 @@ async def snippet_for_create_authentication(): }, ) + # >LOG # use the class directly print(response) @@ -57,6 +58,7 @@ async def snippet_for_create_destination(): }, ) + # >LOG # use the class directly print(response) @@ -94,6 +96,7 @@ async def snippet_for_create_source(): }, ) + # >LOG # use the class directly print(response) @@ -121,6 +124,7 @@ async def snippet_for_create_task(): }, ) + # >LOG # use the class directly print(response) @@ -151,6 +155,7 @@ async def snippet_for_create_task_v1(): }, ) + # >LOG # use the class directly print(response) @@ -178,6 +183,7 @@ async def snippet_for_create_transformation(): }, ) + # >LOG # use the class directly print(response) @@ -201,6 +207,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -224,6 +231,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -247,6 +255,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -270,6 +279,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -293,6 +303,7 @@ async def snippet_for_delete_authentication(): authentication_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -316,6 +327,7 @@ async def snippet_for_delete_destination(): destination_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -339,6 +351,7 @@ async def snippet_for_delete_source(): source_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -362,6 +375,7 @@ async def snippet_for_delete_task(): task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -385,6 +399,7 @@ async def snippet_for_delete_task_v1(): task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -408,6 +423,7 @@ async def snippet_for_delete_transformation(): transformation_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -431,6 +447,7 @@ async def snippet_for_disable_task(): task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -454,6 +471,7 @@ async def snippet_for_disable_task_v1(): task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -477,6 +495,7 @@ async def snippet_for_enable_task(): task_id="76ab4c2a-ce17-496f-b7a6-506dc59ee498", ) + # >LOG # use the class directly print(response) @@ -500,6 +519,7 @@ async def snippet_for_enable_task_v1(): task_id="76ab4c2a-ce17-496f-b7a6-506dc59ee498", ) + # >LOG # use the class directly print(response) @@ -526,6 +546,7 @@ async def snippet_for_generate_transformation_code(): }, ) + # >LOG # use the class directly print(response) @@ -549,6 +570,7 @@ async def snippet_for_get_authentication(): authentication_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -572,6 +594,7 @@ async def snippet_for_get_destination(): destination_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -596,6 +619,7 @@ async def snippet_for_get_event(): event_id="6c02aeb1-775e-418e-870b-1faccd4b2c0c", ) + # >LOG # use the class directly print(response) @@ -619,6 +643,7 @@ async def snippet_for_get_run(): run_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -642,6 +667,7 @@ async def snippet_for_get_source(): source_id="75eeb306-51d3-4e5e-a279-3c92bd8893ac", ) + # >LOG # use the class directly print(response) @@ -665,6 +691,7 @@ async def snippet_for_get_task(): task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -688,6 +715,7 @@ async def snippet_for_get_task_v1(): task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -711,6 +739,7 @@ async def snippet_for_get_transformation(): transformation_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -732,6 +761,7 @@ async def snippet_for_list_authentications(): # Call the API response = await _client.list_authentications() + # >LOG # use the class directly print(response) @@ -753,6 +783,7 @@ async def snippet_for_list_destinations(): # Call the API response = await _client.list_destinations() + # >LOG # use the class directly print(response) @@ -776,6 +807,7 @@ async def snippet_for_list_events(): run_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -797,6 +829,7 @@ async def snippet_for_list_runs(): # Call the API response = await _client.list_runs() + # >LOG # use the class directly print(response) @@ -818,6 +851,7 @@ async def snippet_for_list_sources(): # Call the API response = await _client.list_sources() + # >LOG # use the class directly print(response) @@ -839,6 +873,7 @@ async def snippet_for_list_tasks(): # Call the API response = await _client.list_tasks() + # >LOG # use the class directly print(response) @@ -860,6 +895,7 @@ async def snippet_for_list_tasks_v1(): # Call the API response = await _client.list_tasks_v1() + # >LOG # use the class directly print(response) @@ -881,6 +917,7 @@ async def snippet_for_list_transformation_models(): # Call the API response = await _client.list_transformation_models() + # >LOG # use the class directly print(response) @@ -902,6 +939,7 @@ async def snippet_for_list_transformations(): # Call the API response = await _client.list_transformations() + # >LOG # use the class directly print(response) @@ -940,6 +978,7 @@ async def snippet_for_push_task(): }, ) + # >LOG # use the class directly print(response) @@ -974,6 +1013,7 @@ async def snippet_for_run_source(): }, ) + # >LOG # use the class directly print(response) @@ -997,6 +1037,7 @@ async def snippet_for_run_task(): task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -1020,6 +1061,7 @@ async def snippet_for_run_task_v1(): task_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -1048,6 +1090,7 @@ async def snippet_for_search_authentications(): }, ) + # >LOG # use the class directly print(response) @@ -1076,6 +1119,7 @@ async def snippet_for_search_destinations(): }, ) + # >LOG # use the class directly print(response) @@ -1104,6 +1148,7 @@ async def snippet_for_search_sources(): }, ) + # >LOG # use the class directly print(response) @@ -1133,6 +1178,7 @@ async def snippet_for_search_tasks(): }, ) + # >LOG # use the class directly print(response) @@ -1162,6 +1208,7 @@ async def snippet_for_search_tasks_v1(): }, ) + # >LOG # use the class directly print(response) @@ -1191,6 +1238,7 @@ async def snippet_for_search_transformations(): }, ) + # >LOG # use the class directly print(response) @@ -1199,6 +1247,25 @@ async def snippet_for_search_transformations(): # SEPARATOR< +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = IngestionClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< + + async def snippet_for_trigger_docker_source_discover(): """ Snippet for the triggerDockerSourceDiscover method. @@ -1214,6 +1281,7 @@ async def snippet_for_trigger_docker_source_discover(): source_id="6c02aeb1-775e-418e-870b-1faccd4b2c0f", ) + # >LOG # use the class directly print(response) @@ -1242,6 +1310,7 @@ async def snippet_for_try_transformation(): }, ) + # >LOG # use the class directly print(response) @@ -1271,6 +1340,7 @@ async def snippet_for_try_transformation_before_update(): }, ) + # >LOG # use the class directly print(response) @@ -1297,6 +1367,7 @@ async def snippet_for_update_authentication(): }, ) + # >LOG # use the class directly print(response) @@ -1323,6 +1394,7 @@ async def snippet_for_update_destination(): }, ) + # >LOG # use the class directly print(response) @@ -1349,6 +1421,7 @@ async def snippet_for_update_source(): }, ) + # >LOG # use the class directly print(response) @@ -1376,6 +1449,7 @@ async def snippet_for_update_task(): }, ) + # >LOG # use the class directly print(response) @@ -1402,6 +1476,7 @@ async def snippet_for_update_task_v1(): }, ) + # >LOG # use the class directly print(response) @@ -1430,6 +1505,7 @@ async def snippet_for_update_transformation(): }, ) + # >LOG # use the class directly print(response) @@ -1467,6 +1543,7 @@ async def snippet_for_validate_source(): }, ) + # >LOG # use the class directly print(response) @@ -1493,6 +1570,7 @@ async def snippet_for_validate_source_before_update(): }, ) + # >LOG # use the class directly print(response) diff --git a/snippets/python/insights.py b/snippets/python/insights.py index 870f8ae20b..31174274f0 100644 --- a/snippets/python/insights.py +++ b/snippets/python/insights.py @@ -19,6 +19,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -42,6 +43,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -65,6 +67,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -88,6 +91,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -107,15 +111,11 @@ async def snippet_for_delete_user_token(): _client = InsightsClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") # Call the API - response = await _client.delete_user_token( + await _client.delete_user_token( user_token="test-user-1", ) - # use the class directly - print(response) - - # print the JSON response - print(response.to_json()) + # >LOG # SEPARATOR< @@ -154,9 +154,29 @@ async def snippet_for_push_events(): }, ) + # >LOG # use the class directly print(response) # print the JSON response print(response.to_json()) # SEPARATOR< + + +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = InsightsClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< diff --git a/snippets/python/monitoring.py b/snippets/python/monitoring.py index 42d5c0ca3c..b85745e157 100644 --- a/snippets/python/monitoring.py +++ b/snippets/python/monitoring.py @@ -19,6 +19,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -42,6 +43,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -65,6 +67,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -88,6 +91,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -111,6 +115,7 @@ async def snippet_for_get_cluster_incidents(): clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -134,6 +139,7 @@ async def snippet_for_get_cluster_status(): clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -155,6 +161,7 @@ async def snippet_for_get_incidents(): # Call the API response = await _client.get_incidents() + # >LOG # use the class directly print(response) @@ -178,6 +185,7 @@ async def snippet_for_get_indexing_time(): clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -201,6 +209,7 @@ async def snippet_for_get_latency(): clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -225,6 +234,7 @@ async def snippet_for_get_metrics(): period="minute", ) + # >LOG # use the class directly print(response) @@ -248,6 +258,7 @@ async def snippet_for_get_reachability(): clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -269,6 +280,7 @@ async def snippet_for_get_servers(): # Call the API response = await _client.get_servers() + # >LOG # use the class directly print(response) @@ -290,9 +302,29 @@ async def snippet_for_get_status(): # Call the API response = await _client.get_status() + # >LOG # use the class directly print(response) # print the JSON response print(response.to_json()) # SEPARATOR< + + +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = MonitoringClient("YOUR_APP_ID", "YOUR_API_KEY") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< diff --git a/snippets/python/personalization.py b/snippets/python/personalization.py index e0b7ef7f6c..fa5543e29e 100644 --- a/snippets/python/personalization.py +++ b/snippets/python/personalization.py @@ -19,6 +19,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -42,6 +43,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -65,6 +67,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -88,6 +91,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -111,6 +115,7 @@ async def snippet_for_delete_user_profile(): user_token="UserToken", ) + # >LOG # use the class directly print(response) @@ -132,6 +137,7 @@ async def snippet_for_get_personalization_strategy(): # Call the API response = await _client.get_personalization_strategy() + # >LOG # use the class directly print(response) @@ -155,6 +161,7 @@ async def snippet_for_get_user_token_profile(): user_token="UserToken", ) + # >LOG # use the class directly print(response) @@ -163,6 +170,25 @@ async def snippet_for_get_user_token_profile(): # SEPARATOR< +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = PersonalizationClient("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< + + async def snippet_for_set_personalization_strategy(): """ Snippet for the setPersonalizationStrategy method. @@ -193,6 +219,7 @@ async def snippet_for_set_personalization_strategy(): }, ) + # >LOG # use the class directly print(response) diff --git a/snippets/python/query_suggestions.py b/snippets/python/query_suggestions.py index 11e3b85779..fef59478be 100644 --- a/snippets/python/query_suggestions.py +++ b/snippets/python/query_suggestions.py @@ -48,6 +48,7 @@ async def snippet_for_create_config(): }, ) + # >LOG # use the class directly print(response) @@ -73,6 +74,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -98,6 +100,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -123,6 +126,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -148,6 +152,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -173,6 +178,7 @@ async def snippet_for_delete_config(): index_name="", ) + # >LOG # use the class directly print(response) @@ -196,6 +202,7 @@ async def snippet_for_get_all_configs(): # Call the API response = await _client.get_all_configs() + # >LOG # use the class directly print(response) @@ -221,6 +228,7 @@ async def snippet_for_get_config(): index_name="", ) + # >LOG # use the class directly print(response) @@ -246,6 +254,7 @@ async def snippet_for_get_config_status(): index_name="", ) + # >LOG # use the class directly print(response) @@ -271,6 +280,7 @@ async def snippet_for_get_log_file(): index_name="", ) + # >LOG # use the class directly print(response) @@ -279,6 +289,27 @@ async def snippet_for_get_log_file(): # SEPARATOR< +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = QuerySuggestionsClient( + "YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION" + ) + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< + + async def snippet_for_update_config(): """ Snippet for the updateConfig method. @@ -323,6 +354,7 @@ async def snippet_for_update_config(): }, ) + # >LOG # use the class directly print(response) diff --git a/snippets/python/recommend.py b/snippets/python/recommend.py index 64fbaf5d37..663fadf261 100644 --- a/snippets/python/recommend.py +++ b/snippets/python/recommend.py @@ -19,6 +19,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -42,6 +43,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -65,6 +67,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -88,6 +91,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -113,6 +117,7 @@ async def snippet_for_delete_recommend_rule(): object_id="objectID", ) + # >LOG # use the class directly print(response) @@ -138,6 +143,7 @@ async def snippet_for_get_recommend_rule(): object_id="objectID", ) + # >LOG # use the class directly print(response) @@ -163,6 +169,7 @@ async def snippet_for_get_recommend_status(): task_id=12345, ) + # >LOG # use the class directly print(response) @@ -195,6 +202,7 @@ async def snippet_for_get_recommendations(): }, ) + # >LOG # use the class directly print(response) @@ -219,9 +227,29 @@ async def snippet_for_search_recommend_rules(): model="related-products", ) + # >LOG # use the class directly print(response) # print the JSON response print(response.to_json()) # SEPARATOR< + + +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = RecommendClient("YOUR_APP_ID", "YOUR_API_KEY") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< diff --git a/snippets/python/search.py b/snippets/python/search.py index 912bf38720..3f3a326437 100644 --- a/snippets/python/search.py +++ b/snippets/python/search.py @@ -28,6 +28,7 @@ async def snippet_for_add_api_key(): }, ) + # >LOG # use the class directly print(response) @@ -55,6 +56,7 @@ async def snippet_for_add_or_update_object(): }, ) + # >LOG # use the class directly print(response) @@ -81,6 +83,7 @@ async def snippet_for_append_source(): }, ) + # >LOG # use the class directly print(response) @@ -107,6 +110,7 @@ async def snippet_for_assign_user_id(): }, ) + # >LOG # use the class directly print(response) @@ -148,6 +152,7 @@ async def snippet_for_batch(): }, ) + # >LOG # use the class directly print(response) @@ -181,6 +186,7 @@ async def snippet_for_batch1(): }, ) + # >LOG # use the class directly print(response) @@ -214,6 +220,7 @@ async def snippet_for_batch2(): }, ) + # >LOG # use the class directly print(response) @@ -247,6 +254,7 @@ async def snippet_for_batch3(): }, ) + # >LOG # use the class directly print(response) @@ -280,6 +288,7 @@ async def snippet_for_batch4(): }, ) + # >LOG # use the class directly print(response) @@ -313,6 +322,7 @@ async def snippet_for_batch5(): }, ) + # >LOG # use the class directly print(response) @@ -346,6 +356,7 @@ async def snippet_for_batch6(): }, ) + # >LOG # use the class directly print(response) @@ -376,6 +387,7 @@ async def snippet_for_batch_assign_user_ids(): }, ) + # >LOG # use the class directly print(response) @@ -421,6 +433,7 @@ async def snippet_for_batch_dictionary_entries(): }, ) + # >LOG # use the class directly print(response) @@ -455,6 +468,7 @@ async def snippet_for_batch_dictionary_entries1(): }, ) + # >LOG # use the class directly print(response) @@ -490,6 +504,7 @@ async def snippet_for_batch_dictionary_entries2(): }, ) + # >LOG # use the class directly print(response) @@ -513,6 +528,7 @@ async def snippet_for_browse(): index_name="", ) + # >LOG # use the class directly print(response) @@ -536,6 +552,7 @@ async def snippet_for_clear_objects(): index_name="", ) + # >LOG # use the class directly print(response) @@ -559,6 +576,7 @@ async def snippet_for_clear_rules(): index_name="", ) + # >LOG # use the class directly print(response) @@ -582,6 +600,7 @@ async def snippet_for_clear_synonyms(): index_name="", ) + # >LOG # use the class directly print(response) @@ -605,6 +624,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -628,6 +648,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -651,6 +672,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -674,6 +696,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -697,6 +720,7 @@ async def snippet_for_delete_api_key(): key="myTestApiKey", ) + # >LOG # use the class directly print(response) @@ -723,6 +747,7 @@ async def snippet_for_delete_by(): }, ) + # >LOG # use the class directly print(response) @@ -746,6 +771,7 @@ async def snippet_for_delete_index(): index_name="", ) + # >LOG # use the class directly print(response) @@ -770,6 +796,7 @@ async def snippet_for_delete_object(): object_id="uniqueID", ) + # >LOG # use the class directly print(response) @@ -797,6 +824,7 @@ async def snippet_for_delete_objects(): ], ) + # >LOG # use the class directly print(response) @@ -821,6 +849,7 @@ async def snippet_for_delete_rule(): object_id="id1", ) + # >LOG # use the class directly print(response) @@ -844,6 +873,7 @@ async def snippet_for_delete_source(): source="theSource", ) + # >LOG # use the class directly print(response) @@ -868,6 +898,7 @@ async def snippet_for_delete_synonym(): object_id="id1", ) + # >LOG # use the class directly print(response) @@ -887,7 +918,7 @@ async def snippet_for_generate_secured_api_key(): _client = SearchClient("YOUR_APP_ID", "YOUR_API_KEY") # Call the API - response = await _client.generate_secured_api_key( + response = _client.generate_secured_api_key( parent_api_key="2640659426d5107b6e47d75db9cbaef8", restrictions={ "validUntil": 2524604400, @@ -897,6 +928,7 @@ async def snippet_for_generate_secured_api_key(): }, ) + # >LOG # use the class directly print(response) @@ -916,7 +948,7 @@ async def snippet_for_generate_secured_api_key1(): _client = SearchClient("YOUR_APP_ID", "YOUR_API_KEY") # Call the API - response = await _client.generate_secured_api_key( + response = _client.generate_secured_api_key( parent_api_key="2640659426d5107b6e47d75db9cbaef8", restrictions={ "validUntil": 2524604400, @@ -941,6 +973,7 @@ async def snippet_for_generate_secured_api_key1(): }, ) + # >LOG # use the class directly print(response) @@ -964,6 +997,7 @@ async def snippet_for_get_api_key(): key="myTestApiKey", ) + # >LOG # use the class directly print(response) @@ -987,6 +1021,7 @@ async def snippet_for_get_app_task(): task_id=123, ) + # >LOG # use the class directly print(response) @@ -1008,6 +1043,7 @@ async def snippet_for_get_dictionary_languages(): # Call the API response = await _client.get_dictionary_languages() + # >LOG # use the class directly print(response) @@ -1029,6 +1065,7 @@ async def snippet_for_get_dictionary_settings(): # Call the API response = await _client.get_dictionary_settings() + # >LOG # use the class directly print(response) @@ -1050,6 +1087,7 @@ async def snippet_for_get_logs(): # Call the API response = await _client.get_logs() + # >LOG # use the class directly print(response) @@ -1078,6 +1116,7 @@ async def snippet_for_get_object(): ], ) + # >LOG # use the class directly print(response) @@ -1112,6 +1151,7 @@ async def snippet_for_get_objects(): }, ) + # >LOG # use the class directly print(response) @@ -1136,6 +1176,7 @@ async def snippet_for_get_rule(): object_id="qr-1725004648916", ) + # >LOG # use the class directly print(response) @@ -1159,6 +1200,7 @@ async def snippet_for_get_settings(): index_name="", ) + # >LOG # use the class directly print(response) @@ -1180,6 +1222,7 @@ async def snippet_for_get_sources(): # Call the API response = await _client.get_sources() + # >LOG # use the class directly print(response) @@ -1204,6 +1247,7 @@ async def snippet_for_get_synonym(): object_id="id1", ) + # >LOG # use the class directly print(response) @@ -1228,6 +1272,7 @@ async def snippet_for_get_task(): task_id=123, ) + # >LOG # use the class directly print(response) @@ -1249,6 +1294,7 @@ async def snippet_for_get_top_user_ids(): # Call the API response = await _client.get_top_user_ids() + # >LOG # use the class directly print(response) @@ -1272,6 +1318,7 @@ async def snippet_for_get_user_id(): user_id="uniqueID", ) + # >LOG # use the class directly print(response) @@ -1293,6 +1340,7 @@ async def snippet_for_has_pending_mappings(): # Call the API response = await _client.has_pending_mappings() + # >LOG # use the class directly print(response) @@ -1316,6 +1364,7 @@ async def snippet_for_index_exists(): index_name="", ) + # >LOG # use the class directly print(response) @@ -1339,6 +1388,7 @@ async def snippet_for_index_exists1(): index_name="", ) + # >LOG # use the class directly print(response) @@ -1362,6 +1412,7 @@ async def snippet_for_index_exists2(): index_name="", ) + # >LOG # use the class directly print(response) @@ -1383,6 +1434,7 @@ async def snippet_for_list_api_keys(): # Call the API response = await _client.list_api_keys() + # >LOG # use the class directly print(response) @@ -1404,6 +1456,7 @@ async def snippet_for_list_clusters(): # Call the API response = await _client.list_clusters() + # >LOG # use the class directly print(response) @@ -1425,6 +1478,7 @@ async def snippet_for_list_indices(): # Call the API response = await _client.list_indices() + # >LOG # use the class directly print(response) @@ -1446,6 +1500,7 @@ async def snippet_for_list_user_ids(): # Call the API response = await _client.list_user_ids() + # >LOG # use the class directly print(response) @@ -1479,6 +1534,7 @@ async def snippet_for_multiple_batch(): }, ) + # >LOG # use the class directly print(response) @@ -1510,6 +1566,7 @@ async def snippet_for_operation_index(): }, ) + # >LOG # use the class directly print(response) @@ -1537,6 +1594,7 @@ async def snippet_for_operation_index1(): }, ) + # >LOG # use the class directly print(response) @@ -1564,6 +1622,7 @@ async def snippet_for_operation_index2(): }, ) + # >LOG # use the class directly print(response) @@ -1591,6 +1650,7 @@ async def snippet_for_partial_update_object(): }, ) + # >LOG # use the class directly print(response) @@ -1625,6 +1685,7 @@ async def snippet_for_partial_update_objects(): create_if_not_exists=True, ) + # >LOG # use the class directly print(response) @@ -1659,6 +1720,7 @@ async def snippet_for_partial_update_objects1(): create_if_not_exists=False, ) + # >LOG # use the class directly print(response) @@ -1682,6 +1744,7 @@ async def snippet_for_remove_user_id(): user_id="uniqueID", ) + # >LOG # use the class directly print(response) @@ -1748,6 +1811,7 @@ async def snippet_for_replace_all_objects(): batch_size=3, ) + # >LOG # use the class directly print(response) @@ -1776,6 +1840,7 @@ async def snippet_for_replace_sources(): ], ) + # >LOG # use the class directly print(response) @@ -1799,6 +1864,7 @@ async def snippet_for_restore_api_key(): key="myApiKey", ) + # >LOG # use the class directly print(response) @@ -1826,6 +1892,7 @@ async def snippet_for_save_object(): }, ) + # >LOG # use the class directly print(response) @@ -1859,6 +1926,7 @@ async def snippet_for_save_objects(): ], ) + # >LOG # use the class directly print(response) @@ -1892,6 +1960,7 @@ async def snippet_for_save_objects1(): ], ) + # >LOG # use the class directly print(response) @@ -1925,6 +1994,7 @@ async def snippet_for_save_rule(): }, ) + # >LOG # use the class directly print(response) @@ -1970,6 +2040,7 @@ async def snippet_for_save_rules(): clear_existing_rules=True, ) + # >LOG # use the class directly print(response) @@ -2004,6 +2075,7 @@ async def snippet_for_save_synonym(): forward_to_replicas=True, ) + # >LOG # use the class directly print(response) @@ -2050,6 +2122,7 @@ async def snippet_for_save_synonyms(): replace_existing_synonyms=True, ) + # >LOG # use the class directly print(response) @@ -2081,6 +2154,7 @@ async def snippet_for_search(): }, ) + # >LOG # use the class directly print(response) @@ -2112,6 +2186,7 @@ async def snippet_for_search1(): }, ) + # >LOG # use the class directly print(response) @@ -2143,6 +2218,7 @@ async def snippet_for_search2(): }, ) + # >LOG # use the class directly print(response) @@ -2174,6 +2250,7 @@ async def snippet_for_search3(): }, ) + # >LOG # use the class directly print(response) @@ -2208,6 +2285,7 @@ async def snippet_for_search4(): }, ) + # >LOG # use the class directly print(response) @@ -2241,6 +2319,7 @@ async def snippet_for_search5(): }, ) + # >LOG # use the class directly print(response) @@ -2267,6 +2346,7 @@ async def snippet_for_search_dictionary_entries(): }, ) + # >LOG # use the class directly print(response) @@ -2291,6 +2371,7 @@ async def snippet_for_search_for_facet_values(): facet_name="facetName", ) + # >LOG # use the class directly print(response) @@ -2317,6 +2398,7 @@ async def snippet_for_search_rules(): }, ) + # >LOG # use the class directly print(response) @@ -2340,6 +2422,7 @@ async def snippet_for_search_single_index(): index_name="", ) + # >LOG # use the class directly print(response) @@ -2363,6 +2446,7 @@ async def snippet_for_search_synonyms(): index_name="", ) + # >LOG # use the class directly print(response) @@ -2391,6 +2475,7 @@ async def snippet_for_search_user_ids(): }, ) + # >LOG # use the class directly print(response) @@ -2399,6 +2484,25 @@ async def snippet_for_search_user_ids(): # SEPARATOR< +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = SearchClient("YOUR_APP_ID", "YOUR_API_KEY") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< + + async def snippet_for_set_dictionary_settings(): """ Snippet for the setDictionarySettings method. @@ -2422,6 +2526,7 @@ async def snippet_for_set_dictionary_settings(): }, ) + # >LOG # use the class directly print(response) @@ -2452,6 +2557,7 @@ async def snippet_for_set_settings(): }, ) + # >LOG # use the class directly print(response) @@ -2484,6 +2590,7 @@ async def snippet_for_update_api_key(): }, ) + # >LOG # use the class directly print(response) @@ -2508,6 +2615,7 @@ async def snippet_for_wait_for_api_key(): operation="add", ) + # >LOG # use the class directly print(response) @@ -2551,6 +2659,7 @@ async def snippet_for_wait_for_api_key1(): }, ) + # >LOG # use the class directly print(response) @@ -2575,6 +2684,7 @@ async def snippet_for_wait_for_api_key2(): operation="delete", ) + # >LOG # use the class directly print(response) @@ -2598,6 +2708,7 @@ async def snippet_for_wait_for_app_task(): task_id=123, ) + # >LOG # use the class directly print(response) @@ -2622,6 +2733,7 @@ async def snippet_for_wait_for_task(): task_id=123, ) + # >LOG # use the class directly print(response) diff --git a/snippets/python/usage.py b/snippets/python/usage.py index c9aa392f2d..97708ea571 100644 --- a/snippets/python/usage.py +++ b/snippets/python/usage.py @@ -19,6 +19,7 @@ async def snippet_for_custom_delete(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -42,6 +43,7 @@ async def snippet_for_custom_get(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -65,6 +67,7 @@ async def snippet_for_custom_post(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -88,6 +91,7 @@ async def snippet_for_custom_put(): path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -114,6 +118,7 @@ async def snippet_for_get_index_usage(): end_date="2024-04-05T12:46:43Z", ) + # >LOG # use the class directly print(response) @@ -139,9 +144,29 @@ async def snippet_for_get_usage(): end_date="2024-04-05T12:46:43Z", ) + # >LOG # use the class directly print(response) # print the JSON response print(response.to_json()) # SEPARATOR< + + +async def snippet_for_set_client_api_key(): + """ + Snippet for the setClientApiKey method. + + switch API key + """ + # >SEPARATOR setClientApiKey default + # Initialize the client + _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") + + # Call the API + _client.set_client_api_key( + api_key="updated-api-key", + ) + + # >LOG + # SEPARATOR< diff --git a/snippets/ruby/abtesting.rb b/snippets/ruby/abtesting.rb index 4c5c2e5158..e595c75c23 100644 --- a/snippets/ruby/abtesting.rb +++ b/snippets/ruby/abtesting.rb @@ -24,6 +24,7 @@ def snippet_for_add_ab_tests ) ) + # >LOG # use the class directly puts(response) @@ -43,6 +44,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -62,6 +64,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -81,6 +84,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -100,6 +104,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -119,6 +124,7 @@ def snippet_for_delete_ab_test # Call the API response = client.delete_ab_test(42) + # >LOG # use the class directly puts(response) @@ -138,6 +144,7 @@ def snippet_for_get_ab_test # Call the API response = client.get_ab_test(42) + # >LOG # use the class directly puts(response) @@ -157,6 +164,7 @@ def snippet_for_list_ab_tests # Call the API response = client.list_ab_tests + # >LOG # use the class directly puts(response) @@ -186,6 +194,7 @@ def snippet_for_schedule_ab_test ) ) + # >LOG # use the class directly puts(response) @@ -194,6 +203,20 @@ def snippet_for_schedule_ab_test # SEPARATOR< end +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::AbtestingClient.create("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end + # Snippet for the stopABTest method. # # stopABTest @@ -205,6 +228,7 @@ def snippet_for_stop_ab_test # Call the API response = client.stop_ab_test(42) + # >LOG # use the class directly puts(response) diff --git a/snippets/ruby/analytics.rb b/snippets/ruby/analytics.rb index a4f0a11245..2c8e9865ba 100644 --- a/snippets/ruby/analytics.rb +++ b/snippets/ruby/analytics.rb @@ -15,6 +15,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -34,6 +35,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -53,6 +55,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -72,6 +75,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -91,6 +95,7 @@ def snippet_for_get_add_to_cart_rate # Call the API response = client.get_add_to_cart_rate("index") + # >LOG # use the class directly puts(response) @@ -110,6 +115,7 @@ def snippet_for_get_average_click_position # Call the API response = client.get_average_click_position("index") + # >LOG # use the class directly puts(response) @@ -129,6 +135,7 @@ def snippet_for_get_click_positions # Call the API response = client.get_click_positions("index") + # >LOG # use the class directly puts(response) @@ -148,6 +155,7 @@ def snippet_for_get_click_through_rate # Call the API response = client.get_click_through_rate("index") + # >LOG # use the class directly puts(response) @@ -167,6 +175,7 @@ def snippet_for_get_conversion_rate # Call the API response = client.get_conversion_rate("index") + # >LOG # use the class directly puts(response) @@ -186,6 +195,7 @@ def snippet_for_get_no_click_rate # Call the API response = client.get_no_click_rate("index") + # >LOG # use the class directly puts(response) @@ -205,6 +215,7 @@ def snippet_for_get_no_results_rate # Call the API response = client.get_no_results_rate("index") + # >LOG # use the class directly puts(response) @@ -224,6 +235,7 @@ def snippet_for_get_purchase_rate # Call the API response = client.get_purchase_rate("index") + # >LOG # use the class directly puts(response) @@ -243,6 +255,7 @@ def snippet_for_get_revenue # Call the API response = client.get_revenue("index") + # >LOG # use the class directly puts(response) @@ -262,6 +275,7 @@ def snippet_for_get_searches_count # Call the API response = client.get_searches_count("index") + # >LOG # use the class directly puts(response) @@ -281,6 +295,7 @@ def snippet_for_get_searches_no_clicks # Call the API response = client.get_searches_no_clicks("index") + # >LOG # use the class directly puts(response) @@ -300,6 +315,7 @@ def snippet_for_get_searches_no_results # Call the API response = client.get_searches_no_results("index") + # >LOG # use the class directly puts(response) @@ -319,6 +335,7 @@ def snippet_for_get_status # Call the API response = client.get_status("index") + # >LOG # use the class directly puts(response) @@ -338,6 +355,7 @@ def snippet_for_get_top_countries # Call the API response = client.get_top_countries("index") + # >LOG # use the class directly puts(response) @@ -357,6 +375,7 @@ def snippet_for_get_top_filter_attributes # Call the API response = client.get_top_filter_attributes("index") + # >LOG # use the class directly puts(response) @@ -376,6 +395,7 @@ def snippet_for_get_top_filter_for_attribute # Call the API response = client.get_top_filter_for_attribute("myAttribute", "index") + # >LOG # use the class directly puts(response) @@ -395,6 +415,7 @@ def snippet_for_get_top_filters_no_results # Call the API response = client.get_top_filters_no_results("index") + # >LOG # use the class directly puts(response) @@ -414,6 +435,7 @@ def snippet_for_get_top_hits # Call the API response = client.get_top_hits("index") + # >LOG # use the class directly puts(response) @@ -433,6 +455,7 @@ def snippet_for_get_top_searches # Call the API response = client.get_top_searches("index") + # >LOG # use the class directly puts(response) @@ -452,6 +475,7 @@ def snippet_for_get_users_count # Call the API response = client.get_users_count("index") + # >LOG # use the class directly puts(response) @@ -459,3 +483,17 @@ def snippet_for_get_users_count puts(response.to_json) # SEPARATOR< end + +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::AnalyticsClient.create("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end diff --git a/snippets/ruby/ingestion.rb b/snippets/ruby/ingestion.rb index 693762df5c..844030fd33 100644 --- a/snippets/ruby/ingestion.rb +++ b/snippets/ruby/ingestion.rb @@ -21,6 +21,7 @@ def snippet_for_create_authentication ) ) + # >LOG # use the class directly puts(response) @@ -47,6 +48,7 @@ def snippet_for_create_destination ) ) + # >LOG # use the class directly puts(response) @@ -78,6 +80,7 @@ def snippet_for_create_source ) ) + # >LOG # use the class directly puts(response) @@ -99,6 +102,7 @@ def snippet_for_create_task TaskCreate.new(source_id: "search", destination_id: "destinationName", action: "replace") ) + # >LOG # use the class directly puts(response) @@ -125,6 +129,7 @@ def snippet_for_create_task_v1 ) ) + # >LOG # use the class directly puts(response) @@ -144,6 +149,7 @@ def snippet_for_create_transformation # Call the API response = client.create_transformation(TransformationCreate.new(code: "foo", name: "bar", description: "baz")) + # >LOG # use the class directly puts(response) @@ -163,6 +169,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -182,6 +189,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -201,6 +209,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -220,6 +229,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -239,6 +249,7 @@ def snippet_for_delete_authentication # Call the API response = client.delete_authentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -258,6 +269,7 @@ def snippet_for_delete_destination # Call the API response = client.delete_destination("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -277,6 +289,7 @@ def snippet_for_delete_source # Call the API response = client.delete_source("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -296,6 +309,7 @@ def snippet_for_delete_task # Call the API response = client.delete_task("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -315,6 +329,7 @@ def snippet_for_delete_task_v1 # Call the API response = client.delete_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -334,6 +349,7 @@ def snippet_for_delete_transformation # Call the API response = client.delete_transformation("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -353,6 +369,7 @@ def snippet_for_disable_task # Call the API response = client.disable_task("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -372,6 +389,7 @@ def snippet_for_disable_task_v1 # Call the API response = client.disable_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -391,6 +409,7 @@ def snippet_for_enable_task # Call the API response = client.enable_task("76ab4c2a-ce17-496f-b7a6-506dc59ee498") + # >LOG # use the class directly puts(response) @@ -410,6 +429,7 @@ def snippet_for_enable_task_v1 # Call the API response = client.enable_task_v1("76ab4c2a-ce17-496f-b7a6-506dc59ee498") + # >LOG # use the class directly puts(response) @@ -434,6 +454,7 @@ def snippet_for_generate_transformation_code ) ) + # >LOG # use the class directly puts(response) @@ -453,6 +474,7 @@ def snippet_for_get_authentication # Call the API response = client.get_authentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -472,6 +494,7 @@ def snippet_for_get_destination # Call the API response = client.get_destination("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -491,6 +514,7 @@ def snippet_for_get_event # Call the API response = client.get_event("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "6c02aeb1-775e-418e-870b-1faccd4b2c0c") + # >LOG # use the class directly puts(response) @@ -510,6 +534,7 @@ def snippet_for_get_run # Call the API response = client.get_run("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -529,6 +554,7 @@ def snippet_for_get_source # Call the API response = client.get_source("75eeb306-51d3-4e5e-a279-3c92bd8893ac") + # >LOG # use the class directly puts(response) @@ -548,6 +574,7 @@ def snippet_for_get_task # Call the API response = client.get_task("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -567,6 +594,7 @@ def snippet_for_get_task_v1 # Call the API response = client.get_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -586,6 +614,7 @@ def snippet_for_get_transformation # Call the API response = client.get_transformation("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -605,6 +634,7 @@ def snippet_for_list_authentications # Call the API response = client.list_authentications + # >LOG # use the class directly puts(response) @@ -624,6 +654,7 @@ def snippet_for_list_destinations # Call the API response = client.list_destinations + # >LOG # use the class directly puts(response) @@ -643,6 +674,7 @@ def snippet_for_list_events # Call the API response = client.list_events("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -662,6 +694,7 @@ def snippet_for_list_runs # Call the API response = client.list_runs + # >LOG # use the class directly puts(response) @@ -681,6 +714,7 @@ def snippet_for_list_sources # Call the API response = client.list_sources + # >LOG # use the class directly puts(response) @@ -700,6 +734,7 @@ def snippet_for_list_tasks # Call the API response = client.list_tasks + # >LOG # use the class directly puts(response) @@ -719,6 +754,7 @@ def snippet_for_list_tasks_v1 # Call the API response = client.list_tasks_v1 + # >LOG # use the class directly puts(response) @@ -738,6 +774,7 @@ def snippet_for_list_transformation_models # Call the API response = client.list_transformation_models + # >LOG # use the class directly puts(response) @@ -757,6 +794,7 @@ def snippet_for_list_transformations # Call the API response = client.list_transformations + # >LOG # use the class directly puts(response) @@ -785,6 +823,7 @@ def snippet_for_push_task ) ) + # >LOG # use the class directly puts(response) @@ -811,6 +850,7 @@ def snippet_for_run_source ) ) + # >LOG # use the class directly puts(response) @@ -830,6 +870,7 @@ def snippet_for_run_task # Call the API response = client.run_task("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -849,6 +890,7 @@ def snippet_for_run_task_v1 # Call the API response = client.run_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -872,6 +914,7 @@ def snippet_for_search_authentications ) ) + # >LOG # use the class directly puts(response) @@ -895,6 +938,7 @@ def snippet_for_search_destinations ) ) + # >LOG # use the class directly puts(response) @@ -916,6 +960,7 @@ def snippet_for_search_sources SourceSearch.new(source_ids: ["6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a"]) ) + # >LOG # use the class directly puts(response) @@ -943,6 +988,7 @@ def snippet_for_search_tasks ) ) + # >LOG # use the class directly puts(response) @@ -970,6 +1016,7 @@ def snippet_for_search_tasks_v1 ) ) + # >LOG # use the class directly puts(response) @@ -997,6 +1044,7 @@ def snippet_for_search_transformations ) ) + # >LOG # use the class directly puts(response) @@ -1005,6 +1053,20 @@ def snippet_for_search_transformations # SEPARATOR< end +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::IngestionClient.create("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end + # Snippet for the triggerDockerSourceDiscover method. # # triggerDockerSourceDiscover @@ -1016,6 +1078,7 @@ def snippet_for_trigger_docker_source_discover # Call the API response = client.trigger_docker_source_discover("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG # use the class directly puts(response) @@ -1035,6 +1098,7 @@ def snippet_for_try_transformation # Call the API response = client.try_transformation(TransformationTry.new(code: "foo", sample_record: {bar: "baz"})) + # >LOG # use the class directly puts(response) @@ -1057,6 +1121,7 @@ def snippet_for_try_transformation_before_update TransformationTry.new(code: "foo", sample_record: {bar: "baz"}) ) + # >LOG # use the class directly puts(response) @@ -1079,6 +1144,7 @@ def snippet_for_update_authentication AuthenticationUpdate.new(name: "newName") ) + # >LOG # use the class directly puts(response) @@ -1098,6 +1164,7 @@ def snippet_for_update_destination # Call the API response = client.update_destination("6c02aeb1-775e-418e-870b-1faccd4b2c0f", DestinationUpdate.new(name: "newName")) + # >LOG # use the class directly puts(response) @@ -1117,6 +1184,7 @@ def snippet_for_update_source # Call the API response = client.update_source("6c02aeb1-775e-418e-870b-1faccd4b2c0f", SourceUpdate.new(name: "newName")) + # >LOG # use the class directly puts(response) @@ -1139,6 +1207,7 @@ def snippet_for_update_task TaskUpdate.new(enabled: false, cron: "* * * * *") ) + # >LOG # use the class directly puts(response) @@ -1158,6 +1227,7 @@ def snippet_for_update_task_v1 # Call the API response = client.update_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f", TaskUpdateV1.new(enabled: false)) + # >LOG # use the class directly puts(response) @@ -1180,6 +1250,7 @@ def snippet_for_update_transformation TransformationCreate.new(code: "foo", name: "bar", description: "baz") ) + # >LOG # use the class directly puts(response) @@ -1211,6 +1282,7 @@ def snippet_for_validate_source ) ) + # >LOG # use the class directly puts(response) @@ -1233,6 +1305,7 @@ def snippet_for_validate_source_before_update SourceUpdate.new(name: "newName") ) + # >LOG # use the class directly puts(response) diff --git a/snippets/ruby/insights.rb b/snippets/ruby/insights.rb index 4bd67b9167..93fea9c33e 100644 --- a/snippets/ruby/insights.rb +++ b/snippets/ruby/insights.rb @@ -15,6 +15,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -34,6 +35,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -53,6 +55,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -72,6 +75,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -89,13 +93,8 @@ def snippet_for_delete_user_token client = Algolia::InsightsClient.create("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") # Call the API - response = client.delete_user_token("test-user-1") - - # use the class directly - puts(response) - - # print the JSON response - puts(response.to_json) + client.delete_user_token("test-user-1") + # >LOG # SEPARATOR< end @@ -126,6 +125,7 @@ def snippet_for_push_events ) ) + # >LOG # use the class directly puts(response) @@ -133,3 +133,17 @@ def snippet_for_push_events puts(response.to_json) # SEPARATOR< end + +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::InsightsClient.create("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end diff --git a/snippets/ruby/monitoring.rb b/snippets/ruby/monitoring.rb index b8dc011afa..7bde8e37f7 100644 --- a/snippets/ruby/monitoring.rb +++ b/snippets/ruby/monitoring.rb @@ -15,6 +15,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -34,6 +35,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -53,6 +55,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -72,6 +75,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -91,6 +95,7 @@ def snippet_for_get_cluster_incidents # Call the API response = client.get_cluster_incidents("c1-de") + # >LOG # use the class directly puts(response) @@ -110,6 +115,7 @@ def snippet_for_get_cluster_status # Call the API response = client.get_cluster_status("c1-de") + # >LOG # use the class directly puts(response) @@ -129,6 +135,7 @@ def snippet_for_get_incidents # Call the API response = client.get_incidents + # >LOG # use the class directly puts(response) @@ -148,6 +155,7 @@ def snippet_for_get_indexing_time # Call the API response = client.get_indexing_time("c1-de") + # >LOG # use the class directly puts(response) @@ -167,6 +175,7 @@ def snippet_for_get_latency # Call the API response = client.get_latency("c1-de") + # >LOG # use the class directly puts(response) @@ -186,6 +195,7 @@ def snippet_for_get_metrics # Call the API response = client.get_metrics("avg_build_time", "minute") + # >LOG # use the class directly puts(response) @@ -205,6 +215,7 @@ def snippet_for_get_reachability # Call the API response = client.get_reachability("c1-de") + # >LOG # use the class directly puts(response) @@ -224,6 +235,7 @@ def snippet_for_get_servers # Call the API response = client.get_servers + # >LOG # use the class directly puts(response) @@ -243,6 +255,7 @@ def snippet_for_get_status # Call the API response = client.get_status + # >LOG # use the class directly puts(response) @@ -250,3 +263,17 @@ def snippet_for_get_status puts(response.to_json) # SEPARATOR< end + +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::MonitoringClient.create("YOUR_APP_ID", "YOUR_API_KEY") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end diff --git a/snippets/ruby/personalization.rb b/snippets/ruby/personalization.rb index 5ee433d496..1d602597b5 100644 --- a/snippets/ruby/personalization.rb +++ b/snippets/ruby/personalization.rb @@ -15,6 +15,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -34,6 +35,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -53,6 +55,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -72,6 +75,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -91,6 +95,7 @@ def snippet_for_delete_user_profile # Call the API response = client.delete_user_profile("UserToken") + # >LOG # use the class directly puts(response) @@ -110,6 +115,7 @@ def snippet_for_get_personalization_strategy # Call the API response = client.get_personalization_strategy + # >LOG # use the class directly puts(response) @@ -129,6 +135,7 @@ def snippet_for_get_user_token_profile # Call the API response = client.get_user_token_profile("UserToken") + # >LOG # use the class directly puts(response) @@ -137,6 +144,20 @@ def snippet_for_get_user_token_profile # SEPARATOR< end +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::PersonalizationClient.create("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end + # Snippet for the setPersonalizationStrategy method. # # set setPersonalizationStrategy @@ -154,6 +175,7 @@ def snippet_for_set_personalization_strategy ) ) + # >LOG # use the class directly puts(response) diff --git a/snippets/ruby/query_suggestions.rb b/snippets/ruby/query_suggestions.rb index 7905bf5226..a0ddf08dba 100644 --- a/snippets/ruby/query_suggestions.rb +++ b/snippets/ruby/query_suggestions.rb @@ -28,6 +28,7 @@ def snippet_for_create_config ) ) + # >LOG # use the class directly puts(response) @@ -47,6 +48,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -66,6 +68,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -85,6 +88,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -104,6 +108,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -123,6 +128,7 @@ def snippet_for_delete_config # Call the API response = client.delete_config("") + # >LOG # use the class directly puts(response) @@ -142,6 +148,7 @@ def snippet_for_get_all_configs # Call the API response = client.get_all_configs + # >LOG # use the class directly puts(response) @@ -161,6 +168,7 @@ def snippet_for_get_config # Call the API response = client.get_config("") + # >LOG # use the class directly puts(response) @@ -180,6 +188,7 @@ def snippet_for_get_config_status # Call the API response = client.get_config_status("") + # >LOG # use the class directly puts(response) @@ -199,6 +208,7 @@ def snippet_for_get_log_file # Call the API response = client.get_log_file("") + # >LOG # use the class directly puts(response) @@ -207,6 +217,20 @@ def snippet_for_get_log_file # SEPARATOR< end +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::QuerySuggestionsClient.create("YOUR_APP_ID", "YOUR_API_KEY", "YOUR_APP_ID_REGION") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end + # Snippet for the updateConfig method. # # updateConfig @@ -231,6 +255,7 @@ def snippet_for_update_config ) ) + # >LOG # use the class directly puts(response) diff --git a/snippets/ruby/recommend.rb b/snippets/ruby/recommend.rb index 5c64b29790..0f61e146de 100644 --- a/snippets/ruby/recommend.rb +++ b/snippets/ruby/recommend.rb @@ -15,6 +15,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -34,6 +35,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -53,6 +55,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -72,6 +75,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -91,6 +95,7 @@ def snippet_for_delete_recommend_rule # Call the API response = client.delete_recommend_rule("", "related-products", "objectID") + # >LOG # use the class directly puts(response) @@ -110,6 +115,7 @@ def snippet_for_get_recommend_rule # Call the API response = client.get_recommend_rule("", "related-products", "objectID") + # >LOG # use the class directly puts(response) @@ -129,6 +135,7 @@ def snippet_for_get_recommend_status # Call the API response = client.get_recommend_status("", "related-products", 12345) + # >LOG # use the class directly puts(response) @@ -159,6 +166,7 @@ def snippet_for_get_recommendations ) ) + # >LOG # use the class directly puts(response) @@ -178,6 +186,7 @@ def snippet_for_search_recommend_rules # Call the API response = client.search_recommend_rules("", "related-products") + # >LOG # use the class directly puts(response) @@ -185,3 +194,17 @@ def snippet_for_search_recommend_rules puts(response.to_json) # SEPARATOR< end + +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::RecommendClient.create("YOUR_APP_ID", "YOUR_API_KEY") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end diff --git a/snippets/ruby/search.rb b/snippets/ruby/search.rb index e5389e4a88..ebf4dfac1e 100644 --- a/snippets/ruby/search.rb +++ b/snippets/ruby/search.rb @@ -23,6 +23,7 @@ def snippet_for_add_api_key ) ) + # >LOG # use the class directly puts(response) @@ -42,6 +43,7 @@ def snippet_for_add_or_update_object # Call the API response = client.add_or_update_object("", "uniqueID", {key: "value"}) + # >LOG # use the class directly puts(response) @@ -61,6 +63,7 @@ def snippet_for_append_source # Call the API response = client.append_source(Source.new(source: "theSource", description: "theDescription")) + # >LOG # use the class directly puts(response) @@ -80,6 +83,7 @@ def snippet_for_assign_user_id # Call the API response = client.assign_user_id("userID", AssignUserIdParams.new(cluster: "theCluster")) + # >LOG # use the class directly puts(response) @@ -107,6 +111,7 @@ def snippet_for_batch ) ) + # >LOG # use the class directly puts(response) @@ -129,6 +134,7 @@ def snippet_for_batch1 BatchWriteParams.new(requests: [BatchRequest.new(action: "clear", body: {key: "value"})]) ) + # >LOG # use the class directly puts(response) @@ -151,6 +157,7 @@ def snippet_for_batch2 BatchWriteParams.new(requests: [BatchRequest.new(action: "delete", body: {key: "value"})]) ) + # >LOG # use the class directly puts(response) @@ -173,6 +180,7 @@ def snippet_for_batch3 BatchWriteParams.new(requests: [BatchRequest.new(action: "deleteObject", body: {key: "value"})]) ) + # >LOG # use the class directly puts(response) @@ -195,6 +203,7 @@ def snippet_for_batch4 BatchWriteParams.new(requests: [BatchRequest.new(action: "partialUpdateObject", body: {key: "value"})]) ) + # >LOG # use the class directly puts(response) @@ -217,6 +226,7 @@ def snippet_for_batch5 BatchWriteParams.new(requests: [BatchRequest.new(action: "partialUpdateObjectNoCreate", body: {key: "value"})]) ) + # >LOG # use the class directly puts(response) @@ -239,6 +249,7 @@ def snippet_for_batch6 BatchWriteParams.new(requests: [BatchRequest.new(action: "updateObject", body: {key: "value"})]) ) + # >LOG # use the class directly puts(response) @@ -261,6 +272,7 @@ def snippet_for_batch_assign_user_ids BatchAssignUserIdsParams.new(cluster: "theCluster", users: ["user1", "user2"]) ) + # >LOG # use the class directly puts(response) @@ -298,6 +310,7 @@ def snippet_for_batch_dictionary_entries ) ) + # >LOG # use the class directly puts(response) @@ -323,6 +336,7 @@ def snippet_for_batch_dictionary_entries1 ) ) + # >LOG # use the class directly puts(response) @@ -352,6 +366,7 @@ def snippet_for_batch_dictionary_entries2 ) ) + # >LOG # use the class directly puts(response) @@ -371,6 +386,7 @@ def snippet_for_browse # Call the API response = client.browse("") + # >LOG # use the class directly puts(response) @@ -390,6 +406,7 @@ def snippet_for_clear_objects # Call the API response = client.clear_objects("") + # >LOG # use the class directly puts(response) @@ -409,6 +426,7 @@ def snippet_for_clear_rules # Call the API response = client.clear_rules("") + # >LOG # use the class directly puts(response) @@ -428,6 +446,7 @@ def snippet_for_clear_synonyms # Call the API response = client.clear_synonyms("") + # >LOG # use the class directly puts(response) @@ -447,6 +466,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -466,6 +486,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -485,6 +506,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -504,6 +526,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -523,6 +546,7 @@ def snippet_for_delete_api_key # Call the API response = client.delete_api_key("myTestApiKey") + # >LOG # use the class directly puts(response) @@ -542,6 +566,7 @@ def snippet_for_delete_by # Call the API response = client.delete_by("", DeleteByParams.new(filters: "brand:brandName")) + # >LOG # use the class directly puts(response) @@ -561,6 +586,7 @@ def snippet_for_delete_index # Call the API response = client.delete_index("") + # >LOG # use the class directly puts(response) @@ -580,6 +606,7 @@ def snippet_for_delete_object # Call the API response = client.delete_object("", "uniqueID") + # >LOG # use the class directly puts(response) @@ -599,6 +626,7 @@ def snippet_for_delete_objects # Call the API response = client.delete_objects("", ["1", "2"]) + # >LOG # use the class directly puts(response) @@ -618,6 +646,7 @@ def snippet_for_delete_rule # Call the API response = client.delete_rule("", "id1") + # >LOG # use the class directly puts(response) @@ -637,6 +666,7 @@ def snippet_for_delete_source # Call the API response = client.delete_source("theSource") + # >LOG # use the class directly puts(response) @@ -656,6 +686,7 @@ def snippet_for_delete_synonym # Call the API response = client.delete_synonym("", "id1") + # >LOG # use the class directly puts(response) @@ -678,6 +709,7 @@ def snippet_for_generate_secured_api_key SecuredApiKeyRestrictions.new(valid_until: 2524604400, restrict_indices: ["Movies"]) ) + # >LOG # use the class directly puts(response) @@ -714,6 +746,7 @@ def snippet_for_generate_secured_api_key1 ) ) + # >LOG # use the class directly puts(response) @@ -733,6 +766,7 @@ def snippet_for_get_api_key # Call the API response = client.get_api_key("myTestApiKey") + # >LOG # use the class directly puts(response) @@ -752,6 +786,7 @@ def snippet_for_get_app_task # Call the API response = client.get_app_task(123) + # >LOG # use the class directly puts(response) @@ -771,6 +806,7 @@ def snippet_for_get_dictionary_languages # Call the API response = client.get_dictionary_languages + # >LOG # use the class directly puts(response) @@ -790,6 +826,7 @@ def snippet_for_get_dictionary_settings # Call the API response = client.get_dictionary_settings + # >LOG # use the class directly puts(response) @@ -809,6 +846,7 @@ def snippet_for_get_logs # Call the API response = client.get_logs + # >LOG # use the class directly puts(response) @@ -828,6 +866,7 @@ def snippet_for_get_object # Call the API response = client.get_object("", "uniqueID", ["attr1", "attr2"]) + # >LOG # use the class directly puts(response) @@ -857,6 +896,7 @@ def snippet_for_get_objects ) ) + # >LOG # use the class directly puts(response) @@ -876,6 +916,7 @@ def snippet_for_get_rule # Call the API response = client.get_rule("", "qr-1725004648916") + # >LOG # use the class directly puts(response) @@ -895,6 +936,7 @@ def snippet_for_get_settings # Call the API response = client.get_settings("") + # >LOG # use the class directly puts(response) @@ -914,6 +956,7 @@ def snippet_for_get_sources # Call the API response = client.get_sources + # >LOG # use the class directly puts(response) @@ -933,6 +976,7 @@ def snippet_for_get_synonym # Call the API response = client.get_synonym("", "id1") + # >LOG # use the class directly puts(response) @@ -952,6 +996,7 @@ def snippet_for_get_task # Call the API response = client.get_task("", 123) + # >LOG # use the class directly puts(response) @@ -971,6 +1016,7 @@ def snippet_for_get_top_user_ids # Call the API response = client.get_top_user_ids + # >LOG # use the class directly puts(response) @@ -990,6 +1036,7 @@ def snippet_for_get_user_id # Call the API response = client.get_user_id("uniqueID") + # >LOG # use the class directly puts(response) @@ -1009,6 +1056,7 @@ def snippet_for_has_pending_mappings # Call the API response = client.has_pending_mappings + # >LOG # use the class directly puts(response) @@ -1028,6 +1076,7 @@ def snippet_for_index_exists # Call the API response = client.index_exists("") + # >LOG # use the class directly puts(response) @@ -1047,6 +1096,7 @@ def snippet_for_index_exists1 # Call the API response = client.index_exists("") + # >LOG # use the class directly puts(response) @@ -1066,6 +1116,7 @@ def snippet_for_index_exists2 # Call the API response = client.index_exists("") + # >LOG # use the class directly puts(response) @@ -1085,6 +1136,7 @@ def snippet_for_list_api_keys # Call the API response = client.list_api_keys + # >LOG # use the class directly puts(response) @@ -1104,6 +1156,7 @@ def snippet_for_list_clusters # Call the API response = client.list_clusters + # >LOG # use the class directly puts(response) @@ -1123,6 +1176,7 @@ def snippet_for_list_indices # Call the API response = client.list_indices + # >LOG # use the class directly puts(response) @@ -1142,6 +1196,7 @@ def snippet_for_list_user_ids # Call the API response = client.list_user_ids + # >LOG # use the class directly puts(response) @@ -1165,6 +1220,7 @@ def snippet_for_multiple_batch ) ) + # >LOG # use the class directly puts(response) @@ -1187,6 +1243,7 @@ def snippet_for_operation_index OperationIndexParams.new(operation: "move", destination: "", scope: ["rules", "settings"]) ) + # >LOG # use the class directly puts(response) @@ -1209,6 +1266,7 @@ def snippet_for_operation_index1 OperationIndexParams.new(operation: "copy", destination: "") ) + # >LOG # use the class directly puts(response) @@ -1231,6 +1289,7 @@ def snippet_for_operation_index2 OperationIndexParams.new(operation: "move", destination: "") ) + # >LOG # use the class directly puts(response) @@ -1250,6 +1309,7 @@ def snippet_for_partial_update_object # Call the API response = client.partial_update_object("", "uniqueID", {attributeId: "new value"}) + # >LOG # use the class directly puts(response) @@ -1273,6 +1333,7 @@ def snippet_for_partial_update_objects true ) + # >LOG # use the class directly puts(response) @@ -1296,6 +1357,7 @@ def snippet_for_partial_update_objects1 false ) + # >LOG # use the class directly puts(response) @@ -1315,6 +1377,7 @@ def snippet_for_remove_user_id # Call the API response = client.remove_user_id("uniqueID") + # >LOG # use the class directly puts(response) @@ -1349,6 +1412,7 @@ def snippet_for_replace_all_objects 3 ) + # >LOG # use the class directly puts(response) @@ -1368,6 +1432,7 @@ def snippet_for_replace_sources # Call the API response = client.replace_sources([Source.new(source: "theSource", description: "theDescription")]) + # >LOG # use the class directly puts(response) @@ -1387,6 +1452,7 @@ def snippet_for_restore_api_key # Call the API response = client.restore_api_key("myApiKey") + # >LOG # use the class directly puts(response) @@ -1406,6 +1472,7 @@ def snippet_for_save_object # Call the API response = client.save_object("", {objectID: "id", test: "val"}) + # >LOG # use the class directly puts(response) @@ -1428,6 +1495,7 @@ def snippet_for_save_objects [{objectID: "1", name: "Adam"}, {objectID: "2", name: "Benoit"}] ) + # >LOG # use the class directly puts(response) @@ -1450,6 +1518,7 @@ def snippet_for_save_objects1 [{objectID: "1", name: "Adam"}, {objectID: "2", name: "Benoit"}] ) + # >LOG # use the class directly puts(response) @@ -1473,6 +1542,7 @@ def snippet_for_save_rule Rule.new(object_id: "id1", conditions: [Condition.new(pattern: "apple", anchoring: "contains")]) ) + # >LOG # use the class directly puts(response) @@ -1500,6 +1570,7 @@ def snippet_for_save_rules true ) + # >LOG # use the class directly puts(response) @@ -1524,6 +1595,7 @@ def snippet_for_save_synonym true ) + # >LOG # use the class directly puts(response) @@ -1551,6 +1623,7 @@ def snippet_for_save_synonyms true ) + # >LOG # use the class directly puts(response) @@ -1574,6 +1647,7 @@ def snippet_for_search ) ) + # >LOG # use the class directly puts(response) @@ -1599,6 +1673,7 @@ def snippet_for_search1 ) ) + # >LOG # use the class directly puts(response) @@ -1628,6 +1703,7 @@ def snippet_for_search2 ) ) + # >LOG # use the class directly puts(response) @@ -1653,6 +1729,7 @@ def snippet_for_search3 ) ) + # >LOG # use the class directly puts(response) @@ -1676,6 +1753,7 @@ def snippet_for_search4 ) ) + # >LOG # use the class directly puts(response) @@ -1699,6 +1777,7 @@ def snippet_for_search5 ) ) + # >LOG # use the class directly puts(response) @@ -1718,6 +1797,7 @@ def snippet_for_search_dictionary_entries # Call the API response = client.search_dictionary_entries("stopwords", SearchDictionaryEntriesParams.new(query: "about")) + # >LOG # use the class directly puts(response) @@ -1737,6 +1817,7 @@ def snippet_for_search_for_facet_values # Call the API response = client.search_for_facet_values("", "facetName") + # >LOG # use the class directly puts(response) @@ -1756,6 +1837,7 @@ def snippet_for_search_rules # Call the API response = client.search_rules("", SearchRulesParams.new(query: "zorro")) + # >LOG # use the class directly puts(response) @@ -1775,6 +1857,7 @@ def snippet_for_search_single_index # Call the API response = client.search_single_index("") + # >LOG # use the class directly puts(response) @@ -1794,6 +1877,7 @@ def snippet_for_search_synonyms # Call the API response = client.search_synonyms("") + # >LOG # use the class directly puts(response) @@ -1815,6 +1899,7 @@ def snippet_for_search_user_ids SearchUserIdsParams.new(query: "test", cluster_name: "theClusterName", page: 5, hits_per_page: 10) ) + # >LOG # use the class directly puts(response) @@ -1823,6 +1908,20 @@ def snippet_for_search_user_ids # SEPARATOR< end +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::SearchClient.create("YOUR_APP_ID", "YOUR_API_KEY") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end + # Snippet for the setDictionarySettings method. # # get setDictionarySettings results with minimal parameters @@ -1838,6 +1937,7 @@ def snippet_for_set_dictionary_settings ) ) + # >LOG # use the class directly puts(response) @@ -1860,6 +1960,7 @@ def snippet_for_set_settings IndexSettings.new(attributes_for_faceting: ["actor", "filterOnly(category)", "searchable(publisher)"]) ) + # >LOG # use the class directly puts(response) @@ -1882,6 +1983,7 @@ def snippet_for_update_api_key ApiKey.new(acl: ["search", "addObject"], validity: 300, max_queries_per_ip_per_hour: 100, max_hits_per_query: 20) ) + # >LOG # use the class directly puts(response) @@ -1901,6 +2003,7 @@ def snippet_for_wait_for_api_key # Call the API response = client.wait_for_api_key("api-key-add-operation-test-ruby", "add") + # >LOG # use the class directly puts(response) @@ -1932,6 +2035,7 @@ def snippet_for_wait_for_api_key1 ) ) + # >LOG # use the class directly puts(response) @@ -1951,6 +2055,7 @@ def snippet_for_wait_for_api_key2 # Call the API response = client.wait_for_api_key("api-key-delete-operation-test-ruby", "delete") + # >LOG # use the class directly puts(response) @@ -1970,6 +2075,7 @@ def snippet_for_wait_for_app_task # Call the API response = client.wait_for_app_task(123) + # >LOG # use the class directly puts(response) @@ -1989,6 +2095,7 @@ def snippet_for_wait_for_task # Call the API response = client.wait_for_task("", 123) + # >LOG # use the class directly puts(response) diff --git a/snippets/ruby/usage.rb b/snippets/ruby/usage.rb index 123a2bd257..417b14e6e7 100644 --- a/snippets/ruby/usage.rb +++ b/snippets/ruby/usage.rb @@ -15,6 +15,7 @@ def snippet_for_custom_delete # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -34,6 +35,7 @@ def snippet_for_custom_get # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -53,6 +55,7 @@ def snippet_for_custom_post # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -72,6 +75,7 @@ def snippet_for_custom_put # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -96,6 +100,7 @@ def snippet_for_get_index_usage "2024-04-05T12:46:43Z" ) + # >LOG # use the class directly puts(response) @@ -115,6 +120,7 @@ def snippet_for_get_usage # Call the API response = client.get_usage("queries_operations", "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z") + # >LOG # use the class directly puts(response) @@ -122,3 +128,17 @@ def snippet_for_get_usage puts(response.to_json) # SEPARATOR< end + +# Snippet for the setClientApiKey method. +# +# switch API key +def snippet_for_set_client_api_key + # >SEPARATOR setClientApiKey default + # Initialize the client + client = Algolia::UsageClient.create("YOUR_APP_ID", "YOUR_API_KEY") + + # Call the API + client.set_client_api_key("updated-api-key") + # >LOG + # SEPARATOR< +end diff --git a/snippets/scala/src/main/scala/Abtesting.scala b/snippets/scala/src/main/scala/Abtesting.scala index 4fc4060b2f..a67738964c 100644 --- a/snippets/scala/src/main/scala/Abtesting.scala +++ b/snippets/scala/src/main/scala/Abtesting.scala @@ -43,6 +43,7 @@ class SnippetAbtestingClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -62,6 +63,7 @@ class SnippetAbtestingClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -81,6 +83,7 @@ class SnippetAbtestingClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -100,6 +103,7 @@ class SnippetAbtestingClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -119,6 +123,7 @@ class SnippetAbtestingClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -138,6 +143,7 @@ class SnippetAbtestingClient { id = 42 ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -157,6 +163,7 @@ class SnippetAbtestingClient { id = 42 ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -175,6 +182,7 @@ class SnippetAbtestingClient { val response = client.listABTests( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -208,6 +216,7 @@ class SnippetAbtestingClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -227,6 +236,7 @@ class SnippetAbtestingClient { id = 42 ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/Analytics.scala b/snippets/scala/src/main/scala/Analytics.scala index 0dea989bcb..b77ebf73b1 100644 --- a/snippets/scala/src/main/scala/Analytics.scala +++ b/snippets/scala/src/main/scala/Analytics.scala @@ -30,6 +30,7 @@ class SnippetAnalyticsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -49,6 +50,7 @@ class SnippetAnalyticsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -68,6 +70,7 @@ class SnippetAnalyticsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -87,6 +90,7 @@ class SnippetAnalyticsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -106,6 +110,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -125,6 +130,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -144,6 +150,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -163,6 +170,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -182,6 +190,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -201,6 +210,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -220,6 +230,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -239,6 +250,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -258,6 +270,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -277,6 +290,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -296,6 +310,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -315,6 +330,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -334,6 +350,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -353,6 +370,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -372,6 +390,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -392,6 +411,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -411,6 +431,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -430,6 +451,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -449,6 +471,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -468,6 +491,7 @@ class SnippetAnalyticsClient { index = "index" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/Ingestion.scala b/snippets/scala/src/main/scala/Ingestion.scala index f55d718fb7..7b918525df 100644 --- a/snippets/scala/src/main/scala/Ingestion.scala +++ b/snippets/scala/src/main/scala/Ingestion.scala @@ -38,6 +38,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -64,6 +65,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -95,6 +97,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -118,6 +121,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -144,6 +148,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -167,6 +172,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -186,6 +192,7 @@ class SnippetIngestionClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -205,6 +212,7 @@ class SnippetIngestionClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -224,6 +232,7 @@ class SnippetIngestionClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -243,6 +252,7 @@ class SnippetIngestionClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -262,6 +272,7 @@ class SnippetIngestionClient { authenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -281,6 +292,7 @@ class SnippetIngestionClient { destinationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -300,6 +312,7 @@ class SnippetIngestionClient { sourceID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -319,6 +332,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -338,6 +352,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -357,6 +372,7 @@ class SnippetIngestionClient { transformationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -376,6 +392,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -395,6 +412,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -414,6 +432,7 @@ class SnippetIngestionClient { taskID = "76ab4c2a-ce17-496f-b7a6-506dc59ee498" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -433,6 +452,7 @@ class SnippetIngestionClient { taskID = "76ab4c2a-ce17-496f-b7a6-506dc59ee498" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -456,6 +476,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -475,6 +496,7 @@ class SnippetIngestionClient { authenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -494,6 +516,7 @@ class SnippetIngestionClient { destinationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -514,6 +537,7 @@ class SnippetIngestionClient { eventID = "6c02aeb1-775e-418e-870b-1faccd4b2c0c" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -533,6 +557,7 @@ class SnippetIngestionClient { runID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -552,6 +577,7 @@ class SnippetIngestionClient { sourceID = "75eeb306-51d3-4e5e-a279-3c92bd8893ac" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -571,6 +597,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -590,6 +617,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -609,6 +637,7 @@ class SnippetIngestionClient { transformationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -627,6 +656,7 @@ class SnippetIngestionClient { val response = client.listAuthentications( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -645,6 +675,7 @@ class SnippetIngestionClient { val response = client.listDestinations( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -664,6 +695,7 @@ class SnippetIngestionClient { runID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -682,6 +714,7 @@ class SnippetIngestionClient { val response = client.listRuns( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -700,6 +733,7 @@ class SnippetIngestionClient { val response = client.listSources( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -718,6 +752,7 @@ class SnippetIngestionClient { val response = client.listTasks( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -736,6 +771,7 @@ class SnippetIngestionClient { val response = client.listTasksV1( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -754,6 +790,7 @@ class SnippetIngestionClient { val response = client.listTransformationModels( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -772,6 +809,7 @@ class SnippetIngestionClient { val response = client.listTransformations( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -804,6 +842,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -830,6 +869,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -849,6 +889,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -868,6 +909,7 @@ class SnippetIngestionClient { taskID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -889,6 +931,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -910,6 +953,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -931,6 +975,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -956,6 +1001,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -981,6 +1027,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1006,6 +1053,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1025,6 +1073,7 @@ class SnippetIngestionClient { sourceID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1047,6 +1096,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1070,6 +1120,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1092,6 +1143,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1114,6 +1166,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1136,6 +1189,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1159,6 +1213,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1181,6 +1236,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1205,6 +1261,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1238,6 +1295,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1260,6 +1318,7 @@ class SnippetIngestionClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/Insights.scala b/snippets/scala/src/main/scala/Insights.scala index 2aab33c3b5..2317c96370 100644 --- a/snippets/scala/src/main/scala/Insights.scala +++ b/snippets/scala/src/main/scala/Insights.scala @@ -30,6 +30,7 @@ class SnippetInsightsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -49,6 +50,7 @@ class SnippetInsightsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -68,6 +70,7 @@ class SnippetInsightsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -87,6 +90,7 @@ class SnippetInsightsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -102,12 +106,11 @@ class SnippetInsightsClient { val client = InsightsClient(appId = "YOUR_APP_ID", apiKey = "YOUR_API_KEY", region = Option("YOUR_APP_ID_REGION")) // Call the API - val response = client.deleteUserToken( + client.deleteUserToken( userToken = "test-user-1" ) - // Use the response - val value = Await.result(response, Duration(100, "sec")) + // >LOG // SEPARATOR< } @@ -139,6 +142,7 @@ class SnippetInsightsClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/Monitoring.scala b/snippets/scala/src/main/scala/Monitoring.scala index f96c960cb7..eaa64baad3 100644 --- a/snippets/scala/src/main/scala/Monitoring.scala +++ b/snippets/scala/src/main/scala/Monitoring.scala @@ -30,6 +30,7 @@ class SnippetMonitoringClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -49,6 +50,7 @@ class SnippetMonitoringClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -68,6 +70,7 @@ class SnippetMonitoringClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -87,6 +90,7 @@ class SnippetMonitoringClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -106,6 +110,7 @@ class SnippetMonitoringClient { clusters = "c1-de" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -125,6 +130,7 @@ class SnippetMonitoringClient { clusters = "c1-de" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -143,6 +149,7 @@ class SnippetMonitoringClient { val response = client.getIncidents( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -162,6 +169,7 @@ class SnippetMonitoringClient { clusters = "c1-de" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -181,6 +189,7 @@ class SnippetMonitoringClient { clusters = "c1-de" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -201,6 +210,7 @@ class SnippetMonitoringClient { period = Period.withName("minute") ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -220,6 +230,7 @@ class SnippetMonitoringClient { clusters = "c1-de" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -238,6 +249,7 @@ class SnippetMonitoringClient { val response = client.getServers( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -256,6 +268,7 @@ class SnippetMonitoringClient { val response = client.getStatus( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/Personalization.scala b/snippets/scala/src/main/scala/Personalization.scala index 2d452be3fd..acd23e061d 100644 --- a/snippets/scala/src/main/scala/Personalization.scala +++ b/snippets/scala/src/main/scala/Personalization.scala @@ -30,6 +30,7 @@ class SnippetPersonalizationClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -49,6 +50,7 @@ class SnippetPersonalizationClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -68,6 +70,7 @@ class SnippetPersonalizationClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -87,6 +90,7 @@ class SnippetPersonalizationClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -106,6 +110,7 @@ class SnippetPersonalizationClient { userToken = "UserToken" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -124,6 +129,7 @@ class SnippetPersonalizationClient { val response = client.getPersonalizationStrategy( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -143,6 +149,7 @@ class SnippetPersonalizationClient { userToken = "UserToken" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -177,6 +184,7 @@ class SnippetPersonalizationClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/QuerySuggestions.scala b/snippets/scala/src/main/scala/QuerySuggestions.scala index c397eeae81..d646faa777 100644 --- a/snippets/scala/src/main/scala/QuerySuggestions.scala +++ b/snippets/scala/src/main/scala/QuerySuggestions.scala @@ -47,6 +47,7 @@ class SnippetQuerySuggestionsClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -66,6 +67,7 @@ class SnippetQuerySuggestionsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -85,6 +87,7 @@ class SnippetQuerySuggestionsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -104,6 +107,7 @@ class SnippetQuerySuggestionsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -123,6 +127,7 @@ class SnippetQuerySuggestionsClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -142,6 +147,7 @@ class SnippetQuerySuggestionsClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -160,6 +166,7 @@ class SnippetQuerySuggestionsClient { val response = client.getAllConfigs( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -179,6 +186,7 @@ class SnippetQuerySuggestionsClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -198,6 +206,7 @@ class SnippetQuerySuggestionsClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -217,6 +226,7 @@ class SnippetQuerySuggestionsClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -253,6 +263,7 @@ class SnippetQuerySuggestionsClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/Recommend.scala b/snippets/scala/src/main/scala/Recommend.scala index 9381eba838..d1299b3de3 100644 --- a/snippets/scala/src/main/scala/Recommend.scala +++ b/snippets/scala/src/main/scala/Recommend.scala @@ -30,6 +30,7 @@ class SnippetRecommendClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -49,6 +50,7 @@ class SnippetRecommendClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -68,6 +70,7 @@ class SnippetRecommendClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -87,6 +90,7 @@ class SnippetRecommendClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -108,6 +112,7 @@ class SnippetRecommendClient { objectID = "objectID" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -129,6 +134,7 @@ class SnippetRecommendClient { objectID = "objectID" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -150,6 +156,7 @@ class SnippetRecommendClient { taskID = 12345L ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -178,6 +185,7 @@ class SnippetRecommendClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -198,6 +206,7 @@ class SnippetRecommendClient { model = RecommendModels.withName("related-products") ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/Search.scala b/snippets/scala/src/main/scala/Search.scala index efea6bbbf1..639d56d38c 100644 --- a/snippets/scala/src/main/scala/Search.scala +++ b/snippets/scala/src/main/scala/Search.scala @@ -37,6 +37,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -58,6 +59,7 @@ class SnippetSearchClient { body = JObject(List(JField("key", JString("value")))) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -80,6 +82,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -102,6 +105,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -133,6 +137,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -160,6 +165,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -187,6 +193,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -214,6 +221,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -241,6 +249,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -268,6 +277,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -295,6 +305,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -318,6 +329,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -353,6 +365,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -383,6 +396,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -414,6 +428,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -433,6 +448,7 @@ class SnippetSearchClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -452,6 +468,7 @@ class SnippetSearchClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -471,6 +488,7 @@ class SnippetSearchClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -490,6 +508,7 @@ class SnippetSearchClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -509,6 +528,7 @@ class SnippetSearchClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -528,6 +548,7 @@ class SnippetSearchClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -547,6 +568,7 @@ class SnippetSearchClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -566,6 +588,7 @@ class SnippetSearchClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -585,6 +608,7 @@ class SnippetSearchClient { key = "myTestApiKey" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -607,6 +631,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -626,6 +651,7 @@ class SnippetSearchClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -646,6 +672,7 @@ class SnippetSearchClient { objectID = "uniqueID" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -666,6 +693,7 @@ class SnippetSearchClient { objectID = "id1" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -685,6 +713,7 @@ class SnippetSearchClient { source = "theSource" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -705,6 +734,7 @@ class SnippetSearchClient { objectID = "id1" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -724,6 +754,7 @@ class SnippetSearchClient { key = "myTestApiKey" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -743,6 +774,7 @@ class SnippetSearchClient { taskID = 123L ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -761,6 +793,7 @@ class SnippetSearchClient { val response = client.getDictionaryLanguages( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -779,6 +812,7 @@ class SnippetSearchClient { val response = client.getDictionarySettings( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -797,6 +831,7 @@ class SnippetSearchClient { val response = client.getLogs( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -818,6 +853,7 @@ class SnippetSearchClient { attributesToRetrieve = Some(Seq("attr1", "attr2")) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -845,6 +881,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -865,6 +902,7 @@ class SnippetSearchClient { objectID = "qr-1725004648916" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -884,6 +922,7 @@ class SnippetSearchClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -902,6 +941,7 @@ class SnippetSearchClient { val response = client.getSources( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -922,6 +962,7 @@ class SnippetSearchClient { objectID = "id1" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -942,6 +983,7 @@ class SnippetSearchClient { taskID = 123L ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -960,6 +1002,7 @@ class SnippetSearchClient { val response = client.getTopUserIds( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -979,6 +1022,7 @@ class SnippetSearchClient { userID = "uniqueID" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -997,6 +1041,7 @@ class SnippetSearchClient { val response = client.hasPendingMappings( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1015,6 +1060,7 @@ class SnippetSearchClient { val response = client.listApiKeys( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1033,6 +1079,7 @@ class SnippetSearchClient { val response = client.listClusters( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1051,6 +1098,7 @@ class SnippetSearchClient { val response = client.listIndices( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1069,6 +1117,7 @@ class SnippetSearchClient { val response = client.listUserIds( ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1096,6 +1145,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1120,6 +1170,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1143,6 +1194,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1166,6 +1218,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1187,6 +1240,7 @@ class SnippetSearchClient { attributesToUpdate = JObject(List(JField("attributeId", JString("new value")))) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1206,6 +1260,7 @@ class SnippetSearchClient { userID = "uniqueID" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1230,6 +1285,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1249,6 +1305,7 @@ class SnippetSearchClient { key = "myApiKey" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1269,6 +1326,7 @@ class SnippetSearchClient { body = JObject(List(JField("objectID", JString("id")), JField("test", JString("val")))) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1300,6 +1358,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1345,6 +1404,7 @@ class SnippetSearchClient { clearExistingRules = Some(true) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1371,6 +1431,7 @@ class SnippetSearchClient { forwardToReplicas = Some(true) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1405,6 +1466,7 @@ class SnippetSearchClient { replaceExistingSynonyms = Some(true) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1432,6 +1494,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1459,6 +1522,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1486,6 +1550,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1513,6 +1578,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1540,6 +1606,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1567,6 +1634,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1589,6 +1657,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1609,6 +1678,7 @@ class SnippetSearchClient { facetName = "facetName" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1633,6 +1703,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1652,6 +1723,7 @@ class SnippetSearchClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1671,6 +1743,7 @@ class SnippetSearchClient { indexName = "" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1695,6 +1768,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1718,6 +1792,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1740,6 +1815,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -1765,6 +1841,7 @@ class SnippetSearchClient { ) ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/scala/src/main/scala/Usage.scala b/snippets/scala/src/main/scala/Usage.scala index 915cf7fe2d..eec48fcec5 100644 --- a/snippets/scala/src/main/scala/Usage.scala +++ b/snippets/scala/src/main/scala/Usage.scala @@ -30,6 +30,7 @@ class SnippetUsageClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -49,6 +50,7 @@ class SnippetUsageClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -68,6 +70,7 @@ class SnippetUsageClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -87,6 +90,7 @@ class SnippetUsageClient { path = "test/minimal" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -109,6 +113,7 @@ class SnippetUsageClient { endDate = "2024-04-05T12:46:43Z" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< @@ -130,6 +135,7 @@ class SnippetUsageClient { endDate = "2024-04-05T12:46:43Z" ) + // >LOG // Use the response val value = Await.result(response, Duration(100, "sec")) // SEPARATOR< diff --git a/snippets/swift/Sources/Abtesting.swift b/snippets/swift/Sources/Abtesting.swift index 1ab8bca27e..96bacd285b 100644 --- a/snippets/swift/Sources/Abtesting.swift +++ b/snippets/swift/Sources/Abtesting.swift @@ -24,6 +24,7 @@ final class AbtestingClientSnippet { ], endAt: "2022-12-31T00:00:00.000Z" )) + // >LOG // SEPARATOR< } @@ -37,6 +38,7 @@ final class AbtestingClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -50,6 +52,7 @@ final class AbtestingClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -63,6 +66,7 @@ final class AbtestingClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -76,6 +80,7 @@ final class AbtestingClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -89,6 +94,7 @@ final class AbtestingClientSnippet { // Call the API let response = try await client.deleteABTest(id: 42) + // >LOG // SEPARATOR< } @@ -102,6 +108,7 @@ final class AbtestingClientSnippet { // Call the API let response = try await client.getABTest(id: 42) + // >LOG // SEPARATOR< } @@ -115,6 +122,7 @@ final class AbtestingClientSnippet { // Call the API let response = try await client.listABTests() + // >LOG // SEPARATOR< } @@ -136,6 +144,21 @@ final class AbtestingClientSnippet { scheduledAt: "2022-11-31T00:00:00.000Z", endAt: "2022-12-31T00:00:00.000Z" )) + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } @@ -149,6 +172,7 @@ final class AbtestingClientSnippet { // Call the API let response = try await client.stopABTest(id: 42) + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/Analytics.swift b/snippets/swift/Sources/Analytics.swift index 85a1c6bcd4..2ad1aad39c 100644 --- a/snippets/swift/Sources/Analytics.swift +++ b/snippets/swift/Sources/Analytics.swift @@ -17,6 +17,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -30,6 +31,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -43,6 +45,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -56,6 +59,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -69,6 +73,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getAddToCartRate(index: "index") + // >LOG // SEPARATOR< } @@ -82,6 +87,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getAverageClickPosition(index: "index") + // >LOG // SEPARATOR< } @@ -95,6 +101,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getClickPositions(index: "index") + // >LOG // SEPARATOR< } @@ -108,6 +115,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getClickThroughRate(index: "index") + // >LOG // SEPARATOR< } @@ -121,6 +129,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getConversionRate(index: "index") + // >LOG // SEPARATOR< } @@ -134,6 +143,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getNoClickRate(index: "index") + // >LOG // SEPARATOR< } @@ -147,6 +157,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getNoResultsRate(index: "index") + // >LOG // SEPARATOR< } @@ -160,6 +171,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getPurchaseRate(index: "index") + // >LOG // SEPARATOR< } @@ -173,6 +185,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getRevenue(index: "index") + // >LOG // SEPARATOR< } @@ -186,6 +199,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getSearchesCount(index: "index") + // >LOG // SEPARATOR< } @@ -199,6 +213,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getSearchesNoClicks(index: "index") + // >LOG // SEPARATOR< } @@ -212,6 +227,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getSearchesNoResults(index: "index") + // >LOG // SEPARATOR< } @@ -225,6 +241,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getStatus(index: "index") + // >LOG // SEPARATOR< } @@ -238,6 +255,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getTopCountries(index: "index") + // >LOG // SEPARATOR< } @@ -251,6 +269,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getTopFilterAttributes(index: "index") + // >LOG // SEPARATOR< } @@ -264,6 +283,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getTopFilterForAttribute(attribute: "myAttribute", index: "index") + // >LOG // SEPARATOR< } @@ -277,6 +297,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getTopFiltersNoResults(index: "index") + // >LOG // SEPARATOR< } @@ -290,6 +311,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getTopHits(index: "index") + // >LOG // SEPARATOR< } @@ -303,6 +325,7 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getTopSearches(index: "index") + // >LOG // SEPARATOR< } @@ -316,6 +339,21 @@ final class AnalyticsClientSnippet { // Call the API let response = try await client.getUsersCount(index: "index") + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/Ingestion.swift b/snippets/swift/Sources/Ingestion.swift index fca28bd116..29256fd293 100644 --- a/snippets/swift/Sources/Ingestion.swift +++ b/snippets/swift/Sources/Ingestion.swift @@ -21,6 +21,7 @@ final class IngestionClientSnippet { name: "authName", input: AuthInput.authOAuth(AuthOAuth(url: "http://test.oauth", clientId: "myID", clientSecret: "mySecret")) )) + // >LOG // SEPARATOR< } @@ -39,6 +40,7 @@ final class IngestionClientSnippet { input: DestinationInput.destinationIndexName(DestinationIndexName(indexName: "")), authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f" )) + // >LOG // SEPARATOR< } @@ -62,6 +64,7 @@ final class IngestionClientSnippet { )), authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f" )) + // >LOG // SEPARATOR< } @@ -79,6 +82,7 @@ final class IngestionClientSnippet { destinationID: "destinationName", action: ActionType.replace )) + // >LOG // SEPARATOR< } @@ -97,6 +101,7 @@ final class IngestionClientSnippet { trigger: TaskCreateTrigger.onDemandTriggerInput(OnDemandTriggerInput(type: OnDemandTriggerType.onDemand)), action: ActionType.replace )) + // >LOG // SEPARATOR< } @@ -114,6 +119,7 @@ final class IngestionClientSnippet { name: "bar", description: "baz" )) + // >LOG // SEPARATOR< } @@ -127,6 +133,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -140,6 +147,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -153,6 +161,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -166,6 +175,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -179,6 +189,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.deleteAuthentication(authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -192,6 +203,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.deleteDestination(destinationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -205,6 +217,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.deleteSource(sourceID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -218,6 +231,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.deleteTask(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -231,6 +245,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.deleteTaskV1(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -244,6 +259,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.deleteTransformation(transformationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -257,6 +273,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.disableTask(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -270,6 +287,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.disableTaskV1(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -283,6 +301,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.enableTask(taskID: "76ab4c2a-ce17-496f-b7a6-506dc59ee498") + // >LOG // SEPARATOR< } @@ -296,6 +315,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.enableTaskV1(taskID: "76ab4c2a-ce17-496f-b7a6-506dc59ee498") + // >LOG // SEPARATOR< } @@ -313,6 +333,7 @@ final class IngestionClientSnippet { id: "foo", userPrompt: "fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing" )) + // >LOG // SEPARATOR< } @@ -326,6 +347,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.getAuthentication(authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -339,6 +361,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.getDestination(destinationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -355,6 +378,7 @@ final class IngestionClientSnippet { runID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", eventID: "6c02aeb1-775e-418e-870b-1faccd4b2c0c" ) + // >LOG // SEPARATOR< } @@ -368,6 +392,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.getRun(runID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -381,6 +406,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.getSource(sourceID: "75eeb306-51d3-4e5e-a279-3c92bd8893ac") + // >LOG // SEPARATOR< } @@ -394,6 +420,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.getTask(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -407,6 +434,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.getTaskV1(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -420,6 +448,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.getTransformation(transformationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -433,6 +462,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listAuthentications() + // >LOG // SEPARATOR< } @@ -446,6 +476,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listDestinations() + // >LOG // SEPARATOR< } @@ -459,6 +490,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listEvents(runID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -472,6 +504,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listRuns() + // >LOG // SEPARATOR< } @@ -485,6 +518,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listSources() + // >LOG // SEPARATOR< } @@ -498,6 +532,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listTasks() + // >LOG // SEPARATOR< } @@ -511,6 +546,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listTasksV1() + // >LOG // SEPARATOR< } @@ -524,6 +560,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listTransformationModels() + // >LOG // SEPARATOR< } @@ -537,6 +574,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.listTransformations() + // >LOG // SEPARATOR< } @@ -567,6 +605,7 @@ final class IngestionClientSnippet { ] ) ) + // >LOG // SEPARATOR< } @@ -587,6 +626,7 @@ final class IngestionClientSnippet { entityType: EntityType.product ) ) + // >LOG // SEPARATOR< } @@ -600,6 +640,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.runTask(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -613,6 +654,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.runTaskV1(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -630,6 +672,7 @@ final class IngestionClientSnippet { "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a", ])) + // >LOG // SEPARATOR< } @@ -646,6 +689,7 @@ final class IngestionClientSnippet { "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a", ])) + // >LOG // SEPARATOR< } @@ -662,6 +706,7 @@ final class IngestionClientSnippet { "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a", ])) + // >LOG // SEPARATOR< } @@ -679,6 +724,7 @@ final class IngestionClientSnippet { "947ac9c4-7e58-4c87-b1e7-14a68e99699a", "76ab4c2a-ce17-496f-b7a6-506dc59ee498", ])) + // >LOG // SEPARATOR< } @@ -696,6 +742,7 @@ final class IngestionClientSnippet { "947ac9c4-7e58-4c87-b1e7-14a68e99699a", "76ab4c2a-ce17-496f-b7a6-506dc59ee498", ])) + // >LOG // SEPARATOR< } @@ -714,6 +761,21 @@ final class IngestionClientSnippet { "947ac9c4-7e58-4c87-b1e7-14a68e99699a", "76ab4c2a-ce17-496f-b7a6-506dc59ee498", ])) + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } @@ -727,6 +789,7 @@ final class IngestionClientSnippet { // Call the API let response = try await client.triggerDockerSourceDiscover(sourceID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + // >LOG // SEPARATOR< } @@ -743,6 +806,7 @@ final class IngestionClientSnippet { code: "foo", sampleRecord: ["bar": "baz"] )) + // >LOG // SEPARATOR< } @@ -759,6 +823,7 @@ final class IngestionClientSnippet { transformationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", transformationTry: TransformationTry(code: "foo", sampleRecord: ["bar": "baz"]) ) + // >LOG // SEPARATOR< } @@ -775,6 +840,7 @@ final class IngestionClientSnippet { authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", authenticationUpdate: AuthenticationUpdate(name: "newName") ) + // >LOG // SEPARATOR< } @@ -791,6 +857,7 @@ final class IngestionClientSnippet { destinationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", destinationUpdate: DestinationUpdate(name: "newName") ) + // >LOG // SEPARATOR< } @@ -807,6 +874,7 @@ final class IngestionClientSnippet { sourceID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", sourceUpdate: SourceUpdate(name: "newName") ) + // >LOG // SEPARATOR< } @@ -823,6 +891,7 @@ final class IngestionClientSnippet { taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", taskUpdate: TaskUpdate(cron: "* * * * *", enabled: false) ) + // >LOG // SEPARATOR< } @@ -839,6 +908,7 @@ final class IngestionClientSnippet { taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", taskUpdate: TaskUpdateV1(enabled: false) ) + // >LOG // SEPARATOR< } @@ -855,6 +925,7 @@ final class IngestionClientSnippet { transformationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", transformationCreate: TransformationCreate(code: "foo", name: "bar", description: "baz") ) + // >LOG // SEPARATOR< } @@ -878,6 +949,7 @@ final class IngestionClientSnippet { )), authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f" )) + // >LOG // SEPARATOR< } @@ -894,6 +966,7 @@ final class IngestionClientSnippet { sourceID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", sourceUpdate: SourceUpdate(name: "newName") ) + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/Insights.swift b/snippets/swift/Sources/Insights.swift index d59a99f417..c9dd4b18a9 100644 --- a/snippets/swift/Sources/Insights.swift +++ b/snippets/swift/Sources/Insights.swift @@ -17,6 +17,7 @@ final class InsightsClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -30,6 +31,7 @@ final class InsightsClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -43,6 +45,7 @@ final class InsightsClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -56,6 +59,7 @@ final class InsightsClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -68,7 +72,8 @@ final class InsightsClientSnippet { let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API - let response = try await client.deleteUserToken(userToken: "test-user-1") + try await client.deleteUserToken(userToken: "test-user-1") + // >LOG // SEPARATOR< } @@ -96,6 +101,21 @@ final class InsightsClientSnippet { timestamp: Int64(1_641_290_601_962) )), ])) + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/Monitoring.swift b/snippets/swift/Sources/Monitoring.swift index 33533cee24..e0c299226d 100644 --- a/snippets/swift/Sources/Monitoring.swift +++ b/snippets/swift/Sources/Monitoring.swift @@ -17,6 +17,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -30,6 +31,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -43,6 +45,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -56,6 +59,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -69,6 +73,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getClusterIncidents(clusters: "c1-de") + // >LOG // SEPARATOR< } @@ -82,6 +87,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getClusterStatus(clusters: "c1-de") + // >LOG // SEPARATOR< } @@ -95,6 +101,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getIncidents() + // >LOG // SEPARATOR< } @@ -108,6 +115,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getIndexingTime(clusters: "c1-de") + // >LOG // SEPARATOR< } @@ -121,6 +129,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getLatency(clusters: "c1-de") + // >LOG // SEPARATOR< } @@ -134,6 +143,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getMetrics(metric: Metric.avgBuildTime, period: Period.minute) + // >LOG // SEPARATOR< } @@ -147,6 +157,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getReachability(clusters: "c1-de") + // >LOG // SEPARATOR< } @@ -160,6 +171,7 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getServers() + // >LOG // SEPARATOR< } @@ -173,6 +185,21 @@ final class MonitoringClientSnippet { // Call the API let response = try await client.getStatus() + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/Personalization.swift b/snippets/swift/Sources/Personalization.swift index 427ab3f819..d4767f8857 100644 --- a/snippets/swift/Sources/Personalization.swift +++ b/snippets/swift/Sources/Personalization.swift @@ -17,6 +17,7 @@ final class PersonalizationClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -30,6 +31,7 @@ final class PersonalizationClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -43,6 +45,7 @@ final class PersonalizationClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -56,6 +59,7 @@ final class PersonalizationClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -69,6 +73,7 @@ final class PersonalizationClientSnippet { // Call the API let response = try await client.deleteUserProfile(userToken: "UserToken") + // >LOG // SEPARATOR< } @@ -82,6 +87,7 @@ final class PersonalizationClientSnippet { // Call the API let response = try await client.getPersonalizationStrategy() + // >LOG // SEPARATOR< } @@ -95,6 +101,21 @@ final class PersonalizationClientSnippet { // Call the API let response = try await client.getUserTokenProfile(userToken: "UserToken") + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } @@ -117,6 +138,7 @@ final class PersonalizationClientSnippet { facetScoring: [FacetScoring(score: 42, facetName: "Event")], personalizationImpact: 42 )) + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/QuerySuggestions.swift b/snippets/swift/Sources/QuerySuggestions.swift index 7a5629789c..977d5d0b31 100644 --- a/snippets/swift/Sources/QuerySuggestions.swift +++ b/snippets/swift/Sources/QuerySuggestions.swift @@ -26,6 +26,7 @@ final class QuerySuggestionsClientSnippet { exclude: ["test"], indexName: "" )) + // >LOG // SEPARATOR< } @@ -39,6 +40,7 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -52,6 +54,7 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -65,6 +68,7 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -78,6 +82,7 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -91,6 +96,7 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.deleteConfig(indexName: "") + // >LOG // SEPARATOR< } @@ -104,6 +110,7 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.getAllConfigs() + // >LOG // SEPARATOR< } @@ -117,6 +124,7 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.getConfig(indexName: "") + // >LOG // SEPARATOR< } @@ -130,6 +138,7 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.getConfigStatus(indexName: "") + // >LOG // SEPARATOR< } @@ -143,6 +152,21 @@ final class QuerySuggestionsClientSnippet { // Call the API let response = try await client.getLogFile(indexName: "") + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } @@ -167,6 +191,7 @@ final class QuerySuggestionsClientSnippet { exclude: ["test"] ) ) + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/Recommend.swift b/snippets/swift/Sources/Recommend.swift index 58c182b4bf..126c9b8f1e 100644 --- a/snippets/swift/Sources/Recommend.swift +++ b/snippets/swift/Sources/Recommend.swift @@ -17,6 +17,7 @@ final class RecommendClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -30,6 +31,7 @@ final class RecommendClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -43,6 +45,7 @@ final class RecommendClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -56,6 +59,7 @@ final class RecommendClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -73,6 +77,7 @@ final class RecommendClientSnippet { model: RecommendModels.relatedProducts, objectID: "objectID" ) + // >LOG // SEPARATOR< } @@ -90,6 +95,7 @@ final class RecommendClientSnippet { model: RecommendModels.relatedProducts, objectID: "objectID" ) + // >LOG // SEPARATOR< } @@ -107,6 +113,7 @@ final class RecommendClientSnippet { model: RecommendModels.relatedProducts, taskID: Int64(12345) ) + // >LOG // SEPARATOR< } @@ -129,6 +136,7 @@ final class RecommendClientSnippet { objectID: "objectID" )), ])) + // >LOG // SEPARATOR< } @@ -145,6 +153,21 @@ final class RecommendClientSnippet { indexName: "", model: RecommendModels.relatedProducts ) + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/Search.swift b/snippets/swift/Sources/Search.swift index fe0dc45ca7..9d01fc649f 100644 --- a/snippets/swift/Sources/Search.swift +++ b/snippets/swift/Sources/Search.swift @@ -23,6 +23,7 @@ final class SearchClientSnippet { maxQueriesPerIPPerHour: 100, validity: 300 )) + // >LOG // SEPARATOR< } @@ -40,6 +41,7 @@ final class SearchClientSnippet { objectID: "uniqueID", body: ["key": "value"] ) + // >LOG // SEPARATOR< } @@ -56,6 +58,7 @@ final class SearchClientSnippet { source: "theSource", description: "theDescription" )) + // >LOG // SEPARATOR< } @@ -72,6 +75,7 @@ final class SearchClientSnippet { xAlgoliaUserID: "userID", assignUserIdParams: AssignUserIdParams(cluster: "theCluster") ) + // >LOG // SEPARATOR< } @@ -91,6 +95,7 @@ final class SearchClientSnippet { SearchBatchRequest(action: SearchAction.addObject, body: ["key": "baz", "foo": "2"]), ]) ) + // >LOG // SEPARATOR< } @@ -110,6 +115,7 @@ final class SearchClientSnippet { body: ["key": "value"] )]) ) + // >LOG // SEPARATOR< } @@ -129,6 +135,7 @@ final class SearchClientSnippet { body: ["key": "value"] )]) ) + // >LOG // SEPARATOR< } @@ -148,6 +155,7 @@ final class SearchClientSnippet { body: ["key": "value"] )]) ) + // >LOG // SEPARATOR< } @@ -167,6 +175,7 @@ final class SearchClientSnippet { body: ["key": "value"] )]) ) + // >LOG // SEPARATOR< } @@ -186,6 +195,7 @@ final class SearchClientSnippet { body: ["key": "value"] )]) ) + // >LOG // SEPARATOR< } @@ -205,6 +215,7 @@ final class SearchClientSnippet { body: ["key": "value"] )]) ) + // >LOG // SEPARATOR< } @@ -221,6 +232,7 @@ final class SearchClientSnippet { xAlgoliaUserID: "userID", batchAssignUserIdsParams: BatchAssignUserIdsParams(cluster: "theCluster", users: ["user1", "user2"]) ) + // >LOG // SEPARATOR< } @@ -250,6 +262,7 @@ final class SearchClientSnippet { )] ) ) + // >LOG // SEPARATOR< } @@ -272,6 +285,7 @@ final class SearchClientSnippet { )] ) ) + // >LOG // SEPARATOR< } @@ -295,6 +309,7 @@ final class SearchClientSnippet { ]) )]) ) + // >LOG // SEPARATOR< } @@ -308,6 +323,7 @@ final class SearchClientSnippet { // Call the API let response: BrowseResponse = try await client.browse(indexName: "") + // >LOG // SEPARATOR< } @@ -321,6 +337,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.clearObjects(indexName: "") + // >LOG // SEPARATOR< } @@ -334,6 +351,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.clearRules(indexName: "") + // >LOG // SEPARATOR< } @@ -347,6 +365,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.clearSynonyms(indexName: "") + // >LOG // SEPARATOR< } @@ -360,6 +379,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -373,6 +393,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -386,6 +407,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -399,6 +421,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -412,6 +435,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.deleteApiKey(key: "myTestApiKey") + // >LOG // SEPARATOR< } @@ -428,6 +452,7 @@ final class SearchClientSnippet { indexName: "", deleteByParams: DeleteByParams(filters: "brand:brandName") ) + // >LOG // SEPARATOR< } @@ -441,6 +466,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.deleteIndex(indexName: "") + // >LOG // SEPARATOR< } @@ -454,6 +480,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.deleteObject(indexName: "", objectID: "uniqueID") + // >LOG // SEPARATOR< } @@ -467,6 +494,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.deleteObjects(indexName: "", objectIDs: ["1", "2"]) + // >LOG // SEPARATOR< } @@ -480,6 +508,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.deleteRule(indexName: "", objectID: "id1") + // >LOG // SEPARATOR< } @@ -493,6 +522,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.deleteSource(source: "theSource") + // >LOG // SEPARATOR< } @@ -506,6 +536,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.deleteSynonym(indexName: "", objectID: "id1") + // >LOG // SEPARATOR< } @@ -522,6 +553,7 @@ final class SearchClientSnippet { parentApiKey: "2640659426d5107b6e47d75db9cbaef8", restrictions: SecuredApiKeyRestrictions(validUntil: Int64(2_524_604_400), restrictIndices: ["Movies"]) ) + // >LOG // SEPARATOR< } @@ -552,6 +584,7 @@ final class SearchClientSnippet { userToken: "user123" ) ) + // >LOG // SEPARATOR< } @@ -565,6 +598,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getApiKey(key: "myTestApiKey") + // >LOG // SEPARATOR< } @@ -578,6 +612,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getAppTask(taskID: Int64(123)) + // >LOG // SEPARATOR< } @@ -591,6 +626,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getDictionaryLanguages() + // >LOG // SEPARATOR< } @@ -604,6 +640,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getDictionarySettings() + // >LOG // SEPARATOR< } @@ -617,6 +654,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getLogs() + // >LOG // SEPARATOR< } @@ -634,6 +672,7 @@ final class SearchClientSnippet { objectID: "uniqueID", attributesToRetrieve: ["attr1", "attr2"] ) + // >LOG // SEPARATOR< } @@ -652,6 +691,7 @@ final class SearchClientSnippet { objectID: "uniqueID", indexName: "" )])) + // >LOG // SEPARATOR< } @@ -665,6 +705,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getRule(indexName: "", objectID: "qr-1725004648916") + // >LOG // SEPARATOR< } @@ -678,6 +719,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getSettings(indexName: "") + // >LOG // SEPARATOR< } @@ -691,6 +733,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getSources() + // >LOG // SEPARATOR< } @@ -704,6 +747,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getSynonym(indexName: "", objectID: "id1") + // >LOG // SEPARATOR< } @@ -717,6 +761,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getTask(indexName: "", taskID: Int64(123)) + // >LOG // SEPARATOR< } @@ -730,6 +775,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getTopUserIds() + // >LOG // SEPARATOR< } @@ -743,6 +789,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.getUserId(userID: "uniqueID") + // >LOG // SEPARATOR< } @@ -756,6 +803,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.hasPendingMappings() + // >LOG // SEPARATOR< } @@ -769,6 +817,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.indexExists(indexName: "") + // >LOG // SEPARATOR< } @@ -782,6 +831,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.indexExists(indexName: "") + // >LOG // SEPARATOR< } @@ -795,6 +845,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.indexExists(indexName: "") + // >LOG // SEPARATOR< } @@ -808,6 +859,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.listApiKeys() + // >LOG // SEPARATOR< } @@ -821,6 +873,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.listClusters() + // >LOG // SEPARATOR< } @@ -834,6 +887,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.listIndices() + // >LOG // SEPARATOR< } @@ -847,6 +901,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.listUserIds() + // >LOG // SEPARATOR< } @@ -864,6 +919,7 @@ final class SearchClientSnippet { body: ["key": "value"], indexName: "" )])) + // >LOG // SEPARATOR< } @@ -884,6 +940,7 @@ final class SearchClientSnippet { scope: [ScopeType.rules, ScopeType.settings] ) ) + // >LOG // SEPARATOR< } @@ -903,6 +960,7 @@ final class SearchClientSnippet { destination: "" ) ) + // >LOG // SEPARATOR< } @@ -922,6 +980,7 @@ final class SearchClientSnippet { destination: "" ) ) + // >LOG // SEPARATOR< } @@ -939,6 +998,7 @@ final class SearchClientSnippet { objectID: "uniqueID", attributesToUpdate: ["attributeId": "new value"] ) + // >LOG // SEPARATOR< } @@ -956,6 +1016,7 @@ final class SearchClientSnippet { objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]], createIfNotExists: true ) + // >LOG // SEPARATOR< } @@ -973,6 +1034,7 @@ final class SearchClientSnippet { objects: [["objectID": "3", "name": "Cyril"], ["objectID": "4", "name": "David"]], createIfNotExists: false ) + // >LOG // SEPARATOR< } @@ -986,6 +1048,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.removeUserId(userID: "uniqueID") + // >LOG // SEPARATOR< } @@ -1014,6 +1077,7 @@ final class SearchClientSnippet { ], batchSize: 3 ) + // >LOG // SEPARATOR< } @@ -1030,6 +1094,7 @@ final class SearchClientSnippet { source: "theSource", description: "theDescription" )]) + // >LOG // SEPARATOR< } @@ -1043,6 +1108,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.restoreApiKey(key: "myApiKey") + // >LOG // SEPARATOR< } @@ -1059,6 +1125,7 @@ final class SearchClientSnippet { indexName: "", body: ["objectID": "id", "test": "val"] ) + // >LOG // SEPARATOR< } @@ -1075,6 +1142,7 @@ final class SearchClientSnippet { indexName: "", objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]] ) + // >LOG // SEPARATOR< } @@ -1091,6 +1159,7 @@ final class SearchClientSnippet { indexName: "", objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]] ) + // >LOG // SEPARATOR< } @@ -1111,6 +1180,7 @@ final class SearchClientSnippet { conditions: [SearchCondition(pattern: "apple", anchoring: SearchAnchoring.contains)] ) ) + // >LOG // SEPARATOR< } @@ -1138,6 +1208,7 @@ final class SearchClientSnippet { forwardToReplicas: false, clearExistingRules: true ) + // >LOG // SEPARATOR< } @@ -1156,6 +1227,7 @@ final class SearchClientSnippet { synonymHit: SynonymHit(objectID: "id1", type: SynonymType.synonym, synonyms: ["car", "vehicule", "auto"]), forwardToReplicas: true ) + // >LOG // SEPARATOR< } @@ -1182,6 +1254,7 @@ final class SearchClientSnippet { forwardToReplicas: true, replaceExistingSynonyms: true ) + // >LOG // SEPARATOR< } @@ -1200,6 +1273,7 @@ final class SearchClientSnippet { hitsPerPage: 50, indexName: "" ))])) + // >LOG // SEPARATOR< } @@ -1218,6 +1292,7 @@ final class SearchClientSnippet { filters: "actor:Scarlett Johansson", indexName: "" ))])) + // >LOG // SEPARATOR< } @@ -1236,6 +1311,7 @@ final class SearchClientSnippet { filters: "actor:Tom Cruise OR actor:Scarlett Johansson", indexName: "" ))])) + // >LOG // SEPARATOR< } @@ -1254,6 +1330,7 @@ final class SearchClientSnippet { filters: "NOT actor:Nicolas Cage", indexName: "" ))])) + // >LOG // SEPARATOR< } @@ -1272,6 +1349,7 @@ final class SearchClientSnippet { facets: ["author", "genre"], indexName: "" ))])) + // >LOG // SEPARATOR< } @@ -1290,6 +1368,7 @@ final class SearchClientSnippet { facets: ["*"], indexName: "" ))])) + // >LOG // SEPARATOR< } @@ -1306,6 +1385,7 @@ final class SearchClientSnippet { dictionaryName: DictionaryType.stopwords, searchDictionaryEntriesParams: SearchDictionaryEntriesParams(query: "about") ) + // >LOG // SEPARATOR< } @@ -1319,6 +1399,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.searchForFacetValues(indexName: "", facetName: "facetName") + // >LOG // SEPARATOR< } @@ -1335,6 +1416,7 @@ final class SearchClientSnippet { indexName: "", searchRulesParams: SearchRulesParams(query: "zorro") ) + // >LOG // SEPARATOR< } @@ -1348,6 +1430,7 @@ final class SearchClientSnippet { // Call the API let response: SearchResponse = try await client.searchSingleIndex(indexName: "") + // >LOG // SEPARATOR< } @@ -1361,6 +1444,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.searchSynonyms(indexName: "") + // >LOG // SEPARATOR< } @@ -1379,6 +1463,21 @@ final class SearchClientSnippet { page: 5, hitsPerPage: 10 )) + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } @@ -1399,6 +1498,7 @@ final class SearchClientSnippet { "ru": true, ])) ) + // >LOG // SEPARATOR< } @@ -1419,6 +1519,7 @@ final class SearchClientSnippet { "searchable(publisher)", ]) ) + // >LOG // SEPARATOR< } @@ -1440,6 +1541,7 @@ final class SearchClientSnippet { validity: 300 ) ) + // >LOG // SEPARATOR< } @@ -1456,6 +1558,7 @@ final class SearchClientSnippet { key: "api-key-add-operation-test-swift", operation: ApiKeyOperation.add ) + // >LOG // SEPARATOR< } @@ -1481,6 +1584,7 @@ final class SearchClientSnippet { validity: 305 ) ) + // >LOG // SEPARATOR< } @@ -1497,6 +1601,7 @@ final class SearchClientSnippet { key: "api-key-delete-operation-test-swift", operation: ApiKeyOperation.delete ) + // >LOG // SEPARATOR< } @@ -1510,6 +1615,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.waitForAppTask(taskID: Int64(123)) + // >LOG // SEPARATOR< } @@ -1523,6 +1629,7 @@ final class SearchClientSnippet { // Call the API let response = try await client.waitForTask(indexName: "", taskID: Int64(123)) + // >LOG // SEPARATOR< } } diff --git a/snippets/swift/Sources/Usage.swift b/snippets/swift/Sources/Usage.swift index 1080dedbf9..5d06e81c9b 100644 --- a/snippets/swift/Sources/Usage.swift +++ b/snippets/swift/Sources/Usage.swift @@ -17,6 +17,7 @@ final class UsageClientSnippet { // Call the API let response = try await client.customDelete(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -30,6 +31,7 @@ final class UsageClientSnippet { // Call the API let response = try await client.customGet(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -43,6 +45,7 @@ final class UsageClientSnippet { // Call the API let response = try await client.customPost(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -56,6 +59,7 @@ final class UsageClientSnippet { // Call the API let response = try await client.customPut(path: "test/minimal") + // >LOG // SEPARATOR< } @@ -74,6 +78,7 @@ final class UsageClientSnippet { startDate: "2024-04-03T12:46:43Z", endDate: "2024-04-05T12:46:43Z" ) + // >LOG // SEPARATOR< } @@ -91,6 +96,21 @@ final class UsageClientSnippet { startDate: "2024-04-03T12:46:43Z", endDate: "2024-04-05T12:46:43Z" ) + // >LOG + // SEPARATOR< + } + + /// Snippet for the setClientApiKey method. + /// + /// switch API key + func snippetForSetClientApiKey() async throws { + // >SEPARATOR setClientApiKey default + // Initialize the client + let client = try UsageClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + + // Call the API + try client.setClientApiKey(apiKey: "updated-api-key") + // >LOG // SEPARATOR< } } diff --git a/specs/bundled/abtesting.doc.yml b/specs/bundled/abtesting.doc.yml index 8632ca72f3..e8be16f4da 100644 --- a/specs/bundled/abtesting.doc.yml +++ b/specs/bundled/abtesting.doc.yml @@ -148,6 +148,7 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -175,6 +176,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -190,6 +193,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -204,6 +209,8 @@ paths: const response = await client.customGet({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -223,6 +230,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -242,6 +251,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -261,6 +272,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -283,6 +296,8 @@ paths: response = client.custom_get("test/minimal") + # >LOG + # use the class directly puts(response) @@ -307,6 +322,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -322,6 +339,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -361,6 +380,7 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -388,6 +408,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -403,6 +425,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -417,6 +441,8 @@ paths: const response = await client.customPost({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -436,6 +462,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -455,6 +483,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -474,6 +504,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -496,6 +528,8 @@ paths: response = client.custom_post("test/minimal") + # >LOG + # use the class directly puts(response) @@ -520,6 +554,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -535,6 +571,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -574,6 +612,7 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -601,6 +640,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -616,6 +657,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -630,6 +673,8 @@ paths: const response = await client.customPut({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -649,6 +694,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -668,6 +715,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -687,6 +736,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -709,6 +760,8 @@ paths: response = client.custom_put("test/minimal") + # >LOG + # use the class directly puts(response) @@ -733,6 +786,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -748,6 +803,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -781,6 +838,7 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -809,6 +867,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -824,6 +884,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -839,6 +901,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -858,6 +922,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -877,6 +943,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -896,6 +964,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -918,6 +988,8 @@ paths: response = client.custom_delete("test/minimal") + # >LOG + # use the class directly puts(response) @@ -942,6 +1014,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -957,6 +1031,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /2/abtests: post: tags: @@ -1036,6 +1112,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -1067,6 +1144,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1092,6 +1171,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1113,6 +1194,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1145,6 +1228,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1175,6 +1260,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1207,6 +1294,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1238,6 +1327,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -1275,6 +1366,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1298,6 +1391,8 @@ paths: ], endAt: "2022-12-31T00:00:00.000Z" )) + + // >LOG get: tags: - abtest @@ -1375,6 +1470,7 @@ paths: // Call the API var response = await client.ListABTestsAsync(); + // >LOG - lang: go label: Go source: > @@ -1401,6 +1497,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1416,6 +1514,8 @@ paths: // Call the API client.listABTests(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1430,6 +1530,8 @@ paths: const response = await client.listABTests(); + // >LOG + // use typed response console.log(response); @@ -1447,6 +1549,8 @@ paths: var response = client.listABTests() + // >LOG + // Use the response println(response) @@ -1464,6 +1568,8 @@ paths: $response = $client->listABTests(); + // >LOG + // play with the response var_dump($response); @@ -1481,6 +1587,8 @@ paths: response = await _client.list_ab_tests() + # >LOG + # use the class directly print(response) @@ -1503,6 +1611,8 @@ paths: response = client.list_ab_tests + # >LOG + # use the class directly puts(response) @@ -1527,6 +1637,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1542,6 +1654,8 @@ paths: // Call the API let response = try await client.listABTests() + + // >LOG /2/abtests/{id}: get: tags: @@ -1586,6 +1700,7 @@ paths: // Call the API var response = await client.GetABTestAsync(42); + // >LOG - lang: go label: Go source: > @@ -1613,6 +1728,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1628,6 +1745,8 @@ paths: // Call the API client.getABTest(42); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1642,6 +1761,8 @@ paths: const response = await client.getABTest({ id: 42 }); + // >LOG + // use typed response console.log(response); @@ -1661,6 +1782,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1680,6 +1803,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1699,6 +1824,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1721,6 +1848,8 @@ paths: response = client.get_ab_test(42) + # >LOG + # use the class directly puts(response) @@ -1745,6 +1874,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1760,6 +1891,8 @@ paths: // Call the API let response = try await client.getABTest(id: 42) + + // >LOG delete: tags: - abtest @@ -1803,6 +1936,7 @@ paths: // Call the API var response = await client.DeleteABTestAsync(42); + // >LOG - lang: go label: Go source: > @@ -1831,6 +1965,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1846,6 +1982,8 @@ paths: // Call the API client.deleteABTest(42); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1860,6 +1998,8 @@ paths: const response = await client.deleteABTest({ id: 42 }); + // >LOG + // use typed response console.log(response); @@ -1879,6 +2019,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1898,6 +2040,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1917,6 +2061,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1939,6 +2085,8 @@ paths: response = client.delete_ab_test(42) + # >LOG + # use the class directly puts(response) @@ -1963,6 +2111,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1978,6 +2128,8 @@ paths: // Call the API let response = try await client.deleteABTest(id: 42) + + // >LOG /2/abtests/{id}/stop: post: tags: @@ -2025,6 +2177,7 @@ paths: // Call the API var response = await client.StopABTestAsync(42); + // >LOG - lang: go label: Go source: > @@ -2052,6 +2205,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2067,6 +2222,8 @@ paths: // Call the API client.stopABTest(42); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2081,6 +2238,8 @@ paths: const response = await client.stopABTest({ id: 42 }); + // >LOG + // use typed response console.log(response); @@ -2100,6 +2259,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2119,6 +2280,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2138,6 +2301,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2160,6 +2325,8 @@ paths: response = client.stop_ab_test(42) + # >LOG + # use the class directly puts(response) @@ -2184,6 +2351,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2199,6 +2368,8 @@ paths: // Call the API let response = try await client.stopABTest(id: 42) + + // >LOG /2/abtests/schedule: post: tags: @@ -2283,6 +2454,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -2315,6 +2487,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2341,6 +2515,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2363,6 +2539,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -2396,6 +2574,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2427,6 +2607,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2460,6 +2642,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2492,6 +2676,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -2530,6 +2716,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2555,6 +2743,8 @@ paths: scheduledAt: "2022-11-31T00:00:00.000Z", endAt: "2022-12-31T00:00:00.000Z" )) + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/abtesting.yml b/specs/bundled/abtesting.yml index 19722daf0c..cba99dad68 100644 --- a/specs/bundled/abtesting.yml +++ b/specs/bundled/abtesting.yml @@ -504,6 +504,26 @@ paths: $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - abtesting + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/analytics.doc.yml b/specs/bundled/analytics.doc.yml index 381103f9df..6b2e52c1d6 100644 --- a/specs/bundled/analytics.doc.yml +++ b/specs/bundled/analytics.doc.yml @@ -161,6 +161,7 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -188,6 +189,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -203,6 +206,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -217,6 +222,8 @@ paths: const response = await client.customGet({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -236,6 +243,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -255,6 +264,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -274,6 +285,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -296,6 +309,8 @@ paths: response = client.custom_get("test/minimal") + # >LOG + # use the class directly puts(response) @@ -320,6 +335,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -335,6 +352,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -374,6 +393,7 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -401,6 +421,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -416,6 +438,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -430,6 +454,8 @@ paths: const response = await client.customPost({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -449,6 +475,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -468,6 +496,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -487,6 +517,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -509,6 +541,8 @@ paths: response = client.custom_post("test/minimal") + # >LOG + # use the class directly puts(response) @@ -533,6 +567,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -548,6 +584,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -587,6 +625,7 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -614,6 +653,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -629,6 +670,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -643,6 +686,8 @@ paths: const response = await client.customPut({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -662,6 +707,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -681,6 +728,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -700,6 +749,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -722,6 +773,8 @@ paths: response = client.custom_put("test/minimal") + # >LOG + # use the class directly puts(response) @@ -746,6 +799,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -761,6 +816,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -794,6 +851,7 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -822,6 +880,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -837,6 +897,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -852,6 +914,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -871,6 +935,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -890,6 +956,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -909,6 +977,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -931,6 +1001,8 @@ paths: response = client.custom_delete("test/minimal") + # >LOG + # use the class directly puts(response) @@ -955,6 +1027,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -970,6 +1044,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /2/searches: get: tags: @@ -1023,6 +1099,7 @@ paths: // Call the API var response = await client.GetTopSearchesAsync("index"); + // >LOG - lang: go label: Go source: > @@ -1051,6 +1128,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1066,6 +1145,8 @@ paths: // Call the API client.getTopSearches("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1080,6 +1161,8 @@ paths: const response = await client.getTopSearches({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -1099,6 +1182,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1118,6 +1203,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1137,6 +1224,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1159,6 +1248,8 @@ paths: response = client.get_top_searches("index") + # >LOG + # use the class directly puts(response) @@ -1183,6 +1274,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1198,6 +1291,8 @@ paths: // Call the API let response = try await client.getTopSearches(index: "index") + + // >LOG /2/searches/count: get: tags: @@ -1274,6 +1369,7 @@ paths: // Call the API var response = await client.GetSearchesCountAsync("index"); + // >LOG - lang: go label: Go source: > @@ -1302,6 +1398,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1317,6 +1415,8 @@ paths: // Call the API client.getSearchesCount("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1331,6 +1431,8 @@ paths: const response = await client.getSearchesCount({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -1350,6 +1452,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1369,6 +1473,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1388,6 +1494,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1410,6 +1518,8 @@ paths: response = client.get_searches_count("index") + # >LOG + # use the class directly puts(response) @@ -1434,6 +1544,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1449,6 +1561,8 @@ paths: // Call the API let response = try await client.getSearchesCount(index: "index") + + // >LOG /2/searches/noResults: get: tags: @@ -1521,6 +1635,7 @@ paths: // Call the API var response = await client.GetSearchesNoResultsAsync("index"); + // >LOG - lang: go label: Go source: > @@ -1549,6 +1664,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1564,6 +1681,8 @@ paths: // Call the API client.getSearchesNoResults("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1579,6 +1698,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1598,6 +1719,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1617,6 +1740,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1636,6 +1761,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1658,6 +1785,8 @@ paths: response = client.get_searches_no_results("index") + # >LOG + # use the class directly puts(response) @@ -1682,6 +1811,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1697,6 +1828,8 @@ paths: // Call the API let response = try await client.getSearchesNoResults(index: "index") + + // >LOG /2/searches/noClicks: get: tags: @@ -1774,6 +1907,7 @@ paths: // Call the API var response = await client.GetSearchesNoClicksAsync("index"); + // >LOG - lang: go label: Go source: > @@ -1802,6 +1936,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1817,6 +1953,8 @@ paths: // Call the API client.getSearchesNoClicks("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1832,6 +1970,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1851,6 +1991,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1870,6 +2012,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1889,6 +2033,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1911,6 +2057,8 @@ paths: response = client.get_searches_no_clicks("index") + # >LOG + # use the class directly puts(response) @@ -1935,6 +2083,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1950,6 +2100,8 @@ paths: // Call the API let response = try await client.getSearchesNoClicks(index: "index") + + // >LOG /2/searches/noResultRate: get: tags: @@ -2038,6 +2190,7 @@ paths: // Call the API var response = await client.GetNoResultsRateAsync("index"); + // >LOG - lang: go label: Go source: > @@ -2066,6 +2219,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2081,6 +2236,8 @@ paths: // Call the API client.getNoResultsRate("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2095,6 +2252,8 @@ paths: const response = await client.getNoResultsRate({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -2114,6 +2273,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2133,6 +2294,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2152,6 +2315,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2174,6 +2339,8 @@ paths: response = client.get_no_results_rate("index") + # >LOG + # use the class directly puts(response) @@ -2198,6 +2365,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2213,6 +2382,8 @@ paths: // Call the API let response = try await client.getNoResultsRate(index: "index") + + // >LOG /2/searches/noClickRate: get: tags: @@ -2301,6 +2472,7 @@ paths: // Call the API var response = await client.GetNoClickRateAsync("index"); + // >LOG - lang: go label: Go source: > @@ -2329,6 +2501,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2344,6 +2518,8 @@ paths: // Call the API client.getNoClickRate("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2358,6 +2534,8 @@ paths: const response = await client.getNoClickRate({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -2377,6 +2555,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2396,6 +2576,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2415,6 +2597,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2437,6 +2621,8 @@ paths: response = client.get_no_click_rate("index") + # >LOG + # use the class directly puts(response) @@ -2461,6 +2647,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2476,6 +2664,8 @@ paths: // Call the API let response = try await client.getNoClickRate(index: "index") + + // >LOG /2/hits: get: tags: @@ -2528,6 +2718,7 @@ paths: // Call the API var response = await client.GetTopHitsAsync("index"); + // >LOG - lang: go label: Go source: > @@ -2555,6 +2746,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2570,6 +2763,8 @@ paths: // Call the API client.getTopHits("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2584,6 +2779,8 @@ paths: const response = await client.getTopHits({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -2603,6 +2800,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2622,6 +2821,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2641,6 +2842,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2663,6 +2866,8 @@ paths: response = client.get_top_hits("index") + # >LOG + # use the class directly puts(response) @@ -2687,6 +2892,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2702,6 +2909,8 @@ paths: // Call the API let response = try await client.getTopHits(index: "index") + + // >LOG /2/users/count: get: tags: @@ -2793,6 +3002,7 @@ paths: // Call the API var response = await client.GetUsersCountAsync("index"); + // >LOG - lang: go label: Go source: > @@ -2821,6 +3031,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2836,6 +3048,8 @@ paths: // Call the API client.getUsersCount("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2850,6 +3064,8 @@ paths: const response = await client.getUsersCount({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -2869,6 +3085,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2888,6 +3106,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2907,6 +3127,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2929,6 +3151,8 @@ paths: response = client.get_users_count("index") + # >LOG + # use the class directly puts(response) @@ -2953,6 +3177,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2968,6 +3194,8 @@ paths: // Call the API let response = try await client.getUsersCount(index: "index") + + // >LOG /2/filters: get: tags: @@ -3023,6 +3251,7 @@ paths: // Call the API var response = await client.GetTopFilterAttributesAsync("index"); + // >LOG - lang: go label: Go source: > @@ -3051,6 +3280,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3066,6 +3297,8 @@ paths: // Call the API client.getTopFilterAttributes("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3081,6 +3314,8 @@ paths: 'index' }); + // >LOG + // use typed response console.log(response); @@ -3100,6 +3335,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3119,6 +3356,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -3138,6 +3377,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -3160,6 +3401,8 @@ paths: response = client.get_top_filter_attributes("index") + # >LOG + # use the class directly puts(response) @@ -3184,6 +3427,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3200,6 +3445,8 @@ paths: let response = try await client.getTopFilterAttributes(index: "index") + + // >LOG /2/filters/{attribute}: get: tags: @@ -3261,6 +3508,8 @@ paths: var response = await client.GetTopFilterForAttributeAsync("myAttribute", "index"); + + // >LOG - lang: go label: Go source: > @@ -3289,6 +3538,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3304,6 +3555,8 @@ paths: // Call the API client.getTopFilterForAttribute("myAttribute", "index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3319,6 +3572,8 @@ paths: 'myAttribute', index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -3339,6 +3594,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3359,6 +3616,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -3379,6 +3638,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -3402,6 +3663,8 @@ paths: "index") + # >LOG + # use the class directly puts(response) @@ -3427,6 +3690,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3443,6 +3708,8 @@ paths: let response = try await client.getTopFilterForAttribute(attribute: "myAttribute", index: "index") + + // >LOG /2/filters/noResults: get: tags: @@ -3500,6 +3767,7 @@ paths: // Call the API var response = await client.GetTopFiltersNoResultsAsync("index"); + // >LOG - lang: go label: Go source: > @@ -3528,6 +3796,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3543,6 +3813,8 @@ paths: // Call the API client.getTopFiltersNoResults("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3558,6 +3830,8 @@ paths: 'index' }); + // >LOG + // use typed response console.log(response); @@ -3577,6 +3851,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3596,6 +3872,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -3615,6 +3893,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -3637,6 +3917,8 @@ paths: response = client.get_top_filters_no_results("index") + # >LOG + # use the class directly puts(response) @@ -3661,6 +3943,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3677,6 +3961,8 @@ paths: let response = try await client.getTopFiltersNoResults(index: "index") + + // >LOG /2/countries: get: tags: @@ -3748,6 +4034,7 @@ paths: // Call the API var response = await client.GetTopCountriesAsync("index"); + // >LOG - lang: go label: Go source: > @@ -3776,6 +4063,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3791,6 +4080,8 @@ paths: // Call the API client.getTopCountries("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3805,6 +4096,8 @@ paths: const response = await client.getTopCountries({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -3824,6 +4117,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3843,6 +4138,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -3862,6 +4159,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -3884,6 +4183,8 @@ paths: response = client.get_top_countries("index") + # >LOG + # use the class directly puts(response) @@ -3908,6 +4209,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3923,6 +4226,8 @@ paths: // Call the API let response = try await client.getTopCountries(index: "index") + + // >LOG /2/clicks/averageClickPosition: get: tags: @@ -4011,6 +4316,7 @@ paths: // Call the API var response = await client.GetAverageClickPositionAsync("index"); + // >LOG - lang: go label: Go source: > @@ -4039,6 +4345,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4054,6 +4362,8 @@ paths: // Call the API client.getAverageClickPosition("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -4069,6 +4379,8 @@ paths: 'index' }); + // >LOG + // use typed response console.log(response); @@ -4088,6 +4400,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4107,6 +4421,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -4126,6 +4442,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -4148,6 +4466,8 @@ paths: response = client.get_average_click_position("index") + # >LOG + # use the class directly puts(response) @@ -4172,6 +4492,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4188,6 +4510,8 @@ paths: let response = try await client.getAverageClickPosition(index: "index") + + // >LOG /2/clicks/positions: get: tags: @@ -4248,6 +4572,7 @@ paths: // Call the API var response = await client.GetClickPositionsAsync("index"); + // >LOG - lang: go label: Go source: > @@ -4276,6 +4601,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4291,6 +4618,8 @@ paths: // Call the API client.getClickPositions("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -4305,6 +4634,8 @@ paths: const response = await client.getClickPositions({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -4324,6 +4655,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4343,6 +4676,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -4362,6 +4697,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -4384,6 +4721,8 @@ paths: response = client.get_click_positions("index") + # >LOG + # use the class directly puts(response) @@ -4408,6 +4747,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4423,6 +4764,8 @@ paths: // Call the API let response = try await client.getClickPositions(index: "index") + + // >LOG /2/clicks/clickThroughRate: get: tags: @@ -4511,6 +4854,7 @@ paths: // Call the API var response = await client.GetClickThroughRateAsync("index"); + // >LOG - lang: go label: Go source: > @@ -4539,6 +4883,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4554,6 +4900,8 @@ paths: // Call the API client.getClickThroughRate("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -4569,6 +4917,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -4588,6 +4938,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4607,6 +4959,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -4626,6 +4980,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -4648,6 +5004,8 @@ paths: response = client.get_click_through_rate("index") + # >LOG + # use the class directly puts(response) @@ -4672,6 +5030,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4687,6 +5047,8 @@ paths: // Call the API let response = try await client.getClickThroughRate(index: "index") + + // >LOG /2/conversions/conversionRate: get: tags: @@ -4775,6 +5137,7 @@ paths: // Call the API var response = await client.GetConversionRateAsync("index"); + // >LOG - lang: go label: Go source: > @@ -4803,6 +5166,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4818,6 +5183,8 @@ paths: // Call the API client.getConversionRate("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -4832,6 +5199,8 @@ paths: const response = await client.getConversionRate({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -4851,6 +5220,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4870,6 +5241,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -4889,6 +5262,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -4911,6 +5286,8 @@ paths: response = client.get_conversion_rate("index") + # >LOG + # use the class directly puts(response) @@ -4935,6 +5312,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4950,6 +5329,8 @@ paths: // Call the API let response = try await client.getConversionRate(index: "index") + + // >LOG /2/conversions/addToCartRate: get: tags: @@ -5038,6 +5419,7 @@ paths: // Call the API var response = await client.GetAddToCartRateAsync("index"); + // >LOG - lang: go label: Go source: > @@ -5066,6 +5448,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -5081,6 +5465,8 @@ paths: // Call the API client.getAddToCartRate("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5095,6 +5481,8 @@ paths: const response = await client.getAddToCartRate({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -5114,6 +5502,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5133,6 +5523,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5152,6 +5544,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -5174,6 +5568,8 @@ paths: response = client.get_add_to_cart_rate("index") + # >LOG + # use the class directly puts(response) @@ -5198,6 +5594,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5213,6 +5611,8 @@ paths: // Call the API let response = try await client.getAddToCartRate(index: "index") + + // >LOG /2/conversions/purchaseRate: get: tags: @@ -5301,6 +5701,7 @@ paths: // Call the API var response = await client.GetPurchaseRateAsync("index"); + // >LOG - lang: go label: Go source: > @@ -5329,6 +5730,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -5344,6 +5747,8 @@ paths: // Call the API client.getPurchaseRate("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5358,6 +5763,8 @@ paths: const response = await client.getPurchaseRate({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -5377,6 +5784,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5396,6 +5805,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5415,6 +5826,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -5437,6 +5850,8 @@ paths: response = client.get_purchase_rate("index") + # >LOG + # use the class directly puts(response) @@ -5461,6 +5876,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5476,6 +5893,8 @@ paths: // Call the API let response = try await client.getPurchaseRate(index: "index") + + // >LOG /2/conversions/revenue: get: tags: @@ -5547,6 +5966,7 @@ paths: // Call the API var response = await client.GetRevenueAsync("index"); + // >LOG - lang: go label: Go source: > @@ -5574,6 +5994,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -5589,6 +6011,8 @@ paths: // Call the API client.getRevenue("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5603,6 +6027,8 @@ paths: const response = await client.getRevenue({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -5622,6 +6048,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5641,6 +6069,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5660,6 +6090,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -5682,6 +6114,8 @@ paths: response = client.get_revenue("index") + # >LOG + # use the class directly puts(response) @@ -5706,6 +6140,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5721,6 +6157,8 @@ paths: // Call the API let response = try await client.getRevenue(index: "index") + + // >LOG /2/status: get: tags: @@ -5770,6 +6208,7 @@ paths: // Call the API var response = await client.GetStatusAsync("index"); + // >LOG - lang: go label: Go source: > @@ -5797,6 +6236,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -5812,6 +6253,8 @@ paths: // Call the API client.getStatus("index"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5826,6 +6269,8 @@ paths: const response = await client.getStatus({ index: 'index' }); + // >LOG + // use typed response console.log(response); @@ -5845,6 +6290,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5864,6 +6311,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5883,6 +6332,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -5905,6 +6356,8 @@ paths: response = client.get_status("index") + # >LOG + # use the class directly puts(response) @@ -5929,6 +6382,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5944,6 +6399,8 @@ paths: // Call the API let response = try await client.getStatus(index: "index") + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/analytics.yml b/specs/bundled/analytics.yml index 38e3f7b49b..5977d90b57 100644 --- a/specs/bundled/analytics.yml +++ b/specs/bundled/analytics.yml @@ -1473,6 +1473,26 @@ paths: $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - analytics + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/ingestion.doc.yml b/specs/bundled/ingestion.doc.yml index 48750af3dc..1bbf38fb49 100644 --- a/specs/bundled/ingestion.doc.yml +++ b/specs/bundled/ingestion.doc.yml @@ -169,6 +169,7 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -196,6 +197,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -211,6 +214,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -225,6 +230,8 @@ paths: const response = await client.customGet({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -244,6 +251,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -263,6 +272,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -282,6 +293,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -304,6 +317,8 @@ paths: response = client.custom_get("test/minimal") + # >LOG + # use the class directly puts(response) @@ -328,6 +343,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -343,6 +360,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -382,6 +401,7 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -409,6 +429,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -424,6 +446,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -438,6 +462,8 @@ paths: const response = await client.customPost({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -457,6 +483,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -476,6 +504,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -495,6 +525,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -517,6 +549,8 @@ paths: response = client.custom_post("test/minimal") + # >LOG + # use the class directly puts(response) @@ -541,6 +575,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -556,6 +592,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -595,6 +633,7 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -622,6 +661,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -637,6 +678,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -651,6 +694,8 @@ paths: const response = await client.customPut({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -670,6 +715,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -689,6 +736,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -708,6 +757,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -730,6 +781,8 @@ paths: response = client.custom_put("test/minimal") + # >LOG + # use the class directly puts(response) @@ -754,6 +807,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -769,6 +824,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -802,6 +859,7 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -830,6 +888,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -845,6 +905,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -860,6 +922,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -879,6 +943,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -898,6 +964,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -917,6 +985,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -939,6 +1009,8 @@ paths: response = client.custom_delete("test/minimal") + # >LOG + # use the class directly puts(response) @@ -963,6 +1035,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -978,6 +1052,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /1/authentications: get: tags: @@ -1028,6 +1104,7 @@ paths: // Call the API var response = await client.ListAuthenticationsAsync(); + // >LOG - lang: go label: Go source: > @@ -1054,6 +1131,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1069,6 +1148,8 @@ paths: // Call the API client.listAuthentications(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1083,6 +1164,8 @@ paths: const response = await client.listAuthentications(); + // >LOG + // use typed response console.log(response); @@ -1100,6 +1183,8 @@ paths: var response = client.listAuthentications() + // >LOG + // Use the response println(response) @@ -1117,6 +1202,8 @@ paths: $response = $client->listAuthentications(); + // >LOG + // play with the response var_dump($response); @@ -1134,6 +1221,8 @@ paths: response = await _client.list_authentications() + # >LOG + # use the class directly print(response) @@ -1156,6 +1245,8 @@ paths: response = client.list_authentications + # >LOG + # use the class directly puts(response) @@ -1180,6 +1271,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1195,6 +1288,8 @@ paths: // Call the API let response = try await client.listAuthentications() + + // >LOG post: tags: - authentications @@ -1246,6 +1341,7 @@ paths: ), } ); + // >LOG - lang: go label: Go source: > @@ -1276,6 +1372,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1296,6 +1394,8 @@ paths: .setName("authName") .setInput(new AuthOAuth().setUrl("http://test.oauth").setClientId("myID").setClientSecret("mySecret")) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1314,6 +1414,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1341,6 +1443,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1366,6 +1470,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1393,6 +1499,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1421,6 +1529,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -1453,6 +1563,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1474,6 +1586,8 @@ paths: name: "authName", input: AuthInput.authOAuth(AuthOAuth(url: "http://test.oauth", clientId: "myID", clientSecret: "mySecret")) )) + + // >LOG /1/authentications/search: post: tags: @@ -1523,6 +1637,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -1553,6 +1668,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1571,6 +1688,8 @@ paths: new AuthenticationSearch() .setAuthenticationIDs(Arrays.asList("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a")) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1587,6 +1706,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1608,6 +1729,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1632,6 +1755,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1656,6 +1781,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1682,6 +1809,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -1708,6 +1837,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1727,6 +1858,7 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a", ])) + // >LOG /1/authentications/{authenticationID}: get: tags: @@ -1764,6 +1896,8 @@ paths: var response = await client.GetAuthenticationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -1792,6 +1926,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1807,6 +1943,8 @@ paths: // Call the API client.getAuthentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1822,6 +1960,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -1841,6 +1981,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1860,6 +2002,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1879,6 +2023,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1902,6 +2048,8 @@ paths: client.get_authentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -1926,6 +2074,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1942,6 +2092,8 @@ paths: let response = try await client.getAuthentication(authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG patch: tags: - authentications @@ -1983,6 +2135,7 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new AuthenticationUpdate { Name = "newName", } ); + // >LOG - lang: go label: Go source: > @@ -2012,6 +2165,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2028,6 +2183,8 @@ paths: client.updateAuthentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new AuthenticationUpdate().setName("newName")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2045,6 +2202,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -2067,6 +2226,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2088,6 +2249,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2110,6 +2273,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2135,6 +2300,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -2162,6 +2329,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2180,6 +2349,8 @@ paths: authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", authenticationUpdate: AuthenticationUpdate(name: "newName") ) + + // >LOG delete: tags: - authentications @@ -2218,6 +2389,8 @@ paths: var response = await client.DeleteAuthenticationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -2246,6 +2419,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2261,6 +2436,8 @@ paths: // Call the API client.deleteAuthentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2276,6 +2453,8 @@ paths: authenticationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -2295,6 +2474,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2314,6 +2495,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2333,6 +2516,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2356,6 +2541,8 @@ paths: client.delete_authentication("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -2380,6 +2567,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2397,6 +2586,8 @@ paths: let response = try await client.deleteAuthentication(authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/destinations: get: tags: @@ -2447,6 +2638,7 @@ paths: // Call the API var response = await client.ListDestinationsAsync(); + // >LOG - lang: go label: Go source: > @@ -2473,6 +2665,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2488,6 +2682,8 @@ paths: // Call the API client.listDestinations(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2502,6 +2698,8 @@ paths: const response = await client.listDestinations(); + // >LOG + // use typed response console.log(response); @@ -2519,6 +2717,8 @@ paths: var response = client.listDestinations() + // >LOG + // Use the response println(response) @@ -2536,6 +2736,8 @@ paths: $response = $client->listDestinations(); + // >LOG + // play with the response var_dump($response); @@ -2553,6 +2755,8 @@ paths: response = await _client.list_destinations() + # >LOG + # use the class directly print(response) @@ -2575,6 +2779,8 @@ paths: response = client.list_destinations + # >LOG + # use the class directly puts(response) @@ -2599,6 +2805,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2614,6 +2822,8 @@ paths: // Call the API let response = try await client.listDestinations() + + // >LOG post: tags: - destinations @@ -2659,6 +2869,7 @@ paths: AuthenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", } ); + // >LOG - lang: go label: Go source: > @@ -2689,6 +2900,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2710,6 +2923,8 @@ paths: .setInput(new DestinationIndexName().setIndexName("")) .setAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f") ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2729,6 +2944,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -2755,6 +2972,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2779,6 +2998,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2805,6 +3026,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -2834,6 +3057,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -2865,6 +3090,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2886,6 +3113,8 @@ paths: input: DestinationInput.destinationIndexName(DestinationIndexName(indexName: "")), authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f" )) + + // >LOG /1/destinations/search: post: tags: @@ -2935,6 +3164,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -2965,6 +3195,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2983,6 +3215,8 @@ paths: new DestinationSearch() .setDestinationIDs(Arrays.asList("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a")) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2999,6 +3233,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -3020,6 +3256,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3044,6 +3282,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -3068,6 +3308,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -3094,6 +3336,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -3120,6 +3364,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3140,6 +3386,8 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a", ])) + + // >LOG /1/destinations/{destinationID}: get: tags: @@ -3177,6 +3425,8 @@ paths: var response = await client.GetDestinationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -3205,6 +3455,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3220,6 +3472,8 @@ paths: // Call the API client.getDestination("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3235,6 +3489,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -3254,6 +3510,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3273,6 +3531,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -3292,6 +3552,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -3315,6 +3577,8 @@ paths: client.get_destination("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -3339,6 +3603,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3355,6 +3621,8 @@ paths: let response = try await client.getDestination(destinationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG patch: tags: - destinations @@ -3396,6 +3664,7 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new DestinationUpdate { Name = "newName", } ); + // >LOG - lang: go label: Go source: > @@ -3425,6 +3694,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3441,6 +3712,8 @@ paths: client.updateDestination("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new DestinationUpdate().setName("newName")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3458,6 +3731,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -3480,6 +3755,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3501,6 +3778,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -3523,6 +3802,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -3547,6 +3828,8 @@ paths: DestinationUpdate.new(name: "newName")) + # >LOG + # use the class directly puts(response) @@ -3574,6 +3857,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3592,6 +3877,8 @@ paths: destinationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", destinationUpdate: DestinationUpdate(name: "newName") ) + + // >LOG delete: tags: - destinations @@ -3630,6 +3917,8 @@ paths: var response = await client.DeleteDestinationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -3658,6 +3947,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3673,6 +3964,8 @@ paths: // Call the API client.deleteDestination("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3688,6 +3981,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -3707,6 +4002,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3726,6 +4023,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -3745,6 +4044,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -3768,6 +4069,8 @@ paths: client.delete_destination("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -3792,6 +4095,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3808,6 +4113,8 @@ paths: let response = try await client.deleteDestination(destinationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/sources: get: tags: @@ -3858,6 +4165,7 @@ paths: // Call the API var response = await client.ListSourcesAsync(); + // >LOG - lang: go label: Go source: > @@ -3884,6 +4192,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3899,6 +4209,8 @@ paths: // Call the API client.listSources(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3913,6 +4225,8 @@ paths: const response = await client.listSources(); + // >LOG + // use typed response console.log(response); @@ -3930,6 +4244,8 @@ paths: var response = client.listSources() + // >LOG + // Use the response println(response) @@ -3947,6 +4263,8 @@ paths: $response = $client->listSources(); + // >LOG + // play with the response var_dump($response); @@ -3964,6 +4282,8 @@ paths: response = await _client.list_sources() + # >LOG + # use the class directly print(response) @@ -3986,6 +4306,8 @@ paths: response = client.list_sources + # >LOG + # use the class directly puts(response) @@ -4010,6 +4332,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4025,6 +4349,8 @@ paths: // Call the API let response = try await client.listSources() + + // >LOG post: tags: - sources @@ -4078,6 +4404,7 @@ paths: AuthenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", } ); + // >LOG - lang: go label: Go source: > @@ -4110,6 +4437,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4137,6 +4466,8 @@ paths: ) .setAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f") ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -4156,6 +4487,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -4185,6 +4518,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4216,6 +4551,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -4249,6 +4586,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -4283,6 +4622,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -4319,6 +4660,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4345,6 +4688,8 @@ paths: )), authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f" )) + + // >LOG /1/sources/validate: post: tags: @@ -4400,6 +4745,7 @@ paths: AuthenticationID = "6c02aeb1-775e-418e-870b-1faccd4b2c0f", } ); + // >LOG - lang: go label: Go source: > @@ -4429,6 +4775,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4456,6 +4804,8 @@ paths: ) .setAuthenticationID("6c02aeb1-775e-418e-870b-1faccd4b2c0f") ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -4475,6 +4825,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -4504,6 +4856,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4535,6 +4889,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -4568,6 +4924,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -4602,6 +4960,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -4640,6 +5000,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4666,6 +5028,8 @@ paths: )), authenticationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f" )) + + // >LOG /1/sources/search: post: tags: @@ -4715,6 +5079,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -4745,6 +5110,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4762,6 +5129,8 @@ paths: client.searchSources( new SourceSearch().setSourceIDs(Arrays.asList("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a")) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -4778,6 +5147,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -4799,6 +5170,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4823,6 +5196,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -4847,6 +5222,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -4871,6 +5248,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -4897,6 +5276,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4916,6 +5297,8 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "947ac9c4-7e58-4c87-b1e7-14a68e99699a", ])) + + // >LOG /1/sources/{sourceID}: get: tags: @@ -4953,6 +5336,8 @@ paths: var response = await client.GetSourceAsync("75eeb306-51d3-4e5e-a279-3c92bd8893ac"); + + // >LOG - lang: go label: Go source: > @@ -4980,6 +5365,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4995,6 +5382,8 @@ paths: // Call the API client.getSource("75eeb306-51d3-4e5e-a279-3c92bd8893ac"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5010,6 +5399,8 @@ paths: '75eeb306-51d3-4e5e-a279-3c92bd8893ac' }); + // >LOG + // use typed response console.log(response); @@ -5029,6 +5420,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5048,6 +5441,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5067,6 +5462,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -5089,6 +5486,8 @@ paths: response = client.get_source("75eeb306-51d3-4e5e-a279-3c92bd8893ac") + # >LOG + # use the class directly puts(response) @@ -5113,6 +5512,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5129,6 +5530,8 @@ paths: let response = try await client.getSource(sourceID: "75eeb306-51d3-4e5e-a279-3c92bd8893ac") + + // >LOG patch: tags: - sources @@ -5170,6 +5573,7 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new SourceUpdate { Name = "newName", } ); + // >LOG - lang: go label: Go source: > @@ -5199,6 +5603,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -5215,6 +5621,8 @@ paths: client.updateSource("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new SourceUpdate().setName("newName")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5232,6 +5640,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -5254,6 +5664,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5275,6 +5687,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5297,6 +5711,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -5321,6 +5737,8 @@ paths: SourceUpdate.new(name: "newName")) + # >LOG + # use the class directly puts(response) @@ -5348,6 +5766,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5366,6 +5786,8 @@ paths: sourceID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", sourceUpdate: SourceUpdate(name: "newName") ) + + // >LOG delete: tags: - sources @@ -5404,6 +5826,8 @@ paths: var response = await client.DeleteSourceAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -5432,6 +5856,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -5447,6 +5873,8 @@ paths: // Call the API client.deleteSource("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5462,6 +5890,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -5481,6 +5911,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5500,6 +5932,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5519,6 +5953,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -5542,6 +5978,8 @@ paths: client.delete_source("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -5566,6 +6004,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5582,6 +6022,8 @@ paths: let response = try await client.deleteSource(sourceID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/sources/{sourceID}/validate: post: tags: @@ -5626,6 +6068,7 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new SourceUpdate { Name = "newName", } ); + // >LOG - lang: go label: Go source: > @@ -5655,6 +6098,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -5671,6 +6116,8 @@ paths: client.validateSourceBeforeUpdate("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new SourceUpdate().setName("newName")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5688,6 +6135,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -5710,6 +6159,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5731,6 +6182,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5753,6 +6206,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -5778,6 +6233,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -5805,6 +6262,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5823,6 +6282,8 @@ paths: sourceID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", sourceUpdate: SourceUpdate(name: "newName") ) + + // >LOG /1/sources/{sourceID}/discover: post: tags: @@ -5862,6 +6323,7 @@ paths: var response = await client.TriggerDockerSourceDiscoverAsync( "6c02aeb1-775e-418e-870b-1faccd4b2c0f" ); + // >LOG - lang: go label: Go source: > @@ -5890,6 +6352,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -5905,6 +6369,8 @@ paths: // Call the API client.triggerDockerSourceDiscover("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5920,6 +6386,8 @@ paths: sourceID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -5939,6 +6407,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5958,6 +6428,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -5977,6 +6449,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -6000,6 +6474,8 @@ paths: client.trigger_docker_source_discover("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -6024,6 +6500,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -6041,6 +6519,8 @@ paths: let response = try await client.triggerDockerSourceDiscover(sourceID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/sources/{sourceID}/run: post: tags: @@ -6104,6 +6584,7 @@ paths: EntityType = Enum.Parse("Product"), } ); + // >LOG - lang: go label: Go source: > @@ -6133,6 +6614,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -6154,6 +6637,8 @@ paths: .setEntityIDs(Arrays.asList("1234", "5678")) .setEntityType(EntityType.PRODUCT) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -6175,6 +6660,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -6199,6 +6686,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -6230,6 +6719,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -6260,6 +6751,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -6289,6 +6782,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -6320,6 +6815,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -6342,6 +6839,8 @@ paths: entityType: EntityType.product ) ) + + // >LOG /1/tasks: get: tags: @@ -6398,6 +6897,7 @@ paths: // Call the API var response = await client.ListTasksV1Async(); + // >LOG - lang: go label: Go source: > @@ -6424,6 +6924,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -6439,6 +6941,8 @@ paths: // Call the API client.listTasksV1(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -6453,6 +6957,8 @@ paths: const response = await client.listTasksV1(); + // >LOG + // use typed response console.log(response); @@ -6470,6 +6976,8 @@ paths: var response = client.listTasksV1() + // >LOG + // Use the response println(response) @@ -6487,6 +6995,8 @@ paths: $response = $client->listTasksV1(); + // >LOG + // play with the response var_dump($response); @@ -6504,6 +7014,8 @@ paths: response = await _client.list_tasks_v1() + # >LOG + # use the class directly print(response) @@ -6526,6 +7038,8 @@ paths: response = client.list_tasks_v1 + # >LOG + # use the class directly puts(response) @@ -6550,6 +7064,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -6565,6 +7081,8 @@ paths: // Call the API let response = try await client.listTasksV1() + + // >LOG post: tags: - tasks @@ -6611,6 +7129,7 @@ paths: Action = Enum.Parse("Replace"), } ); + // >LOG - lang: go label: Go source: > @@ -6641,6 +7160,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -6662,6 +7183,8 @@ paths: .setTrigger(new OnDemandTriggerInput().setType(OnDemandTriggerType.ON_DEMAND)) .setAction(ActionType.REPLACE) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -6681,6 +7204,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -6707,6 +7232,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -6731,6 +7258,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -6757,6 +7286,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -6786,6 +7317,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -6817,6 +7350,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -6838,6 +7373,8 @@ paths: trigger: TaskCreateTrigger.onDemandTriggerInput(OnDemandTriggerInput(type: OnDemandTriggerType.onDemand)), action: ActionType.replace )) + + // >LOG /1/tasks/search: post: tags: @@ -6890,6 +7427,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -6920,6 +7458,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -6944,6 +7484,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -6964,6 +7506,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -6985,6 +7529,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7011,6 +7557,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -7036,6 +7584,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -7066,6 +7616,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -7096,6 +7648,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7116,6 +7670,8 @@ paths: "947ac9c4-7e58-4c87-b1e7-14a68e99699a", "76ab4c2a-ce17-496f-b7a6-506dc59ee498", ])) + + // >LOG /1/tasks/{taskID}: get: tags: @@ -7155,6 +7711,8 @@ paths: var response = await client.GetTaskV1Async("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -7182,6 +7740,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -7197,6 +7757,8 @@ paths: // Call the API client.getTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -7212,6 +7774,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -7231,6 +7795,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7250,6 +7816,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -7269,6 +7837,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -7292,6 +7862,8 @@ paths: client.get_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -7316,6 +7888,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7332,6 +7906,8 @@ paths: let response = try await client.getTaskV1(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG patch: tags: - tasks @@ -7372,6 +7948,7 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TaskUpdateV1 { Enabled = false, } ); + // >LOG - lang: go label: Go source: > @@ -7401,6 +7978,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -7417,6 +7996,8 @@ paths: client.updateTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TaskUpdateV1().setEnabled(false)); + + // >LOG - lang: javascript label: JavaScript source: > @@ -7434,6 +8015,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -7456,6 +8039,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7477,6 +8062,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -7499,6 +8086,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -7523,6 +8112,8 @@ paths: TaskUpdateV1.new(enabled: false)) + # >LOG + # use the class directly puts(response) @@ -7550,6 +8141,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7568,6 +8161,8 @@ paths: taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", taskUpdate: TaskUpdateV1(enabled: false) ) + + // >LOG delete: tags: - tasks @@ -7602,6 +8197,8 @@ paths: var response = await client.DeleteTaskV1Async("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -7630,6 +8227,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -7645,6 +8244,8 @@ paths: // Call the API client.deleteTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -7660,6 +8261,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -7679,6 +8282,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7698,6 +8303,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -7717,6 +8324,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -7740,6 +8349,8 @@ paths: client.delete_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -7764,6 +8375,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7780,6 +8393,8 @@ paths: let response = try await client.deleteTaskV1(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/tasks/{taskID}/run: post: tags: @@ -7819,6 +8434,8 @@ paths: var response = await client.RunTaskV1Async("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -7846,6 +8463,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -7861,6 +8480,8 @@ paths: // Call the API client.runTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -7876,6 +8497,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -7895,6 +8518,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7914,6 +8539,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -7933,6 +8560,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -7956,6 +8585,8 @@ paths: client.run_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -7980,6 +8611,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7996,6 +8629,8 @@ paths: let response = try await client.runTaskV1(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/tasks/{taskID}/enable: put: tags: @@ -8033,6 +8668,8 @@ paths: var response = await client.EnableTaskV1Async("76ab4c2a-ce17-496f-b7a6-506dc59ee498"); + + // >LOG - lang: go label: Go source: > @@ -8061,6 +8698,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -8076,6 +8715,8 @@ paths: // Call the API client.enableTaskV1("76ab4c2a-ce17-496f-b7a6-506dc59ee498"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -8091,6 +8732,8 @@ paths: '76ab4c2a-ce17-496f-b7a6-506dc59ee498' }); + // >LOG + // use typed response console.log(response); @@ -8110,6 +8753,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -8129,6 +8774,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -8148,6 +8795,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -8171,6 +8820,8 @@ paths: client.enable_task_v1("76ab4c2a-ce17-496f-b7a6-506dc59ee498") + # >LOG + # use the class directly puts(response) @@ -8195,6 +8846,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8211,6 +8864,8 @@ paths: let response = try await client.enableTaskV1(taskID: "76ab4c2a-ce17-496f-b7a6-506dc59ee498") + + // >LOG /1/tasks/{taskID}/disable: put: tags: @@ -8249,6 +8904,8 @@ paths: var response = await client.DisableTaskV1Async("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -8277,6 +8934,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -8292,6 +8951,8 @@ paths: // Call the API client.disableTaskV1("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -8307,6 +8968,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -8326,6 +8989,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -8345,6 +9010,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -8364,6 +9031,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -8387,6 +9056,8 @@ paths: client.disable_task_v1("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -8411,6 +9082,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8427,6 +9100,8 @@ paths: let response = try await client.disableTaskV1(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /2/tasks: get: tags: @@ -8481,6 +9156,7 @@ paths: // Call the API var response = await client.ListTasksAsync(); + // >LOG - lang: go label: Go source: > @@ -8506,6 +9182,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -8521,6 +9199,8 @@ paths: // Call the API client.listTasks(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -8535,6 +9215,8 @@ paths: const response = await client.listTasks(); + // >LOG + // use typed response console.log(response); @@ -8552,6 +9234,8 @@ paths: var response = client.listTasks() + // >LOG + // Use the response println(response) @@ -8569,6 +9253,8 @@ paths: $response = $client->listTasks(); + // >LOG + // play with the response var_dump($response); @@ -8586,6 +9272,8 @@ paths: response = await _client.list_tasks() + # >LOG + # use the class directly print(response) @@ -8608,6 +9296,8 @@ paths: response = client.list_tasks + # >LOG + # use the class directly puts(response) @@ -8632,6 +9322,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8647,6 +9339,8 @@ paths: // Call the API let response = try await client.listTasks() + + // >LOG post: tags: - tasks @@ -8687,6 +9381,7 @@ paths: Action = Enum.Parse("Replace"), } ); + // >LOG - lang: go label: Go source: > @@ -8715,6 +9410,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -8731,6 +9428,8 @@ paths: client.createTask(new TaskCreate().setSourceID("search").setDestinationID("destinationName").setAction(ActionType.REPLACE)); + + // >LOG - lang: javascript label: JavaScript source: > @@ -8746,6 +9445,8 @@ paths: destinationID: 'destinationName', action: 'replace' }); + // >LOG + // use typed response console.log(response); @@ -8769,6 +9470,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -8791,6 +9494,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -8814,6 +9519,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -8838,6 +9545,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -8866,6 +9575,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8885,6 +9596,8 @@ paths: destinationID: "destinationName", action: ActionType.replace )) + + // >LOG /2/tasks/search: post: tags: @@ -8935,6 +9648,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -8964,6 +9678,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -8988,6 +9704,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -9008,6 +9726,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -9029,6 +9749,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9055,6 +9777,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -9080,6 +9804,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -9110,6 +9836,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -9140,6 +9868,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -9160,6 +9890,8 @@ paths: "947ac9c4-7e58-4c87-b1e7-14a68e99699a", "76ab4c2a-ce17-496f-b7a6-506dc59ee498", ])) + + // >LOG /2/tasks/{taskID}: get: tags: @@ -9197,6 +9929,8 @@ paths: var response = await client.GetTaskAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -9224,6 +9958,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -9239,6 +9975,8 @@ paths: // Call the API client.getTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -9254,6 +9992,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -9273,6 +10013,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9292,6 +10034,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -9311,6 +10055,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -9333,6 +10079,8 @@ paths: response = client.get_task("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -9357,6 +10105,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -9373,6 +10123,8 @@ paths: let response = try await client.getTask(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG patch: tags: - tasks @@ -9410,6 +10162,7 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TaskUpdate { Enabled = false, Cron = "* * * * *", } ); + // >LOG - lang: go label: Go source: > @@ -9438,6 +10191,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -9454,6 +10209,8 @@ paths: client.updateTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TaskUpdate().setEnabled(false).setCron("* * * * *")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -9471,6 +10228,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -9494,6 +10253,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9516,6 +10277,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -9539,6 +10302,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -9564,6 +10329,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -9592,6 +10359,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -9610,6 +10379,8 @@ paths: taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", taskUpdate: TaskUpdate(cron: "* * * * *", enabled: false) ) + + // >LOG delete: tags: - tasks @@ -9642,6 +10413,8 @@ paths: var response = await client.DeleteTaskAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -9669,6 +10442,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -9684,6 +10459,8 @@ paths: // Call the API client.deleteTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -9699,6 +10476,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -9718,6 +10497,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9737,6 +10518,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -9756,6 +10539,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -9779,6 +10564,8 @@ paths: client.delete_task("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -9803,6 +10590,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -9819,6 +10608,8 @@ paths: let response = try await client.deleteTask(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /2/tasks/{taskID}/run: post: tags: @@ -9858,6 +10649,8 @@ paths: var response = await client.RunTaskAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -9885,6 +10678,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -9900,6 +10695,8 @@ paths: // Call the API client.runTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -9915,6 +10712,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -9934,6 +10733,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9953,6 +10754,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -9972,6 +10775,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -9994,6 +10799,8 @@ paths: response = client.run_task("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -10018,6 +10825,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -10034,6 +10843,8 @@ paths: let response = try await client.runTask(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /2/tasks/{taskID}/push: post: tags: @@ -10123,6 +10934,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -10152,6 +10964,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -10177,6 +10991,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -10200,6 +11016,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -10238,6 +11056,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -10270,6 +11090,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -10304,6 +11126,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -10335,6 +11159,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -10372,6 +11198,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -10404,6 +11232,8 @@ paths: ] ) ) + + // >LOG /2/tasks/{taskID}/enable: put: tags: @@ -10441,6 +11271,8 @@ paths: var response = await client.EnableTaskAsync("76ab4c2a-ce17-496f-b7a6-506dc59ee498"); + + // >LOG - lang: go label: Go source: > @@ -10468,6 +11300,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -10483,6 +11317,8 @@ paths: // Call the API client.enableTask("76ab4c2a-ce17-496f-b7a6-506dc59ee498"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -10498,6 +11334,8 @@ paths: '76ab4c2a-ce17-496f-b7a6-506dc59ee498' }); + // >LOG + // use typed response console.log(response); @@ -10517,6 +11355,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -10536,6 +11376,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -10555,6 +11397,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -10578,6 +11422,8 @@ paths: client.enable_task("76ab4c2a-ce17-496f-b7a6-506dc59ee498") + # >LOG + # use the class directly puts(response) @@ -10602,6 +11448,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -10618,6 +11466,8 @@ paths: let response = try await client.enableTask(taskID: "76ab4c2a-ce17-496f-b7a6-506dc59ee498") + + // >LOG /2/tasks/{taskID}/disable: put: tags: @@ -10655,6 +11505,8 @@ paths: var response = await client.DisableTaskAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -10682,6 +11534,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -10697,6 +11551,8 @@ paths: // Call the API client.disableTask("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -10712,6 +11568,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -10731,6 +11589,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -10750,6 +11610,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -10769,6 +11631,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -10792,6 +11656,8 @@ paths: client.disable_task("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -10816,6 +11682,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -10832,6 +11700,8 @@ paths: let response = try await client.disableTask(taskID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/transformations: get: tags: @@ -10881,6 +11751,7 @@ paths: // Call the API var response = await client.ListTransformationsAsync(); + // >LOG - lang: go label: Go source: > @@ -10907,6 +11778,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -10922,6 +11795,8 @@ paths: // Call the API client.listTransformations(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -10936,6 +11811,8 @@ paths: const response = await client.listTransformations(); + // >LOG + // use typed response console.log(response); @@ -10953,6 +11830,8 @@ paths: var response = client.listTransformations() + // >LOG + // Use the response println(response) @@ -10970,6 +11849,8 @@ paths: $response = $client->listTransformations(); + // >LOG + // play with the response var_dump($response); @@ -10987,6 +11868,8 @@ paths: response = await _client.list_transformations() + # >LOG + # use the class directly print(response) @@ -11009,6 +11892,8 @@ paths: response = client.list_transformations + # >LOG + # use the class directly puts(response) @@ -11033,6 +11918,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -11048,6 +11935,8 @@ paths: // Call the API let response = try await client.listTransformations() + + // >LOG post: tags: - transformations @@ -11088,6 +11977,7 @@ paths: Description = "baz", } ); + // >LOG - lang: go label: Go source: > @@ -11117,6 +12007,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -11133,6 +12025,8 @@ paths: client.createTransformation(new TransformationCreate().setCode("foo").setName("bar").setDescription("baz")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -11148,6 +12042,8 @@ paths: name: 'bar', description: 'baz' }); + // >LOG + // use typed response console.log(response); @@ -11171,6 +12067,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -11193,6 +12091,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -11216,6 +12116,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -11240,6 +12142,8 @@ paths: name: "bar", description: "baz")) + # >LOG + # use the class directly puts(response) @@ -11268,6 +12172,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -11289,6 +12195,8 @@ paths: name: "bar", description: "baz" )) + + // >LOG /1/transformations/try: post: tags: @@ -11332,6 +12240,7 @@ paths: SampleRecord = new Dictionary { { "bar", "baz" } }, } ); + // >LOG - lang: go label: Go source: > @@ -11361,6 +12270,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -11386,6 +12297,8 @@ paths: } ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -11401,6 +12314,8 @@ paths: sampleRecord: { bar: 'baz' } }); + // >LOG + // use typed response console.log(response); @@ -11428,6 +12343,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -11450,6 +12367,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -11474,6 +12393,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -11497,6 +12418,8 @@ paths: "foo", sample_record: {bar: "baz"})) + # >LOG + # use the class directly puts(response) @@ -11524,6 +12447,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -11543,6 +12468,8 @@ paths: code: "foo", sampleRecord: ["bar": "baz"] )) + + // >LOG /1/transformations/search: post: tags: @@ -11593,6 +12520,7 @@ paths: }, } ); + // >LOG - lang: go label: Go source: > @@ -11623,6 +12551,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -11647,6 +12577,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -11667,6 +12599,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -11688,6 +12622,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -11714,6 +12650,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -11739,6 +12677,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -11769,6 +12709,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -11799,6 +12741,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -11819,6 +12763,7 @@ paths: "947ac9c4-7e58-4c87-b1e7-14a68e99699a", "76ab4c2a-ce17-496f-b7a6-506dc59ee498", ])) + // >LOG /1/transformations/models: get: tags: @@ -11860,6 +12805,7 @@ paths: // Call the API var response = await client.ListTransformationModelsAsync(); + // >LOG - lang: go label: Go source: > @@ -11885,6 +12831,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -11900,6 +12848,8 @@ paths: // Call the API client.listTransformationModels(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -11914,6 +12864,8 @@ paths: const response = await client.listTransformationModels(); + // >LOG + // use typed response console.log(response); @@ -11931,6 +12883,8 @@ paths: var response = client.listTransformationModels() + // >LOG + // Use the response println(response) @@ -11948,6 +12902,8 @@ paths: $response = $client->listTransformationModels(); + // >LOG + // play with the response var_dump($response); @@ -11965,6 +12921,8 @@ paths: response = await _client.list_transformation_models() + # >LOG + # use the class directly print(response) @@ -11987,6 +12945,8 @@ paths: response = client.list_transformation_models + # >LOG + # use the class directly puts(response) @@ -12011,6 +12971,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12026,6 +12988,8 @@ paths: // Call the API let response = try await client.listTransformationModels() + + // >LOG post: tags: - transformations @@ -12086,6 +13050,7 @@ paths: "fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing", } ); + // >LOG - lang: go label: Go source: > @@ -12115,6 +13080,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -12134,6 +13101,8 @@ paths: .setId("foo") .setUserPrompt("fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE" + " of code is doing") ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -12151,6 +13120,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -12173,6 +13144,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -12194,6 +13167,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -12216,6 +13191,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -12243,6 +13220,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -12271,6 +13250,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12290,6 +13271,7 @@ paths: id: "foo", userPrompt: "fizzbuzz algorithm in fortran with a lot of comments that describe what EACH LINE of code is doing" )) + // >LOG /1/transformations/{transformationID}: get: tags: @@ -12327,6 +13309,8 @@ paths: var response = await client.GetTransformationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -12355,6 +13339,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -12370,6 +13356,8 @@ paths: // Call the API client.getTransformation("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -12385,6 +13373,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -12404,6 +13394,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -12423,6 +13415,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -12442,6 +13436,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -12465,6 +13461,8 @@ paths: client.get_transformation("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -12489,6 +13487,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12505,6 +13505,8 @@ paths: let response = try await client.getTransformation(transformationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG put: tags: - transformations @@ -12547,6 +13549,7 @@ paths: Description = "baz", } ); + // >LOG - lang: go label: Go source: > @@ -12576,6 +13579,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -12594,6 +13599,8 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", new TransformationCreate().setCode("foo").setName("bar").setDescription("baz") ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -12611,6 +13618,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -12635,6 +13644,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -12658,6 +13669,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -12682,6 +13695,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -12707,6 +13722,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -12736,6 +13753,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12754,6 +13773,8 @@ paths: transformationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", transformationCreate: TransformationCreate(code: "foo", name: "bar", description: "baz") ) + + // >LOG delete: tags: - transformations @@ -12786,6 +13807,8 @@ paths: var response = await client.DeleteTransformationAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -12814,6 +13837,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -12829,6 +13854,8 @@ paths: // Call the API client.deleteTransformation("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -12844,6 +13871,8 @@ paths: transformationID: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -12863,6 +13892,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -12882,6 +13913,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -12901,6 +13934,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -12924,6 +13959,8 @@ paths: client.delete_transformation("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -12948,6 +13985,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12965,6 +14004,8 @@ paths: let response = try await client.deleteTransformation(transformationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/transformations/{transformationID}/try: post: tags: @@ -13011,6 +14052,7 @@ paths: SampleRecord = new Dictionary { { "bar", "baz" } }, } ); + // >LOG - lang: go label: Go source: > @@ -13040,6 +14082,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13066,6 +14110,8 @@ paths: } ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -13083,6 +14129,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -13111,6 +14159,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -13134,6 +14184,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -13159,6 +14211,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -13184,6 +14238,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -13212,6 +14268,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -13230,6 +14288,8 @@ paths: transformationID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", transformationTry: TransformationTry(code: "foo", sampleRecord: ["bar": "baz"]) ) + + // >LOG /1/runs: get: tags: @@ -13283,6 +14343,7 @@ paths: // Call the API var response = await client.ListRunsAsync(); + // >LOG - lang: go label: Go source: > @@ -13308,6 +14369,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13323,6 +14386,8 @@ paths: // Call the API client.listRuns(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -13337,6 +14402,8 @@ paths: const response = await client.listRuns(); + // >LOG + // use typed response console.log(response); @@ -13354,6 +14421,8 @@ paths: var response = client.listRuns() + // >LOG + // Use the response println(response) @@ -13371,6 +14440,8 @@ paths: $response = $client->listRuns(); + // >LOG + // play with the response var_dump($response); @@ -13388,6 +14459,8 @@ paths: response = await _client.list_runs() + # >LOG + # use the class directly print(response) @@ -13410,6 +14483,8 @@ paths: response = client.list_runs + # >LOG + # use the class directly puts(response) @@ -13434,6 +14509,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -13449,6 +14526,8 @@ paths: // Call the API let response = try await client.listRuns() + + // >LOG /1/runs/{runID}: get: tags: @@ -13486,6 +14565,8 @@ paths: var response = await client.GetRunAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -13513,6 +14594,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13528,6 +14611,8 @@ paths: // Call the API client.getRun("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -13543,6 +14628,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -13562,6 +14649,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -13581,6 +14670,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -13600,6 +14691,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -13622,6 +14715,8 @@ paths: response = client.get_run("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -13646,6 +14741,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -13662,6 +14759,8 @@ paths: let response = try await client.getRun(runID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/runs/{runID}/events: get: tags: @@ -13734,6 +14833,8 @@ paths: var response = await client.ListEventsAsync("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: go label: Go source: > @@ -13761,6 +14862,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13776,6 +14879,8 @@ paths: // Call the API client.listEvents("6c02aeb1-775e-418e-870b-1faccd4b2c0f"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -13791,6 +14896,8 @@ paths: '6c02aeb1-775e-418e-870b-1faccd4b2c0f' }); + // >LOG + // use typed response console.log(response); @@ -13810,6 +14917,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -13829,6 +14938,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -13848,6 +14959,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -13871,6 +14984,8 @@ paths: client.list_events("6c02aeb1-775e-418e-870b-1faccd4b2c0f") + # >LOG + # use the class directly puts(response) @@ -13895,6 +15010,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -13911,6 +15028,8 @@ paths: let response = try await client.listEvents(runID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f") + + // >LOG /1/runs/{runID}/events/{eventID}: get: tags: @@ -13948,6 +15067,7 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "6c02aeb1-775e-418e-870b-1faccd4b2c0c" ); + // >LOG - lang: go label: Go source: > @@ -13975,6 +15095,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13991,6 +15113,8 @@ paths: client.getEvent("6c02aeb1-775e-418e-870b-1faccd4b2c0f", "6c02aeb1-775e-418e-870b-1faccd4b2c0c"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -14008,6 +15132,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -14028,6 +15154,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -14048,6 +15176,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -14068,6 +15198,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -14091,6 +15223,8 @@ paths: "6c02aeb1-775e-418e-870b-1faccd4b2c0c") + # >LOG + # use the class directly puts(response) @@ -14116,6 +15250,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -14134,6 +15270,8 @@ paths: runID: "6c02aeb1-775e-418e-870b-1faccd4b2c0f", eventID: "6c02aeb1-775e-418e-870b-1faccd4b2c0c" ) + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/ingestion.yml b/specs/bundled/ingestion.yml index 21f6abd5ec..144cc3db4b 100644 --- a/specs/bundled/ingestion.yml +++ b/specs/bundled/ingestion.yml @@ -1805,6 +1805,26 @@ paths: $ref: '#/components/schemas/Event' '400': $ref: '#/components/responses/BadRequest' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - ingestion + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/insights.doc.yml b/specs/bundled/insights.doc.yml index 5e2e986d7d..79ef0226ed 100644 --- a/specs/bundled/insights.doc.yml +++ b/specs/bundled/insights.doc.yml @@ -156,6 +156,7 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG - lang: dart label: Dart source: | @@ -169,6 +170,7 @@ paths: final response = await client.customGet( path: "test/minimal", ); + // >LOG - lang: go label: Go source: > @@ -196,6 +198,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -211,6 +215,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -225,6 +231,8 @@ paths: const response = await client.customGet({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -244,6 +252,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -263,6 +273,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -282,6 +294,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -304,6 +318,8 @@ paths: response = client.custom_get("test/minimal") + # >LOG + # use the class directly puts(response) @@ -328,6 +344,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -343,6 +361,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -382,6 +402,7 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG - lang: dart label: Dart source: | @@ -395,6 +416,7 @@ paths: final response = await client.customPost( path: "test/minimal", ); + // >LOG - lang: go label: Go source: > @@ -422,6 +444,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -437,6 +461,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -451,6 +477,8 @@ paths: const response = await client.customPost({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -470,6 +498,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -489,6 +519,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -508,6 +540,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -530,6 +564,8 @@ paths: response = client.custom_post("test/minimal") + # >LOG + # use the class directly puts(response) @@ -554,6 +590,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -569,6 +607,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -608,6 +648,7 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG - lang: dart label: Dart source: | @@ -621,6 +662,7 @@ paths: final response = await client.customPut( path: "test/minimal", ); + // >LOG - lang: go label: Go source: > @@ -648,6 +690,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -663,6 +707,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -677,6 +723,8 @@ paths: const response = await client.customPut({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -696,6 +744,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -715,6 +765,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -734,6 +786,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -756,6 +810,8 @@ paths: response = client.custom_put("test/minimal") + # >LOG + # use the class directly puts(response) @@ -780,6 +836,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -795,6 +853,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -828,6 +888,7 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG - lang: dart label: Dart source: | @@ -841,6 +902,7 @@ paths: final response = await client.customDelete( path: "test/minimal", ); + // >LOG - lang: go label: Go source: > @@ -869,6 +931,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -884,6 +948,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -899,6 +965,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -918,6 +986,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -937,6 +1007,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -956,6 +1028,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -978,6 +1052,8 @@ paths: response = client.custom_delete("test/minimal") + # >LOG + # use the class directly puts(response) @@ -1002,6 +1078,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1017,6 +1095,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /1/events: post: tags: @@ -1491,6 +1571,7 @@ paths: }, } ); + // >LOG - lang: dart label: Dart source: | @@ -1524,6 +1605,7 @@ paths: ], ), ); + // >LOG - lang: go label: Go source: > @@ -1556,6 +1638,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1587,6 +1671,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1615,6 +1701,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1648,6 +1736,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1687,6 +1777,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1726,6 +1818,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1764,6 +1858,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -1802,6 +1898,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1831,6 +1929,7 @@ paths: timestamp: Int64(1_641_290_601_962) )), ])) + // >LOG /1/usertokens/{userToken}: delete: tags: @@ -1887,6 +1986,7 @@ paths: // Call the API await client.DeleteUserTokenAsync("test-user-1"); + // >LOG - lang: dart label: Dart source: | @@ -1897,12 +1997,13 @@ paths: region: 'YOUR_APP_ID_REGION'); // Call the API - final response = await client.deleteUserToken( + await client.deleteUserToken( userToken: "test-user-1", ); + // >LOG - lang: go label: Go - source: >+ + source: > // Initialize the client with your application region, eg. insights.YOUR_APP_ID_REGION @@ -1926,6 +2027,8 @@ paths: panic(err) } + + // >LOG - lang: java label: Java source: > @@ -1938,6 +2041,8 @@ paths: // Call the API client.deleteUserToken("test-user-1"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1949,13 +2054,10 @@ paths: // Call the API - const response = await client.deleteUserToken({ userToken: - 'test-user-1' }); + await client.deleteUserToken({ userToken: 'test-user-1' }); - // use typed response - - console.log(response); + // >LOG - lang: kotlin label: Kotlin source: > @@ -1967,14 +2069,12 @@ paths: // Call the API - var response = client.deleteUserToken( + client.deleteUserToken( userToken = "test-user-1", ) - // Use the response - - println(response) + // >LOG - lang: php label: PHP source: > @@ -1986,14 +2086,12 @@ paths: // Call the API - $response = $client->deleteUserToken( + $client->deleteUserToken( 'test-user-1', ); - // play with the response - - var_dump($response); + // >LOG - lang: python label: Python source: > @@ -2005,19 +2103,12 @@ paths: # Call the API - response = await _client.delete_user_token( + await _client.delete_user_token( user_token="test-user-1", ) - # use the class directly - - print(response) - - - # print the JSON response - - print(response.to_json()) + # >LOG - lang: ruby label: Ruby source: > @@ -2029,17 +2120,9 @@ paths: # Call the API - response = client.delete_user_token("test-user-1") - + client.delete_user_token("test-user-1") - # use the class directly - - puts(response) - - - # print the JSON response - - puts(response.to_json) + # >LOG - lang: scala label: Scala source: > @@ -2051,14 +2134,12 @@ paths: // Call the API - val response = client.deleteUserToken( + client.deleteUserToken( userToken = "test-user-1" ) - // Use the response - - val value = Await.result(response, Duration(100, "sec")) + // >LOG - lang: swift label: Swift source: > @@ -2070,8 +2151,9 @@ paths: // Call the API - let response = try await client.deleteUserToken(userToken: - "test-user-1") + try await client.deleteUserToken(userToken: "test-user-1") + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/insights.yml b/specs/bundled/insights.yml index cd37772ed6..e4fa194778 100644 --- a/specs/bundled/insights.yml +++ b/specs/bundled/insights.yml @@ -718,6 +718,26 @@ paths: application/json: schema: $ref: '#/components/schemas/EventsResponse' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - insights + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/monitoring.doc.yml b/specs/bundled/monitoring.doc.yml index af64057569..657aabbdc8 100644 --- a/specs/bundled/monitoring.doc.yml +++ b/specs/bundled/monitoring.doc.yml @@ -118,6 +118,8 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + + // >LOG - lang: go label: Go source: | @@ -137,6 +139,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -151,6 +154,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -160,6 +165,7 @@ paths: // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -178,6 +184,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -197,6 +205,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -211,6 +221,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -230,6 +241,8 @@ paths: response = client.custom_get("test/minimal") + # >LOG + # use the class directly puts(response) @@ -254,6 +267,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -269,6 +284,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -310,6 +327,8 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + + // >LOG - lang: go label: Go source: | @@ -329,6 +348,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -343,6 +363,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -352,6 +374,7 @@ paths: // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -370,6 +393,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -389,6 +414,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -403,6 +430,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -422,6 +450,8 @@ paths: response = client.custom_post("test/minimal") + # >LOG + # use the class directly puts(response) @@ -446,6 +476,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -461,6 +493,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -502,6 +536,8 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + + // >LOG - lang: go label: Go source: | @@ -521,6 +557,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -535,6 +572,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -544,6 +583,7 @@ paths: // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -562,6 +602,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -581,6 +623,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -595,6 +639,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -614,6 +659,8 @@ paths: response = client.custom_put("test/minimal") + # >LOG + # use the class directly puts(response) @@ -638,6 +685,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -653,6 +702,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -688,6 +739,8 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + + // >LOG - lang: go label: Go source: > @@ -714,6 +767,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -729,6 +784,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -743,6 +800,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -762,6 +821,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -781,6 +842,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -795,6 +858,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -814,6 +878,8 @@ paths: response = client.custom_delete("test/minimal") + # >LOG + # use the class directly puts(response) @@ -838,6 +904,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -853,6 +921,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /1/status: get: operationId: getStatus @@ -879,6 +949,8 @@ paths: // Call the API var response = await client.GetStatusAsync(); + + // >LOG - lang: go label: Go source: | @@ -896,6 +968,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -910,6 +983,8 @@ paths: // Call the API client.getStatus(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -919,6 +994,7 @@ paths: // Call the API const response = await client.getStatus(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -935,6 +1011,8 @@ paths: var response = client.getStatus() + // >LOG + // Use the response println(response) @@ -952,6 +1030,8 @@ paths: $response = $client->getStatus(); + // >LOG + // play with the response var_dump($response); @@ -964,6 +1044,7 @@ paths: # Call the API response = await _client.get_status() + # >LOG # use the class directly print(response) @@ -983,6 +1064,8 @@ paths: response = client.get_status + # >LOG + # use the class directly puts(response) @@ -1007,6 +1090,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1022,6 +1107,8 @@ paths: // Call the API let response = try await client.getStatus() + + // >LOG /1/status/{clusters}: get: summary: Retrieve cluster status @@ -1052,6 +1139,8 @@ paths: // Call the API var response = await client.GetClusterStatusAsync("c1-de"); + + // >LOG - lang: go label: Go source: > @@ -1078,6 +1167,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1093,6 +1184,8 @@ paths: // Call the API client.getClusterStatus("c1-de"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1107,6 +1200,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1126,6 +1221,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1145,6 +1242,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1159,6 +1258,7 @@ paths: clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -1178,6 +1278,8 @@ paths: response = client.get_cluster_status("c1-de") + # >LOG + # use the class directly puts(response) @@ -1202,6 +1304,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1217,6 +1321,8 @@ paths: // Call the API let response = try await client.getClusterStatus(clusters: "c1-de") + + // >LOG /1/incidents: get: summary: Retrieve all incidents @@ -1243,6 +1349,8 @@ paths: // Call the API var response = await client.GetIncidentsAsync(); + + // >LOG - lang: go label: Go source: | @@ -1260,6 +1368,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -1274,6 +1383,8 @@ paths: // Call the API client.getIncidents(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1283,6 +1394,7 @@ paths: // Call the API const response = await client.getIncidents(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1299,6 +1411,8 @@ paths: var response = client.getIncidents() + // >LOG + // Use the response println(response) @@ -1316,6 +1430,8 @@ paths: $response = $client->getIncidents(); + // >LOG + // play with the response var_dump($response); @@ -1328,6 +1444,7 @@ paths: # Call the API response = await _client.get_incidents() + # >LOG # use the class directly print(response) @@ -1347,6 +1464,8 @@ paths: response = client.get_incidents + # >LOG + # use the class directly puts(response) @@ -1371,6 +1490,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1386,6 +1507,8 @@ paths: // Call the API let response = try await client.getIncidents() + + // >LOG /1/incidents/{clusters}: get: summary: Retrieve cluster incidents @@ -1416,6 +1539,8 @@ paths: // Call the API var response = await client.GetClusterIncidentsAsync("c1-de"); + + // >LOG - lang: go label: Go source: > @@ -1442,6 +1567,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1457,6 +1584,8 @@ paths: // Call the API client.getClusterIncidents("c1-de"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1471,6 +1600,8 @@ paths: 'c1-de' }); + // >LOG + // use typed response console.log(response); @@ -1490,6 +1621,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1509,6 +1642,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1523,6 +1658,7 @@ paths: clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -1542,6 +1678,8 @@ paths: response = client.get_cluster_incidents("c1-de") + # >LOG + # use the class directly puts(response) @@ -1566,6 +1704,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1582,6 +1722,8 @@ paths: let response = try await client.getClusterIncidents(clusters: "c1-de") + + // >LOG /1/inventory/servers: get: summary: Retrieve servers @@ -1619,6 +1761,8 @@ paths: // Call the API var response = await client.GetServersAsync(); + + // >LOG - lang: go label: Go source: | @@ -1636,6 +1780,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -1650,6 +1795,8 @@ paths: // Call the API client.getServers(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1659,6 +1806,7 @@ paths: // Call the API const response = await client.getServers(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1675,6 +1823,8 @@ paths: var response = client.getServers() + // >LOG + // Use the response println(response) @@ -1692,6 +1842,8 @@ paths: $response = $client->getServers(); + // >LOG + // play with the response var_dump($response); @@ -1704,6 +1856,7 @@ paths: # Call the API response = await _client.get_servers() + # >LOG # use the class directly print(response) @@ -1723,6 +1876,8 @@ paths: response = client.get_servers + # >LOG + # use the class directly puts(response) @@ -1747,6 +1902,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1762,6 +1919,8 @@ paths: // Call the API let response = try await client.getServers() + + // >LOG /1/latency/{clusters}: get: summary: Retrieve search latency times @@ -1790,6 +1949,8 @@ paths: // Call the API var response = await client.GetLatencyAsync("c1-de"); + + // >LOG - lang: go label: Go source: | @@ -1809,6 +1970,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -1823,6 +1985,8 @@ paths: // Call the API client.getLatency("c1-de"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1832,6 +1996,7 @@ paths: // Call the API const response = await client.getLatency({ clusters: 'c1-de' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1850,6 +2015,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1869,6 +2036,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1883,6 +2052,7 @@ paths: clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -1902,6 +2072,8 @@ paths: response = client.get_latency("c1-de") + # >LOG + # use the class directly puts(response) @@ -1926,6 +2098,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1941,6 +2115,8 @@ paths: // Call the API let response = try await client.getLatency(clusters: "c1-de") + + // >LOG /1/indexing/{clusters}: get: summary: Retrieve indexing times @@ -1969,6 +2145,8 @@ paths: // Call the API var response = await client.GetIndexingTimeAsync("c1-de"); + + // >LOG - lang: go label: Go source: > @@ -1995,6 +2173,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2010,6 +2190,8 @@ paths: // Call the API client.getIndexingTime("c1-de"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2024,6 +2206,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -2043,6 +2227,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2062,6 +2248,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2076,6 +2264,7 @@ paths: clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -2095,6 +2284,8 @@ paths: response = client.get_indexing_time("c1-de") + # >LOG + # use the class directly puts(response) @@ -2119,6 +2310,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2134,6 +2327,8 @@ paths: // Call the API let response = try await client.getIndexingTime(clusters: "c1-de") + + // >LOG /1/reachability/{clusters}/probes: get: summary: Test the reachability of clusters @@ -2162,6 +2357,8 @@ paths: // Call the API var response = await client.GetReachabilityAsync("c1-de"); + + // >LOG - lang: go label: Go source: > @@ -2188,6 +2385,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2203,6 +2402,8 @@ paths: // Call the API client.getReachability("c1-de"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2217,6 +2418,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -2236,6 +2439,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2255,6 +2460,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2269,6 +2476,7 @@ paths: clusters="c1-de", ) + # >LOG # use the class directly print(response) @@ -2288,6 +2496,8 @@ paths: response = client.get_reachability("c1-de") + # >LOG + # use the class directly puts(response) @@ -2312,6 +2522,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2327,6 +2539,8 @@ paths: // Call the API let response = try await client.getReachability(clusters: "c1-de") + + // >LOG /1/infrastructure/{metric}/period/{period}: get: summary: Retrieve metrics @@ -2367,6 +2581,8 @@ paths: Enum.Parse("AvgBuildTime"), Enum.Parse("Minute") ); + + // >LOG - lang: go label: Go source: | @@ -2386,6 +2602,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -2400,6 +2617,8 @@ paths: // Call the API client.getMetrics(Metric.AVG_BUILD_TIME, Period.MINUTE); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2414,6 +2633,8 @@ paths: period: 'minute' }); + // >LOG + // use typed response console.log(response); @@ -2434,6 +2655,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2454,6 +2677,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2469,6 +2694,7 @@ paths: period="minute", ) + # >LOG # use the class directly print(response) @@ -2488,6 +2714,8 @@ paths: response = client.get_metrics("avg_build_time", "minute") + # >LOG + # use the class directly puts(response) @@ -2513,6 +2741,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2529,6 +2759,8 @@ paths: let response = try await client.getMetrics(metric: Metric.avgBuildTime, period: Period.minute) + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/monitoring.yml b/specs/bundled/monitoring.yml index 17e7d20ba7..b30cfd076c 100644 --- a/specs/bundled/monitoring.yml +++ b/specs/bundled/monitoring.yml @@ -344,6 +344,26 @@ paths: $ref: '#/components/responses/InfrastructureResponse' '401': $ref: '#/components/responses/InfrastructureAPIUnauthorized' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - monitoring + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/personalization.doc.yml b/specs/bundled/personalization.doc.yml index 007667fb8a..3ba178d5ce 100644 --- a/specs/bundled/personalization.doc.yml +++ b/specs/bundled/personalization.doc.yml @@ -134,6 +134,7 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -161,6 +162,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -177,6 +180,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -191,6 +196,8 @@ paths: const response = await client.customGet({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -210,6 +217,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -229,6 +238,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -248,6 +259,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -270,6 +283,8 @@ paths: response = client.custom_get("test/minimal") + # >LOG + # use the class directly puts(response) @@ -294,6 +309,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -309,6 +326,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -348,6 +367,7 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -375,6 +395,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -391,6 +413,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -405,6 +429,8 @@ paths: const response = await client.customPost({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -424,6 +450,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -443,6 +471,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -462,6 +492,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -484,6 +516,8 @@ paths: response = client.custom_post("test/minimal") + # >LOG + # use the class directly puts(response) @@ -508,6 +542,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -523,6 +559,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -562,6 +600,7 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -589,6 +628,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -605,6 +646,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -619,6 +662,8 @@ paths: const response = await client.customPut({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -638,6 +683,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -657,6 +704,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -676,6 +725,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -698,6 +749,8 @@ paths: response = client.custom_put("test/minimal") + # >LOG + # use the class directly puts(response) @@ -722,6 +775,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -737,6 +792,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -770,6 +827,7 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -798,6 +856,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -814,6 +874,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -829,6 +891,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -848,6 +912,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -867,6 +933,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -886,6 +954,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -908,6 +978,8 @@ paths: response = client.custom_delete("test/minimal") + # >LOG + # use the class directly puts(response) @@ -932,6 +1004,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -947,6 +1021,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /1/profiles/personalization/{userToken}: get: tags: @@ -1008,6 +1084,7 @@ paths: // Call the API var response = await client.GetUserTokenProfileAsync("UserToken"); + // >LOG - lang: go label: Go source: > @@ -1036,6 +1113,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1052,6 +1131,8 @@ paths: // Call the API client.getUserTokenProfile("UserToken"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1067,6 +1148,8 @@ paths: 'UserToken' }); + // >LOG + // use typed response console.log(response); @@ -1086,6 +1169,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1105,6 +1190,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1124,6 +1211,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1146,6 +1235,8 @@ paths: response = client.get_user_token_profile("UserToken") + # >LOG + # use the class directly puts(response) @@ -1170,6 +1261,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1186,6 +1279,8 @@ paths: let response = try await client.getUserTokenProfile(userToken: "UserToken") + + // >LOG /1/profiles/{userToken}: delete: tags: @@ -1244,6 +1339,7 @@ paths: // Call the API var response = await client.DeleteUserProfileAsync("UserToken"); + // >LOG - lang: go label: Go source: > @@ -1272,6 +1368,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1288,6 +1386,8 @@ paths: // Call the API client.deleteUserProfile("UserToken"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1303,6 +1403,8 @@ paths: 'UserToken' }); + // >LOG + // use typed response console.log(response); @@ -1322,6 +1424,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1341,6 +1445,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1360,6 +1466,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1382,6 +1490,8 @@ paths: response = client.delete_user_profile("UserToken") + # >LOG + # use the class directly puts(response) @@ -1406,6 +1516,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1422,6 +1534,8 @@ paths: let response = try await client.deleteUserProfile(userToken: "UserToken") + + // >LOG /1/strategies/personalization: get: tags: @@ -1457,6 +1571,7 @@ paths: // Call the API var response = await client.GetPersonalizationStrategyAsync(); + // >LOG - lang: go label: Go source: > @@ -1482,6 +1597,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1498,6 +1615,8 @@ paths: // Call the API client.getPersonalizationStrategy(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1512,6 +1631,8 @@ paths: const response = await client.getPersonalizationStrategy(); + // >LOG + // use typed response console.log(response); @@ -1529,6 +1650,8 @@ paths: var response = client.getPersonalizationStrategy() + // >LOG + // Use the response println(response) @@ -1546,6 +1669,8 @@ paths: $response = $client->getPersonalizationStrategy(); + // >LOG + // play with the response var_dump($response); @@ -1563,6 +1688,8 @@ paths: response = await _client.get_personalization_strategy() + # >LOG + # use the class directly print(response) @@ -1585,6 +1712,8 @@ paths: response = client.get_personalization_strategy + # >LOG + # use the class directly puts(response) @@ -1609,6 +1738,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1624,6 +1755,8 @@ paths: // Call the API let response = try await client.getPersonalizationStrategy() + + // >LOG post: tags: - strategies @@ -1691,6 +1824,7 @@ paths: PersonalizationImpact = 42, } ); + // >LOG - lang: go label: Go source: > @@ -1722,6 +1856,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1743,6 +1879,8 @@ paths: .setFacetScoring(Arrays.asList(new FacetScoring().setScore(42).setFacetName("Event"))) .setPersonalizationImpact(42) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1761,6 +1899,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1795,6 +1935,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1826,6 +1968,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1860,6 +2004,8 @@ paths: ) + # >LOG + # use the class directly print(response) @@ -1888,6 +2034,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -1927,6 +2075,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1951,6 +2101,7 @@ paths: facetScoring: [FacetScoring(score: 42, facetName: "Event")], personalizationImpact: 42 )) + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/personalization.yml b/specs/bundled/personalization.yml index 818d136f0c..280caac219 100644 --- a/specs/bundled/personalization.yml +++ b/specs/bundled/personalization.yml @@ -368,6 +368,26 @@ paths: $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - personalization + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/query-suggestions.doc.yml b/specs/bundled/query-suggestions.doc.yml index d3ed90a62c..c0f896b66b 100644 --- a/specs/bundled/query-suggestions.doc.yml +++ b/specs/bundled/query-suggestions.doc.yml @@ -134,6 +134,7 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -161,6 +162,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -177,6 +180,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -191,6 +196,8 @@ paths: const response = await client.customGet({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -210,6 +217,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -229,6 +238,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -245,6 +256,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -264,6 +276,8 @@ paths: response = client.custom_get("test/minimal") + # >LOG + # use the class directly puts(response) @@ -288,6 +302,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -303,6 +319,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -342,6 +360,7 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -369,6 +388,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -385,6 +406,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -399,6 +422,8 @@ paths: const response = await client.customPost({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -418,6 +443,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -437,6 +464,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -453,6 +482,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -472,6 +502,8 @@ paths: response = client.custom_post("test/minimal") + # >LOG + # use the class directly puts(response) @@ -496,6 +528,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -511,6 +545,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -550,6 +586,7 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -577,6 +614,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -593,6 +632,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -607,6 +648,8 @@ paths: const response = await client.customPut({ path: 'test/minimal' }); + // >LOG + // use typed response console.log(response); @@ -626,6 +669,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -645,6 +690,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -661,6 +708,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -680,6 +728,8 @@ paths: response = client.custom_put("test/minimal") + # >LOG + # use the class directly puts(response) @@ -704,6 +754,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -719,6 +771,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -752,6 +806,7 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + // >LOG - lang: go label: Go source: > @@ -780,6 +835,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -796,6 +853,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -811,6 +870,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -830,6 +891,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -849,6 +912,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -865,6 +930,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -884,6 +950,8 @@ paths: response = client.custom_delete("test/minimal") + # >LOG + # use the class directly puts(response) @@ -908,6 +976,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -923,6 +993,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /1/configs: get: tags: @@ -956,6 +1028,7 @@ paths: // Call the API var response = await client.GetAllConfigsAsync(); + // >LOG - lang: go label: Go source: > @@ -981,6 +1054,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -997,6 +1072,8 @@ paths: // Call the API client.getAllConfigs(); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1011,6 +1088,8 @@ paths: const response = await client.getAllConfigs(); + // >LOG + // use typed response console.log(response); @@ -1028,6 +1107,8 @@ paths: var response = client.getAllConfigs() + // >LOG + // Use the response println(response) @@ -1045,6 +1126,8 @@ paths: $response = $client->getAllConfigs(); + // >LOG + // play with the response var_dump($response); @@ -1059,6 +1142,7 @@ paths: # Call the API response = await _client.get_all_configs() + # >LOG # use the class directly print(response) @@ -1078,6 +1162,8 @@ paths: response = client.get_all_configs + # >LOG + # use the class directly puts(response) @@ -1102,6 +1188,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1117,6 +1205,8 @@ paths: // Call the API let response = try await client.getAllConfigs() + + // >LOG post: tags: - configurations @@ -1188,6 +1278,7 @@ paths: Exclude = new List { "test" }, } ); + // >LOG - lang: go label: Go source: > @@ -1224,6 +1315,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1253,6 +1346,8 @@ paths: .setLanguages(Languages.of(Arrays.asList("french"))) .setExclude(Arrays.asList("test")) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1274,6 +1369,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1308,6 +1405,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1353,6 +1452,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1396,6 +1497,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -1428,6 +1530,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -1469,6 +1573,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1494,6 +1600,8 @@ paths: exclude: ["test"], indexName: "" )) + + // >LOG /1/configs/{indexName}: get: tags: @@ -1529,6 +1637,7 @@ paths: // Call the API var response = await client.GetConfigAsync(""); + // >LOG - lang: go label: Go source: > @@ -1556,6 +1665,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1572,6 +1683,8 @@ paths: // Call the API client.getConfig(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1587,6 +1700,8 @@ paths: 'cts_e2e_browse_query_suggestions' }); + // >LOG + // use typed response console.log(response); @@ -1606,6 +1721,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1625,6 +1742,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1641,6 +1760,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -1660,6 +1780,8 @@ paths: response = client.get_config("") + # >LOG + # use the class directly puts(response) @@ -1684,6 +1806,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1700,6 +1824,8 @@ paths: let response = try await client.getConfig(indexName: "") + + // >LOG put: tags: - configurations @@ -1766,6 +1892,7 @@ paths: Exclude = new List { "test" }, } ); + // >LOG - lang: go label: Go source: > @@ -1802,6 +1929,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1831,6 +1960,8 @@ paths: .setLanguages(Languages.of(Arrays.asList("french"))) .setExclude(Arrays.asList("test")) ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1854,6 +1985,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1888,6 +2021,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1933,6 +2068,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1976,6 +2113,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -2008,6 +2146,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -2049,6 +2189,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2075,6 +2217,8 @@ paths: exclude: ["test"] ) ) + + // >LOG delete: tags: - configurations @@ -2121,6 +2265,7 @@ paths: // Call the API var response = await client.DeleteConfigAsync(""); + // >LOG - lang: go label: Go source: > @@ -2149,6 +2294,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2165,6 +2312,8 @@ paths: // Call the API client.deleteConfig(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2180,6 +2329,8 @@ paths: 'theIndexName' }); + // >LOG + // use typed response console.log(response); @@ -2199,6 +2350,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2218,6 +2371,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2234,6 +2389,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -2253,6 +2409,8 @@ paths: response = client.delete_config("") + # >LOG + # use the class directly puts(response) @@ -2277,6 +2435,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2293,6 +2453,8 @@ paths: let response = try await client.deleteConfig(indexName: "") + + // >LOG /1/configs/{indexName}/status: get: tags: @@ -2357,6 +2519,8 @@ paths: var response = await client.GetConfigStatusAsync(""); + + // >LOG - lang: go label: Go source: > @@ -2385,6 +2549,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2401,6 +2567,8 @@ paths: // Call the API client.getConfigStatus(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2416,6 +2584,8 @@ paths: 'theIndexName' }); + // >LOG + // use typed response console.log(response); @@ -2435,6 +2605,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2454,6 +2626,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2470,6 +2644,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -2489,6 +2664,8 @@ paths: response = client.get_config_status("") + # >LOG + # use the class directly puts(response) @@ -2513,6 +2690,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2529,6 +2708,8 @@ paths: let response = try await client.getConfigStatus(indexName: "") + + // >LOG /1/logs/{indexName}: get: tags: @@ -2588,6 +2769,7 @@ paths: // Call the API var response = await client.GetLogFileAsync(""); + // >LOG - lang: go label: Go source: > @@ -2615,6 +2797,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2631,6 +2815,8 @@ paths: // Call the API client.getLogFile(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2646,6 +2832,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -2665,6 +2853,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2684,6 +2874,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2700,6 +2892,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -2719,6 +2912,8 @@ paths: response = client.get_log_file("") + # >LOG + # use the class directly puts(response) @@ -2743,6 +2938,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2759,6 +2956,8 @@ paths: let response = try await client.getLogFile(indexName: "") + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/query-suggestions.yml b/specs/bundled/query-suggestions.yml index b5ecb0da54..5136ca1aa0 100644 --- a/specs/bundled/query-suggestions.yml +++ b/specs/bundled/query-suggestions.yml @@ -462,6 +462,26 @@ paths: $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - query-suggestions + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/recommend.doc.yml b/specs/bundled/recommend.doc.yml index 36f5100591..924865cbac 100644 --- a/specs/bundled/recommend.doc.yml +++ b/specs/bundled/recommend.doc.yml @@ -183,6 +183,8 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + + // >LOG - lang: dart label: Dart source: > @@ -197,6 +199,8 @@ paths: final response = await client.customGet( path: "test/minimal", ); + + // >LOG - lang: go label: Go source: | @@ -216,6 +220,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -230,6 +235,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -239,6 +246,7 @@ paths: // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -257,6 +265,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -276,6 +286,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -290,6 +302,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -309,6 +322,8 @@ paths: response = client.custom_get("test/minimal") + # >LOG + # use the class directly puts(response) @@ -333,6 +348,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -348,6 +365,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -389,6 +408,8 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + + // >LOG - lang: dart label: Dart source: > @@ -403,6 +424,8 @@ paths: final response = await client.customPost( path: "test/minimal", ); + + // >LOG - lang: go label: Go source: | @@ -422,6 +445,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -436,6 +460,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -445,6 +471,7 @@ paths: // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -463,6 +490,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -482,6 +511,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -496,6 +527,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -515,6 +547,8 @@ paths: response = client.custom_post("test/minimal") + # >LOG + # use the class directly puts(response) @@ -539,6 +573,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -554,6 +590,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -595,6 +633,8 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + + // >LOG - lang: dart label: Dart source: > @@ -609,6 +649,8 @@ paths: final response = await client.customPut( path: "test/minimal", ); + + // >LOG - lang: go label: Go source: | @@ -628,6 +670,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -642,6 +685,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -651,6 +696,7 @@ paths: // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -669,6 +715,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -688,6 +736,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -702,6 +752,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -721,6 +772,8 @@ paths: response = client.custom_put("test/minimal") + # >LOG + # use the class directly puts(response) @@ -745,6 +798,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -760,6 +815,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -795,6 +852,8 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + + // >LOG - lang: dart label: Dart source: > @@ -809,6 +868,8 @@ paths: final response = await client.customDelete( path: "test/minimal", ); + + // >LOG - lang: go label: Go source: > @@ -835,6 +896,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -850,6 +913,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -864,6 +929,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -883,6 +950,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -902,6 +971,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -916,6 +987,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -935,6 +1007,8 @@ paths: response = client.custom_delete("test/minimal") + # >LOG + # use the class directly puts(response) @@ -959,6 +1033,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -974,6 +1050,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /1/indexes/*/recommendations: post: tags: @@ -1059,6 +1137,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -1082,6 +1162,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: > @@ -1111,6 +1193,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1137,6 +1221,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1148,6 +1234,7 @@ paths: requests: [{ indexName: 'indexName', objectID: 'objectID', model: 'related-products', threshold: 42.1 }], }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1175,6 +1262,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1201,6 +1290,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1224,6 +1315,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -1254,6 +1346,8 @@ paths: ) + # >LOG + # use the class directly puts(response) @@ -1287,6 +1381,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1311,6 +1407,7 @@ paths: objectID: "objectID" )), ])) + // >LOG /1/indexes/{indexName}/{model}/recommend/rules/{objectID}: get: tags: @@ -1358,6 +1455,8 @@ paths: Enum.Parse("RelatedProducts"), "objectID" ); + + // >LOG - lang: dart label: Dart source: > @@ -1374,6 +1473,8 @@ paths: model: RecommendModels.fromJson("related-products"), objectID: "objectID", ); + + // >LOG - lang: go label: Go source: > @@ -1400,6 +1501,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1416,6 +1519,8 @@ paths: client.getRecommendRule("", RecommendModels.RELATED_PRODUCTS, "objectID"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1429,6 +1534,7 @@ paths: objectID: 'objectID', }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1449,6 +1555,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1470,6 +1578,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1486,6 +1596,7 @@ paths: object_id="objectID", ) + # >LOG # use the class directly print(response) @@ -1506,6 +1617,8 @@ paths: "related-products", "objectID") + # >LOG + # use the class directly puts(response) @@ -1532,6 +1645,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1551,6 +1666,8 @@ paths: model: RecommendModels.relatedProducts, objectID: "objectID" ) + + // >LOG delete: tags: - rules @@ -1591,6 +1708,8 @@ paths: Enum.Parse("RelatedProducts"), "objectID" ); + + // >LOG - lang: dart label: Dart source: > @@ -1607,6 +1726,8 @@ paths: model: RecommendModels.fromJson("related-products"), objectID: "objectID", ); + + // >LOG - lang: go label: Go source: > @@ -1633,6 +1754,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1649,6 +1772,8 @@ paths: client.deleteRecommendRule("", RecommendModels.RELATED_PRODUCTS, "objectID"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1662,6 +1787,7 @@ paths: objectID: 'objectID', }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1682,6 +1808,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1703,6 +1831,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1719,6 +1849,7 @@ paths: object_id="objectID", ) + # >LOG # use the class directly print(response) @@ -1739,6 +1870,8 @@ paths: "related-products", "objectID") + # >LOG + # use the class directly puts(response) @@ -1765,6 +1898,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1784,6 +1919,8 @@ paths: model: RecommendModels.relatedProducts, objectID: "objectID" ) + + // >LOG /1/indexes/{indexName}/{model}/task/{taskID}: get: tags: @@ -1851,6 +1988,8 @@ paths: Enum.Parse("RelatedProducts"), 12345L ); + + // >LOG - lang: dart label: Dart source: > @@ -1867,6 +2006,8 @@ paths: model: RecommendModels.fromJson("related-products"), taskID: 12345, ); + + // >LOG - lang: go label: Go source: > @@ -1893,6 +2034,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1909,6 +2052,8 @@ paths: client.getRecommendStatus("", RecommendModels.RELATED_PRODUCTS, 12345L); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1922,6 +2067,7 @@ paths: taskID: 12345, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1942,6 +2088,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1963,6 +2111,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -1979,6 +2129,7 @@ paths: task_id=12345, ) + # >LOG # use the class directly print(response) @@ -1999,6 +2150,8 @@ paths: "related-products", 12345) + # >LOG + # use the class directly puts(response) @@ -2025,6 +2178,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2044,6 +2199,8 @@ paths: model: RecommendModels.relatedProducts, taskID: Int64(12345) ) + + // >LOG /1/indexes/{indexName}/{model}/recommend/rules/search: post: tags: @@ -2160,6 +2317,8 @@ paths: "", Enum.Parse("RelatedProducts") ); + + // >LOG - lang: dart label: Dart source: > @@ -2175,6 +2334,8 @@ paths: indexName: "", model: RecommendModels.fromJson("related-products"), ); + + // >LOG - lang: go label: Go source: > @@ -2201,6 +2362,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2217,6 +2380,8 @@ paths: client.searchRecommendRules("", RecommendModels.RELATED_PRODUCTS); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2231,6 +2396,8 @@ paths: 'indexName', model: 'related-products' }); + // >LOG + // use typed response console.log(response); @@ -2251,6 +2418,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2271,6 +2440,8 @@ paths: ); + // >LOG + // play with the response var_dump($response); @@ -2286,6 +2457,7 @@ paths: model="related-products", ) + # >LOG # use the class directly print(response) @@ -2306,6 +2478,8 @@ paths: "related-products") + # >LOG + # use the class directly puts(response) @@ -2331,6 +2505,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2349,6 +2525,8 @@ paths: indexName: "", model: RecommendModels.relatedProducts ) + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/recommend.yml b/specs/bundled/recommend.yml index 956de5bfc5..a784f3d345 100644 --- a/specs/bundled/recommend.yml +++ b/specs/bundled/recommend.yml @@ -515,6 +515,26 @@ paths: $ref: '#/components/responses/MethodNotAllowed' '404': $ref: '#/components/responses/IndexNotFound' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - recommend + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/search.doc.yml b/specs/bundled/search.doc.yml index c052343c94..2ed9a87d42 100644 --- a/specs/bundled/search.doc.yml +++ b/specs/bundled/search.doc.yml @@ -305,6 +305,8 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + + // >LOG - lang: dart label: Dart source: > @@ -319,6 +321,8 @@ paths: final response = await client.customGet( path: "test/minimal", ); + + // >LOG - lang: go label: Go source: | @@ -338,6 +342,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -352,6 +357,8 @@ paths: // Call the API client.customGet("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -361,6 +368,7 @@ paths: // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -379,6 +387,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -393,6 +403,7 @@ paths: 'test/minimal', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -406,6 +417,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -420,6 +432,7 @@ paths: # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -441,6 +454,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -456,6 +471,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -497,6 +514,8 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + + // >LOG - lang: dart label: Dart source: > @@ -511,6 +530,8 @@ paths: final response = await client.customPost( path: "test/minimal", ); + + // >LOG - lang: go label: Go source: | @@ -530,6 +551,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -544,6 +566,8 @@ paths: // Call the API client.customPost("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -553,6 +577,7 @@ paths: // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -571,6 +596,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -585,6 +612,7 @@ paths: 'test/minimal', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -598,6 +626,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -612,6 +641,7 @@ paths: # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -633,6 +663,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -648,6 +680,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -689,6 +723,8 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + + // >LOG - lang: dart label: Dart source: > @@ -703,6 +739,8 @@ paths: final response = await client.customPut( path: "test/minimal", ); + + // >LOG - lang: go label: Go source: | @@ -722,6 +760,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -736,6 +775,8 @@ paths: // Call the API client.customPut("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -745,6 +786,7 @@ paths: // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -763,6 +805,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -777,6 +821,7 @@ paths: 'test/minimal', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -790,6 +835,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -804,6 +850,7 @@ paths: # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -825,6 +872,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -840,6 +889,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -875,6 +926,8 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + + // >LOG - lang: dart label: Dart source: > @@ -889,6 +942,8 @@ paths: final response = await client.customDelete( path: "test/minimal", ); + + // >LOG - lang: go label: Go source: > @@ -915,6 +970,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -930,6 +987,8 @@ paths: // Call the API client.customDelete("test/minimal"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -944,6 +1003,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -963,6 +1024,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -977,6 +1040,7 @@ paths: 'test/minimal', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -990,6 +1054,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -1004,6 +1069,7 @@ paths: # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -1025,6 +1091,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1040,6 +1108,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /1/indexes/{indexName}/query: post: tags: @@ -1095,6 +1165,8 @@ paths: var response = await client.SearchSingleIndexAsync(""); + + // >LOG - lang: dart label: Dart source: > @@ -1109,6 +1181,8 @@ paths: final response = await client.searchSingleIndex( indexName: "", ); + + // >LOG - lang: go label: Go source: > @@ -1135,6 +1209,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1150,6 +1226,8 @@ paths: // Call the API client.searchSingleIndex("", Hit.class); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1164,6 +1242,8 @@ paths: 'indexName' }); + // >LOG + // use typed response console.log(response); @@ -1183,6 +1263,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1197,6 +1279,7 @@ paths: '', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -1210,6 +1293,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -1224,6 +1308,7 @@ paths: # Call the API response = client.search_single_index("") + # >LOG # use the class directly puts(response) @@ -1245,6 +1330,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1261,6 +1348,8 @@ paths: let response: SearchResponse = try await client.searchSingleIndex(indexName: "") + + // >LOG /1/indexes/*/queries: post: tags: @@ -1356,6 +1445,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -1378,6 +1469,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: | @@ -1400,6 +1493,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -1418,6 +1512,8 @@ paths: .setRequests(Arrays.asList(new SearchForHits().setIndexName("").setQuery("").setHitsPerPage(50))), Hit.class ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1429,6 +1525,7 @@ paths: requests: [{ indexName: '', query: '', hitsPerPage: 50 }], }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1455,6 +1552,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1475,6 +1574,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -1496,6 +1596,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -1514,6 +1615,7 @@ paths: ) ) + # >LOG # use the class directly puts(response) @@ -1543,6 +1645,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1563,6 +1667,7 @@ paths: hitsPerPage: 50, indexName: "" ))])) + // >LOG /1/indexes/{indexName}/facets/{facetName}/query: post: tags: @@ -1637,6 +1742,8 @@ paths: var response = await client.SearchForFacetValuesAsync("", "facetName"); + + // >LOG - lang: dart label: Dart source: > @@ -1652,6 +1759,8 @@ paths: indexName: "", facetName: "facetName", ); + + // >LOG - lang: go label: Go source: > @@ -1678,6 +1787,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1693,6 +1804,8 @@ paths: // Call the API client.searchForFacetValues("", "facetName"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1707,6 +1820,8 @@ paths: 'indexName', facetName: 'facetName' }); + // >LOG + // use typed response console.log(response); @@ -1727,6 +1842,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1742,6 +1859,7 @@ paths: 'facetName', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -1756,6 +1874,7 @@ paths: facet_name="facetName", ) + # >LOG # use the class directly print(response) @@ -1775,6 +1894,8 @@ paths: "facetName") + # >LOG + # use the class directly puts(response) @@ -1800,6 +1921,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1816,6 +1939,8 @@ paths: let response = try await client.searchForFacetValues(indexName: "", facetName: "facetName") + + // >LOG /1/indexes/{indexName}/browse: post: tags: @@ -1908,6 +2033,8 @@ paths: // Call the API var response = await client.BrowseAsync(""); + + // >LOG - lang: dart label: Dart source: > @@ -1922,6 +2049,8 @@ paths: final response = await client.browse( indexName: "", ); + + // >LOG - lang: go label: Go source: | @@ -1941,6 +2070,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -1955,6 +2085,8 @@ paths: // Call the API client.browse("", Hit.class); + + // >LOG - lang: javascript label: JavaScript source: > @@ -1969,6 +2101,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -1988,6 +2122,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2002,6 +2138,7 @@ paths: '', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -2015,6 +2152,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -2029,6 +2167,7 @@ paths: # Call the API response = client.browse("") + # >LOG # use the class directly puts(response) @@ -2050,6 +2189,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2066,6 +2207,8 @@ paths: let response: BrowseResponse = try await client.browse(indexName: "") + + // >LOG /1/indexes/{indexName}: post: tags: @@ -2150,6 +2293,8 @@ paths: "", new Dictionary { { "objectID", "id" }, { "test", "val" } } ); + + // >LOG - lang: dart label: Dart source: > @@ -2168,6 +2313,8 @@ paths: 'test': "val", }, ); + + // >LOG - lang: go label: Go source: | @@ -2187,6 +2334,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -2209,6 +2357,8 @@ paths: } } ); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2223,6 +2373,8 @@ paths: '', body: { objectID: 'id', test: 'val' } }); + // >LOG + // use typed response console.log(response); @@ -2252,6 +2404,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2269,6 +2423,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -2286,6 +2441,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -2305,6 +2461,8 @@ paths: test: "val"}) + # >LOG + # use the class directly puts(response) @@ -2330,6 +2488,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2348,6 +2508,8 @@ paths: indexName: "", body: ["objectID": "id", "test": "val"] ) + + // >LOG delete: tags: - Indices @@ -2401,6 +2563,8 @@ paths: // Call the API var response = await client.DeleteIndexAsync(""); + + // >LOG - lang: dart label: Dart source: > @@ -2415,6 +2579,8 @@ paths: final response = await client.deleteIndex( indexName: "", ); + + // >LOG - lang: go label: Go source: | @@ -2434,6 +2600,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -2448,6 +2615,8 @@ paths: // Call the API client.deleteIndex(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -2462,6 +2631,8 @@ paths: 'theIndexName' }); + // >LOG + // use typed response console.log(response); @@ -2481,6 +2652,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2495,6 +2668,7 @@ paths: '', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -2508,6 +2682,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -2522,6 +2697,7 @@ paths: # Call the API response = client.delete_index("") + # >LOG # use the class directly puts(response) @@ -2543,6 +2719,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2559,6 +2737,8 @@ paths: let response = try await client.deleteIndex(indexName: "") + + // >LOG /1/indexes/{indexName}/{objectID}: get: tags: @@ -2630,6 +2810,8 @@ paths: "uniqueID", new List { "attr1", "attr2" } ); + + // >LOG - lang: dart label: Dart source: > @@ -2649,6 +2831,8 @@ paths: "attr2", ], ); + + // >LOG - lang: go label: Go source: | @@ -2669,6 +2853,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -2684,6 +2869,8 @@ paths: client.getObject("", "uniqueID", Arrays.asList("attr1", "attr2")); + + // >LOG - lang: javascript label: JavaScript source: | @@ -2697,6 +2884,7 @@ paths: attributesToRetrieve: ['attr1', 'attr2'], }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -2717,6 +2905,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -2737,6 +2927,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -2755,6 +2946,7 @@ paths: ], ) + # >LOG # use the class directly print(response) @@ -2774,6 +2966,8 @@ paths: ["attr1", "attr2"]) + # >LOG + # use the class directly puts(response) @@ -2800,6 +2994,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -2819,6 +3015,8 @@ paths: objectID: "uniqueID", attributesToRetrieve: ["attr1", "attr2"] ) + + // >LOG put: tags: - Records @@ -2878,6 +3076,8 @@ paths: "uniqueID", new Dictionary { { "key", "value" } } ); + + // >LOG - lang: dart label: Dart source: > @@ -2896,6 +3096,8 @@ paths: 'key': "value", }, ); + + // >LOG - lang: go label: Go source: > @@ -2922,6 +3124,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -2945,6 +3149,8 @@ paths: } } ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -2958,6 +3164,7 @@ paths: body: { key: 'value' }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -2983,6 +3190,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3000,6 +3209,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -3017,6 +3227,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -3036,6 +3247,8 @@ paths: "uniqueID", {key: "value"}) + # >LOG + # use the class directly puts(response) @@ -3062,6 +3275,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3081,6 +3296,8 @@ paths: objectID: "uniqueID", body: ["key": "value"] ) + + // >LOG delete: tags: - Records @@ -3125,6 +3342,8 @@ paths: var response = await client.DeleteObjectAsync("", "uniqueID"); + + // >LOG - lang: dart label: Dart source: > @@ -3140,6 +3359,8 @@ paths: indexName: "", objectID: "uniqueID", ); + + // >LOG - lang: go label: Go source: > @@ -3166,6 +3387,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3181,6 +3404,8 @@ paths: // Call the API client.deleteObject("", "uniqueID"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3195,6 +3420,8 @@ paths: '', objectID: 'uniqueID' }); + // >LOG + // use typed response console.log(response); @@ -3215,6 +3442,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3230,6 +3459,7 @@ paths: 'uniqueID', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -3244,6 +3474,7 @@ paths: object_id="uniqueID", ) + # >LOG # use the class directly print(response) @@ -3258,6 +3489,7 @@ paths: # Call the API response = client.delete_object("", "uniqueID") + # >LOG # use the class directly puts(response) @@ -3280,6 +3512,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3296,6 +3530,8 @@ paths: let response = try await client.deleteObject(indexName: "", objectID: "uniqueID") + + // >LOG /1/indexes/{indexName}/deleteByQuery: post: tags: @@ -3348,6 +3584,8 @@ paths: "", new DeleteByParams { Filters = "brand:brandName", } ); + + // >LOG - lang: dart label: Dart source: > @@ -3365,6 +3603,8 @@ paths: filters: "brand:brandName", ), ); + + // >LOG - lang: go label: Go source: | @@ -3385,6 +3625,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -3400,6 +3641,8 @@ paths: client.deleteBy("", new DeleteByParams().setFilters("brand:brandName")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3414,6 +3657,8 @@ paths: deleteByParams: { filters: 'brand:brandName' } }); + // >LOG + // use typed response console.log(response); @@ -3436,6 +3681,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3452,6 +3699,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -3468,6 +3716,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -3487,6 +3736,8 @@ paths: DeleteByParams.new(filters: "brand:brandName")) + # >LOG + # use the class directly puts(response) @@ -3514,6 +3765,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3532,6 +3785,8 @@ paths: indexName: "", deleteByParams: DeleteByParams(filters: "brand:brandName") ) + + // >LOG /1/indexes/{indexName}/clear: post: tags: @@ -3569,6 +3824,8 @@ paths: // Call the API var response = await client.ClearObjectsAsync(""); + + // >LOG - lang: dart label: Dart source: > @@ -3583,6 +3840,8 @@ paths: final response = await client.clearObjects( indexName: "", ); + + // >LOG - lang: go label: Go source: > @@ -3609,6 +3868,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3624,6 +3885,8 @@ paths: // Call the API client.clearObjects(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -3638,6 +3901,8 @@ paths: 'theIndexName' }); + // >LOG + // use typed response console.log(response); @@ -3657,6 +3922,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3671,6 +3938,7 @@ paths: '', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -3684,6 +3952,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -3698,6 +3967,7 @@ paths: # Call the API response = client.clear_objects("") + # >LOG # use the class directly puts(response) @@ -3719,6 +3989,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -3735,6 +4007,8 @@ paths: let response = try await client.clearObjects(indexName: "") + + // >LOG /1/indexes/{indexName}/{objectID}/partial: post: tags: @@ -3842,6 +4116,8 @@ paths: "uniqueID", new Dictionary { { "attributeId", "new value" } } ); + + // >LOG - lang: dart label: Dart source: > @@ -3860,6 +4136,8 @@ paths: 'attributeId': "new value", }, ); + + // >LOG - lang: go label: Go source: > @@ -3886,6 +4164,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -3909,6 +4189,8 @@ paths: } } ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -3922,6 +4204,7 @@ paths: attributesToUpdate: { attributeId: 'new value' }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -3947,6 +4230,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -3964,6 +4249,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -3981,6 +4267,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -4000,6 +4287,8 @@ paths: "uniqueID", {attributeId: "new value"}) + # >LOG + # use the class directly puts(response) @@ -4026,6 +4315,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4045,6 +4336,8 @@ paths: objectID: "uniqueID", attributesToUpdate: ["attributeId": "new value"] ) + + // >LOG /1/indexes/{indexName}/batch: post: tags: @@ -4118,6 +4411,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -4150,6 +4445,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: | @@ -4171,6 +4468,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -4212,6 +4510,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -4229,6 +4529,7 @@ paths: }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -4277,6 +4578,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4305,6 +4608,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -4336,6 +4640,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -4358,6 +4663,7 @@ paths: ) ) + # >LOG # use the class directly puts(response) @@ -4391,6 +4697,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4412,6 +4720,8 @@ paths: SearchBatchRequest(action: SearchAction.addObject, body: ["key": "baz", "foo": "2"]), ]) ) + + // >LOG /1/indexes/*/batch: post: tags: @@ -4527,6 +4837,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -4551,6 +4863,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: > @@ -4579,6 +4893,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -4610,6 +4926,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -4621,6 +4939,7 @@ paths: requests: [{ action: 'addObject', body: { key: 'value' }, indexName: 'theIndexName' }], }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -4652,6 +4971,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -4673,6 +4994,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -4696,6 +5018,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -4714,6 +5037,7 @@ paths: ) ) + # >LOG # use the class directly puts(response) @@ -4743,6 +5067,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -4763,6 +5089,8 @@ paths: body: ["key": "value"], indexName: "" )])) + + // >LOG /1/indexes/*/objects: post: tags: @@ -4875,6 +5203,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -4900,6 +5230,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: | @@ -4922,6 +5254,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -4947,6 +5280,8 @@ paths: ), Hit.class ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -4958,6 +5293,7 @@ paths: requests: [{ attributesToRetrieve: ['attr1', 'attr2'], objectID: 'uniqueID', indexName: 'theIndexName' }], }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -4984,6 +5320,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5008,6 +5346,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -5032,6 +5371,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -5056,6 +5396,7 @@ paths: ) ) + # >LOG # use the class directly puts(response) @@ -5085,6 +5426,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5105,6 +5448,7 @@ paths: objectID: "uniqueID", indexName: "" )])) + // >LOG /1/indexes/{indexName}/settings: get: tags: @@ -5144,6 +5488,8 @@ paths: // Call the API var response = await client.GetSettingsAsync(""); + + // >LOG - lang: dart label: Dart source: > @@ -5158,6 +5504,8 @@ paths: final response = await client.getSettings( indexName: "", ); + + // >LOG - lang: go label: Go source: | @@ -5177,6 +5525,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -5191,6 +5540,8 @@ paths: // Call the API client.getSettings(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5205,6 +5556,8 @@ paths: 'cts_e2e_settings' }); + // >LOG + // use typed response console.log(response); @@ -5224,6 +5577,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5238,6 +5593,7 @@ paths: '', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -5251,6 +5607,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -5265,6 +5622,7 @@ paths: # Call the API response = client.get_settings("") + # >LOG # use the class directly puts(response) @@ -5286,6 +5644,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5302,6 +5662,8 @@ paths: let response = try await client.getSettings(indexName: "") + + // >LOG put: tags: - Indices @@ -5364,6 +5726,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -5385,6 +5749,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: | @@ -5406,6 +5772,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -5423,6 +5790,8 @@ paths: "", new IndexSettings().setAttributesForFaceting(Arrays.asList("actor", "filterOnly(category)", "searchable(publisher)")) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -5435,6 +5804,7 @@ paths: indexSettings: { attributesForFaceting: ['actor', 'filterOnly(category)', 'searchable(publisher)'] }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -5456,6 +5826,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5478,6 +5850,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -5498,6 +5871,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -5515,6 +5889,7 @@ paths: IndexSettings.new(attributes_for_faceting: ["actor", "filterOnly(category)", "searchable(publisher)"]) ) + # >LOG # use the class directly puts(response) @@ -5539,6 +5914,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5561,6 +5938,8 @@ paths: "searchable(publisher)", ]) ) + + // >LOG /1/indexes/{indexName}/synonyms/{objectID}: get: tags: @@ -5605,6 +5984,8 @@ paths: var response = await client.GetSynonymAsync("", "id1"); + + // >LOG - lang: dart label: Dart source: > @@ -5620,6 +6001,8 @@ paths: indexName: "", objectID: "id1", ); + + // >LOG - lang: go label: Go source: | @@ -5639,6 +6022,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -5653,6 +6037,8 @@ paths: // Call the API client.getSynonym("", "id1"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -5667,6 +6053,8 @@ paths: objectID: 'id1' }); + // >LOG + // use typed response console.log(response); @@ -5687,6 +6075,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5702,6 +6092,7 @@ paths: 'id1', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -5716,6 +6107,7 @@ paths: object_id="id1", ) + # >LOG # use the class directly print(response) @@ -5730,6 +6122,7 @@ paths: # Call the API response = client.get_synonym("", "id1") + # >LOG # use the class directly puts(response) @@ -5752,6 +6145,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -5768,6 +6163,8 @@ paths: let response = try await client.getSynonym(indexName: "", objectID: "id1") + + // >LOG put: tags: - Synonyms @@ -5844,6 +6241,8 @@ paths: }, true ); + + // >LOG - lang: dart label: Dart source: > @@ -5869,6 +6268,8 @@ paths: ), forwardToReplicas: true, ); + + // >LOG - lang: go label: Go source: | @@ -5890,6 +6291,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -5909,6 +6311,8 @@ paths: new SynonymHit().setObjectID("id1").setType(SynonymType.SYNONYM).setSynonyms(Arrays.asList("car", "vehicule", "auto")), true ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -5923,6 +6327,7 @@ paths: forwardToReplicas: true, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -5948,6 +6353,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -5974,6 +6381,7 @@ paths: true, ); + // >LOG // play with the response var_dump($response); - lang: python @@ -5998,6 +6406,7 @@ paths: forward_to_replicas=True, ) + # >LOG # use the class directly print(response) @@ -6017,6 +6426,7 @@ paths: true ) + # >LOG # use the class directly puts(response) @@ -6045,6 +6455,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -6065,6 +6477,8 @@ paths: synonymHit: SynonymHit(objectID: "id1", type: SynonymType.synonym, synonyms: ["car", "vehicule", "auto"]), forwardToReplicas: true ) + + // >LOG delete: tags: - Synonyms @@ -6106,6 +6520,8 @@ paths: var response = await client.DeleteSynonymAsync("", "id1"); + + // >LOG - lang: dart label: Dart source: > @@ -6121,6 +6537,8 @@ paths: indexName: "", objectID: "id1", ); + + // >LOG - lang: go label: Go source: > @@ -6147,6 +6565,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -6162,6 +6582,8 @@ paths: // Call the API client.deleteSynonym("", "id1"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -6176,6 +6598,8 @@ paths: 'indexName', objectID: 'id1' }); + // >LOG + // use typed response console.log(response); @@ -6196,6 +6620,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -6211,6 +6637,7 @@ paths: 'id1', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -6225,6 +6652,7 @@ paths: object_id="id1", ) + # >LOG # use the class directly print(response) @@ -6239,6 +6667,7 @@ paths: # Call the API response = client.delete_synonym("", "id1") + # >LOG # use the class directly puts(response) @@ -6261,6 +6690,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -6277,6 +6708,8 @@ paths: let response = try await client.deleteSynonym(indexName: "", objectID: "id1") + + // >LOG /1/indexes/{indexName}/synonyms/batch: post: tags: @@ -6342,6 +6775,8 @@ paths: true, true ); + + // >LOG - lang: dart label: Dart source: > @@ -6379,6 +6814,8 @@ paths: forwardToReplicas: true, replaceExistingSynonyms: true, ); + + // >LOG - lang: go label: Go source: > @@ -6408,6 +6845,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -6435,6 +6874,8 @@ paths: true, true ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -6452,6 +6893,7 @@ paths: replaceExistingSynonyms: true, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -6485,6 +6927,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -6525,6 +6969,7 @@ paths: true, ); + // >LOG // play with the response var_dump($response); - lang: python @@ -6561,6 +7006,7 @@ paths: replace_existing_synonyms=True, ) + # >LOG # use the class directly print(response) @@ -6583,6 +7029,7 @@ paths: true ) + # >LOG # use the class directly puts(response) @@ -6619,6 +7066,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -6647,6 +7096,8 @@ paths: forwardToReplicas: true, replaceExistingSynonyms: true ) + + // >LOG /1/indexes/{indexName}/synonyms/clear: post: tags: @@ -6683,6 +7134,8 @@ paths: // Call the API var response = await client.ClearSynonymsAsync(""); + + // >LOG - lang: dart label: Dart source: > @@ -6697,6 +7150,8 @@ paths: final response = await client.clearSynonyms( indexName: "", ); + + // >LOG - lang: go label: Go source: > @@ -6723,6 +7178,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -6738,6 +7195,8 @@ paths: // Call the API client.clearSynonyms(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -6752,6 +7211,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -6771,6 +7232,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -6785,6 +7248,7 @@ paths: '', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -6798,6 +7262,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -6812,6 +7277,7 @@ paths: # Call the API response = client.clear_synonyms("") + # >LOG # use the class directly puts(response) @@ -6833,6 +7299,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -6849,6 +7317,8 @@ paths: let response = try await client.clearSynonyms(indexName: "") + + // >LOG /1/indexes/{indexName}/synonyms/search: post: tags: @@ -6908,6 +7378,8 @@ paths: var response = await client.SearchSynonymsAsync(""); + + // >LOG - lang: dart label: Dart source: > @@ -6922,6 +7394,8 @@ paths: final response = await client.searchSynonyms( indexName: "", ); + + // >LOG - lang: go label: Go source: > @@ -6948,6 +7422,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -6963,6 +7439,8 @@ paths: // Call the API client.searchSynonyms(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -6977,6 +7455,8 @@ paths: 'indexName' }); + // >LOG + // use typed response console.log(response); @@ -6996,6 +7476,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7010,6 +7492,7 @@ paths: '', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -7023,6 +7506,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -7037,6 +7521,7 @@ paths: # Call the API response = client.search_synonyms("") + # >LOG # use the class directly puts(response) @@ -7058,6 +7543,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7074,6 +7561,8 @@ paths: let response = try await client.searchSynonyms(indexName: "") + + // >LOG /1/keys: get: tags: @@ -7123,6 +7612,8 @@ paths: // Call the API var response = await client.ListApiKeysAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -7135,6 +7626,8 @@ paths: // Call the API final response = await client.listApiKeys(); + + // >LOG - lang: go label: Go source: | @@ -7152,6 +7645,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -7166,6 +7660,8 @@ paths: // Call the API client.listApiKeys(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -7175,6 +7671,7 @@ paths: // Call the API const response = await client.listApiKeys(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -7191,6 +7688,8 @@ paths: var response = client.listApiKeys() + // >LOG + // Use the response println(response) @@ -7203,6 +7702,7 @@ paths: // Call the API $response = $client->listApiKeys(); + // >LOG // play with the response var_dump($response); - lang: python @@ -7214,6 +7714,7 @@ paths: # Call the API response = await _client.list_api_keys() + # >LOG # use the class directly print(response) @@ -7228,6 +7729,7 @@ paths: # Call the API response = client.list_api_keys + # >LOG # use the class directly puts(response) @@ -7249,6 +7751,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7264,6 +7768,8 @@ paths: // Call the API let response = try await client.listApiKeys() + + // >LOG post: tags: - Api Keys @@ -7315,6 +7821,8 @@ paths: MaxHitsPerQuery = 20, } ); + + // >LOG - lang: dart label: Dart source: > @@ -7338,6 +7846,8 @@ paths: maxHitsPerQuery: 20, ), ); + + // >LOG - lang: go label: Go source: | @@ -7359,6 +7869,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -7380,6 +7891,8 @@ paths: .setMaxQueriesPerIPPerHour(100) .setMaxHitsPerQuery(20) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -7395,6 +7908,7 @@ paths: maxHitsPerQuery: 20, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -7419,6 +7933,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7442,6 +7958,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -7464,6 +7981,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -7486,6 +8004,7 @@ paths: ) ) + # >LOG # use the class directly puts(response) @@ -7513,6 +8032,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7534,6 +8055,8 @@ paths: maxQueriesPerIPPerHour: 100, validity: 300 )) + + // >LOG /1/keys/{key}: get: tags: @@ -7579,6 +8102,8 @@ paths: // Call the API var response = await client.GetApiKeyAsync("myTestApiKey"); + + // >LOG - lang: dart label: Dart source: > @@ -7593,6 +8118,8 @@ paths: final response = await client.getApiKey( key: "myTestApiKey", ); + + // >LOG - lang: go label: Go source: | @@ -7612,6 +8139,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -7626,6 +8154,8 @@ paths: // Call the API client.getApiKey("myTestApiKey"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -7635,6 +8165,7 @@ paths: // Call the API const response = await client.getApiKey({ key: 'myTestApiKey' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -7653,6 +8184,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7667,6 +8200,7 @@ paths: 'myTestApiKey', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -7680,6 +8214,7 @@ paths: key="myTestApiKey", ) + # >LOG # use the class directly print(response) @@ -7694,6 +8229,7 @@ paths: # Call the API response = client.get_api_key("myTestApiKey") + # >LOG # use the class directly puts(response) @@ -7715,6 +8251,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -7730,6 +8268,8 @@ paths: // Call the API let response = try await client.getApiKey(key: "myTestApiKey") + + // >LOG put: tags: - Api Keys @@ -7796,6 +8336,8 @@ paths: MaxHitsPerQuery = 20, } ); + + // >LOG - lang: dart label: Dart source: > @@ -7819,6 +8361,8 @@ paths: maxHitsPerQuery: 20, ), ); + + // >LOG - lang: go label: Go source: > @@ -7847,6 +8391,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -7865,6 +8411,8 @@ paths: "myApiKey", new ApiKey().setAcl(Arrays.asList(Acl.SEARCH, Acl.ADD_OBJECT)).setValidity(300).setMaxQueriesPerIPPerHour(100).setMaxHitsPerQuery(20) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -7877,6 +8425,7 @@ paths: apiKey: { acl: ['search', 'addObject'], validity: 300, maxQueriesPerIPPerHour: 100, maxHitsPerQuery: 20 }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -7901,6 +8450,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -7924,6 +8475,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -7946,6 +8498,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -7963,6 +8516,7 @@ paths: ApiKey.new(acl: ["search", "addObject"], validity: 300, max_queries_per_ip_per_hour: 100, max_hits_per_query: 20) ) + # >LOG # use the class directly puts(response) @@ -7990,6 +8544,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8013,6 +8569,8 @@ paths: validity: 300 ) ) + + // >LOG delete: tags: - Api Keys @@ -8058,6 +8616,8 @@ paths: // Call the API var response = await client.DeleteApiKeyAsync("myTestApiKey"); + + // >LOG - lang: dart label: Dart source: > @@ -8072,6 +8632,8 @@ paths: final response = await client.deleteApiKey( key: "myTestApiKey", ); + + // >LOG - lang: go label: Go source: > @@ -8098,6 +8660,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -8113,6 +8677,8 @@ paths: // Call the API client.deleteApiKey("myTestApiKey"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -8122,6 +8688,7 @@ paths: // Call the API const response = await client.deleteApiKey({ key: 'myTestApiKey' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -8140,6 +8707,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -8154,6 +8723,7 @@ paths: 'myTestApiKey', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -8167,6 +8737,7 @@ paths: key="myTestApiKey", ) + # >LOG # use the class directly print(response) @@ -8181,6 +8752,7 @@ paths: # Call the API response = client.delete_api_key("myTestApiKey") + # >LOG # use the class directly puts(response) @@ -8202,6 +8774,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8217,6 +8791,8 @@ paths: // Call the API let response = try await client.deleteApiKey(key: "myTestApiKey") + + // >LOG /1/keys/{key}/restore: post: tags: @@ -8266,6 +8842,8 @@ paths: // Call the API var response = await client.RestoreApiKeyAsync("myApiKey"); + + // >LOG - lang: dart label: Dart source: > @@ -8280,6 +8858,8 @@ paths: final response = await client.restoreApiKey( key: "myApiKey", ); + + // >LOG - lang: go label: Go source: > @@ -8306,6 +8886,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -8321,6 +8903,8 @@ paths: // Call the API client.restoreApiKey("myApiKey"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -8330,6 +8914,7 @@ paths: // Call the API const response = await client.restoreApiKey({ key: 'myApiKey' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -8348,6 +8933,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -8362,6 +8949,7 @@ paths: 'myApiKey', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -8375,6 +8963,7 @@ paths: key="myApiKey", ) + # >LOG # use the class directly print(response) @@ -8389,6 +8978,7 @@ paths: # Call the API response = client.restore_api_key("myApiKey") + # >LOG # use the class directly puts(response) @@ -8410,6 +9000,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8425,6 +9017,8 @@ paths: // Call the API let response = try await client.restoreApiKey(key: "myApiKey") + + // >LOG /1/indexes/{indexName}/rules/{objectID}: get: tags: @@ -8470,6 +9064,8 @@ paths: var response = await client.GetRuleAsync("", "qr-1725004648916"); + + // >LOG - lang: dart label: Dart source: > @@ -8485,6 +9081,8 @@ paths: indexName: "", objectID: "qr-1725004648916", ); + + // >LOG - lang: go label: Go source: | @@ -8504,6 +9102,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -8518,6 +9117,8 @@ paths: // Call the API client.getRule("", "qr-1725004648916"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -8532,6 +9133,8 @@ paths: objectID: 'qr-1725004648916' }); + // >LOG + // use typed response console.log(response); @@ -8552,6 +9155,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -8567,6 +9172,7 @@ paths: 'qr-1725004648916', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -8581,6 +9187,7 @@ paths: object_id="qr-1725004648916", ) + # >LOG # use the class directly print(response) @@ -8595,6 +9202,7 @@ paths: # Call the API response = client.get_rule("", "qr-1725004648916") + # >LOG # use the class directly puts(response) @@ -8617,6 +9225,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8633,6 +9243,8 @@ paths: let response = try await client.getRule(indexName: "", objectID: "qr-1725004648916") + + // >LOG put: tags: - Rules @@ -8697,6 +9309,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -8721,6 +9335,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: | @@ -8742,6 +9358,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -8760,6 +9377,8 @@ paths: "id1", new Rule().setObjectID("id1").setConditions(Arrays.asList(new Condition().setPattern("apple").setAnchoring(Anchoring.CONTAINS))) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -8773,6 +9392,7 @@ paths: rule: { objectID: 'id1', conditions: [{ pattern: 'apple', anchoring: 'contains' }] }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -8801,6 +9421,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -8823,6 +9445,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -8846,6 +9469,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -8864,6 +9488,7 @@ paths: Rule.new(object_id: "id1", conditions: [Condition.new(pattern: "apple", anchoring: "contains")]) ) + # >LOG # use the class directly puts(response) @@ -8897,6 +9522,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -8919,6 +9546,8 @@ paths: conditions: [SearchCondition(pattern: "apple", anchoring: SearchAnchoring.contains)] ) ) + + // >LOG delete: tags: - Rules @@ -8959,6 +9588,8 @@ paths: var response = await client.DeleteRuleAsync("", "id1"); + + // >LOG - lang: dart label: Dart source: > @@ -8974,6 +9605,8 @@ paths: indexName: "", objectID: "id1", ); + + // >LOG - lang: go label: Go source: | @@ -8993,6 +9626,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -9007,6 +9641,8 @@ paths: // Call the API client.deleteRule("", "id1"); + + // >LOG - lang: javascript label: JavaScript source: > @@ -9021,6 +9657,8 @@ paths: objectID: 'id1' }); + // >LOG + // use typed response console.log(response); @@ -9041,6 +9679,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9056,6 +9696,7 @@ paths: 'id1', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -9070,6 +9711,7 @@ paths: object_id="id1", ) + # >LOG # use the class directly print(response) @@ -9084,6 +9726,7 @@ paths: # Call the API response = client.delete_rule("", "id1") + # >LOG # use the class directly puts(response) @@ -9106,6 +9749,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -9122,6 +9767,8 @@ paths: let response = try await client.deleteRule(indexName: "", objectID: "id1") + + // >LOG /1/indexes/{indexName}/rules/batch: post: tags: @@ -9199,6 +9846,8 @@ paths: false, true ); + + // >LOG - lang: dart label: Dart source: > @@ -9235,6 +9884,8 @@ paths: forwardToReplicas: false, clearExistingRules: true, ); + + // >LOG - lang: go label: Go source: | @@ -9257,6 +9908,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -9283,6 +9935,8 @@ paths: false, true ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -9300,6 +9954,7 @@ paths: clearExistingRules: true, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -9340,6 +9995,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9373,6 +10030,7 @@ paths: true, ); + // >LOG // play with the response var_dump($response); - lang: python @@ -9408,6 +10066,7 @@ paths: clear_existing_rules=True, ) + # >LOG # use the class directly print(response) @@ -9430,6 +10089,7 @@ paths: true ) + # >LOG # use the class directly puts(response) @@ -9477,6 +10137,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -9506,6 +10168,8 @@ paths: forwardToReplicas: false, clearExistingRules: true ) + + // >LOG /1/indexes/{indexName}/rules/clear: post: tags: @@ -9542,6 +10206,8 @@ paths: // Call the API var response = await client.ClearRulesAsync(""); + + // >LOG - lang: dart label: Dart source: > @@ -9556,6 +10222,8 @@ paths: final response = await client.clearRules( indexName: "", ); + + // >LOG - lang: go label: Go source: | @@ -9575,6 +10243,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -9589,6 +10258,8 @@ paths: // Call the API client.clearRules(""); + + // >LOG - lang: javascript label: JavaScript source: > @@ -9603,6 +10274,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -9622,6 +10295,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9636,6 +10311,7 @@ paths: '', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -9649,6 +10325,7 @@ paths: index_name="", ) + # >LOG # use the class directly print(response) @@ -9663,6 +10340,7 @@ paths: # Call the API response = client.clear_rules("") + # >LOG # use the class directly puts(response) @@ -9684,6 +10362,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -9700,6 +10380,8 @@ paths: let response = try await client.clearRules(indexName: "") + + // >LOG /1/indexes/{indexName}/rules/search: post: tags: @@ -9796,6 +10478,8 @@ paths: "", new SearchRulesParams { Query = "zorro", } ); + + // >LOG - lang: dart label: Dart source: > @@ -9813,6 +10497,8 @@ paths: query: "zorro", ), ); + + // >LOG - lang: go label: Go source: | @@ -9833,6 +10519,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -9848,6 +10535,8 @@ paths: client.searchRules("", new SearchRulesParams().setQuery("zorro")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -9862,6 +10551,8 @@ paths: 'cts_e2e_browse', searchRulesParams: { query: 'zorro' } }); + // >LOG + // use typed response console.log(response); @@ -9884,6 +10575,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -9900,6 +10593,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -9916,6 +10610,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -9935,6 +10630,8 @@ paths: SearchRulesParams.new(query: "zorro")) + # >LOG + # use the class directly puts(response) @@ -9964,6 +10661,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -9982,6 +10681,8 @@ paths: indexName: "", searchRulesParams: SearchRulesParams(query: "zorro") ) + + // >LOG /1/dictionaries/{dictionaryName}/batch: post: tags: @@ -10074,6 +10775,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -10110,6 +10813,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: > @@ -10141,6 +10846,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -10175,6 +10882,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -10202,6 +10911,7 @@ paths: }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -10236,6 +10946,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -10271,6 +10983,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -10306,6 +11019,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -10338,6 +11052,7 @@ paths: ) ) + # >LOG # use the class directly puts(response) @@ -10375,6 +11090,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -10406,6 +11123,8 @@ paths: )] ) ) + + // >LOG /1/dictionaries/{dictionaryName}/search: post: tags: @@ -10470,6 +11189,8 @@ paths: Enum.Parse("Stopwords"), new SearchDictionaryEntriesParams { Query = "about", } ); + + // >LOG - lang: dart label: Dart source: > @@ -10487,6 +11208,8 @@ paths: query: "about", ), ); + + // >LOG - lang: go label: Go source: > @@ -10514,6 +11237,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -10530,6 +11255,8 @@ paths: client.searchDictionaryEntries(DictionaryType.STOPWORDS, new SearchDictionaryEntriesParams().setQuery("about")); + + // >LOG - lang: javascript label: JavaScript source: | @@ -10542,6 +11269,7 @@ paths: searchDictionaryEntriesParams: { query: 'about' }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -10563,6 +11291,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -10579,6 +11309,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -10595,6 +11326,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -10614,6 +11346,8 @@ paths: SearchDictionaryEntriesParams.new(query: "about")) + # >LOG + # use the class directly puts(response) @@ -10641,6 +11375,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -10659,6 +11395,8 @@ paths: dictionaryName: DictionaryType.stopwords, searchDictionaryEntriesParams: SearchDictionaryEntriesParams(query: "about") ) + + // >LOG /1/dictionaries/*/settings: get: tags: @@ -10705,6 +11443,8 @@ paths: // Call the API var response = await client.GetDictionarySettingsAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -10717,6 +11457,8 @@ paths: // Call the API final response = await client.getDictionarySettings(); + + // >LOG - lang: go label: Go source: | @@ -10734,6 +11476,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -10748,6 +11491,8 @@ paths: // Call the API client.getDictionarySettings(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -10757,6 +11502,7 @@ paths: // Call the API const response = await client.getDictionarySettings(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -10773,6 +11519,8 @@ paths: var response = client.getDictionarySettings() + // >LOG + // Use the response println(response) @@ -10785,6 +11533,7 @@ paths: // Call the API $response = $client->getDictionarySettings(); + // >LOG // play with the response var_dump($response); - lang: python @@ -10796,6 +11545,7 @@ paths: # Call the API response = await _client.get_dictionary_settings() + # >LOG # use the class directly print(response) @@ -10810,6 +11560,7 @@ paths: # Call the API response = client.get_dictionary_settings + # >LOG # use the class directly puts(response) @@ -10831,6 +11582,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -10846,6 +11599,8 @@ paths: // Call the API let response = try await client.getDictionarySettings() + + // >LOG put: tags: - Dictionaries @@ -10909,6 +11664,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -10931,6 +11688,8 @@ paths: ), ), ); + + // >LOG - lang: go label: Go source: > @@ -10959,6 +11718,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -10988,6 +11749,8 @@ paths: ) ) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -10999,6 +11762,7 @@ paths: disableStandardEntries: { plurals: { fr: false, en: false, ru: true } }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -11021,6 +11785,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -11040,6 +11806,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -11061,6 +11828,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -11079,6 +11847,7 @@ paths: ) ) + # >LOG # use the class directly puts(response) @@ -11104,6 +11873,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -11126,6 +11897,7 @@ paths: "ru": true, ])) ) + // >LOG /1/dictionaries/*/languages: get: tags: @@ -11173,6 +11945,8 @@ paths: // Call the API var response = await client.GetDictionaryLanguagesAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -11185,6 +11959,8 @@ paths: // Call the API final response = await client.getDictionaryLanguages(); + + // >LOG - lang: go label: Go source: | @@ -11202,6 +11978,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -11216,6 +11993,8 @@ paths: // Call the API client.getDictionaryLanguages(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -11225,6 +12004,7 @@ paths: // Call the API const response = await client.getDictionaryLanguages(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -11241,6 +12021,8 @@ paths: var response = client.getDictionaryLanguages() + // >LOG + // Use the response println(response) @@ -11253,6 +12035,7 @@ paths: // Call the API $response = $client->getDictionaryLanguages(); + // >LOG // play with the response var_dump($response); - lang: python @@ -11264,6 +12047,7 @@ paths: # Call the API response = await _client.get_dictionary_languages() + # >LOG # use the class directly print(response) @@ -11278,6 +12062,7 @@ paths: # Call the API response = client.get_dictionary_languages + # >LOG # use the class directly puts(response) @@ -11299,6 +12084,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -11314,6 +12101,8 @@ paths: // Call the API let response = try await client.getDictionaryLanguages() + + // >LOG /1/clusters/mapping: post: tags: @@ -11371,6 +12160,8 @@ paths: "userID", new AssignUserIdParams { Cluster = "theCluster", } ); + + // >LOG - lang: dart label: Dart source: > @@ -11388,6 +12179,8 @@ paths: cluster: "theCluster", ), ); + + // >LOG - lang: go label: Go source: > @@ -11415,6 +12208,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -11431,6 +12226,8 @@ paths: client.assignUserId("userID", new AssignUserIdParams().setCluster("theCluster")); + + // >LOG - lang: javascript label: JavaScript source: | @@ -11443,6 +12240,7 @@ paths: assignUserIdParams: { cluster: 'theCluster' }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -11464,6 +12262,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -11480,6 +12280,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -11496,6 +12297,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -11515,6 +12317,8 @@ paths: AssignUserIdParams.new(cluster: "theCluster")) + # >LOG + # use the class directly puts(response) @@ -11542,6 +12346,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -11560,6 +12366,8 @@ paths: xAlgoliaUserID: "userID", assignUserIdParams: AssignUserIdParams(cluster: "theCluster") ) + + // >LOG get: tags: - Clusters @@ -11616,6 +12424,8 @@ paths: // Call the API var response = await client.ListUserIdsAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -11628,6 +12438,8 @@ paths: // Call the API final response = await client.listUserIds(); + + // >LOG - lang: go label: Go source: > @@ -11652,6 +12464,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -11667,6 +12481,8 @@ paths: // Call the API client.listUserIds(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -11676,6 +12492,7 @@ paths: // Call the API const response = await client.listUserIds(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -11692,6 +12509,8 @@ paths: var response = client.listUserIds() + // >LOG + // Use the response println(response) @@ -11704,6 +12523,7 @@ paths: // Call the API $response = $client->listUserIds(); + // >LOG // play with the response var_dump($response); - lang: python @@ -11715,6 +12535,7 @@ paths: # Call the API response = await _client.list_user_ids() + # >LOG # use the class directly print(response) @@ -11729,6 +12550,7 @@ paths: # Call the API response = client.list_user_ids + # >LOG # use the class directly puts(response) @@ -11750,6 +12572,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -11765,6 +12589,8 @@ paths: // Call the API let response = try await client.listUserIds() + + // >LOG /1/clusters/mapping/batch: post: tags: @@ -11834,6 +12660,8 @@ paths: Users = new List { "user1", "user2" }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -11855,6 +12683,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: > @@ -11883,6 +12713,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -11900,6 +12732,8 @@ paths: client.batchAssignUserIds("userID", new BatchAssignUserIdsParams().setCluster("theCluster").setUsers(Arrays.asList("user1", "user2"))); + + // >LOG - lang: javascript label: JavaScript source: | @@ -11912,6 +12746,7 @@ paths: batchAssignUserIdsParams: { cluster: 'theCluster', users: ['user1', 'user2'] }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -11934,6 +12769,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -11955,6 +12792,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -11975,6 +12813,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -11992,6 +12831,7 @@ paths: BatchAssignUserIdsParams.new(cluster: "theCluster", users: ["user1", "user2"]) ) + # >LOG # use the class directly puts(response) @@ -12017,6 +12857,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12035,6 +12877,8 @@ paths: xAlgoliaUserID: "userID", batchAssignUserIdsParams: BatchAssignUserIdsParams(cluster: "theCluster", users: ["user1", "user2"]) ) + + // >LOG /1/clusters/mapping/top: get: tags: @@ -12098,6 +12942,8 @@ paths: // Call the API var response = await client.GetTopUserIdsAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -12110,6 +12956,8 @@ paths: // Call the API final response = await client.getTopUserIds(); + + // >LOG - lang: go label: Go source: | @@ -12127,6 +12975,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -12141,6 +12990,8 @@ paths: // Call the API client.getTopUserIds(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -12150,6 +13001,7 @@ paths: // Call the API const response = await client.getTopUserIds(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -12166,6 +13018,8 @@ paths: var response = client.getTopUserIds() + // >LOG + // Use the response println(response) @@ -12178,6 +13032,7 @@ paths: // Call the API $response = $client->getTopUserIds(); + // >LOG // play with the response var_dump($response); - lang: python @@ -12189,6 +13044,7 @@ paths: # Call the API response = await _client.get_top_user_ids() + # >LOG # use the class directly print(response) @@ -12203,6 +13059,7 @@ paths: # Call the API response = client.get_top_user_ids + # >LOG # use the class directly puts(response) @@ -12224,6 +13081,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12239,6 +13098,8 @@ paths: // Call the API let response = try await client.getTopUserIds() + + // >LOG /1/clusters/mapping/{userID}: get: tags: @@ -12285,6 +13146,8 @@ paths: // Call the API var response = await client.GetUserIdAsync("uniqueID"); + + // >LOG - lang: dart label: Dart source: > @@ -12299,6 +13162,8 @@ paths: final response = await client.getUserId( userID: "uniqueID", ); + + // >LOG - lang: go label: Go source: | @@ -12318,6 +13183,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -12332,6 +13198,8 @@ paths: // Call the API client.getUserId("uniqueID"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -12341,6 +13209,7 @@ paths: // Call the API const response = await client.getUserId({ userID: 'uniqueID' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -12359,6 +13228,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -12373,6 +13244,7 @@ paths: 'uniqueID', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -12386,6 +13258,7 @@ paths: user_id="uniqueID", ) + # >LOG # use the class directly print(response) @@ -12400,6 +13273,7 @@ paths: # Call the API response = client.get_user_id("uniqueID") + # >LOG # use the class directly puts(response) @@ -12421,6 +13295,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12436,6 +13312,8 @@ paths: // Call the API let response = try await client.getUserId(userID: "uniqueID") + + // >LOG delete: tags: - Clusters @@ -12481,6 +13359,8 @@ paths: // Call the API var response = await client.RemoveUserIdAsync("uniqueID"); + + // >LOG - lang: dart label: Dart source: > @@ -12495,6 +13375,8 @@ paths: final response = await client.removeUserId( userID: "uniqueID", ); + + // >LOG - lang: go label: Go source: > @@ -12521,6 +13403,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -12536,6 +13420,8 @@ paths: // Call the API client.removeUserId("uniqueID"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -12545,6 +13431,7 @@ paths: // Call the API const response = await client.removeUserId({ userID: 'uniqueID' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -12563,6 +13450,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -12577,6 +13466,7 @@ paths: 'uniqueID', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -12590,6 +13480,7 @@ paths: user_id="uniqueID", ) + # >LOG # use the class directly print(response) @@ -12604,6 +13495,7 @@ paths: # Call the API response = client.remove_user_id("uniqueID") + # >LOG # use the class directly puts(response) @@ -12625,6 +13517,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12640,6 +13534,8 @@ paths: // Call the API let response = try await client.removeUserId(userID: "uniqueID") + + // >LOG /1/clusters: get: tags: @@ -12690,6 +13586,8 @@ paths: // Call the API var response = await client.ListClustersAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -12702,6 +13600,8 @@ paths: // Call the API final response = await client.listClusters(); + + // >LOG - lang: go label: Go source: | @@ -12719,6 +13619,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -12733,6 +13634,8 @@ paths: // Call the API client.listClusters(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -12742,6 +13645,7 @@ paths: // Call the API const response = await client.listClusters(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -12758,6 +13662,8 @@ paths: var response = client.listClusters() + // >LOG + // Use the response println(response) @@ -12770,6 +13676,7 @@ paths: // Call the API $response = $client->listClusters(); + // >LOG // play with the response var_dump($response); - lang: python @@ -12781,6 +13688,7 @@ paths: # Call the API response = await _client.list_clusters() + # >LOG # use the class directly print(response) @@ -12795,6 +13703,7 @@ paths: # Call the API response = client.list_clusters + # >LOG # use the class directly puts(response) @@ -12816,6 +13725,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -12831,6 +13742,8 @@ paths: // Call the API let response = try await client.listClusters() + + // >LOG /1/clusters/mapping/search: post: tags: @@ -12966,6 +13879,8 @@ paths: HitsPerPage = 10, } ); + + // >LOG - lang: dart label: Dart source: > @@ -12985,6 +13900,8 @@ paths: hitsPerPage: 10, ), ); + + // >LOG - lang: go label: Go source: > @@ -13012,6 +13929,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13028,6 +13947,8 @@ paths: client.searchUserIds(new SearchUserIdsParams().setQuery("test").setClusterName("theClusterName").setPage(5).setHitsPerPage(10)); + + // >LOG - lang: javascript label: JavaScript source: | @@ -13042,6 +13963,7 @@ paths: hitsPerPage: 10, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -13065,6 +13987,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -13083,6 +14007,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -13101,6 +14026,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -13117,6 +14043,7 @@ paths: SearchUserIdsParams.new(query: "test", cluster_name: "theClusterName", page: 5, hits_per_page: 10) ) + # >LOG # use the class directly puts(response) @@ -13143,6 +14070,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -13164,6 +14093,8 @@ paths: page: 5, hitsPerPage: 10 )) + + // >LOG /1/clusters/mapping/pending: get: tags: @@ -13231,6 +14162,8 @@ paths: // Call the API var response = await client.HasPendingMappingsAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -13243,6 +14176,8 @@ paths: // Call the API final response = await client.hasPendingMappings(); + + // >LOG - lang: go label: Go source: > @@ -13267,6 +14202,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13282,6 +14219,8 @@ paths: // Call the API client.hasPendingMappings(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -13291,6 +14230,7 @@ paths: // Call the API const response = await client.hasPendingMappings(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -13307,6 +14247,8 @@ paths: var response = client.hasPendingMappings() + // >LOG + // Use the response println(response) @@ -13319,6 +14261,7 @@ paths: // Call the API $response = $client->hasPendingMappings(); + // >LOG // play with the response var_dump($response); - lang: python @@ -13330,6 +14273,7 @@ paths: # Call the API response = await _client.has_pending_mappings() + # >LOG # use the class directly print(response) @@ -13344,6 +14288,7 @@ paths: # Call the API response = client.has_pending_mappings + # >LOG # use the class directly puts(response) @@ -13365,6 +14310,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -13380,6 +14327,8 @@ paths: // Call the API let response = try await client.hasPendingMappings() + + // >LOG /1/security/sources: get: tags: @@ -13417,6 +14366,8 @@ paths: // Call the API var response = await client.GetSourcesAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -13429,6 +14380,8 @@ paths: // Call the API final response = await client.getSources(); + + // >LOG - lang: go label: Go source: | @@ -13446,6 +14399,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -13460,6 +14414,8 @@ paths: // Call the API client.getSources(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -13469,6 +14425,7 @@ paths: // Call the API const response = await client.getSources(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -13485,6 +14442,8 @@ paths: var response = client.getSources() + // >LOG + // Use the response println(response) @@ -13497,6 +14456,7 @@ paths: // Call the API $response = $client->getSources(); + // >LOG // play with the response var_dump($response); - lang: python @@ -13508,6 +14468,7 @@ paths: # Call the API response = await _client.get_sources() + # >LOG # use the class directly print(response) @@ -13522,6 +14483,7 @@ paths: # Call the API response = client.get_sources + # >LOG # use the class directly puts(response) @@ -13543,6 +14505,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -13558,6 +14522,8 @@ paths: // Call the API let response = try await client.getSources() + + // >LOG put: tags: - Vaults @@ -13613,6 +14579,8 @@ paths: new Source { VarSource = "theSource", Description = "theDescription", } } ); + + // >LOG - lang: dart label: Dart source: > @@ -13632,6 +14600,8 @@ paths: ), ], ); + + // >LOG - lang: go label: Go source: > @@ -13659,6 +14629,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13675,6 +14647,8 @@ paths: client.replaceSources(Arrays.asList(new Source().setSource("theSource").setDescription("theDescription"))); + + // >LOG - lang: javascript label: JavaScript source: > @@ -13689,6 +14663,8 @@ paths: 'theSource', description: 'theDescription' }] }); + // >LOG + // use typed response console.log(response); @@ -13713,6 +14689,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -13731,6 +14709,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -13749,6 +14728,7 @@ paths: ], ) + # >LOG # use the class directly print(response) @@ -13768,6 +14748,8 @@ paths: description: "theDescription")]) + # >LOG + # use the class directly puts(response) @@ -13797,6 +14779,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -13816,6 +14800,8 @@ paths: source: "theSource", description: "theDescription" )]) + + // >LOG /1/security/sources/append: post: tags: @@ -13858,6 +14844,8 @@ paths: var response = await client.AppendSourceAsync( new Source { VarSource = "theSource", Description = "theDescription", } ); + + // >LOG - lang: dart label: Dart source: > @@ -13875,6 +14863,8 @@ paths: description: "theDescription", ), ); + + // >LOG - lang: go label: Go source: > @@ -13902,6 +14892,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -13918,6 +14910,8 @@ paths: client.appendSource(new Source().setSource("theSource").setDescription("theDescription")); + + // >LOG - lang: javascript label: JavaScript source: > @@ -13932,6 +14926,8 @@ paths: description: 'theDescription' }); + // >LOG + // use typed response console.log(response); @@ -13954,6 +14950,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -13970,6 +14968,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -13986,6 +14985,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -14005,6 +15005,8 @@ paths: description: "theDescription")) + # >LOG + # use the class directly puts(response) @@ -14032,6 +15034,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -14050,6 +15054,8 @@ paths: source: "theSource", description: "theDescription" )) + + // >LOG /1/security/sources/{source}: delete: tags: @@ -14102,6 +15108,8 @@ paths: // Call the API var response = await client.DeleteSourceAsync("theSource"); + + // >LOG - lang: dart label: Dart source: > @@ -14116,6 +15124,8 @@ paths: final response = await client.deleteSource( source: "theSource", ); + + // >LOG - lang: go label: Go source: > @@ -14142,6 +15152,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -14157,6 +15169,8 @@ paths: // Call the API client.deleteSource("theSource"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -14166,6 +15180,7 @@ paths: // Call the API const response = await client.deleteSource({ source: 'theSource' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -14184,6 +15199,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -14198,6 +15215,7 @@ paths: 'theSource', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -14211,6 +15229,7 @@ paths: source="theSource", ) + # >LOG # use the class directly print(response) @@ -14225,6 +15244,7 @@ paths: # Call the API response = client.delete_source("theSource") + # >LOG # use the class directly puts(response) @@ -14246,6 +15266,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -14261,6 +15283,8 @@ paths: // Call the API let response = try await client.deleteSource(source: "theSource") + + // >LOG /1/logs: get: tags: @@ -14481,6 +15505,8 @@ paths: // Call the API var response = await client.GetLogsAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -14493,6 +15519,8 @@ paths: // Call the API final response = await client.getLogs(); + + // >LOG - lang: go label: Go source: | @@ -14510,6 +15538,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -14524,6 +15553,8 @@ paths: // Call the API client.getLogs(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -14533,6 +15564,7 @@ paths: // Call the API const response = await client.getLogs(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -14549,6 +15581,8 @@ paths: var response = client.getLogs() + // >LOG + // Use the response println(response) @@ -14561,6 +15595,7 @@ paths: // Call the API $response = $client->getLogs(); + // >LOG // play with the response var_dump($response); - lang: python @@ -14572,6 +15607,7 @@ paths: # Call the API response = await _client.get_logs() + # >LOG # use the class directly print(response) @@ -14586,6 +15622,7 @@ paths: # Call the API response = client.get_logs + # >LOG # use the class directly puts(response) @@ -14607,6 +15644,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -14622,6 +15661,8 @@ paths: // Call the API let response = try await client.getLogs() + + // >LOG /1/task/{taskID}: get: tags: @@ -14667,6 +15708,8 @@ paths: // Call the API var response = await client.GetAppTaskAsync(123L); + + // >LOG - lang: dart label: Dart source: > @@ -14681,6 +15724,8 @@ paths: final response = await client.getAppTask( taskID: 123, ); + + // >LOG - lang: go label: Go source: | @@ -14700,6 +15745,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -14714,6 +15760,8 @@ paths: // Call the API client.getAppTask(123L); + + // >LOG - lang: javascript label: JavaScript source: | @@ -14723,6 +15771,7 @@ paths: // Call the API const response = await client.getAppTask({ taskID: 123 }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -14741,6 +15790,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -14755,6 +15806,7 @@ paths: 123, ); + // >LOG // play with the response var_dump($response); - lang: python @@ -14768,6 +15820,7 @@ paths: task_id=123, ) + # >LOG # use the class directly print(response) @@ -14782,6 +15835,7 @@ paths: # Call the API response = client.get_app_task(123) + # >LOG # use the class directly puts(response) @@ -14803,6 +15857,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -14818,6 +15874,8 @@ paths: // Call the API let response = try await client.getAppTask(taskID: Int64(123)) + + // >LOG /1/indexes/{indexName}/task/{taskID}: get: tags: @@ -14878,6 +15936,8 @@ paths: // Call the API var response = await client.GetTaskAsync("", 123L); + + // >LOG - lang: dart label: Dart source: > @@ -14893,6 +15953,8 @@ paths: indexName: "", taskID: 123, ); + + // >LOG - lang: go label: Go source: | @@ -14912,6 +15974,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -14926,6 +15989,8 @@ paths: // Call the API client.getTask("", 123L); + + // >LOG - lang: javascript label: JavaScript source: > @@ -14940,6 +16005,8 @@ paths: taskID: 123 }); + // >LOG + // use typed response console.log(response); @@ -14960,6 +16027,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -14975,6 +16044,7 @@ paths: 123, ); + // >LOG // play with the response var_dump($response); - lang: python @@ -14989,6 +16059,7 @@ paths: task_id=123, ) + # >LOG # use the class directly print(response) @@ -15003,6 +16074,7 @@ paths: # Call the API response = client.get_task("", 123) + # >LOG # use the class directly puts(response) @@ -15025,6 +16097,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -15041,6 +16115,8 @@ paths: let response = try await client.getTask(indexName: "", taskID: Int64(123)) + + // >LOG /1/indexes/{indexName}/operation: post: tags: @@ -15160,6 +16236,8 @@ paths: }, } ); + + // >LOG - lang: dart label: Dart source: > @@ -15182,6 +16260,8 @@ paths: ], ), ); + + // >LOG - lang: go label: Go source: > @@ -15210,6 +16290,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -15231,6 +16313,8 @@ paths: .setDestination("") .setScope(Arrays.asList(ScopeType.RULES, ScopeType.SETTINGS)) ); + + // >LOG - lang: javascript label: JavaScript source: | @@ -15243,6 +16327,7 @@ paths: operationIndexParams: { operation: 'move', destination: '', scope: ['rules', 'settings'] }, }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -15266,6 +16351,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -15288,6 +16375,7 @@ paths: ], ); + // >LOG // play with the response var_dump($response); - lang: python @@ -15309,6 +16397,7 @@ paths: }, ) + # >LOG # use the class directly print(response) @@ -15326,6 +16415,7 @@ paths: OperationIndexParams.new(operation: "move", destination: "", scope: ["rules", "settings"]) ) + # >LOG # use the class directly puts(response) @@ -15352,6 +16442,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -15374,6 +16466,8 @@ paths: scope: [ScopeType.rules, ScopeType.settings] ) ) + + // >LOG /1/indexes: get: tags: @@ -15419,6 +16513,8 @@ paths: // Call the API var response = await client.ListIndicesAsync(); + + // >LOG - lang: dart label: Dart source: > @@ -15431,6 +16527,8 @@ paths: // Call the API final response = await client.listIndices(); + + // >LOG - lang: go label: Go source: > @@ -15455,6 +16553,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -15470,6 +16570,8 @@ paths: // Call the API client.listIndices(); + + // >LOG - lang: javascript label: JavaScript source: | @@ -15479,6 +16581,7 @@ paths: // Call the API const response = await client.listIndices(); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -15495,6 +16598,8 @@ paths: var response = client.listIndices() + // >LOG + // Use the response println(response) @@ -15507,6 +16612,7 @@ paths: // Call the API $response = $client->listIndices(); + // >LOG // play with the response var_dump($response); - lang: python @@ -15518,6 +16624,7 @@ paths: # Call the API response = await _client.list_indices() + # >LOG # use the class directly print(response) @@ -15532,6 +16639,7 @@ paths: # Call the API response = client.list_indices + # >LOG # use the class directly puts(response) @@ -15553,6 +16661,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -15568,6 +16678,8 @@ paths: // Call the API let response = try await client.listIndices() + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/search.yml b/specs/bundled/search.yml index dd4a3d2a77..f37c69eeae 100644 --- a/specs/bundled/search.yml +++ b/specs/bundled/search.yml @@ -3647,6 +3647,26 @@ paths: application/json: schema: type: boolean + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - search + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/specs/bundled/usage.doc.yml b/specs/bundled/usage.doc.yml index 8266b94b3e..a5cab34523 100644 --- a/specs/bundled/usage.doc.yml +++ b/specs/bundled/usage.doc.yml @@ -101,6 +101,8 @@ paths: // Call the API var response = await client.CustomGetAsync("test/minimal"); + + // >LOG - lang: go label: Go source: | @@ -120,6 +122,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -130,6 +133,7 @@ paths: // Call the API client.customGet("test/minimal"); + // >LOG - lang: javascript label: JavaScript source: | @@ -139,6 +143,7 @@ paths: // Call the API const response = await client.customGet({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -157,6 +162,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -171,6 +178,7 @@ paths: 'test/minimal', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -184,6 +192,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -198,6 +207,7 @@ paths: # Call the API response = client.custom_get("test/minimal") + # >LOG # use the class directly puts(response) @@ -219,6 +229,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -234,6 +246,8 @@ paths: // Call the API let response = try await client.customGet(path: "test/minimal") + + // >LOG post: operationId: customPost requestBody: @@ -275,6 +289,8 @@ paths: // Call the API var response = await client.CustomPostAsync("test/minimal"); + + // >LOG - lang: go label: Go source: | @@ -294,6 +310,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -304,6 +321,7 @@ paths: // Call the API client.customPost("test/minimal"); + // >LOG - lang: javascript label: JavaScript source: | @@ -313,6 +331,7 @@ paths: // Call the API const response = await client.customPost({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -331,6 +350,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -345,6 +366,7 @@ paths: 'test/minimal', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -358,6 +380,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -372,6 +395,7 @@ paths: # Call the API response = client.custom_post("test/minimal") + # >LOG # use the class directly puts(response) @@ -393,6 +417,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -408,6 +434,8 @@ paths: // Call the API let response = try await client.customPost(path: "test/minimal") + + // >LOG put: operationId: customPut requestBody: @@ -449,6 +477,8 @@ paths: // Call the API var response = await client.CustomPutAsync("test/minimal"); + + // >LOG - lang: go label: Go source: | @@ -468,6 +498,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -478,6 +509,7 @@ paths: // Call the API client.customPut("test/minimal"); + // >LOG - lang: javascript label: JavaScript source: | @@ -487,6 +519,7 @@ paths: // Call the API const response = await client.customPut({ path: 'test/minimal' }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -505,6 +538,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -519,6 +554,7 @@ paths: 'test/minimal', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -532,6 +568,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -546,6 +583,7 @@ paths: # Call the API response = client.custom_put("test/minimal") + # >LOG # use the class directly puts(response) @@ -567,6 +605,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -582,6 +622,8 @@ paths: // Call the API let response = try await client.customPut(path: "test/minimal") + + // >LOG delete: operationId: customDelete summary: Send requests to the Algolia REST API @@ -617,6 +659,8 @@ paths: // Call the API var response = await client.CustomDeleteAsync("test/minimal"); + + // >LOG - lang: go label: Go source: > @@ -643,6 +687,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -654,6 +700,7 @@ paths: // Call the API client.customDelete("test/minimal"); + // >LOG - lang: javascript label: JavaScript source: > @@ -668,6 +715,8 @@ paths: }); + // >LOG + // use typed response console.log(response); @@ -687,6 +736,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -701,6 +752,7 @@ paths: 'test/minimal', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -714,6 +766,7 @@ paths: path="test/minimal", ) + # >LOG # use the class directly print(response) @@ -728,6 +781,7 @@ paths: # Call the API response = client.custom_delete("test/minimal") + # >LOG # use the class directly puts(response) @@ -749,6 +803,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -764,6 +820,8 @@ paths: // Call the API let response = try await client.customDelete(path: "test/minimal") + + // >LOG /1/usage/{statistic}: get: operationId: getUsage @@ -807,6 +865,8 @@ paths: "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z" ); + + // >LOG - lang: go label: Go source: | @@ -826,6 +886,7 @@ paths: panic(err) } + // >LOG // use the model directly print(response) - lang: java @@ -840,6 +901,8 @@ paths: client.getUsage(Statistic.QUERIES_OPERATIONS, "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -853,6 +916,7 @@ paths: endDate: '2024-04-05T12:46:43Z', }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -873,6 +937,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -889,6 +955,7 @@ paths: '2024-04-05T12:46:43Z', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -904,6 +971,7 @@ paths: end_date="2024-04-05T12:46:43Z", ) + # >LOG # use the class directly print(response) @@ -923,6 +991,8 @@ paths: "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z") + # >LOG + # use the class directly puts(response) @@ -949,6 +1019,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -968,6 +1040,8 @@ paths: startDate: "2024-04-03T12:46:43Z", endDate: "2024-04-05T12:46:43Z" ) + + // >LOG /1/usage/{statistic}/{indexName}: get: operationId: getIndexUsage @@ -1013,6 +1087,8 @@ paths: "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z" ); + + // >LOG - lang: go label: Go source: > @@ -1039,6 +1115,8 @@ paths: } + // >LOG + // use the model directly print(response) @@ -1055,6 +1133,8 @@ paths: client.getIndexUsage(Statistic.QUERIES_OPERATIONS, "", "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z"); + + // >LOG - lang: javascript label: JavaScript source: | @@ -1069,6 +1149,7 @@ paths: endDate: '2024-04-05T12:46:43Z', }); + // >LOG // use typed response console.log(response); - lang: kotlin @@ -1090,6 +1171,8 @@ paths: ) + // >LOG + // Use the response println(response) @@ -1107,6 +1190,7 @@ paths: '2024-04-05T12:46:43Z', ); + // >LOG // play with the response var_dump($response); - lang: python @@ -1123,6 +1207,7 @@ paths: end_date="2024-04-05T12:46:43Z", ) + # >LOG # use the class directly print(response) @@ -1142,6 +1227,7 @@ paths: "2024-04-05T12:46:43Z" ) + # >LOG # use the class directly puts(response) @@ -1166,6 +1252,8 @@ paths: ) + // >LOG + // Use the response val value = Await.result(response, Duration(100, "sec")) @@ -1186,6 +1274,8 @@ paths: startDate: "2024-04-03T12:46:43Z", endDate: "2024-04-05T12:46:43Z" ) + + // >LOG components: securitySchemes: appId: diff --git a/specs/bundled/usage.yml b/specs/bundled/usage.yml index d6a9afe774..0ccad972cc 100644 --- a/specs/bundled/usage.yml +++ b/specs/bundled/usage.yml @@ -227,6 +227,26 @@ paths: $ref: '#/components/responses/IndexNotFound' '422': $ref: '#/components/responses/UnprocessableEntity' + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - usage + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. components: securitySchemes: appId: diff --git a/tests/output/csharp/src/generated/client/Abtesting.test.cs b/tests/output/csharp/src/generated/client/Abtesting.test.cs index 91574c6154..fa5580e877 100644 --- a/tests/output/csharp/src/generated/client/Abtesting.test.cs +++ b/tests/output/csharp/src/generated/client/Abtesting.test.cs @@ -111,4 +111,47 @@ public async Task ParametersTest2() _ex.Message.ToLowerInvariant() ); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + AbtestingConfig _config = new AbtestingConfig("test-app-id", "test-api-key", "us") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new AbtestingClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/csharp/src/generated/client/Analytics.test.cs b/tests/output/csharp/src/generated/client/Analytics.test.cs index 671b928a45..ffbf117517 100644 --- a/tests/output/csharp/src/generated/client/Analytics.test.cs +++ b/tests/output/csharp/src/generated/client/Analytics.test.cs @@ -126,4 +126,47 @@ public async Task ParametersTest3() _ex.Message.ToLowerInvariant() ); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + AnalyticsConfig _config = new AnalyticsConfig("test-app-id", "test-api-key", "us") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new AnalyticsClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/csharp/src/generated/client/Ingestion.test.cs b/tests/output/csharp/src/generated/client/Ingestion.test.cs index f9171f1d61..498469fbe1 100644 --- a/tests/output/csharp/src/generated/client/Ingestion.test.cs +++ b/tests/output/csharp/src/generated/client/Ingestion.test.cs @@ -100,4 +100,47 @@ public async Task ParametersTest1() _ex.Message.ToLowerInvariant() ); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + IngestionConfig _config = new IngestionConfig("test-app-id", "test-api-key", "us") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new IngestionClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/csharp/src/generated/client/Insights.test.cs b/tests/output/csharp/src/generated/client/Insights.test.cs index 32f38c5bfe..c10f8a8e9a 100644 --- a/tests/output/csharp/src/generated/client/Insights.test.cs +++ b/tests/output/csharp/src/generated/client/Insights.test.cs @@ -132,4 +132,47 @@ public async Task ParametersTest2() _ex.Message.ToLowerInvariant() ); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + InsightsConfig _config = new InsightsConfig("test-app-id", "test-api-key", "us") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new InsightsClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/csharp/src/generated/client/Monitoring.test.cs b/tests/output/csharp/src/generated/client/Monitoring.test.cs index 7709d202c2..d84c0e02f8 100644 --- a/tests/output/csharp/src/generated/client/Monitoring.test.cs +++ b/tests/output/csharp/src/generated/client/Monitoring.test.cs @@ -84,4 +84,47 @@ public async Task ParametersTest0() Assert.Equal("status.algolia.com", result.Host); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + MonitoringConfig _config = new MonitoringConfig("test-app-id", "test-api-key") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new MonitoringClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/csharp/src/generated/client/Personalization.test.cs b/tests/output/csharp/src/generated/client/Personalization.test.cs index 91d2c07057..43085318c0 100644 --- a/tests/output/csharp/src/generated/client/Personalization.test.cs +++ b/tests/output/csharp/src/generated/client/Personalization.test.cs @@ -126,4 +126,47 @@ public async Task ParametersTest2() _echo ); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + PersonalizationConfig _config = new PersonalizationConfig("test-app-id", "test-api-key", "us") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new PersonalizationClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/csharp/src/generated/client/QuerySuggestions.test.cs b/tests/output/csharp/src/generated/client/QuerySuggestions.test.cs index 3a5b049f90..5fd3d75517 100644 --- a/tests/output/csharp/src/generated/client/QuerySuggestions.test.cs +++ b/tests/output/csharp/src/generated/client/QuerySuggestions.test.cs @@ -126,4 +126,47 @@ public async Task ParametersTest2() _echo ); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + QuerySuggestionsConfig _config = new QuerySuggestionsConfig("test-app-id", "test-api-key", "us") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new QuerySuggestionsClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/csharp/src/generated/client/Recommend.test.cs b/tests/output/csharp/src/generated/client/Recommend.test.cs index 66682e5244..675460adb2 100644 --- a/tests/output/csharp/src/generated/client/Recommend.test.cs +++ b/tests/output/csharp/src/generated/client/Recommend.test.cs @@ -95,4 +95,47 @@ public async Task CommonApiTest3() Assert.Equal(2000, result.ConnectTimeout.TotalMilliseconds); Assert.Equal(30000, result.ResponseTimeout.TotalMilliseconds); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + RecommendConfig _config = new RecommendConfig("test-app-id", "test-api-key") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new RecommendClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/csharp/src/generated/client/Search.test.cs b/tests/output/csharp/src/generated/client/Search.test.cs index 0f3b1c30dc..45658aabec 100644 --- a/tests/output/csharp/src/generated/client/Search.test.cs +++ b/tests/output/csharp/src/generated/client/Search.test.cs @@ -227,66 +227,72 @@ public async Task DeleteObjectsTest0() }; var client = new SearchClient(_config); - var res = await client.DeleteObjectsAsync( - "cts_e2e_deleteObjects_csharp", - new List { "1", "2" } - ); + { + var res = await client.DeleteObjectsAsync( + "cts_e2e_deleteObjects_csharp", + new List { "1", "2" } + ); - JsonAssert.EqualOverrideDefault( - "[{\"taskID\":666,\"objectIDs\":[\"1\",\"2\"]}]", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "[{\"taskID\":666,\"objectIDs\":[\"1\",\"2\"]}]", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } [Fact(DisplayName = "generate secured api key basic")] public async Task GenerateSecuredApiKeyTest0() { var client = new SearchClient(new SearchConfig("appId", "apiKey"), _echo); - var res = client.GenerateSecuredApiKey( - "2640659426d5107b6e47d75db9cbaef8", - new SecuredApiKeyRestrictions - { - ValidUntil = 2524604400L, - RestrictIndices = new List { "Movies" }, - } - ); + { + var res = client.GenerateSecuredApiKey( + "2640659426d5107b6e47d75db9cbaef8", + new SecuredApiKeyRestrictions + { + ValidUntil = 2524604400L, + RestrictIndices = new List { "Movies" }, + } + ); - Assert.Equal( - "NjFhZmE0OGEyMTI3OThiODc0OTlkOGM0YjcxYzljY2M2NmU2NDE5ZWY0NDZjMWJhNjA2NzBkMjAwOTI2YWQyZnJlc3RyaWN0SW5kaWNlcz1Nb3ZpZXMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", - res - ); + Assert.Equal( + "NjFhZmE0OGEyMTI3OThiODc0OTlkOGM0YjcxYzljY2M2NmU2NDE5ZWY0NDZjMWJhNjA2NzBkMjAwOTI2YWQyZnJlc3RyaWN0SW5kaWNlcz1Nb3ZpZXMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", + res + ); + } } [Fact(DisplayName = "generate secured api key with searchParams")] public async Task GenerateSecuredApiKeyTest1() { var client = new SearchClient(new SearchConfig("appId", "apiKey"), _echo); - var res = client.GenerateSecuredApiKey( - "2640659426d5107b6e47d75db9cbaef8", - new SecuredApiKeyRestrictions - { - ValidUntil = 2524604400L, - RestrictIndices = new List { "Movies", "cts_e2e_settings" }, - RestrictSources = "192.168.1.0/24", - Filters = "category:Book OR category:Ebook AND _tags:published", - UserToken = "user123", - SearchParams = new SearchParamsObject + { + var res = client.GenerateSecuredApiKey( + "2640659426d5107b6e47d75db9cbaef8", + new SecuredApiKeyRestrictions { - Query = "batman", - TypoTolerance = new TypoTolerance(Enum.Parse("Strict")), - AroundRadius = new AroundRadius(Enum.Parse("All")), - Mode = Enum.Parse("NeuralSearch"), - HitsPerPage = 10, - OptionalWords = new List { "one", "two" }, - }, - } - ); + ValidUntil = 2524604400L, + RestrictIndices = new List { "Movies", "cts_e2e_settings" }, + RestrictSources = "192.168.1.0/24", + Filters = "category:Book OR category:Ebook AND _tags:published", + UserToken = "user123", + SearchParams = new SearchParamsObject + { + Query = "batman", + TypoTolerance = new TypoTolerance(Enum.Parse("Strict")), + AroundRadius = new AroundRadius(Enum.Parse("All")), + Mode = Enum.Parse("NeuralSearch"), + HitsPerPage = 10, + OptionalWords = new List { "one", "two" }, + }, + } + ); - Assert.Equal( - "MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", - res - ); + Assert.Equal( + "MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", + res + ); + } } [Fact(DisplayName = "indexExists")] @@ -309,9 +315,11 @@ public async Task IndexExistsTest0() }; var client = new SearchClient(_config); - var res = await client.IndexExistsAsync("indexExistsYES"); + { + var res = await client.IndexExistsAsync("indexExistsYES"); - Assert.True(res); + Assert.True(res); + } } [Fact(DisplayName = "indexNotExists")] @@ -334,9 +342,11 @@ public async Task IndexExistsTest1() }; var client = new SearchClient(_config); - var res = await client.IndexExistsAsync("indexExistsNO"); + { + var res = await client.IndexExistsAsync("indexExistsNO"); - Assert.False(res); + Assert.False(res); + } } [Fact(DisplayName = "indexExistsWithError")] @@ -465,21 +475,23 @@ public async Task PartialUpdateObjectsTest0() }; var client = new SearchClient(_config); - var res = await client.PartialUpdateObjectsAsync( - "cts_e2e_partialUpdateObjects_csharp", - new List - { - new Dictionary { { "objectID", "1" }, { "name", "Adam" } }, - new Dictionary { { "objectID", "2" }, { "name", "Benoit" } } - }, - true - ); + { + var res = await client.PartialUpdateObjectsAsync( + "cts_e2e_partialUpdateObjects_csharp", + new List + { + new Dictionary { { "objectID", "1" }, { "name", "Adam" } }, + new Dictionary { { "objectID", "2" }, { "name", "Benoit" } } + }, + true + ); - JsonAssert.EqualOverrideDefault( - "[{\"taskID\":444,\"objectIDs\":[\"1\",\"2\"]}]", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "[{\"taskID\":444,\"objectIDs\":[\"1\",\"2\"]}]", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } [Fact(DisplayName = "call partialUpdateObjects with createIfNotExists=false")] @@ -502,21 +514,23 @@ public async Task PartialUpdateObjectsTest1() }; var client = new SearchClient(_config); - var res = await client.PartialUpdateObjectsAsync( - "cts_e2e_partialUpdateObjects_csharp", - new List - { - new Dictionary { { "objectID", "3" }, { "name", "Cyril" } }, - new Dictionary { { "objectID", "4" }, { "name", "David" } } - }, - false - ); + { + var res = await client.PartialUpdateObjectsAsync( + "cts_e2e_partialUpdateObjects_csharp", + new List + { + new Dictionary { { "objectID", "3" }, { "name", "Cyril" } }, + new Dictionary { { "objectID", "4" }, { "name", "David" } } + }, + false + ); - JsonAssert.EqualOverrideDefault( - "[{\"taskID\":555,\"objectIDs\":[\"3\",\"4\"]}]", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "[{\"taskID\":555,\"objectIDs\":[\"3\",\"4\"]}]", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } [Fact(DisplayName = "call replaceAllObjects without error")] @@ -539,29 +553,31 @@ public async Task ReplaceAllObjectsTest0() }; var client = new SearchClient(_config); - var res = await client.ReplaceAllObjectsAsync( - "cts_e2e_replace_all_objects_csharp", - new List - { - new Dictionary { { "objectID", "1" }, { "name", "Adam" } }, - new Dictionary { { "objectID", "2" }, { "name", "Benoit" } }, - new Dictionary { { "objectID", "3" }, { "name", "Cyril" } }, - new Dictionary { { "objectID", "4" }, { "name", "David" } }, - new Dictionary { { "objectID", "5" }, { "name", "Eva" } }, - new Dictionary { { "objectID", "6" }, { "name", "Fiona" } }, - new Dictionary { { "objectID", "7" }, { "name", "Gael" } }, - new Dictionary { { "objectID", "8" }, { "name", "Hugo" } }, - new Dictionary { { "objectID", "9" }, { "name", "Igor" } }, - new Dictionary { { "objectID", "10" }, { "name", "Julia" } } - }, - 3 - ); + { + var res = await client.ReplaceAllObjectsAsync( + "cts_e2e_replace_all_objects_csharp", + new List + { + new Dictionary { { "objectID", "1" }, { "name", "Adam" } }, + new Dictionary { { "objectID", "2" }, { "name", "Benoit" } }, + new Dictionary { { "objectID", "3" }, { "name", "Cyril" } }, + new Dictionary { { "objectID", "4" }, { "name", "David" } }, + new Dictionary { { "objectID", "5" }, { "name", "Eva" } }, + new Dictionary { { "objectID", "6" }, { "name", "Fiona" } }, + new Dictionary { { "objectID", "7" }, { "name", "Gael" } }, + new Dictionary { { "objectID", "8" }, { "name", "Hugo" } }, + new Dictionary { { "objectID", "9" }, { "name", "Igor" } }, + new Dictionary { { "objectID", "10" }, { "name", "Julia" } } + }, + 3 + ); - JsonAssert.EqualOverrideDefault( - "{\"copyOperationResponse\":{\"taskID\":125,\"updatedAt\":\"2021-01-01T00:00:00.000Z\"},\"batchResponses\":[{\"taskID\":127,\"objectIDs\":[\"1\",\"2\",\"3\"]},{\"taskID\":130,\"objectIDs\":[\"4\",\"5\",\"6\"]},{\"taskID\":133,\"objectIDs\":[\"7\",\"8\",\"9\"]},{\"taskID\":134,\"objectIDs\":[\"10\"]}],\"moveOperationResponse\":{\"taskID\":777,\"updatedAt\":\"2021-01-01T00:00:00.000Z\"}}", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "{\"copyOperationResponse\":{\"taskID\":125,\"updatedAt\":\"2021-01-01T00:00:00.000Z\"},\"batchResponses\":[{\"taskID\":127,\"objectIDs\":[\"1\",\"2\",\"3\"]},{\"taskID\":130,\"objectIDs\":[\"4\",\"5\",\"6\"]},{\"taskID\":133,\"objectIDs\":[\"7\",\"8\",\"9\"]},{\"taskID\":134,\"objectIDs\":[\"10\"]}],\"moveOperationResponse\":{\"taskID\":777,\"updatedAt\":\"2021-01-01T00:00:00.000Z\"}}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } [Fact(DisplayName = "call saveObjects without error")] @@ -584,20 +600,22 @@ public async Task SaveObjectsTest0() }; var client = new SearchClient(_config); - var res = await client.SaveObjectsAsync( - "cts_e2e_saveObjects_csharp", - new List - { - new Dictionary { { "objectID", "1" }, { "name", "Adam" } }, - new Dictionary { { "objectID", "2" }, { "name", "Benoit" } } - } - ); + { + var res = await client.SaveObjectsAsync( + "cts_e2e_saveObjects_csharp", + new List + { + new Dictionary { { "objectID", "1" }, { "name", "Adam" } }, + new Dictionary { { "objectID", "2" }, { "name", "Benoit" } } + } + ); - JsonAssert.EqualOverrideDefault( - "[{\"taskID\":333,\"objectIDs\":[\"1\",\"2\"]}]", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "[{\"taskID\":333,\"objectIDs\":[\"1\",\"2\"]}]", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } [Fact(DisplayName = "saveObjects should report errors")] @@ -637,6 +655,49 @@ public async Task SaveObjectsTest1() ); } + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + SearchConfig _config = new SearchConfig("test-app-id", "test-api-key") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new SearchClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } + [Fact(DisplayName = "wait for api key helper - add")] public async Task WaitForApiKeyTest0() { @@ -657,16 +718,18 @@ public async Task WaitForApiKeyTest0() }; var client = new SearchClient(_config); - var res = await client.WaitForApiKeyAsync( - "api-key-add-operation-test-csharp", - Enum.Parse("Add") - ); + { + var res = await client.WaitForApiKeyAsync( + "api-key-add-operation-test-csharp", + Enum.Parse("Add") + ); - JsonAssert.EqualOverrideDefault( - "{\"value\":\"api-key-add-operation-test-csharp\",\"description\":\"my new api key\",\"acl\":[\"search\",\"addObject\"],\"validity\":300,\"maxQueriesPerIPPerHour\":100,\"maxHitsPerQuery\":20,\"createdAt\":1720094400}", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "{\"value\":\"api-key-add-operation-test-csharp\",\"description\":\"my new api key\",\"acl\":[\"search\",\"addObject\"],\"validity\":300,\"maxQueriesPerIPPerHour\":100,\"maxHitsPerQuery\":20,\"createdAt\":1720094400}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } [Fact(DisplayName = "wait for api key - update")] @@ -689,31 +752,33 @@ public async Task WaitForApiKeyTest1() }; var client = new SearchClient(_config); - var res = await client.WaitForApiKeyAsync( - "api-key-update-operation-test-csharp", - Enum.Parse("Update"), - new ApiKey - { - Description = "my updated api key", - Acl = new List + { + var res = await client.WaitForApiKeyAsync( + "api-key-update-operation-test-csharp", + Enum.Parse("Update"), + new ApiKey { - Enum.Parse("Search"), - Enum.Parse("AddObject"), - Enum.Parse("DeleteObject") - }, - Indexes = new List { "Movies", "Books" }, - Referers = new List { "*google.com", "*algolia.com" }, - Validity = 305, - MaxQueriesPerIPPerHour = 95, - MaxHitsPerQuery = 20, - } - ); + Description = "my updated api key", + Acl = new List + { + Enum.Parse("Search"), + Enum.Parse("AddObject"), + Enum.Parse("DeleteObject") + }, + Indexes = new List { "Movies", "Books" }, + Referers = new List { "*google.com", "*algolia.com" }, + Validity = 305, + MaxQueriesPerIPPerHour = 95, + MaxHitsPerQuery = 20, + } + ); - JsonAssert.EqualOverrideDefault( - "{\"value\":\"api-key-update-operation-test-csharp\",\"description\":\"my updated api key\",\"acl\":[\"search\",\"addObject\",\"deleteObject\"],\"indexes\":[\"Movies\",\"Books\"],\"referers\":[\"*google.com\",\"*algolia.com\"],\"validity\":305,\"maxQueriesPerIPPerHour\":95,\"maxHitsPerQuery\":20,\"createdAt\":1720094400}", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "{\"value\":\"api-key-update-operation-test-csharp\",\"description\":\"my updated api key\",\"acl\":[\"search\",\"addObject\",\"deleteObject\"],\"indexes\":[\"Movies\",\"Books\"],\"referers\":[\"*google.com\",\"*algolia.com\"],\"validity\":305,\"maxQueriesPerIPPerHour\":95,\"maxHitsPerQuery\":20,\"createdAt\":1720094400}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } [Fact(DisplayName = "wait for api key - delete")] @@ -736,12 +801,14 @@ public async Task WaitForApiKeyTest2() }; var client = new SearchClient(_config); - var res = await client.WaitForApiKeyAsync( - "api-key-delete-operation-test-csharp", - Enum.Parse("Delete") - ); + { + var res = await client.WaitForApiKeyAsync( + "api-key-delete-operation-test-csharp", + Enum.Parse("Delete") + ); - Assert.Null(res); + Assert.Null(res); + } } [Fact(DisplayName = "wait for an application-level task")] @@ -764,13 +831,15 @@ public async Task WaitForAppTaskTest0() }; var client = new SearchClient(_config); - var res = await client.WaitForAppTaskAsync(123L); + { + var res = await client.WaitForAppTaskAsync(123L); - JsonAssert.EqualOverrideDefault( - "{\"status\":\"published\"}", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "{\"status\":\"published\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } [Fact(DisplayName = "wait for task")] @@ -793,12 +862,14 @@ public async Task WaitForTaskTest0() }; var client = new SearchClient(_config); - var res = await client.WaitForTaskAsync("wait-task-csharp", 123L); + { + var res = await client.WaitForTaskAsync("wait-task-csharp", 123L); - JsonAssert.EqualOverrideDefault( - "{\"status\":\"published\"}", - JsonSerializer.Serialize(res, JsonConfig.Options), - new JsonDiffConfig(false) - ); + JsonAssert.EqualOverrideDefault( + "{\"status\":\"published\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } } } diff --git a/tests/output/csharp/src/generated/client/Usage.test.cs b/tests/output/csharp/src/generated/client/Usage.test.cs index df73755f0e..3db3ba29ac 100644 --- a/tests/output/csharp/src/generated/client/Usage.test.cs +++ b/tests/output/csharp/src/generated/client/Usage.test.cs @@ -117,4 +117,47 @@ public async Task ParametersTest0() }); Assert.Equal("`apiKey` is missing.".ToLowerInvariant(), _ex.Message.ToLowerInvariant()); } + + [Fact(DisplayName = "switch API key")] + public async Task SetClientApiKeyTest0() + { + UsageConfig _config = new UsageConfig("test-app-id", "test-api-key") + { + CustomHosts = new List + { + new() + { + Scheme = HttpScheme.Http, + Url = "localhost", + Port = 6683, + Up = true, + LastUse = DateTime.UtcNow, + Accept = CallType.Read | CallType.Write, + } + } + }; + var client = new UsageClient(_config); + + { + var res = await client.CustomGetAsync("check-api-key/1"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"test-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + { + client.SetClientApiKey("updated-api-key"); + } + { + var res = await client.CustomGetAsync("check-api-key/2"); + + JsonAssert.EqualOverrideDefault( + "{\"headerAPIKeyValue\":\"updated-api-key\"}", + JsonSerializer.Serialize(res, JsonConfig.Options), + new JsonDiffConfig(false) + ); + } + } } diff --git a/tests/output/dart/test/client/insights_test.dart b/tests/output/dart/test/client/insights_test.dart index cdb3b09a6d..1160289dd4 100644 --- a/tests/output/dart/test/client/insights_test.dart +++ b/tests/output/dart/test/client/insights_test.dart @@ -155,4 +155,46 @@ void main() { }, ); }); + + test('switch API key', () async { + final requester = RequestInterceptor(); + final client = InsightsClient( + appId: "test-app-id", + apiKey: "test-api-key", + region: 'us', + options: ClientOptions(hosts: [ + Host.create(url: 'localhost:6683', scheme: 'http'), + ])); + { + requester.setOnRequest((request) {}); + try { + final res = await client.customGet( + path: "check-api-key/1", + ); + expectBody(res, """{"headerAPIKeyValue":"test-api-key"}"""); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + { + try { + client.setClientApiKey( + apiKey: "updated-api-key", + ); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + { + requester.setOnRequest((request) {}); + try { + final res = await client.customGet( + path: "check-api-key/2", + ); + expectBody(res, """{"headerAPIKeyValue":"updated-api-key"}"""); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + }); } diff --git a/tests/output/dart/test/client/recommend_test.dart b/tests/output/dart/test/client/recommend_test.dart index f21ec5b5db..f7f4f686ee 100644 --- a/tests/output/dart/test/client/recommend_test.dart +++ b/tests/output/dart/test/client/recommend_test.dart @@ -116,4 +116,45 @@ void main() { // Ignore InterceptionException } }); + + test('switch API key', () async { + final requester = RequestInterceptor(); + final client = RecommendClient( + appId: "test-app-id", + apiKey: "test-api-key", + options: ClientOptions(hosts: [ + Host.create(url: 'localhost:6683', scheme: 'http'), + ])); + { + requester.setOnRequest((request) {}); + try { + final res = await client.customGet( + path: "check-api-key/1", + ); + expectBody(res, """{"headerAPIKeyValue":"test-api-key"}"""); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + { + try { + client.setClientApiKey( + apiKey: "updated-api-key", + ); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + { + requester.setOnRequest((request) {}); + try { + final res = await client.customGet( + path: "check-api-key/2", + ); + expectBody(res, """{"headerAPIKeyValue":"updated-api-key"}"""); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + }); } diff --git a/tests/output/dart/test/client/search_test.dart b/tests/output/dart/test/client/search_test.dart index 634e758163..f32ede3390 100644 --- a/tests/output/dart/test/client/search_test.dart +++ b/tests/output/dart/test/client/search_test.dart @@ -262,4 +262,45 @@ void main() { }, ); }); + + test('switch API key', () async { + final requester = RequestInterceptor(); + final client = SearchClient( + appId: "test-app-id", + apiKey: "test-api-key", + options: ClientOptions(hosts: [ + Host.create(url: 'localhost:6683', scheme: 'http'), + ])); + { + requester.setOnRequest((request) {}); + try { + final res = await client.customGet( + path: "check-api-key/1", + ); + expectBody(res, """{"headerAPIKeyValue":"test-api-key"}"""); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + { + try { + client.setClientApiKey( + apiKey: "updated-api-key", + ); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + { + requester.setOnRequest((request) {}); + try { + final res = await client.customGet( + path: "check-api-key/2", + ); + expectBody(res, """{"headerAPIKeyValue":"updated-api-key"}"""); + } on InterceptionException catch (_) { + // Ignore InterceptionException + } + } + }); } diff --git a/tests/output/go/tests/client/abtesting_test.go b/tests/output/go/tests/client/abtesting_test.go index 9339bed218..9ba4352ad2 100644 --- a/tests/output/go/tests/client/abtesting_test.go +++ b/tests/output/go/tests/client/abtesting_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -10,6 +11,7 @@ import ( "gotests/tests" "github.com/algolia/algoliasearch-client-go/v4/algolia/abtesting" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" ) @@ -161,3 +163,49 @@ func TestAbtestingparameters2(t *testing.T) { client, err = abtesting.NewClientWithConfig(cfg) require.EqualError(t, err, "`region` must be one of the following: de, us") } + +// switch API key +func TestAbtestingsetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *abtesting.APIClient + var cfg abtesting.AbtestingConfiguration + _ = client + _ = echo + cfg = abtesting.AbtestingConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + Region: abtesting.Region("us"), + } + client, err = abtesting.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/go/tests/client/analytics_test.go b/tests/output/go/tests/client/analytics_test.go index 6b6a28506a..140c0fd33c 100644 --- a/tests/output/go/tests/client/analytics_test.go +++ b/tests/output/go/tests/client/analytics_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -10,6 +11,7 @@ import ( "gotests/tests" "github.com/algolia/algoliasearch-client-go/v4/algolia/analytics" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" ) @@ -174,3 +176,49 @@ func TestAnalyticsparameters3(t *testing.T) { )) require.EqualError(t, err, "Parameter `index` is required when calling `GetClickPositions`.") } + +// switch API key +func TestAnalyticssetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *analytics.APIClient + var cfg analytics.AnalyticsConfiguration + _ = client + _ = echo + cfg = analytics.AnalyticsConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + Region: analytics.Region("us"), + } + client, err = analytics.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/go/tests/client/ingestion_test.go b/tests/output/go/tests/client/ingestion_test.go index 7e2fa9ea31..965aa5f00a 100644 --- a/tests/output/go/tests/client/ingestion_test.go +++ b/tests/output/go/tests/client/ingestion_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -9,6 +10,7 @@ import ( "gotests/tests" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" "github.com/algolia/algoliasearch-client-go/v4/algolia/ingestion" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" ) @@ -135,3 +137,49 @@ func TestIngestionparameters1(t *testing.T) { client, err = ingestion.NewClientWithConfig(cfg) require.EqualError(t, err, "`region` is required and must be one of the following: eu, us") } + +// switch API key +func TestIngestionsetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *ingestion.APIClient + var cfg ingestion.IngestionConfiguration + _ = client + _ = echo + cfg = ingestion.IngestionConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + Region: ingestion.Region("us"), + } + client, err = ingestion.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/go/tests/client/insights_test.go b/tests/output/go/tests/client/insights_test.go index 25e5aeb214..0a7ecef5af 100644 --- a/tests/output/go/tests/client/insights_test.go +++ b/tests/output/go/tests/client/insights_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -9,6 +10,7 @@ import ( "gotests/tests" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" "github.com/algolia/algoliasearch-client-go/v4/algolia/insights" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" ) @@ -166,3 +168,49 @@ func TestInsightsparameters2(t *testing.T) { client, err = insights.NewClientWithConfig(cfg) require.EqualError(t, err, "`region` must be one of the following: de, us") } + +// switch API key +func TestInsightssetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *insights.APIClient + var cfg insights.InsightsConfiguration + _ = client + _ = echo + cfg = insights.InsightsConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + Region: insights.Region("us"), + } + client, err = insights.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/go/tests/client/monitoring_test.go b/tests/output/go/tests/client/monitoring_test.go index ada90d4cb9..483c8a55a2 100644 --- a/tests/output/go/tests/client/monitoring_test.go +++ b/tests/output/go/tests/client/monitoring_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -9,6 +10,7 @@ import ( "gotests/tests" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" "github.com/algolia/algoliasearch-client-go/v4/algolia/monitoring" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" ) @@ -111,3 +113,48 @@ func TestMonitoringparameters0(t *testing.T) { require.NoError(t, err) require.Equal(t, "status.algolia.com", echo.Host) } + +// switch API key +func TestMonitoringsetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *monitoring.APIClient + var cfg monitoring.MonitoringConfiguration + _ = client + _ = echo + cfg = monitoring.MonitoringConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + } + client, err = monitoring.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/go/tests/client/personalization_test.go b/tests/output/go/tests/client/personalization_test.go index a7aef9cab3..2b9aedb11b 100644 --- a/tests/output/go/tests/client/personalization_test.go +++ b/tests/output/go/tests/client/personalization_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -9,6 +10,7 @@ import ( "gotests/tests" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" "github.com/algolia/algoliasearch-client-go/v4/algolia/personalization" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" ) @@ -152,3 +154,49 @@ func TestPersonalizationparameters2(t *testing.T) { client, err = personalization.NewClientWithConfig(cfg) require.NoError(t, err) } + +// switch API key +func TestPersonalizationsetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *personalization.APIClient + var cfg personalization.PersonalizationConfiguration + _ = client + _ = echo + cfg = personalization.PersonalizationConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + Region: personalization.Region("us"), + } + client, err = personalization.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/go/tests/client/query-suggestions_test.go b/tests/output/go/tests/client/query-suggestions_test.go index 26be02297e..910dd691cb 100644 --- a/tests/output/go/tests/client/query-suggestions_test.go +++ b/tests/output/go/tests/client/query-suggestions_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -9,6 +10,7 @@ import ( "gotests/tests" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" suggestions "github.com/algolia/algoliasearch-client-go/v4/algolia/query-suggestions" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" ) @@ -152,3 +154,49 @@ func TestSuggestionsparameters2(t *testing.T) { client, err = suggestions.NewClientWithConfig(cfg) require.NoError(t, err) } + +// switch API key +func TestSuggestionssetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *suggestions.APIClient + var cfg suggestions.QuerySuggestionsConfiguration + _ = client + _ = echo + cfg = suggestions.QuerySuggestionsConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + Region: suggestions.Region("us"), + } + client, err = suggestions.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/go/tests/client/recommend_test.go b/tests/output/go/tests/client/recommend_test.go index 9a1c7a4d15..15acbdf502 100644 --- a/tests/output/go/tests/client/recommend_test.go +++ b/tests/output/go/tests/client/recommend_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -9,6 +10,7 @@ import ( "gotests/tests" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" "github.com/algolia/algoliasearch-client-go/v4/algolia/recommend" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" ) @@ -137,3 +139,48 @@ func TestRecommendcommonApi3(t *testing.T) { require.Equal(t, int64(2000), echo.ConnectTimeout.Milliseconds()) require.Equal(t, int64(30000), echo.Timeout.Milliseconds()) } + +// switch API key +func TestRecommendsetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *recommend.APIClient + var cfg recommend.RecommendConfiguration + _ = client + _ = echo + cfg = recommend.RecommendConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + } + client, err = recommend.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/go/tests/client/search_test.go b/tests/output/go/tests/client/search_test.go index 04d4b7c784..2fdf78b15b 100644 --- a/tests/output/go/tests/client/search_test.go +++ b/tests/output/go/tests/client/search_test.go @@ -242,14 +242,16 @@ func TestSearchdeleteObjects0(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.DeleteObjects( - "cts_e2e_deleteObjects_go", - []string{"1", "2"}, - ) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `[{"taskID":666,"objectIDs":["1","2"]}]`, string(rawBody)) + { + res, err = client.DeleteObjects( + "cts_e2e_deleteObjects_go", + []string{"1", "2"}, + ) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `[{"taskID":666,"objectIDs":["1","2"]}]`, string(rawBody)) + } } // generate secured api key basic @@ -259,13 +261,15 @@ func TestSearchgenerateSecuredApiKey0(t *testing.T) { _ = res client, echo := createSearchClient(t) _ = echo - res, err = client.GenerateSecuredApiKey( - "2640659426d5107b6e47d75db9cbaef8", - search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices( - []string{"Movies"}), - ) - require.NoError(t, err) - require.Equal(t, "NjFhZmE0OGEyMTI3OThiODc0OTlkOGM0YjcxYzljY2M2NmU2NDE5ZWY0NDZjMWJhNjA2NzBkMjAwOTI2YWQyZnJlc3RyaWN0SW5kaWNlcz1Nb3ZpZXMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", res) + { + res, err = client.GenerateSecuredApiKey( + "2640659426d5107b6e47d75db9cbaef8", + search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices( + []string{"Movies"}), + ) + require.NoError(t, err) + require.Equal(t, "NjFhZmE0OGEyMTI3OThiODc0OTlkOGM0YjcxYzljY2M2NmU2NDE5ZWY0NDZjMWJhNjA2NzBkMjAwOTI2YWQyZnJlc3RyaWN0SW5kaWNlcz1Nb3ZpZXMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", res) + } } // generate secured api key with searchParams @@ -275,15 +279,17 @@ func TestSearchgenerateSecuredApiKey1(t *testing.T) { _ = res client, echo := createSearchClient(t) _ = echo - res, err = client.GenerateSecuredApiKey( - "2640659426d5107b6e47d75db9cbaef8", - search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices( - []string{"Movies", "cts_e2e_settings"}).SetRestrictSources("192.168.1.0/24").SetFilters("category:Book OR category:Ebook AND _tags:published").SetUserToken("user123").SetSearchParams( - search.NewEmptySearchParamsObject().SetQuery("batman").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum("strict"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll("all"))).SetMode(search.Mode("neuralSearch")).SetHitsPerPage(10).SetOptionalWords( - []string{"one", "two"})), - ) - require.NoError(t, err) - require.Equal(t, "MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", res) + { + res, err = client.GenerateSecuredApiKey( + "2640659426d5107b6e47d75db9cbaef8", + search.NewEmptySecuredApiKeyRestrictions().SetValidUntil(2524604400).SetRestrictIndices( + []string{"Movies", "cts_e2e_settings"}).SetRestrictSources("192.168.1.0/24").SetFilters("category:Book OR category:Ebook AND _tags:published").SetUserToken("user123").SetSearchParams( + search.NewEmptySearchParamsObject().SetQuery("batman").SetTypoTolerance(search.TypoToleranceEnumAsTypoTolerance(search.TypoToleranceEnum("strict"))).SetAroundRadius(search.AroundRadiusAllAsAroundRadius(search.AroundRadiusAll("all"))).SetMode(search.Mode("neuralSearch")).SetHitsPerPage(10).SetOptionalWords( + []string{"one", "two"})), + ) + require.NoError(t, err) + require.Equal(t, "MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", res) + } } // indexExists @@ -305,11 +311,13 @@ func TestSearchindexExists0(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.IndexExists( - "indexExistsYES", - ) - require.NoError(t, err) - require.Equal(t, true, res) + { + res, err = client.IndexExists( + "indexExistsYES", + ) + require.NoError(t, err) + require.Equal(t, true, res) + } } // indexNotExists @@ -331,11 +339,13 @@ func TestSearchindexExists1(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.IndexExists( - "indexExistsNO", - ) - require.NoError(t, err) - require.Equal(t, false, res) + { + res, err = client.IndexExists( + "indexExistsNO", + ) + require.NoError(t, err) + require.Equal(t, false, res) + } } // indexExistsWithError @@ -455,14 +465,16 @@ func TestSearchpartialUpdateObjects0(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.PartialUpdateObjects( - "cts_e2e_partialUpdateObjects_go", - []map[string]any{map[string]any{"objectID": "1", "name": "Adam"}, map[string]any{"objectID": "2", "name": "Benoit"}}, - search.WithCreateIfNotExists(true)) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `[{"taskID":444,"objectIDs":["1","2"]}]`, string(rawBody)) + { + res, err = client.PartialUpdateObjects( + "cts_e2e_partialUpdateObjects_go", + []map[string]any{map[string]any{"objectID": "1", "name": "Adam"}, map[string]any{"objectID": "2", "name": "Benoit"}}, + search.WithCreateIfNotExists(true)) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `[{"taskID":444,"objectIDs":["1","2"]}]`, string(rawBody)) + } } // call partialUpdateObjects with createIfNotExists=false @@ -484,14 +496,16 @@ func TestSearchpartialUpdateObjects1(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.PartialUpdateObjects( - "cts_e2e_partialUpdateObjects_go", - []map[string]any{map[string]any{"objectID": "3", "name": "Cyril"}, map[string]any{"objectID": "4", "name": "David"}}, - search.WithCreateIfNotExists(false)) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `[{"taskID":555,"objectIDs":["3","4"]}]`, string(rawBody)) + { + res, err = client.PartialUpdateObjects( + "cts_e2e_partialUpdateObjects_go", + []map[string]any{map[string]any{"objectID": "3", "name": "Cyril"}, map[string]any{"objectID": "4", "name": "David"}}, + search.WithCreateIfNotExists(false)) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `[{"taskID":555,"objectIDs":["3","4"]}]`, string(rawBody)) + } } // call replaceAllObjects without error @@ -513,14 +527,16 @@ func TestSearchreplaceAllObjects0(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.ReplaceAllObjects( - "cts_e2e_replace_all_objects_go", - []map[string]any{map[string]any{"objectID": "1", "name": "Adam"}, map[string]any{"objectID": "2", "name": "Benoit"}, map[string]any{"objectID": "3", "name": "Cyril"}, map[string]any{"objectID": "4", "name": "David"}, map[string]any{"objectID": "5", "name": "Eva"}, map[string]any{"objectID": "6", "name": "Fiona"}, map[string]any{"objectID": "7", "name": "Gael"}, map[string]any{"objectID": "8", "name": "Hugo"}, map[string]any{"objectID": "9", "name": "Igor"}, map[string]any{"objectID": "10", "name": "Julia"}}, - search.WithBatchSize(3)) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `{"copyOperationResponse":{"taskID":125,"updatedAt":"2021-01-01T00:00:00.000Z"},"batchResponses":[{"taskID":127,"objectIDs":["1","2","3"]},{"taskID":130,"objectIDs":["4","5","6"]},{"taskID":133,"objectIDs":["7","8","9"]},{"taskID":134,"objectIDs":["10"]}],"moveOperationResponse":{"taskID":777,"updatedAt":"2021-01-01T00:00:00.000Z"}}`, string(rawBody)) + { + res, err = client.ReplaceAllObjects( + "cts_e2e_replace_all_objects_go", + []map[string]any{map[string]any{"objectID": "1", "name": "Adam"}, map[string]any{"objectID": "2", "name": "Benoit"}, map[string]any{"objectID": "3", "name": "Cyril"}, map[string]any{"objectID": "4", "name": "David"}, map[string]any{"objectID": "5", "name": "Eva"}, map[string]any{"objectID": "6", "name": "Fiona"}, map[string]any{"objectID": "7", "name": "Gael"}, map[string]any{"objectID": "8", "name": "Hugo"}, map[string]any{"objectID": "9", "name": "Igor"}, map[string]any{"objectID": "10", "name": "Julia"}}, + search.WithBatchSize(3)) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"copyOperationResponse":{"taskID":125,"updatedAt":"2021-01-01T00:00:00.000Z"},"batchResponses":[{"taskID":127,"objectIDs":["1","2","3"]},{"taskID":130,"objectIDs":["4","5","6"]},{"taskID":133,"objectIDs":["7","8","9"]},{"taskID":134,"objectIDs":["10"]}],"moveOperationResponse":{"taskID":777,"updatedAt":"2021-01-01T00:00:00.000Z"}}`, string(rawBody)) + } } // call saveObjects without error @@ -542,14 +558,16 @@ func TestSearchsaveObjects0(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.SaveObjects( - "cts_e2e_saveObjects_go", - []map[string]any{map[string]any{"objectID": "1", "name": "Adam"}, map[string]any{"objectID": "2", "name": "Benoit"}}, - ) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `[{"taskID":333,"objectIDs":["1","2"]}]`, string(rawBody)) + { + res, err = client.SaveObjects( + "cts_e2e_saveObjects_go", + []map[string]any{map[string]any{"objectID": "1", "name": "Adam"}, map[string]any{"objectID": "2", "name": "Benoit"}}, + ) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `[{"taskID":333,"objectIDs":["1","2"]}]`, string(rawBody)) + } } // saveObjects should report errors @@ -578,6 +596,51 @@ func TestSearchsaveObjects1(t *testing.T) { require.EqualError(t, err, "API error [403] {\"message\":\"Invalid Application-ID or API key\",\"status\":403}") } +// switch API key +func TestSearchsetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *search.APIClient + var cfg search.SearchConfiguration + _ = client + _ = echo + cfg = search.SearchConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + } + client, err = search.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} + // wait for api key helper - add func TestSearchwaitForApiKey0(t *testing.T) { var err error @@ -597,13 +660,15 @@ func TestSearchwaitForApiKey0(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.WaitForApiKey( - "api-key-add-operation-test-go", search.ApiKeyOperation("add"), - ) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `{"value":"api-key-add-operation-test-go","description":"my new api key","acl":["search","addObject"],"validity":300,"maxQueriesPerIPPerHour":100,"maxHitsPerQuery":20,"createdAt":1720094400}`, string(rawBody)) + { + res, err = client.WaitForApiKey( + "api-key-add-operation-test-go", search.ApiKeyOperation("add"), + ) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"value":"api-key-add-operation-test-go","description":"my new api key","acl":["search","addObject"],"validity":300,"maxQueriesPerIPPerHour":100,"maxHitsPerQuery":20,"createdAt":1720094400}`, string(rawBody)) + } } // wait for api key - update @@ -625,17 +690,19 @@ func TestSearchwaitForApiKey1(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.WaitForApiKey( - "api-key-update-operation-test-go", search.ApiKeyOperation("update"), - search.WithApiKey( - search.NewEmptyApiKey().SetDescription("my updated api key").SetAcl( - []search.Acl{search.Acl("search"), search.Acl("addObject"), search.Acl("deleteObject")}).SetIndexes( - []string{"Movies", "Books"}).SetReferers( - []string{"*google.com", "*algolia.com"}).SetValidity(305).SetMaxQueriesPerIPPerHour(95).SetMaxHitsPerQuery(20))) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `{"value":"api-key-update-operation-test-go","description":"my updated api key","acl":["search","addObject","deleteObject"],"indexes":["Movies","Books"],"referers":["*google.com","*algolia.com"],"validity":305,"maxQueriesPerIPPerHour":95,"maxHitsPerQuery":20,"createdAt":1720094400}`, string(rawBody)) + { + res, err = client.WaitForApiKey( + "api-key-update-operation-test-go", search.ApiKeyOperation("update"), + search.WithApiKey( + search.NewEmptyApiKey().SetDescription("my updated api key").SetAcl( + []search.Acl{search.Acl("search"), search.Acl("addObject"), search.Acl("deleteObject")}).SetIndexes( + []string{"Movies", "Books"}).SetReferers( + []string{"*google.com", "*algolia.com"}).SetValidity(305).SetMaxQueriesPerIPPerHour(95).SetMaxHitsPerQuery(20))) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"value":"api-key-update-operation-test-go","description":"my updated api key","acl":["search","addObject","deleteObject"],"indexes":["Movies","Books"],"referers":["*google.com","*algolia.com"],"validity":305,"maxQueriesPerIPPerHour":95,"maxHitsPerQuery":20,"createdAt":1720094400}`, string(rawBody)) + } } // wait for api key - delete @@ -657,11 +724,13 @@ func TestSearchwaitForApiKey2(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.WaitForApiKey( - "api-key-delete-operation-test-go", search.ApiKeyOperation("delete"), - ) - require.NoError(t, err) - require.Nil(t, res) + { + res, err = client.WaitForApiKey( + "api-key-delete-operation-test-go", search.ApiKeyOperation("delete"), + ) + require.NoError(t, err) + require.Nil(t, res) + } } // wait for an application-level task @@ -683,13 +752,15 @@ func TestSearchwaitForAppTask0(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.WaitForAppTask( - 123, - ) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `{"status":"published"}`, string(rawBody)) + { + res, err = client.WaitForAppTask( + 123, + ) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"status":"published"}`, string(rawBody)) + } } // wait for task @@ -711,11 +782,13 @@ func TestSearchwaitForTask0(t *testing.T) { } client, err = search.NewClientWithConfig(cfg) require.NoError(t, err) - res, err = client.WaitForTask( - "wait-task-go", 123, - ) - require.NoError(t, err) - rawBody, err := json.Marshal(res) - require.NoError(t, err) - require.JSONEq(t, `{"status":"published"}`, string(rawBody)) + { + res, err = client.WaitForTask( + "wait-task-go", 123, + ) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"status":"published"}`, string(rawBody)) + } } diff --git a/tests/output/go/tests/client/usage_test.go b/tests/output/go/tests/client/usage_test.go index 28a6a2d8e2..845b69a8ee 100644 --- a/tests/output/go/tests/client/usage_test.go +++ b/tests/output/go/tests/client/usage_test.go @@ -2,6 +2,7 @@ package client import ( + "encoding/json" "regexp" "testing" @@ -9,6 +10,7 @@ import ( "gotests/tests" + "github.com/algolia/algoliasearch-client-go/v4/algolia/call" "github.com/algolia/algoliasearch-client-go/v4/algolia/transport" "github.com/algolia/algoliasearch-client-go/v4/algolia/usage" ) @@ -176,3 +178,48 @@ func TestUsageparameters0(t *testing.T) { client, err = usage.NewClientWithConfig(cfg) require.EqualError(t, err, "`apiKey` is missing.") } + +// switch API key +func TestUsagesetClientApiKey0(t *testing.T) { + var err error + var res any + _ = res + echo := &tests.EchoRequester{} + var client *usage.APIClient + var cfg usage.UsageConfiguration + _ = client + _ = echo + cfg = usage.UsageConfiguration{ + Configuration: transport.Configuration{ + AppID: "test-app-id", + ApiKey: "test-api-key", + Hosts: []transport.StatefulHost{transport.NewStatefulHost("http", "localhost:6683", call.IsReadWrite)}, + }, + } + client, err = usage.NewClientWithConfig(cfg) + require.NoError(t, err) + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/1", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"test-api-key"}`, string(rawBody)) + } + { + err = client.SetClientApiKey( + "updated-api-key", + ) + require.NoError(t, err) + } + { + res, err = client.CustomGet(client.NewApiCustomGetRequest( + "check-api-key/2", + )) + require.NoError(t, err) + rawBody, err := json.Marshal(res) + require.NoError(t, err) + require.JSONEq(t, `{"headerAPIKeyValue":"updated-api-key"}`, string(rawBody)) + } +} diff --git a/tests/output/java/src/test/java/com/algolia/client/Abtesting.test.java b/tests/output/java/src/test/java/com/algolia/client/Abtesting.test.java index 71fb029219..6a7bb29c63 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Abtesting.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Abtesting.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -18,6 +19,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class AbtestingClientClientTests { @@ -131,4 +134,32 @@ void parametersTest2() { assertEquals("`region` must be one of the following: de, us", exception.getMessage()); } } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + AbtestingClient client = new AbtestingClient( + "test-app-id", + "test-api-key", + "us", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/java/src/test/java/com/algolia/client/Analytics.test.java b/tests/output/java/src/test/java/com/algolia/client/Analytics.test.java index d4121f58c3..ac5cb37d03 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Analytics.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Analytics.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -18,6 +19,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class AnalyticsClientClientTests { @@ -145,4 +148,32 @@ void parametersTest3() { assertEquals("Parameter `index` is required when calling `getClickPositions`.", exception.getMessage()); } } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + AnalyticsClient client = new AnalyticsClient( + "test-app-id", + "test-api-key", + "us", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/java/src/test/java/com/algolia/client/Ingestion.test.java b/tests/output/java/src/test/java/com/algolia/client/Ingestion.test.java index 21b0b088bb..5600ceaa43 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Ingestion.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Ingestion.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -18,6 +19,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class IngestionClientClientTests { @@ -122,4 +125,32 @@ void parametersTest1() { assertEquals("`region` is required and must be one of the following: eu, us", exception.getMessage()); } } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + IngestionClient client = new IngestionClient( + "test-app-id", + "test-api-key", + "us", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/java/src/test/java/com/algolia/client/Insights.test.java b/tests/output/java/src/test/java/com/algolia/client/Insights.test.java index 14506bd253..343561e943 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Insights.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Insights.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -18,6 +19,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class InsightsClientClientTests { @@ -147,4 +150,32 @@ void parametersTest2() { assertEquals("`region` must be one of the following: de, us", exception.getMessage()); } } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + InsightsClient client = new InsightsClient( + "test-app-id", + "test-api-key", + "us", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/java/src/test/java/com/algolia/client/Monitoring.test.java b/tests/output/java/src/test/java/com/algolia/client/Monitoring.test.java index 308ae7574d..b1d2385d9c 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Monitoring.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Monitoring.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -17,6 +18,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class MonitoringClientClientTests { @@ -110,4 +113,31 @@ void parametersTest0() { EchoResponse result = echo.getLastResponse(); assertEquals("status.algolia.com", result.host); } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + MonitoringClient client = new MonitoringClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/java/src/test/java/com/algolia/client/Personalization.test.java b/tests/output/java/src/test/java/com/algolia/client/Personalization.test.java index 5ca01340a9..e02f1f17ef 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Personalization.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Personalization.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -18,6 +19,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class PersonalizationClientClientTests { @@ -130,4 +133,32 @@ void parametersTest1() { void parametersTest2() { PersonalizationClient client = new PersonalizationClient("my-app-id", "my-api-key", "us", withEchoRequester()); } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + PersonalizationClient client = new PersonalizationClient( + "test-app-id", + "test-api-key", + "us", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/java/src/test/java/com/algolia/client/QuerySuggestions.test.java b/tests/output/java/src/test/java/com/algolia/client/QuerySuggestions.test.java index 2b21f47989..8e211eef21 100644 --- a/tests/output/java/src/test/java/com/algolia/client/QuerySuggestions.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/QuerySuggestions.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -18,6 +19,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class QuerySuggestionsClientClientTests { @@ -130,4 +133,32 @@ void parametersTest1() { void parametersTest2() { QuerySuggestionsClient client = new QuerySuggestionsClient("my-app-id", "my-api-key", "us", withEchoRequester()); } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + QuerySuggestionsClient client = new QuerySuggestionsClient( + "test-app-id", + "test-api-key", + "us", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/java/src/test/java/com/algolia/client/Recommend.test.java b/tests/output/java/src/test/java/com/algolia/client/Recommend.test.java index bcaed5ed41..27ac17eb94 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Recommend.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Recommend.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -17,6 +18,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class RecommendClientClientTests { @@ -119,4 +122,31 @@ void commonApiTest3() { assertEquals(2000, result.connectTimeout); assertEquals(30000, result.responseTimeout); } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + RecommendClient client = new RecommendClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/java/src/test/java/com/algolia/client/Search.test.java b/tests/output/java/src/test/java/com/algolia/client/Search.test.java index 2334e7bff1..d5bec5b93e 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Search.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Search.test.java @@ -197,12 +197,12 @@ void commonApiTest3() { @Test @DisplayName("call deleteObjects without error") void deleteObjectsTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) - ); List res = client.deleteObjects("cts_e2e_deleteObjects_java", Arrays.asList("1", "2")); assertDoesNotThrow(() -> @@ -264,12 +264,12 @@ void generateSecuredApiKeyTest1() { @Test @DisplayName("indexExists") void indexExistsTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) - ); Boolean res = client.indexExists("indexExistsYES"); assertEquals(true, res); @@ -279,12 +279,12 @@ void indexExistsTest0() { @Test @DisplayName("indexNotExists") void indexExistsTest1() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) - ); Boolean res = client.indexExists("indexExistsNO"); assertEquals(false, res); @@ -294,19 +294,17 @@ void indexExistsTest1() { @Test @DisplayName("indexExistsWithError") void indexExistsTest2() { - assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) - ); - { - Exception exception = assertThrows(Exception.class, () -> { - Boolean res = client.indexExists("indexExistsERROR"); - }); - assertEquals("Status Code: 403 - {\"message\":\"Invalid API key\"}", exception.getMessage()); - } - }); + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) + ); + { + Exception exception = assertThrows(Exception.class, () -> { + Boolean res = client.indexExists("indexExistsERROR"); + }); + assertEquals("Status Code: 403 - {\"message\":\"Invalid API key\"}", exception.getMessage()); + } } @Test @@ -389,12 +387,12 @@ void parametersTest2() { @Test @DisplayName("call partialUpdateObjects with createIfNotExists=true") void partialUpdateObjectsTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) - ); List res = client.partialUpdateObjects( "cts_e2e_partialUpdateObjects_java", Arrays.asList( @@ -423,12 +421,12 @@ void partialUpdateObjectsTest0() { @Test @DisplayName("call partialUpdateObjects with createIfNotExists=false") void partialUpdateObjectsTest1() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) - ); List res = client.partialUpdateObjects( "cts_e2e_partialUpdateObjects_java", Arrays.asList( @@ -457,12 +455,12 @@ void partialUpdateObjectsTest1() { @Test @DisplayName("call replaceAllObjects without error") void replaceAllObjectsTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6679)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6679)), false) - ); ReplaceAllObjectsResponse res = client.replaceAllObjects( "cts_e2e_replace_all_objects_java", Arrays.asList( @@ -543,12 +541,12 @@ void replaceAllObjectsTest0() { @Test @DisplayName("call saveObjects without error") void saveObjectsTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) - ); List res = client.saveObjects( "cts_e2e_saveObjects_java", Arrays.asList( @@ -576,46 +574,71 @@ void saveObjectsTest0() { @Test @DisplayName("saveObjects should report errors") void saveObjectsTest1() { + SearchClient client = new SearchClient( + "test-app-id", + "wrong-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) + ); + { + Exception exception = assertThrows(Exception.class, () -> { + List res = client.saveObjects( + "cts_e2e_saveObjects_java", + Arrays.asList( + new HashMap() { + { + put("objectID", "1"); + put("name", "Adam"); + } + }, + new HashMap() { + { + put("objectID", "2"); + put("name", "Benoit"); + } + } + ) + ); + }); + assertEquals("Status Code: 403 - {\"message\":\"Invalid Application-ID or API key\",\"status\":403}", exception.getMessage()); + } + } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "wrong-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6680)), false) + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) ); - { - Exception exception = assertThrows(Exception.class, () -> { - List res = client.saveObjects( - "cts_e2e_saveObjects_java", - Arrays.asList( - new HashMap() { - { - put("objectID", "1"); - put("name", "Adam"); - } - }, - new HashMap() { - { - put("objectID", "2"); - put("name", "Benoit"); - } - } - ) - ); - }); - assertEquals("Status Code: 403 - {\"message\":\"Invalid Application-ID or API" + " key\",\"status\":403}", exception.getMessage()); - } }); } @Test @DisplayName("wait for api key helper - add") void waitForApiKeyTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) - ); GetApiKeyResponse res = client.waitForApiKey("api-key-add-operation-test-java", ApiKeyOperation.ADD); assertDoesNotThrow(() -> @@ -632,12 +655,12 @@ void waitForApiKeyTest0() { @Test @DisplayName("wait for api key - update") void waitForApiKeyTest1() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) - ); GetApiKeyResponse res = client.waitForApiKey( "api-key-update-operation-test-java", ApiKeyOperation.UPDATE, @@ -666,12 +689,12 @@ void waitForApiKeyTest1() { @Test @DisplayName("wait for api key - delete") void waitForApiKeyTest2() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) - ); GetApiKeyResponse res = client.waitForApiKey("api-key-delete-operation-test-java", ApiKeyOperation.DELETE); assertEquals(null, res); @@ -681,12 +704,12 @@ void waitForApiKeyTest2() { @Test @DisplayName("wait for an application-level task") void waitForAppTaskTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) - ); GetTaskResponse res = client.waitForAppTask(123L); assertDoesNotThrow(() -> JSONAssert.assertEquals("{\"status\":\"published\"}", json.writeValueAsString(res), JSONCompareMode.STRICT)); @@ -696,12 +719,12 @@ void waitForAppTaskTest0() { @Test @DisplayName("wait for task") void waitForTaskTest0() { + SearchClient client = new SearchClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) + ); assertDoesNotThrow(() -> { - SearchClient client = new SearchClient( - "test-app-id", - "test-api-key", - withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6681)), false) - ); GetTaskResponse res = client.waitForTask("wait-task-java", 123L); assertDoesNotThrow(() -> JSONAssert.assertEquals("{\"status\":\"published\"}", json.writeValueAsString(res), JSONCompareMode.STRICT)); diff --git a/tests/output/java/src/test/java/com/algolia/client/Usage.test.java b/tests/output/java/src/test/java/com/algolia/client/Usage.test.java index 30c36cf842..7d911496c0 100644 --- a/tests/output/java/src/test/java/com/algolia/client/Usage.test.java +++ b/tests/output/java/src/test/java/com/algolia/client/Usage.test.java @@ -1,5 +1,6 @@ package com.algolia.client; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -18,6 +19,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; @TestInstance(TestInstance.Lifecycle.PER_CLASS) class UsageClientClientTests { @@ -143,4 +146,31 @@ void parametersTest0() { assertEquals("`apiKey` is missing.", exception.getMessage()); } } + + @Test + @DisplayName("switch API key") + void setClientApiKeyTest0() { + UsageClient client = new UsageClient( + "test-app-id", + "test-api-key", + withCustomHosts(Arrays.asList(new Host("localhost", EnumSet.of(CallType.READ, CallType.WRITE), "http", 6683)), false) + ); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/1"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + assertDoesNotThrow(() -> { + client.setClientApiKey("updated-api-key"); + }); + assertDoesNotThrow(() -> { + Object res = client.customGet("check-api-key/2"); + + assertDoesNotThrow(() -> + JSONAssert.assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", json.writeValueAsString(res), JSONCompareMode.STRICT) + ); + }); + } } diff --git a/tests/output/javascript/src/client/abtesting.test.ts b/tests/output/javascript/src/client/abtesting.test.ts index 25ac16dc0c..067339c176 100644 --- a/tests/output/javascript/src/client/abtesting.test.ts +++ b/tests/output/javascript/src/client/abtesting.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ +/* eslint-disable @typescript-eslint/no-unused-vars, require-await, no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { AbtestingClient } from '@algolia/client-abtesting'; import { abtestingClient } from '@algolia/client-abtesting'; @@ -76,6 +76,28 @@ describe('parameters', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = abtestingClient('test-app-id', 'test-api-key', 'us', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = abtestingClient('foo', 'bar', 'us', { diff --git a/tests/output/javascript/src/client/analytics.test.ts b/tests/output/javascript/src/client/analytics.test.ts index fe47fd2645..07f061c1a8 100644 --- a/tests/output/javascript/src/client/analytics.test.ts +++ b/tests/output/javascript/src/client/analytics.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ +/* eslint-disable @typescript-eslint/no-unused-vars, require-await, no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { AnalyticsClient } from '@algolia/client-analytics'; import { analyticsClient } from '@algolia/client-analytics'; @@ -87,6 +87,28 @@ describe('parameters', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = analyticsClient('test-app-id', 'test-api-key', 'us', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = analyticsClient('foo', 'bar', 'us', { diff --git a/tests/output/javascript/src/client/ingestion.test.ts b/tests/output/javascript/src/client/ingestion.test.ts index 00f93d49f5..e87b078697 100644 --- a/tests/output/javascript/src/client/ingestion.test.ts +++ b/tests/output/javascript/src/client/ingestion.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ +/* eslint-disable @typescript-eslint/no-unused-vars, require-await, no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { IngestionClient } from '@algolia/ingestion'; import { ingestionClient } from '@algolia/ingestion'; @@ -70,6 +70,28 @@ describe('parameters', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = ingestionClient('test-app-id', 'test-api-key', 'us', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = ingestionClient('foo', 'bar', 'us', { diff --git a/tests/output/javascript/src/client/insights.test.ts b/tests/output/javascript/src/client/insights.test.ts index c3dd02c407..28bca97041 100644 --- a/tests/output/javascript/src/client/insights.test.ts +++ b/tests/output/javascript/src/client/insights.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ +/* eslint-disable @typescript-eslint/no-unused-vars, require-await, no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { InsightsClient } from '@algolia/client-insights'; import { insightsClient } from '@algolia/client-insights'; @@ -90,6 +90,28 @@ describe('parameters', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = insightsClient('test-app-id', 'test-api-key', 'us', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = insightsClient('foo', 'bar', 'us', { diff --git a/tests/output/javascript/src/client/monitoring.test.ts b/tests/output/javascript/src/client/monitoring.test.ts index dfcdf227ec..aeed26dad1 100644 --- a/tests/output/javascript/src/client/monitoring.test.ts +++ b/tests/output/javascript/src/client/monitoring.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - +/* eslint-disable no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { MonitoringClient } from '@algolia/monitoring'; import { monitoringClient } from '@algolia/monitoring'; @@ -59,6 +59,28 @@ describe('parameters', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = monitoringClient('test-app-id', 'test-api-key', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = monitoringClient('foo', 'bar', { diff --git a/tests/output/javascript/src/client/personalization.test.ts b/tests/output/javascript/src/client/personalization.test.ts index fec2053982..9fa9470dbd 100644 --- a/tests/output/javascript/src/client/personalization.test.ts +++ b/tests/output/javascript/src/client/personalization.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ +/* eslint-disable @typescript-eslint/no-unused-vars, require-await, no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { PersonalizationClient } from '@algolia/client-personalization'; import { personalizationClient } from '@algolia/client-personalization'; @@ -73,6 +73,28 @@ describe('parameters', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = personalizationClient('test-app-id', 'test-api-key', 'us', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = personalizationClient('foo', 'bar', 'us', { diff --git a/tests/output/javascript/src/client/querySuggestions.test.ts b/tests/output/javascript/src/client/querySuggestions.test.ts index f1f9600d78..986d849023 100644 --- a/tests/output/javascript/src/client/querySuggestions.test.ts +++ b/tests/output/javascript/src/client/querySuggestions.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ +/* eslint-disable @typescript-eslint/no-unused-vars, require-await, no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { QuerySuggestionsClient } from '@algolia/client-query-suggestions'; import { querySuggestionsClient } from '@algolia/client-query-suggestions'; @@ -73,6 +73,28 @@ describe('parameters', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = querySuggestionsClient('test-app-id', 'test-api-key', 'us', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = querySuggestionsClient('foo', 'bar', 'us', { diff --git a/tests/output/javascript/src/client/recommend.test.ts b/tests/output/javascript/src/client/recommend.test.ts index f54ba110e4..cfa05c9238 100644 --- a/tests/output/javascript/src/client/recommend.test.ts +++ b/tests/output/javascript/src/client/recommend.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - +/* eslint-disable no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { RecommendClient } from '@algolia/recommend'; import { recommendClient } from '@algolia/recommend'; @@ -67,6 +67,28 @@ describe('commonApi', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = recommendClient('test-app-id', 'test-api-key', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = recommendClient('foo', 'bar', { diff --git a/tests/output/javascript/src/client/search.test.ts b/tests/output/javascript/src/client/search.test.ts index a29dd07863..105291e650 100644 --- a/tests/output/javascript/src/client/search.test.ts +++ b/tests/output/javascript/src/client/search.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ +/* eslint-disable @typescript-eslint/no-unused-vars, require-await, no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { SearchClient } from '@algolia/client-search'; import { searchClient } from '@algolia/client-search'; @@ -102,9 +102,14 @@ describe('deleteObjects', () => { hosts: [{ url: 'localhost', port: 6680, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.deleteObjects({ indexName: 'cts_e2e_deleteObjects_javascript', objectIDs: ['1', '2'] }); + { + const result = await client.deleteObjects({ + indexName: 'cts_e2e_deleteObjects_javascript', + objectIDs: ['1', '2'], + }); - expect(result).toEqual([{ taskID: 666, objectIDs: ['1', '2'] }]); + expect(result).toEqual([{ taskID: 666, objectIDs: ['1', '2'] }]); + } }, 15000); }); @@ -112,41 +117,45 @@ describe('generateSecuredApiKey', () => { test('generate secured api key basic', async () => { const client = createClient(); - const result = client.generateSecuredApiKey({ - parentApiKey: '2640659426d5107b6e47d75db9cbaef8', - restrictions: { validUntil: 2524604400, restrictIndices: ['Movies'] }, - }); + { + const result = client.generateSecuredApiKey({ + parentApiKey: '2640659426d5107b6e47d75db9cbaef8', + restrictions: { validUntil: 2524604400, restrictIndices: ['Movies'] }, + }); - expect(result).toEqual( - 'NjFhZmE0OGEyMTI3OThiODc0OTlkOGM0YjcxYzljY2M2NmU2NDE5ZWY0NDZjMWJhNjA2NzBkMjAwOTI2YWQyZnJlc3RyaWN0SW5kaWNlcz1Nb3ZpZXMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw', - ); + expect(result).toEqual( + 'NjFhZmE0OGEyMTI3OThiODc0OTlkOGM0YjcxYzljY2M2NmU2NDE5ZWY0NDZjMWJhNjA2NzBkMjAwOTI2YWQyZnJlc3RyaWN0SW5kaWNlcz1Nb3ZpZXMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw', + ); + } }, 15000); test('generate secured api key with searchParams', async () => { const client = createClient(); - const result = client.generateSecuredApiKey({ - parentApiKey: '2640659426d5107b6e47d75db9cbaef8', - restrictions: { - validUntil: 2524604400, - restrictIndices: ['Movies', 'cts_e2e_settings'], - restrictSources: '192.168.1.0/24', - filters: 'category:Book OR category:Ebook AND _tags:published', - userToken: 'user123', - searchParams: { - query: 'batman', - typoTolerance: 'strict', - aroundRadius: 'all', - mode: 'neuralSearch', - hitsPerPage: 10, - optionalWords: ['one', 'two'], + { + const result = client.generateSecuredApiKey({ + parentApiKey: '2640659426d5107b6e47d75db9cbaef8', + restrictions: { + validUntil: 2524604400, + restrictIndices: ['Movies', 'cts_e2e_settings'], + restrictSources: '192.168.1.0/24', + filters: 'category:Book OR category:Ebook AND _tags:published', + userToken: 'user123', + searchParams: { + query: 'batman', + typoTolerance: 'strict', + aroundRadius: 'all', + mode: 'neuralSearch', + hitsPerPage: 10, + optionalWords: ['one', 'two'], + }, }, - }, - }); + }); - expect(result).toEqual( - 'MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw', - ); + expect(result).toEqual( + 'MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw', + ); + } }, 15000); }); @@ -156,9 +165,11 @@ describe('indexExists', () => { hosts: [{ url: 'localhost', port: 6681, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.indexExists({ indexName: 'indexExistsYES' }); + { + const result = await client.indexExists({ indexName: 'indexExistsYES' }); - expect(result).toEqual(true); + expect(result).toEqual(true); + } }, 15000); test('indexNotExists', async () => { @@ -166,9 +177,11 @@ describe('indexExists', () => { hosts: [{ url: 'localhost', port: 6681, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.indexExists({ indexName: 'indexExistsNO' }); + { + const result = await client.indexExists({ indexName: 'indexExistsNO' }); - expect(result).toEqual(false); + expect(result).toEqual(false); + } }, 15000); test('indexExistsWithError', async () => { @@ -257,16 +270,18 @@ describe('partialUpdateObjects', () => { hosts: [{ url: 'localhost', port: 6680, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.partialUpdateObjects({ - indexName: 'cts_e2e_partialUpdateObjects_javascript', - objects: [ - { objectID: '1', name: 'Adam' }, - { objectID: '2', name: 'Benoit' }, - ], - createIfNotExists: true, - }); + { + const result = await client.partialUpdateObjects({ + indexName: 'cts_e2e_partialUpdateObjects_javascript', + objects: [ + { objectID: '1', name: 'Adam' }, + { objectID: '2', name: 'Benoit' }, + ], + createIfNotExists: true, + }); - expect(result).toEqual([{ taskID: 444, objectIDs: ['1', '2'] }]); + expect(result).toEqual([{ taskID: 444, objectIDs: ['1', '2'] }]); + } }, 15000); test('call partialUpdateObjects with createIfNotExists=false', async () => { @@ -274,16 +289,18 @@ describe('partialUpdateObjects', () => { hosts: [{ url: 'localhost', port: 6680, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.partialUpdateObjects({ - indexName: 'cts_e2e_partialUpdateObjects_javascript', - objects: [ - { objectID: '3', name: 'Cyril' }, - { objectID: '4', name: 'David' }, - ], - createIfNotExists: false, - }); + { + const result = await client.partialUpdateObjects({ + indexName: 'cts_e2e_partialUpdateObjects_javascript', + objects: [ + { objectID: '3', name: 'Cyril' }, + { objectID: '4', name: 'David' }, + ], + createIfNotExists: false, + }); - expect(result).toEqual([{ taskID: 555, objectIDs: ['3', '4'] }]); + expect(result).toEqual([{ taskID: 555, objectIDs: ['3', '4'] }]); + } }, 15000); }); @@ -293,33 +310,35 @@ describe('replaceAllObjects', () => { hosts: [{ url: 'localhost', port: 6679, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.replaceAllObjects({ - indexName: 'cts_e2e_replace_all_objects_javascript', - objects: [ - { objectID: '1', name: 'Adam' }, - { objectID: '2', name: 'Benoit' }, - { objectID: '3', name: 'Cyril' }, - { objectID: '4', name: 'David' }, - { objectID: '5', name: 'Eva' }, - { objectID: '6', name: 'Fiona' }, - { objectID: '7', name: 'Gael' }, - { objectID: '8', name: 'Hugo' }, - { objectID: '9', name: 'Igor' }, - { objectID: '10', name: 'Julia' }, - ], - batchSize: 3, - }); + { + const result = await client.replaceAllObjects({ + indexName: 'cts_e2e_replace_all_objects_javascript', + objects: [ + { objectID: '1', name: 'Adam' }, + { objectID: '2', name: 'Benoit' }, + { objectID: '3', name: 'Cyril' }, + { objectID: '4', name: 'David' }, + { objectID: '5', name: 'Eva' }, + { objectID: '6', name: 'Fiona' }, + { objectID: '7', name: 'Gael' }, + { objectID: '8', name: 'Hugo' }, + { objectID: '9', name: 'Igor' }, + { objectID: '10', name: 'Julia' }, + ], + batchSize: 3, + }); - expect(result).toEqual({ - copyOperationResponse: { taskID: 125, updatedAt: '2021-01-01T00:00:00.000Z' }, - batchResponses: [ - { taskID: 127, objectIDs: ['1', '2', '3'] }, - { taskID: 130, objectIDs: ['4', '5', '6'] }, - { taskID: 133, objectIDs: ['7', '8', '9'] }, - { taskID: 134, objectIDs: ['10'] }, - ], - moveOperationResponse: { taskID: 777, updatedAt: '2021-01-01T00:00:00.000Z' }, - }); + expect(result).toEqual({ + copyOperationResponse: { taskID: 125, updatedAt: '2021-01-01T00:00:00.000Z' }, + batchResponses: [ + { taskID: 127, objectIDs: ['1', '2', '3'] }, + { taskID: 130, objectIDs: ['4', '5', '6'] }, + { taskID: 133, objectIDs: ['7', '8', '9'] }, + { taskID: 134, objectIDs: ['10'] }, + ], + moveOperationResponse: { taskID: 777, updatedAt: '2021-01-01T00:00:00.000Z' }, + }); + } }, 15000); }); @@ -329,15 +348,17 @@ describe('saveObjects', () => { hosts: [{ url: 'localhost', port: 6680, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.saveObjects({ - indexName: 'cts_e2e_saveObjects_javascript', - objects: [ - { objectID: '1', name: 'Adam' }, - { objectID: '2', name: 'Benoit' }, - ], - }); + { + const result = await client.saveObjects({ + indexName: 'cts_e2e_saveObjects_javascript', + objects: [ + { objectID: '1', name: 'Adam' }, + { objectID: '2', name: 'Benoit' }, + ], + }); - expect(result).toEqual([{ taskID: 333, objectIDs: ['1', '2'] }]); + expect(result).toEqual([{ taskID: 333, objectIDs: ['1', '2'] }]); + } }, 15000); test('saveObjects should report errors', async () => { @@ -360,23 +381,47 @@ describe('saveObjects', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = searchClient('test-app-id', 'test-api-key', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('waitForApiKey', () => { test('wait for api key helper - add', async () => { const client = searchClient('test-app-id', 'test-api-key', { hosts: [{ url: 'localhost', port: 6681, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.waitForApiKey({ key: 'api-key-add-operation-test-javascript', operation: 'add' }); + { + const result = await client.waitForApiKey({ key: 'api-key-add-operation-test-javascript', operation: 'add' }); - expect(result).toEqual({ - value: 'api-key-add-operation-test-javascript', - description: 'my new api key', - acl: ['search', 'addObject'], - validity: 300, - maxQueriesPerIPPerHour: 100, - maxHitsPerQuery: 20, - createdAt: 1720094400, - }); + expect(result).toEqual({ + value: 'api-key-add-operation-test-javascript', + description: 'my new api key', + acl: ['search', 'addObject'], + validity: 300, + maxQueriesPerIPPerHour: 100, + maxHitsPerQuery: 20, + createdAt: 1720094400, + }); + } }, 15000); test('wait for api key - update', async () => { @@ -384,10 +429,23 @@ describe('waitForApiKey', () => { hosts: [{ url: 'localhost', port: 6681, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.waitForApiKey({ - key: 'api-key-update-operation-test-javascript', - operation: 'update', - apiKey: { + { + const result = await client.waitForApiKey({ + key: 'api-key-update-operation-test-javascript', + operation: 'update', + apiKey: { + description: 'my updated api key', + acl: ['search', 'addObject', 'deleteObject'], + indexes: ['Movies', 'Books'], + referers: ['*google.com', '*algolia.com'], + validity: 305, + maxQueriesPerIPPerHour: 95, + maxHitsPerQuery: 20, + }, + }); + + expect(result).toEqual({ + value: 'api-key-update-operation-test-javascript', description: 'my updated api key', acl: ['search', 'addObject', 'deleteObject'], indexes: ['Movies', 'Books'], @@ -395,20 +453,9 @@ describe('waitForApiKey', () => { validity: 305, maxQueriesPerIPPerHour: 95, maxHitsPerQuery: 20, - }, - }); - - expect(result).toEqual({ - value: 'api-key-update-operation-test-javascript', - description: 'my updated api key', - acl: ['search', 'addObject', 'deleteObject'], - indexes: ['Movies', 'Books'], - referers: ['*google.com', '*algolia.com'], - validity: 305, - maxQueriesPerIPPerHour: 95, - maxHitsPerQuery: 20, - createdAt: 1720094400, - }); + createdAt: 1720094400, + }); + } }, 15000); test('wait for api key - delete', async () => { @@ -416,9 +463,14 @@ describe('waitForApiKey', () => { hosts: [{ url: 'localhost', port: 6681, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.waitForApiKey({ key: 'api-key-delete-operation-test-javascript', operation: 'delete' }); + { + const result = await client.waitForApiKey({ + key: 'api-key-delete-operation-test-javascript', + operation: 'delete', + }); - expect(result).toEqual(); + expect(result).toEqual(); + } }, 15000); }); @@ -428,9 +480,11 @@ describe('waitForAppTask', () => { hosts: [{ url: 'localhost', port: 6681, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.waitForAppTask({ taskID: 123 }); + { + const result = await client.waitForAppTask({ taskID: 123 }); - expect(result).toEqual({ status: 'published' }); + expect(result).toEqual({ status: 'published' }); + } }, 15000); }); @@ -440,9 +494,11 @@ describe('waitForTask', () => { hosts: [{ url: 'localhost', port: 6681, accept: 'readWrite', protocol: 'http' }], }); - const result = await client.waitForTask({ indexName: 'wait-task-javascript', taskID: 123 }); + { + const result = await client.waitForTask({ indexName: 'wait-task-javascript', taskID: 123 }); - expect(result).toEqual({ status: 'published' }); + expect(result).toEqual({ status: 'published' }); + } }, 15000); }); diff --git a/tests/output/javascript/src/client/usage.test.ts b/tests/output/javascript/src/client/usage.test.ts index a9c81a2473..5bac196e49 100644 --- a/tests/output/javascript/src/client/usage.test.ts +++ b/tests/output/javascript/src/client/usage.test.ts @@ -1,5 +1,5 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ +/* eslint-disable @typescript-eslint/no-unused-vars, require-await, no-lone-blocks */ // @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. import type { UsageClient } from '@algolia/client-usage'; import { usageClient } from '@algolia/client-usage'; @@ -90,6 +90,28 @@ describe('parameters', () => { }, 15000); }); +describe('setClientApiKey', () => { + test('switch API key', async () => { + const client = usageClient('test-app-id', 'test-api-key', { + hosts: [{ url: 'localhost', port: 6683, accept: 'readWrite', protocol: 'http' }], + }); + + { + const result = await client.customGet({ path: 'check-api-key/1' }); + + expect(result).toEqual({ headerAPIKeyValue: 'test-api-key' }); + } + { + client.setClientApiKey({ apiKey: 'updated-api-key' }); + } + { + const result = await client.customGet({ path: 'check-api-key/2' }); + + expect(result).toEqual({ headerAPIKeyValue: 'updated-api-key' }); + } + }, 15000); +}); + describe('init', () => { test('sets authMode', async () => { const qpClient = usageClient('foo', 'bar', { diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/AbtestingTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/AbtestingTest.kt index 702b369b25..ec6109a4e9 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/AbtestingTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/AbtestingTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -116,4 +117,42 @@ class AbtestingTest { val client = AbtestingClient(appId = "my-app-id", apiKey = "my-api-key", "not_a_region") }.let { error -> assertError(error, "`region` must be one of the following: de, us") } } + + @Test + fun `switch API key`() = runTest { + val client = AbtestingClient(appId = "test-app-id", apiKey = "test-api-key", "us", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/AnalyticsTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/AnalyticsTest.kt index 0789ef4ad2..d014883075 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/AnalyticsTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/AnalyticsTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -126,4 +127,42 @@ class AnalyticsTest { ) }.let { error -> assertError(error, "Parameter `index` is required when calling `getClickPositions`.") } } + + @Test + fun `switch API key`() = runTest { + val client = AnalyticsClient(appId = "test-app-id", apiKey = "test-api-key", "us", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/IngestionTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/IngestionTest.kt index 401c4cf8d4..5e234fccd3 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/IngestionTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/IngestionTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -101,4 +102,42 @@ class IngestionTest { val client = IngestionClient(appId = "my-app-id", apiKey = "my-api-key", "not_a_region") }.let { error -> assertError(error, "`region` is required and must be one of the following: eu, us") } } + + @Test + fun `switch API key`() = runTest { + val client = IngestionClient(appId = "test-app-id", apiKey = "test-api-key", "us", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/InsightsTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/InsightsTest.kt index 332662286e..5d0930b665 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/InsightsTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/InsightsTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -130,4 +131,42 @@ class InsightsTest { val client = InsightsClient(appId = "my-app-id", apiKey = "my-api-key", "not_a_region") }.let { error -> assertError(error, "`region` must be one of the following: de, us") } } + + @Test + fun `switch API key`() = runTest { + val client = InsightsClient(appId = "test-app-id", apiKey = "test-api-key", "us", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/MonitoringTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/MonitoringTest.kt index 56b1771c1f..4c310ef1a7 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/MonitoringTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/MonitoringTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -94,4 +95,42 @@ class MonitoringTest { }, ) } + + @Test + fun `switch API key`() = runTest { + val client = MonitoringClient(appId = "test-app-id", apiKey = "test-api-key", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/PersonalizationTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/PersonalizationTest.kt index 7cac563ed2..9b313fa4b6 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/PersonalizationTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/PersonalizationTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -98,4 +99,42 @@ class PersonalizationTest { fun `does not throw when region is given`() = runTest { val client = PersonalizationClient(appId = "my-app-id", apiKey = "my-api-key", "us") } + + @Test + fun `switch API key`() = runTest { + val client = PersonalizationClient(appId = "test-app-id", apiKey = "test-api-key", "us", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/QuerySuggestionsTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/QuerySuggestionsTest.kt index 0ab773205b..84affe00b3 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/QuerySuggestionsTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/QuerySuggestionsTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -98,4 +99,42 @@ class QuerySuggestionsTest { fun `does not throw when region is given`() = runTest { val client = QuerySuggestionsClient(appId = "my-app-id", apiKey = "my-api-key", "us") } + + @Test + fun `switch API key`() = runTest { + val client = QuerySuggestionsClient(appId = "test-app-id", apiKey = "test-api-key", "us", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/RecommendTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/RecommendTest.kt index 603ebaefaa..ea2a860a28 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/RecommendTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/RecommendTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -109,4 +110,42 @@ class RecommendTest { }, ) } + + @Test + fun `switch API key`() = runTest { + val client = RecommendClient(appId = "test-app-id", apiKey = "test-api-key", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/SearchTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/SearchTest.kt index 0b2d999749..1787ead135 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/SearchTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/SearchTest.kt @@ -606,6 +606,44 @@ class SearchTest { }.let { error -> assertError(error, "Client request(POST http://localhost:6680/1/indexes/cts_e2e_saveObjects_kotlin/batch) invalid: 403 Forbidden. Text: \"{\"message\":\"Invalid Application-ID or API key\",\"status\":403}\"") } } + @Test + fun `switch API key`() = runTest { + val client = SearchClient(appId = "test-app-id", apiKey = "test-api-key", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } + @Test fun `wait for api key helper - add`() = runTest { val client = SearchClient(appId = "test-app-id", apiKey = "test-api-key", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6681)))) diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/UsageTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/UsageTest.kt index 4e9594a5f7..c6b737b35c 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/UsageTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/UsageTest.kt @@ -9,6 +9,7 @@ import com.algolia.client.transport.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* +import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* import kotlin.test.* @@ -122,4 +123,42 @@ class UsageTest { val client = UsageClient(appId = "my-app-id", apiKey = "") }.let { error -> assertError(error, "`apiKey` is missing.") } } + + @Test + fun `switch API key`() = runTest { + val client = UsageClient(appId = "test-app-id", apiKey = "test-api-key", options = ClientOptions(hosts = listOf(Host(url = "localhost", protocol = "http", port = 6683)))) + client.runTest( + call = { + customGet( + path = "check-api-key/1", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"test-api-key\"}", response) + }, + ) + client.runTest( + call = { + setClientApiKey( + apiKey = "updated-api-key", + ) + }, + intercept = { + }, + ) + client.runTest( + call = { + customGet( + path = "check-api-key/2", + ) + }, + + response = { + val response = Json.encodeToString(it) + assertEquals("{\"headerAPIKeyValue\":\"updated-api-key\"}", response) + }, + ) + } } diff --git a/tests/output/php/src/client/AbtestingTest.php b/tests/output/php/src/client/AbtestingTest.php index b58db878f2..62dfd51f57 100644 --- a/tests/output/php/src/client/AbtestingTest.php +++ b/tests/output/php/src/client/AbtestingTest.php @@ -156,6 +156,32 @@ public function test2parameters(): void } } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = AbtestingClient::createWithConfig(AbtestingConfig::create('test-app-id', 'test-api-key', 'us')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/php/src/client/AnalyticsTest.php b/tests/output/php/src/client/AnalyticsTest.php index 565652c534..48690fae3c 100644 --- a/tests/output/php/src/client/AnalyticsTest.php +++ b/tests/output/php/src/client/AnalyticsTest.php @@ -171,6 +171,32 @@ public function test3parameters(): void } } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = AnalyticsClient::createWithConfig(AnalyticsConfig::create('test-app-id', 'test-api-key', 'us')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/php/src/client/IngestionTest.php b/tests/output/php/src/client/IngestionTest.php index cd11e9cd0b..d4f1c96301 100644 --- a/tests/output/php/src/client/IngestionTest.php +++ b/tests/output/php/src/client/IngestionTest.php @@ -138,6 +138,32 @@ public function test1parameters(): void } } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = IngestionClient::createWithConfig(IngestionConfig::create('test-app-id', 'test-api-key', 'us')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/php/src/client/InsightsTest.php b/tests/output/php/src/client/InsightsTest.php index 39fb1736aa..f2fe15fa7b 100644 --- a/tests/output/php/src/client/InsightsTest.php +++ b/tests/output/php/src/client/InsightsTest.php @@ -176,6 +176,32 @@ public function test2parameters(): void } } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = InsightsClient::createWithConfig(InsightsConfig::create('test-app-id', 'test-api-key', 'us')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/php/src/client/MonitoringTest.php b/tests/output/php/src/client/MonitoringTest.php index 08ddd536bf..e8aa63fce1 100644 --- a/tests/output/php/src/client/MonitoringTest.php +++ b/tests/output/php/src/client/MonitoringTest.php @@ -121,6 +121,32 @@ public function test0parameters(): void ); } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = MonitoringClient::createWithConfig(MonitoringConfig::create('test-app-id', 'test-api-key')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/php/src/client/PersonalizationTest.php b/tests/output/php/src/client/PersonalizationTest.php index 16d73b0dbc..cadf682662 100644 --- a/tests/output/php/src/client/PersonalizationTest.php +++ b/tests/output/php/src/client/PersonalizationTest.php @@ -147,6 +147,32 @@ public function test2parameters(): void $this->assertIsObject($client); } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = PersonalizationClient::createWithConfig(PersonalizationConfig::create('test-app-id', 'test-api-key', 'us')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/php/src/client/QuerySuggestionsTest.php b/tests/output/php/src/client/QuerySuggestionsTest.php index 7207290bd4..2deba38da7 100644 --- a/tests/output/php/src/client/QuerySuggestionsTest.php +++ b/tests/output/php/src/client/QuerySuggestionsTest.php @@ -147,6 +147,32 @@ public function test2parameters(): void $this->assertIsObject($client); } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = QuerySuggestionsClient::createWithConfig(QuerySuggestionsConfig::create('test-app-id', 'test-api-key', 'us')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/php/src/client/RecommendTest.php b/tests/output/php/src/client/RecommendTest.php index 4ef4724b51..9c784887c0 100644 --- a/tests/output/php/src/client/RecommendTest.php +++ b/tests/output/php/src/client/RecommendTest.php @@ -138,6 +138,32 @@ public function test3commonApi(): void ); } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = RecommendClient::createWithConfig(RecommendConfig::create('test-app-id', 'test-api-key')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/php/src/client/SearchTest.php b/tests/output/php/src/client/SearchTest.php index 9eadd23202..9320294c56 100644 --- a/tests/output/php/src/client/SearchTest.php +++ b/tests/output/php/src/client/SearchTest.php @@ -190,6 +190,7 @@ public function test0deleteObjects(): void public function test0generateSecuredApiKey(): void { $client = $this->createClient(self::APP_ID, self::API_KEY); + $res = $client->generateSecuredApiKey( '2640659426d5107b6e47d75db9cbaef8', ['validUntil' => 2524604400, @@ -208,6 +209,7 @@ public function test0generateSecuredApiKey(): void public function test1generateSecuredApiKey(): void { $client = $this->createClient(self::APP_ID, self::API_KEY); + $res = $client->generateSecuredApiKey( '2640659426d5107b6e47d75db9cbaef8', ['validUntil' => 2524604400, @@ -523,6 +525,32 @@ public function test1saveObjects(): void } } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = SearchClient::createWithConfig(SearchConfig::create('test-app-id', 'test-api-key')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + #[TestDox('wait for api key helper - add')] public function test0waitForApiKey(): void { diff --git a/tests/output/php/src/client/UsageTest.php b/tests/output/php/src/client/UsageTest.php index d55ee26b2e..29d404c15a 100644 --- a/tests/output/php/src/client/UsageTest.php +++ b/tests/output/php/src/client/UsageTest.php @@ -175,6 +175,32 @@ public function test0parameters(): void } } + #[TestDox('switch API key')] + public function test0setClientApiKey(): void + { + $client = UsageClient::createWithConfig(UsageConfig::create('test-app-id', 'test-api-key')->setFullHosts(['http://localhost:6683'])); + + $res = $client->customGet( + 'check-api-key/1', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"test-api-key"}', + json_encode($res) + ); + + $client->setClientApiKey( + 'updated-api-key', + ); + + $res = $client->customGet( + 'check-api-key/2', + ); + $this->assertEquals( + '{"headerAPIKeyValue":"updated-api-key"}', + json_encode($res) + ); + } + /** * @param mixed $appId * @param mixed $apiKey diff --git a/tests/output/python/tests/client/abtesting_test.py b/tests/output/python/tests/client/abtesting_test.py index 487f28136c..1cd45cb828 100644 --- a/tests/output/python/tests/client/abtesting_test.py +++ b/tests/output/python/tests/client/abtesting_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.abtesting.client import AbtestingClient from algoliasearch.abtesting.config import AbtestingConfig @@ -106,3 +108,37 @@ async def test_parameters_2(self): assert False except (ValueError, Exception) as e: assert str(e) == "`region` must be one of the following: de, us" + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = AbtestingConfig("test-app-id", "test-api-key", "us") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = AbtestingClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/python/tests/client/analytics_test.py b/tests/output/python/tests/client/analytics_test.py index e8ac6e38c9..4bdbeebfd4 100644 --- a/tests/output/python/tests/client/analytics_test.py +++ b/tests/output/python/tests/client/analytics_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.analytics.client import AnalyticsClient from algoliasearch.analytics.config import AnalyticsConfig @@ -123,3 +125,37 @@ async def test_parameters_3(self): str(e) == "Parameter `index` is required when calling `get_click_positions`." ) + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = AnalyticsConfig("test-app-id", "test-api-key", "us") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = AnalyticsClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/python/tests/client/ingestion_test.py b/tests/output/python/tests/client/ingestion_test.py index 0c567a0546..93123f0d12 100644 --- a/tests/output/python/tests/client/ingestion_test.py +++ b/tests/output/python/tests/client/ingestion_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.ingestion.client import IngestionClient from algoliasearch.ingestion.config import IngestionConfig @@ -95,3 +97,37 @@ async def test_parameters_1(self): str(e) == "`region` is required and must be one of the following: eu, us" ) + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = IngestionConfig("test-app-id", "test-api-key", "us") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = IngestionClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/python/tests/client/insights_test.py b/tests/output/python/tests/client/insights_test.py index 183e5351a8..a634f5aa83 100644 --- a/tests/output/python/tests/client/insights_test.py +++ b/tests/output/python/tests/client/insights_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.insights.client import InsightsClient from algoliasearch.insights.config import InsightsConfig @@ -126,3 +128,37 @@ async def test_parameters_2(self): assert False except (ValueError, Exception) as e: assert str(e) == "`region` must be one of the following: de, us" + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = InsightsConfig("test-app-id", "test-api-key", "us") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = InsightsClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/python/tests/client/monitoring_test.py b/tests/output/python/tests/client/monitoring_test.py index 4581c52356..6ff2521d6a 100644 --- a/tests/output/python/tests/client/monitoring_test.py +++ b/tests/output/python/tests/client/monitoring_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.monitoring.client import MonitoringClient from algoliasearch.monitoring.config import MonitoringConfig @@ -78,3 +80,37 @@ async def test_parameters_0(self): path="test", ) assert _req.host == "status.algolia.com" + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = MonitoringConfig("test-app-id", "test-api-key") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = MonitoringClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/python/tests/client/personalization_test.py b/tests/output/python/tests/client/personalization_test.py index fef00fc23f..d0710efb5d 100644 --- a/tests/output/python/tests/client/personalization_test.py +++ b/tests/output/python/tests/client/personalization_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.personalization.client import PersonalizationClient from algoliasearch.personalization.config import PersonalizationConfig @@ -108,3 +110,37 @@ async def test_parameters_2(self): self._client = PersonalizationClient.create_with_config( config=_config, transporter=EchoTransporter(_config) ) + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = PersonalizationConfig("test-app-id", "test-api-key", "us") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = PersonalizationClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/python/tests/client/query_suggestions_test.py b/tests/output/python/tests/client/query_suggestions_test.py index 8cac72808c..546f5225f9 100644 --- a/tests/output/python/tests/client/query_suggestions_test.py +++ b/tests/output/python/tests/client/query_suggestions_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.query_suggestions.client import QuerySuggestionsClient from algoliasearch.query_suggestions.config import QuerySuggestionsConfig @@ -108,3 +110,37 @@ async def test_parameters_2(self): self._client = QuerySuggestionsClient.create_with_config( config=_config, transporter=EchoTransporter(_config) ) + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = QuerySuggestionsConfig("test-app-id", "test-api-key", "us") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = QuerySuggestionsClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/python/tests/client/recommend_test.py b/tests/output/python/tests/client/recommend_test.py index 7809205170..dca7fc48d9 100644 --- a/tests/output/python/tests/client/recommend_test.py +++ b/tests/output/python/tests/client/recommend_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.recommend.client import RecommendClient from algoliasearch.recommend.config import RecommendConfig @@ -92,3 +94,37 @@ async def test_common_api_3(self): ) assert _req.timeouts.get("connect") == 2000 assert _req.timeouts.get("response") == 30000 + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = RecommendConfig("test-app-id", "test-api-key") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = RecommendClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/python/tests/client/search_test.py b/tests/output/python/tests/client/search_test.py index 812001f337..3c3997d7d0 100644 --- a/tests/output/python/tests/client/search_test.py +++ b/tests/output/python/tests/client/search_test.py @@ -544,6 +544,40 @@ async def test_save_objects_1(self): except (ValueError, Exception) as e: assert str(e) == "Invalid Application-ID or API key" + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = SearchConfig("test-app-id", "test-api-key") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = SearchClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") + async def test_wait_for_api_key_0(self): """ wait for api key helper - add diff --git a/tests/output/python/tests/client/usage_test.py b/tests/output/python/tests/client/usage_test.py index 1dca7771e8..50a101de33 100644 --- a/tests/output/python/tests/client/usage_test.py +++ b/tests/output/python/tests/client/usage_test.py @@ -1,7 +1,9 @@ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. from re import compile +from json import loads from algoliasearch.http.transporter import EchoTransporter +from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.usage.client import UsageClient from algoliasearch.usage.config import UsageConfig @@ -122,3 +124,37 @@ async def test_parameters_0(self): assert False except (ValueError, Exception) as e: assert str(e) == "`api_key` is missing." + + async def test_set_client_api_key_0(self): + """ + switch API key + """ + + _config = UsageConfig("test-app-id", "test-api-key") + _config.hosts = HostsCollection( + [Host(url="localhost", scheme="http", port=6683)] + ) + self._client = UsageClient.create_with_config(config=_config) + _req = await self._client.custom_get( + path="check-api-key/1", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"test-api-key"}""") + self._client.set_client_api_key( + api_key="updated-api-key", + ) + _req = await self._client.custom_get( + path="check-api-key/2", + ) + assert ( + _req + if isinstance(_req, dict) + else [elem.to_dict() for elem in _req] + if isinstance(_req, list) + else _req.to_dict() + ) == loads("""{"headerAPIKeyValue":"updated-api-key"}""") diff --git a/tests/output/ruby/test/client/abtesting_test.rb b/tests/output/ruby/test/client/abtesting_test.rb index 55f97dc42c..5c099c8776 100644 --- a/tests/output/ruby/test/client/abtesting_test.rb +++ b/tests/output/ruby/test/client/abtesting_test.rb @@ -100,4 +100,28 @@ def test_parameters2 end end + # switch API key + def test_set_client_api_key0 + client = Algolia::AbtestingClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "abtestingClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/ruby/test/client/analytics_test.rb b/tests/output/ruby/test/client/analytics_test.rb index e13f98e5c1..962383a7d1 100644 --- a/tests/output/ruby/test/client/analytics_test.rb +++ b/tests/output/ruby/test/client/analytics_test.rb @@ -116,4 +116,28 @@ def test_parameters3 end end + # switch API key + def test_set_client_api_key0 + client = Algolia::AnalyticsClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "analyticsClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/ruby/test/client/ingestion_test.rb b/tests/output/ruby/test/client/ingestion_test.rb index a494c3b25c..0e5d2ab7a5 100644 --- a/tests/output/ruby/test/client/ingestion_test.rb +++ b/tests/output/ruby/test/client/ingestion_test.rb @@ -87,4 +87,28 @@ def test_parameters1 end end + # switch API key + def test_set_client_api_key0 + client = Algolia::IngestionClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "ingestionClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/ruby/test/client/insights_test.rb b/tests/output/ruby/test/client/insights_test.rb index 3e61cf8807..506c1e889a 100644 --- a/tests/output/ruby/test/client/insights_test.rb +++ b/tests/output/ruby/test/client/insights_test.rb @@ -116,4 +116,28 @@ def test_parameters2 end end + # switch API key + def test_set_client_api_key0 + client = Algolia::InsightsClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "insightsClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/ruby/test/client/monitoring_test.rb b/tests/output/ruby/test/client/monitoring_test.rb index acad3346e5..c450cc1426 100644 --- a/tests/output/ruby/test/client/monitoring_test.rb +++ b/tests/output/ruby/test/client/monitoring_test.rb @@ -71,4 +71,28 @@ def test_parameters0 assert_equal("status.algolia.com", req.host.url) end + # switch API key + def test_set_client_api_key0 + client = Algolia::MonitoringClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "monitoringClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/ruby/test/client/personalization_test.rb b/tests/output/ruby/test/client/personalization_test.rb index cfad615b47..0d8164fcb6 100644 --- a/tests/output/ruby/test/client/personalization_test.rb +++ b/tests/output/ruby/test/client/personalization_test.rb @@ -101,4 +101,28 @@ def test_parameters2 ) end + # switch API key + def test_set_client_api_key0 + client = Algolia::PersonalizationClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "personalizationClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/ruby/test/client/query_suggestions_test.rb b/tests/output/ruby/test/client/query_suggestions_test.rb index 85f3bd4036..ce20535add 100644 --- a/tests/output/ruby/test/client/query_suggestions_test.rb +++ b/tests/output/ruby/test/client/query_suggestions_test.rb @@ -101,4 +101,28 @@ def test_parameters2 ) end + # switch API key + def test_set_client_api_key0 + client = Algolia::QuerySuggestionsClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "query_suggestionsClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/ruby/test/client/recommend_test.rb b/tests/output/ruby/test/client/recommend_test.rb index 568196a062..6186f4f9d4 100644 --- a/tests/output/ruby/test/client/recommend_test.rb +++ b/tests/output/ruby/test/client/recommend_test.rb @@ -84,4 +84,28 @@ def test_common_api3 assert_equal(30000, req.timeout) end + # switch API key + def test_set_client_api_key0 + client = Algolia::RecommendClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "recommendClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/ruby/test/client/search_test.rb b/tests/output/ruby/test/client/search_test.rb index c98b0e770b..688d1072fe 100644 --- a/tests/output/ruby/test/client/search_test.rb +++ b/tests/output/ruby/test/client/search_test.rb @@ -546,6 +546,30 @@ def test_save_objects1 end end + # switch API key + def test_set_client_api_key0 + client = Algolia::SearchClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "searchClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + # wait for api key helper - add def test_wait_for_api_key0 client = Algolia::SearchClient.create_with_config( diff --git a/tests/output/ruby/test/client/usage_test.rb b/tests/output/ruby/test/client/usage_test.rb index ea1be0c1c4..5a53834a27 100644 --- a/tests/output/ruby/test/client/usage_test.rb +++ b/tests/output/ruby/test/client/usage_test.rb @@ -126,4 +126,28 @@ def test_parameters0 end end + # switch API key + def test_set_client_api_key0 + client = Algolia::UsageClient.create_with_config( + Algolia::Configuration.new( + "test-app-id", + "test-api-key", + [ + Algolia::Transport::StatefulHost.new( + "localhost", + protocol: "http://", + port: 6683, + accept: CallType::READ | CallType::WRITE + ) + ], + "usageClient" + ) + ) + req = client.custom_get("check-api-key/1") + assert_equal({:"headerAPIKeyValue" => "test-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + client.set_client_api_key("updated-api-key") + req = client.custom_get("check-api-key/2") + assert_equal({:"headerAPIKeyValue" => "updated-api-key"}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash) + end + end diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/AbtestingTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/AbtestingTest.scala index 86ef80b0a7..f3e0a9d87c 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/AbtestingTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/AbtestingTest.scala @@ -126,4 +126,44 @@ class AbtestingTest extends AnyFunSuite { val (client, echo) = testClient(appId = "my-app-id", apiKey = "my-api-key", region = "not_a_region") } } + + test("switch API key") { + + val client = AbtestingClient( + appId = "test-app-id", + apiKey = "test-api-key", + region = Option("us"), + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/AnalyticsTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/AnalyticsTest.scala index fca0f1c3cb..133b0d4df8 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/AnalyticsTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/AnalyticsTest.scala @@ -139,4 +139,44 @@ class AnalyticsTest extends AnyFunSuite { ) } } + + test("switch API key") { + + val client = AnalyticsClient( + appId = "test-app-id", + apiKey = "test-api-key", + region = Option("us"), + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/IngestionTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/IngestionTest.scala index e421d254d0..d3837fdbe6 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/IngestionTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/IngestionTest.scala @@ -113,4 +113,44 @@ class IngestionTest extends AnyFunSuite { val (client, echo) = testClient(appId = "my-app-id", apiKey = "my-api-key", region = "not_a_region") } } + + test("switch API key") { + + val client = IngestionClient( + appId = "test-app-id", + apiKey = "test-api-key", + region = "us", + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/InsightsTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/InsightsTest.scala index 2493c7f24b..a8e17670c3 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/InsightsTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/InsightsTest.scala @@ -140,4 +140,44 @@ class InsightsTest extends AnyFunSuite { val (client, echo) = testClient(appId = "my-app-id", apiKey = "my-api-key", region = "not_a_region") } } + + test("switch API key") { + + val client = InsightsClient( + appId = "test-app-id", + apiKey = "test-api-key", + region = Option("us"), + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/MonitoringTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/MonitoringTest.scala index e649235e02..49d7744c06 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/MonitoringTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/MonitoringTest.scala @@ -101,4 +101,43 @@ class MonitoringTest extends AnyFunSuite { ) assert(echo.lastResponse.get.host == "status.algolia.com") } + + test("switch API key") { + + val client = MonitoringClient( + appId = "test-app-id", + apiKey = "test-api-key", + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/PersonalizationTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/PersonalizationTest.scala index 6175efa04f..015ff1f7ce 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/PersonalizationTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/PersonalizationTest.scala @@ -112,4 +112,44 @@ class PersonalizationTest extends AnyFunSuite { val (client, echo) = testClient(appId = "my-app-id", apiKey = "my-api-key", region = "us") } + + test("switch API key") { + + val client = PersonalizationClient( + appId = "test-app-id", + apiKey = "test-api-key", + region = "us", + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/QuerySuggestionsTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/QuerySuggestionsTest.scala index f57c777cd8..46f48b1099 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/QuerySuggestionsTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/QuerySuggestionsTest.scala @@ -112,4 +112,44 @@ class QuerySuggestionsTest extends AnyFunSuite { val (client, echo) = testClient(appId = "my-app-id", apiKey = "my-api-key", region = "us") } + + test("switch API key") { + + val client = QuerySuggestionsClient( + appId = "test-app-id", + apiKey = "test-api-key", + region = "us", + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/RecommendTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/RecommendTest.scala index aa76e9bb3f..5bf2d328c0 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/RecommendTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/RecommendTest.scala @@ -114,4 +114,43 @@ class RecommendTest extends AnyFunSuite { assert(echo.lastResponse.get.connectTimeout == 2000) assert(echo.lastResponse.get.responseTimeout == 30000) } + + test("switch API key") { + + val client = RecommendClient( + appId = "test-app-id", + apiKey = "test-api-key", + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/SearchTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/SearchTest.scala index 566afc205c..f7323042c4 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/SearchTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/SearchTest.scala @@ -253,4 +253,43 @@ class SearchTest extends AnyFunSuite { ) } } + + test("switch API key") { + + val client = SearchClient( + appId = "test-app-id", + apiKey = "test-api-key", + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/scala/src/test/scala/algoliasearch/client/UsageTest.scala b/tests/output/scala/src/test/scala/algoliasearch/client/UsageTest.scala index f6a9aa0e49..8abc866ea6 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/client/UsageTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/client/UsageTest.scala @@ -129,4 +129,43 @@ class UsageTest extends AnyFunSuite { val (client, echo) = testClient(appId = "my-app-id", apiKey = "") } } + + test("switch API key") { + + val client = UsageClient( + appId = "test-app-id", + apiKey = "test-api-key", + clientOptions = ClientOptions + .builder() + .withHosts(List(Host("localhost", Set(CallType.Read, CallType.Write), "http", Option(6683)))) + .build() + ) + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/1" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"test-api-key\"}") + } + + { + + client.setClientApiKey( + apiKey = "updated-api-key" + ) + } + + { + var res = Await.result( + client.customGet[JObject]( + path = "check-api-key/2" + ), + Duration.Inf + ) + assert(write(res) == "{\"headerAPIKeyValue\":\"updated-api-key\"}") + } + } } diff --git a/tests/output/swift/Tests/client/AbtestingTests.swift b/tests/output/swift/Tests/client/AbtestingTests.swift index a4b9dee019..32ee9ba004 100644 --- a/tests/output/swift/Tests/client/AbtestingTests.swift +++ b/tests/output/swift/Tests/client/AbtestingTests.swift @@ -130,4 +130,37 @@ final class AbtestingClientClientTests: XCTestCase { XCTAssertEqual(error.localizedDescription, "`region` must be one of the following: de, us") } } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try AbtestingClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + region: Region(rawValue: "us"), + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = AbtestingClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } } diff --git a/tests/output/swift/Tests/client/AnalyticsTests.swift b/tests/output/swift/Tests/client/AnalyticsTests.swift index 920d82cdc6..6e27f6af5d 100644 --- a/tests/output/swift/Tests/client/AnalyticsTests.swift +++ b/tests/output/swift/Tests/client/AnalyticsTests.swift @@ -137,4 +137,37 @@ final class AnalyticsClientClientTests: XCTestCase { let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AnalyticsClient(configuration: configuration, transporter: transporter) } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try AnalyticsClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + region: Region(rawValue: "us"), + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = AnalyticsClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } } diff --git a/tests/output/swift/Tests/client/IngestionTests.swift b/tests/output/swift/Tests/client/IngestionTests.swift index d464bccbb2..673239d68f 100644 --- a/tests/output/swift/Tests/client/IngestionTests.swift +++ b/tests/output/swift/Tests/client/IngestionTests.swift @@ -118,4 +118,37 @@ final class IngestionClientClientTests: XCTestCase { XCTAssertEqual(error.localizedDescription, "`region` is required and must be one of the following: eu, us") } } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try IngestionClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + region: Region(rawValue: "us"), + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = IngestionClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } } diff --git a/tests/output/swift/Tests/client/InsightsTests.swift b/tests/output/swift/Tests/client/InsightsTests.swift index 09fae77d58..fdf63207a7 100644 --- a/tests/output/swift/Tests/client/InsightsTests.swift +++ b/tests/output/swift/Tests/client/InsightsTests.swift @@ -144,4 +144,37 @@ final class InsightsClientClientTests: XCTestCase { XCTAssertEqual(error.localizedDescription, "`region` must be one of the following: de, us") } } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try InsightsClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + region: Region(rawValue: "us"), + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = InsightsClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } } diff --git a/tests/output/swift/Tests/client/MonitoringTests.swift b/tests/output/swift/Tests/client/MonitoringTests.swift index 2be855aaba..0edca42798 100644 --- a/tests/output/swift/Tests/client/MonitoringTests.swift +++ b/tests/output/swift/Tests/client/MonitoringTests.swift @@ -97,4 +97,36 @@ final class MonitoringClientClientTests: XCTestCase { XCTAssertEqual("status.algolia.com", echoResponse.host) } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try MonitoringClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = MonitoringClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } } diff --git a/tests/output/swift/Tests/client/PersonalizationTests.swift b/tests/output/swift/Tests/client/PersonalizationTests.swift index 702dcc5832..b59783f3b5 100644 --- a/tests/output/swift/Tests/client/PersonalizationTests.swift +++ b/tests/output/swift/Tests/client/PersonalizationTests.swift @@ -146,4 +146,37 @@ final class PersonalizationClientClientTests: XCTestCase { let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = PersonalizationClient(configuration: configuration, transporter: transporter) } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try PersonalizationClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + region: Region(rawValue: "us"), + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = PersonalizationClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } } diff --git a/tests/output/swift/Tests/client/QuerySuggestionsTests.swift b/tests/output/swift/Tests/client/QuerySuggestionsTests.swift index 419b69626a..648c75f300 100644 --- a/tests/output/swift/Tests/client/QuerySuggestionsTests.swift +++ b/tests/output/swift/Tests/client/QuerySuggestionsTests.swift @@ -146,4 +146,37 @@ final class QuerySuggestionsClientClientTests: XCTestCase { let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = QuerySuggestionsClient(configuration: configuration, transporter: transporter) } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try QuerySuggestionsClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + region: Region(rawValue: "us"), + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = QuerySuggestionsClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } } diff --git a/tests/output/swift/Tests/client/RecommendTests.swift b/tests/output/swift/Tests/client/RecommendTests.swift index 8253811f0c..7e8f568cd1 100644 --- a/tests/output/swift/Tests/client/RecommendTests.swift +++ b/tests/output/swift/Tests/client/RecommendTests.swift @@ -109,4 +109,36 @@ final class RecommendClientClientTests: XCTestCase { XCTAssertEqual(TimeInterval(30000 / 1000), echoResponse.timeout) } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try RecommendClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = RecommendClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } } diff --git a/tests/output/swift/Tests/client/SearchTests.swift b/tests/output/swift/Tests/client/SearchTests.swift index 7cfb90b899..4ad73240c3 100644 --- a/tests/output/swift/Tests/client/SearchTests.swift +++ b/tests/output/swift/Tests/client/SearchTests.swift @@ -189,10 +189,15 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.deleteObjects(indexName: "cts_e2e_deleteObjects_swift", objectIDs: ["1", "2"]) + do { + let response = try await client.deleteObjects( + indexName: "cts_e2e_deleteObjects_swift", + objectIDs: ["1", "2"] + ) - let comparableData = try XCTUnwrap("[{\"taskID\":666,\"objectIDs\":[\"1\",\"2\"]}]".data(using: .utf8)) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + let comparableData = try XCTUnwrap("[{\"taskID\":666,\"objectIDs\":[\"1\",\"2\"]}]".data(using: .utf8)) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } /// generate secured api key basic @@ -201,15 +206,17 @@ final class SearchClientClientTests: XCTestCase { let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try client.generateSecuredApiKey( - parentApiKey: "2640659426d5107b6e47d75db9cbaef8", - restrictions: SecuredApiKeyRestrictions(validUntil: Int64(2_524_604_400), restrictIndices: ["Movies"]) - ) + do { + let response = try client.generateSecuredApiKey( + parentApiKey: "2640659426d5107b6e47d75db9cbaef8", + restrictions: SecuredApiKeyRestrictions(validUntil: Int64(2_524_604_400), restrictIndices: ["Movies"]) + ) - XCTAssertEqual( - "NjFhZmE0OGEyMTI3OThiODc0OTlkOGM0YjcxYzljY2M2NmU2NDE5ZWY0NDZjMWJhNjA2NzBkMjAwOTI2YWQyZnJlc3RyaWN0SW5kaWNlcz1Nb3ZpZXMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", - response - ) + XCTAssertEqual( + "NjFhZmE0OGEyMTI3OThiODc0OTlkOGM0YjcxYzljY2M2NmU2NDE5ZWY0NDZjMWJhNjA2NzBkMjAwOTI2YWQyZnJlc3RyaWN0SW5kaWNlcz1Nb3ZpZXMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", + response + ) + } } /// generate secured api key with searchParams @@ -218,29 +225,31 @@ final class SearchClientClientTests: XCTestCase { let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try client.generateSecuredApiKey( - parentApiKey: "2640659426d5107b6e47d75db9cbaef8", - restrictions: SecuredApiKeyRestrictions( - searchParams: SearchSearchParamsObject( - query: "batman", - aroundRadius: SearchAroundRadius.searchAroundRadiusAll(SearchAroundRadiusAll.all), - hitsPerPage: 10, - typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum(SearchTypoToleranceEnum.strict), - mode: SearchMode.neuralSearch, - optionalWords: ["one", "two"] - ), - filters: "category:Book OR category:Ebook AND _tags:published", - validUntil: Int64(2_524_604_400), - restrictIndices: ["Movies", "cts_e2e_settings"], - restrictSources: "192.168.1.0/24", - userToken: "user123" + do { + let response = try client.generateSecuredApiKey( + parentApiKey: "2640659426d5107b6e47d75db9cbaef8", + restrictions: SecuredApiKeyRestrictions( + searchParams: SearchSearchParamsObject( + query: "batman", + aroundRadius: SearchAroundRadius.searchAroundRadiusAll(SearchAroundRadiusAll.all), + hitsPerPage: 10, + typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum(SearchTypoToleranceEnum.strict), + mode: SearchMode.neuralSearch, + optionalWords: ["one", "two"] + ), + filters: "category:Book OR category:Ebook AND _tags:published", + validUntil: Int64(2_524_604_400), + restrictIndices: ["Movies", "cts_e2e_settings"], + restrictSources: "192.168.1.0/24", + userToken: "user123" + ) ) - ) - XCTAssertEqual( - "MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", - response - ) + XCTAssertEqual( + "MzAxMDUwYjYyODMxODQ3ZWM1ZDYzNTkxZmNjNDg2OGZjMjAzYjQyOTZhMGQ1NDJhMDFiNGMzYTYzODRhNmMxZWFyb3VuZFJhZGl1cz1hbGwmZmlsdGVycz1jYXRlZ29yeSUzQUJvb2slMjBPUiUyMGNhdGVnb3J5JTNBRWJvb2slMjBBTkQlMjBfdGFncyUzQXB1Ymxpc2hlZCZoaXRzUGVyUGFnZT0xMCZtb2RlPW5ldXJhbFNlYXJjaCZvcHRpb25hbFdvcmRzPW9uZSUyQ3R3byZxdWVyeT1iYXRtYW4mcmVzdHJpY3RJbmRpY2VzPU1vdmllcyUyQ2N0c19lMmVfc2V0dGluZ3MmcmVzdHJpY3RTb3VyY2VzPTE5Mi4xNjguMS4wJTJGMjQmdHlwb1RvbGVyYW5jZT1zdHJpY3QmdXNlclRva2VuPXVzZXIxMjMmdmFsaWRVbnRpbD0yNTI0NjA0NDAw", + response + ) + } } /// indexExists @@ -252,9 +261,11 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.indexExists(indexName: "indexExistsYES") + do { + let response = try await client.indexExists(indexName: "indexExistsYES") - XCTAssertEqual(true, response) + XCTAssertEqual(true, response) + } } /// indexNotExists @@ -266,9 +277,11 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.indexExists(indexName: "indexExistsNO") + do { + let response = try await client.indexExists(indexName: "indexExistsNO") - XCTAssertEqual(false, response) + XCTAssertEqual(false, response) + } } /// indexExistsWithError @@ -343,14 +356,16 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.partialUpdateObjects( - indexName: "cts_e2e_partialUpdateObjects_swift", - objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]], - createIfNotExists: true - ) + do { + let response = try await client.partialUpdateObjects( + indexName: "cts_e2e_partialUpdateObjects_swift", + objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]], + createIfNotExists: true + ) - let comparableData = try XCTUnwrap("[{\"taskID\":444,\"objectIDs\":[\"1\",\"2\"]}]".data(using: .utf8)) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + let comparableData = try XCTUnwrap("[{\"taskID\":444,\"objectIDs\":[\"1\",\"2\"]}]".data(using: .utf8)) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } /// call partialUpdateObjects with createIfNotExists=false @@ -362,14 +377,16 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.partialUpdateObjects( - indexName: "cts_e2e_partialUpdateObjects_swift", - objects: [["objectID": "3", "name": "Cyril"], ["objectID": "4", "name": "David"]], - createIfNotExists: false - ) + do { + let response = try await client.partialUpdateObjects( + indexName: "cts_e2e_partialUpdateObjects_swift", + objects: [["objectID": "3", "name": "Cyril"], ["objectID": "4", "name": "David"]], + createIfNotExists: false + ) - let comparableData = try XCTUnwrap("[{\"taskID\":555,\"objectIDs\":[\"3\",\"4\"]}]".data(using: .utf8)) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + let comparableData = try XCTUnwrap("[{\"taskID\":555,\"objectIDs\":[\"3\",\"4\"]}]".data(using: .utf8)) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } /// call replaceAllObjects without error @@ -381,29 +398,31 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.replaceAllObjects( - indexName: "cts_e2e_replace_all_objects_swift", - objects: [ - ["objectID": "1", "name": "Adam"], - ["objectID": "2", "name": "Benoit"], - ["objectID": "3", "name": "Cyril"], - ["objectID": "4", "name": "David"], - ["objectID": "5", "name": "Eva"], - ["objectID": "6", "name": "Fiona"], - ["objectID": "7", "name": "Gael"], - ["objectID": "8", "name": "Hugo"], - ["objectID": "9", "name": "Igor"], - ["objectID": "10", "name": "Julia"], - ], - batchSize: 3 - ) - - let comparableData = - try XCTUnwrap( - "{\"copyOperationResponse\":{\"taskID\":125,\"updatedAt\":\"2021-01-01T00:00:00.000Z\"},\"batchResponses\":[{\"taskID\":127,\"objectIDs\":[\"1\",\"2\",\"3\"]},{\"taskID\":130,\"objectIDs\":[\"4\",\"5\",\"6\"]},{\"taskID\":133,\"objectIDs\":[\"7\",\"8\",\"9\"]},{\"taskID\":134,\"objectIDs\":[\"10\"]}],\"moveOperationResponse\":{\"taskID\":777,\"updatedAt\":\"2021-01-01T00:00:00.000Z\"}}" - .data(using: .utf8) + do { + let response = try await client.replaceAllObjects( + indexName: "cts_e2e_replace_all_objects_swift", + objects: [ + ["objectID": "1", "name": "Adam"], + ["objectID": "2", "name": "Benoit"], + ["objectID": "3", "name": "Cyril"], + ["objectID": "4", "name": "David"], + ["objectID": "5", "name": "Eva"], + ["objectID": "6", "name": "Fiona"], + ["objectID": "7", "name": "Gael"], + ["objectID": "8", "name": "Hugo"], + ["objectID": "9", "name": "Igor"], + ["objectID": "10", "name": "Julia"], + ], + batchSize: 3 ) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + + let comparableData = + try XCTUnwrap( + "{\"copyOperationResponse\":{\"taskID\":125,\"updatedAt\":\"2021-01-01T00:00:00.000Z\"},\"batchResponses\":[{\"taskID\":127,\"objectIDs\":[\"1\",\"2\",\"3\"]},{\"taskID\":130,\"objectIDs\":[\"4\",\"5\",\"6\"]},{\"taskID\":133,\"objectIDs\":[\"7\",\"8\",\"9\"]},{\"taskID\":134,\"objectIDs\":[\"10\"]}],\"moveOperationResponse\":{\"taskID\":777,\"updatedAt\":\"2021-01-01T00:00:00.000Z\"}}" + .data(using: .utf8) + ) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } /// call saveObjects without error @@ -415,13 +434,15 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.saveObjects( - indexName: "cts_e2e_saveObjects_swift", - objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]] - ) + do { + let response = try await client.saveObjects( + indexName: "cts_e2e_saveObjects_swift", + objects: [["objectID": "1", "name": "Adam"], ["objectID": "2", "name": "Benoit"]] + ) - let comparableData = try XCTUnwrap("[{\"taskID\":333,\"objectIDs\":[\"1\",\"2\"]}]".data(using: .utf8)) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + let comparableData = try XCTUnwrap("[{\"taskID\":333,\"objectIDs\":[\"1\",\"2\"]}]".data(using: .utf8)) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } /// saveObjects should report errors @@ -448,6 +469,38 @@ final class SearchClientClientTests: XCTestCase { } } + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try SearchClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = SearchClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } + /// wait for api key helper - add func testWaitForApiKeyTest0() async throws { let configuration = try SearchClientConfiguration( @@ -457,17 +510,19 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.waitForApiKey( - key: "api-key-add-operation-test-swift", - operation: ApiKeyOperation.add - ) - - let comparableData = - try XCTUnwrap( - "{\"value\":\"api-key-add-operation-test-swift\",\"description\":\"my new api key\",\"acl\":[\"search\",\"addObject\"],\"validity\":300,\"maxQueriesPerIPPerHour\":100,\"maxHitsPerQuery\":20,\"createdAt\":1720094400}" - .data(using: .utf8) + do { + let response = try await client.waitForApiKey( + key: "api-key-add-operation-test-swift", + operation: ApiKeyOperation.add ) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + + let comparableData = + try XCTUnwrap( + "{\"value\":\"api-key-add-operation-test-swift\",\"description\":\"my new api key\",\"acl\":[\"search\",\"addObject\"],\"validity\":300,\"maxQueriesPerIPPerHour\":100,\"maxHitsPerQuery\":20,\"createdAt\":1720094400}" + .data(using: .utf8) + ) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } /// wait for api key - update @@ -479,26 +534,28 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.waitForApiKey( - key: "api-key-update-operation-test-swift", - operation: ApiKeyOperation.update, - apiKey: ApiKey( - acl: [Acl.search, Acl.addObject, Acl.deleteObject], - description: "my updated api key", - indexes: ["Movies", "Books"], - maxHitsPerQuery: 20, - maxQueriesPerIPPerHour: 95, - referers: ["*google.com", "*algolia.com"], - validity: 305 + do { + let response = try await client.waitForApiKey( + key: "api-key-update-operation-test-swift", + operation: ApiKeyOperation.update, + apiKey: ApiKey( + acl: [Acl.search, Acl.addObject, Acl.deleteObject], + description: "my updated api key", + indexes: ["Movies", "Books"], + maxHitsPerQuery: 20, + maxQueriesPerIPPerHour: 95, + referers: ["*google.com", "*algolia.com"], + validity: 305 + ) ) - ) - let comparableData = - try XCTUnwrap( - "{\"value\":\"api-key-update-operation-test-swift\",\"description\":\"my updated api key\",\"acl\":[\"search\",\"addObject\",\"deleteObject\"],\"indexes\":[\"Movies\",\"Books\"],\"referers\":[\"*google.com\",\"*algolia.com\"],\"validity\":305,\"maxQueriesPerIPPerHour\":95,\"maxHitsPerQuery\":20,\"createdAt\":1720094400}" - .data(using: .utf8) - ) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + let comparableData = + try XCTUnwrap( + "{\"value\":\"api-key-update-operation-test-swift\",\"description\":\"my updated api key\",\"acl\":[\"search\",\"addObject\",\"deleteObject\"],\"indexes\":[\"Movies\",\"Books\"],\"referers\":[\"*google.com\",\"*algolia.com\"],\"validity\":305,\"maxQueriesPerIPPerHour\":95,\"maxHitsPerQuery\":20,\"createdAt\":1720094400}" + .data(using: .utf8) + ) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } /// wait for api key - delete @@ -510,12 +567,14 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.waitForApiKey( - key: "api-key-delete-operation-test-swift", - operation: ApiKeyOperation.delete - ) + do { + let response = try await client.waitForApiKey( + key: "api-key-delete-operation-test-swift", + operation: ApiKeyOperation.delete + ) - XCTAssertNil(response) + XCTAssertNil(response) + } } /// wait for an application-level task @@ -527,10 +586,12 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.waitForAppTask(taskID: Int64(123)) + do { + let response = try await client.waitForAppTask(taskID: Int64(123)) - let comparableData = try XCTUnwrap("{\"status\":\"published\"}".data(using: .utf8)) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + let comparableData = try XCTUnwrap("{\"status\":\"published\"}".data(using: .utf8)) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } /// wait for task @@ -542,9 +603,11 @@ final class SearchClientClientTests: XCTestCase { ) let transporter = Transporter(configuration: configuration) let client = SearchClient(configuration: configuration, transporter: transporter) - let response = try await client.waitForTask(indexName: "wait-task-swift", taskID: Int64(123)) + do { + let response = try await client.waitForTask(indexName: "wait-task-swift", taskID: Int64(123)) - let comparableData = try XCTUnwrap("{\"status\":\"published\"}".data(using: .utf8)) - try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + let comparableData = try XCTUnwrap("{\"status\":\"published\"}".data(using: .utf8)) + try XCTLenientAssertEqual(received: CodableHelper.jsonEncoder.encode(response), expected: comparableData) + } } } diff --git a/tests/output/swift/Tests/client/UsageTests.swift b/tests/output/swift/Tests/client/UsageTests.swift index d5f562102f..908d07023d 100644 --- a/tests/output/swift/Tests/client/UsageTests.swift +++ b/tests/output/swift/Tests/client/UsageTests.swift @@ -140,4 +140,36 @@ final class UsageClientClientTests: XCTestCase { XCTAssertEqual(error.localizedDescription, "`apiKey` is missing.") } } + + /// switch API key + func testSetClientApiKeyTest0() async throws { + let configuration = try UsageClientConfiguration( + appID: "test-app-id", + apiKey: "test-api-key", + hosts: [RetryableHost(url: URL(string: "http://localhost:6683")!)] + ) + let transporter = Transporter(configuration: configuration) + let client = UsageClient(configuration: configuration, transporter: transporter) + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/1") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"test-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + do { + try client.setClientApiKey(apiKey: "updated-api-key") + } + do { + let response = try await client.customGetWithHTTPInfo(path: "check-api-key/2") + let responseBodyData = try XCTUnwrap(response.bodyData) + let responseBodyJSON = try XCTUnwrap(responseBodyData.jsonString) + + let comparableData = "{\"headerAPIKeyValue\":\"updated-api-key\"}".data(using: .utf8) + let comparableJSON = try XCTUnwrap(comparableData?.jsonString) + XCTAssertEqual(comparableJSON, responseBodyJSON) + } + } }