diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/package.json b/clients/algoliasearch-client-javascript/packages/algoliasearch/package.json index 9f70340e83..ae500405df 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/package.json +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/package.json @@ -72,7 +72,7 @@ "@babel/preset-env": "7.24.5", "@babel/preset-typescript": "7.24.1", "@types/jest": "29.5.12", - "@types/node": "20.12.11", + "@types/node": "20.12.12", "jest": "29.7.0", "rollup": "4.17.2", "typescript": "5.4.5" diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/package.json b/clients/algoliasearch-client-javascript/packages/client-abtesting/package.json index 364468ff95..8f5451e181 100644 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/package.json +++ b/clients/algoliasearch-client-javascript/packages/client-abtesting/package.json @@ -44,7 +44,7 @@ "@algolia/requester-node-http": "5.0.0-beta.2" }, "devDependencies": { - "@types/node": "20.12.11", + "@types/node": "20.12.12", "rollup": "4.17.2", "typescript": "5.4.5" }, diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/package.json b/clients/algoliasearch-client-javascript/packages/client-analytics/package.json index 165133063d..6218eca7ca 100644 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/package.json +++ b/clients/algoliasearch-client-javascript/packages/client-analytics/package.json @@ -44,7 +44,7 @@ "@algolia/requester-node-http": "5.0.0-beta.2" }, "devDependencies": { - "@types/node": "20.12.11", + "@types/node": "20.12.12", "rollup": "4.17.2", "typescript": "5.4.5" }, diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/package.json b/clients/algoliasearch-client-javascript/packages/client-insights/package.json index 702196c292..dbffec9546 100644 --- a/clients/algoliasearch-client-javascript/packages/client-insights/package.json +++ b/clients/algoliasearch-client-javascript/packages/client-insights/package.json @@ -44,7 +44,7 @@ "@algolia/requester-node-http": "5.0.0-beta.2" }, "devDependencies": { - "@types/node": "20.12.11", + "@types/node": "20.12.12", "rollup": "4.17.2", "typescript": "5.4.5" }, diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/package.json b/clients/algoliasearch-client-javascript/packages/client-personalization/package.json index c7e6938dec..4d3470d803 100644 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/package.json +++ b/clients/algoliasearch-client-javascript/packages/client-personalization/package.json @@ -44,7 +44,7 @@ "@algolia/requester-node-http": "5.0.0-beta.2" }, "devDependencies": { - "@types/node": "20.12.11", + "@types/node": "20.12.12", "rollup": "4.17.2", "typescript": "5.4.5" }, diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/package.json b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/package.json index d6c4e1d031..135b150ec8 100644 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/package.json +++ b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/package.json @@ -44,7 +44,7 @@ "@algolia/requester-node-http": "5.0.0-beta.2" }, "devDependencies": { - "@types/node": "20.12.11", + "@types/node": "20.12.12", "rollup": "4.17.2", "typescript": "5.4.5" }, diff --git a/clients/algoliasearch-client-javascript/packages/client-search/package.json b/clients/algoliasearch-client-javascript/packages/client-search/package.json index df10fa7b58..e7d2172355 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/package.json +++ b/clients/algoliasearch-client-javascript/packages/client-search/package.json @@ -44,7 +44,7 @@ "@algolia/requester-node-http": "5.0.0-beta.2" }, "devDependencies": { - "@types/node": "20.12.11", + "@types/node": "20.12.12", "rollup": "4.17.2", "typescript": "5.4.5" }, diff --git a/clients/algoliasearch-client-javascript/packages/ingestion/package.json b/clients/algoliasearch-client-javascript/packages/ingestion/package.json index ebd4084a3a..ee336aa350 100644 --- a/clients/algoliasearch-client-javascript/packages/ingestion/package.json +++ b/clients/algoliasearch-client-javascript/packages/ingestion/package.json @@ -44,7 +44,7 @@ "@algolia/requester-node-http": "5.0.0-beta.2" }, "devDependencies": { - "@types/node": "20.12.11", + "@types/node": "20.12.12", "rollup": "4.17.2", "typescript": "5.4.5" }, diff --git a/clients/algoliasearch-client-javascript/packages/recommend/package.json b/clients/algoliasearch-client-javascript/packages/recommend/package.json index 6007db4b54..6c2c99a426 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/package.json +++ b/clients/algoliasearch-client-javascript/packages/recommend/package.json @@ -44,7 +44,7 @@ "@algolia/requester-node-http": "5.0.0-beta.2" }, "devDependencies": { - "@types/node": "20.12.11", + "@types/node": "20.12.12", "rollup": "4.17.2", "typescript": "5.4.5" }, diff --git a/clients/algoliasearch-client-javascript/yarn.lock b/clients/algoliasearch-client-javascript/yarn.lock index 50cd0482ac..8dd45b8325 100644 --- a/clients/algoliasearch-client-javascript/yarn.lock +++ b/clients/algoliasearch-client-javascript/yarn.lock @@ -12,7 +12,7 @@ __metadata: "@algolia/client-common": "npm:5.0.0-beta.2" "@algolia/requester-browser-xhr": "npm:5.0.0-beta.2" "@algolia/requester-node-http": "npm:5.0.0-beta.2" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" rollup: "npm:4.17.2" typescript: "npm:5.4.5" languageName: unknown @@ -25,7 +25,7 @@ __metadata: "@algolia/client-common": "npm:5.0.0-beta.2" "@algolia/requester-browser-xhr": "npm:5.0.0-beta.2" "@algolia/requester-node-http": "npm:5.0.0-beta.2" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" rollup: "npm:4.17.2" typescript: "npm:5.4.5" languageName: unknown @@ -53,7 +53,7 @@ __metadata: "@algolia/client-common": "npm:5.0.0-beta.2" "@algolia/requester-browser-xhr": "npm:5.0.0-beta.2" "@algolia/requester-node-http": "npm:5.0.0-beta.2" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" rollup: "npm:4.17.2" typescript: "npm:5.4.5" languageName: unknown @@ -66,7 +66,7 @@ __metadata: "@algolia/client-common": "npm:5.0.0-beta.2" "@algolia/requester-browser-xhr": "npm:5.0.0-beta.2" "@algolia/requester-node-http": "npm:5.0.0-beta.2" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" rollup: "npm:4.17.2" typescript: "npm:5.4.5" languageName: unknown @@ -79,7 +79,7 @@ __metadata: "@algolia/client-common": "npm:5.0.0-beta.2" "@algolia/requester-browser-xhr": "npm:5.0.0-beta.2" "@algolia/requester-node-http": "npm:5.0.0-beta.2" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" rollup: "npm:4.17.2" typescript: "npm:5.4.5" languageName: unknown @@ -92,7 +92,7 @@ __metadata: "@algolia/client-common": "npm:5.0.0-beta.2" "@algolia/requester-browser-xhr": "npm:5.0.0-beta.2" "@algolia/requester-node-http": "npm:5.0.0-beta.2" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" rollup: "npm:4.17.2" typescript: "npm:5.4.5" languageName: unknown @@ -118,7 +118,7 @@ __metadata: "@algolia/client-common": "npm:5.0.0-beta.2" "@algolia/requester-browser-xhr": "npm:5.0.0-beta.2" "@algolia/requester-node-http": "npm:5.0.0-beta.2" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" rollup: "npm:4.17.2" typescript: "npm:5.4.5" languageName: unknown @@ -144,7 +144,7 @@ __metadata: "@algolia/client-common": "npm:5.0.0-beta.2" "@algolia/requester-browser-xhr": "npm:5.0.0-beta.2" "@algolia/requester-node-http": "npm:5.0.0-beta.2" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" rollup: "npm:4.17.2" typescript: "npm:5.4.5" languageName: unknown @@ -2929,15 +2929,6 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:20.12.11": - version: 20.12.11 - resolution: "@types/node@npm:20.12.11" - dependencies: - undici-types: "npm:~5.26.4" - checksum: c6afe7c2c4504a4f488814d7b306ebad16bf42cbb43bf9db9fe1aed8c5fb99235593c3be5088979a64526b106cf022256688e2f002811be8273d87dc2e0d484f - languageName: node - linkType: hard - "@types/normalize-package-data@npm:^2.4.0": version: 2.4.4 resolution: "@types/normalize-package-data@npm:2.4.4" @@ -3174,7 +3165,7 @@ __metadata: "@babel/preset-env": "npm:7.24.5" "@babel/preset-typescript": "npm:7.24.1" "@types/jest": "npm:29.5.12" - "@types/node": "npm:20.12.11" + "@types/node": "npm:20.12.12" jest: "npm:29.7.0" rollup: "npm:4.17.2" typescript: "npm:5.4.5" diff --git a/specs/bundled/usage.doc.yml b/specs/bundled/usage.doc.yml index d57530e64c..7e121bac2e 100644 --- a/specs/bundled/usage.doc.yml +++ b/specs/bundled/usage.doc.yml @@ -245,6 +245,35 @@ paths: // Call the API _ = try await client.customGet(path: "test/minimal") + post: + operationId: customPost + requestBody: + description: Parameters to send with the custom request. + content: + application/json: + schema: + type: object + summary: Send requests to the Algolia REST API + description: This method allow you to send requests to the Algolia REST API. + parameters: + - $ref: '#/components/parameters/PathInPath' + - $ref: '#/components/parameters/Parameters' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + '400': + $ref: '#/components/responses/BadRequest' + '402': + $ref: '#/components/responses/FeatureNotEnabled' + '403': + $ref: '#/components/responses/MethodNotAllowed' + '404': + $ref: '#/components/responses/IndexNotFound' + x-codeSamples: - lang: csharp label: C# source: > @@ -256,7 +285,7 @@ paths: // Call the API - var response = await client.CustomGetAsync("test/minimal"); + var response = await client.CustomPostAsync("test/minimal"); - lang: go label: Go source: | @@ -268,7 +297,7 @@ paths: } // Call the API - resp, err := client.CustomGet(client.NewApiCustomGetRequest( + resp, err := client.CustomPost(client.NewApiCustomPostRequest( "test/minimal", )) if err != nil { @@ -285,7 +314,7 @@ paths: UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); // Call the API - client.customGet("test/minimal"); + client.customPost("test/minimal"); - lang: javascript label: JavaScript source: | @@ -293,7 +322,7 @@ paths: const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); // Call the API - const response = await client.customGet({ path: 'test/minimal' }); + const response = await client.customPost({ path: 'test/minimal' }); // use typed response console.log(response); @@ -308,7 +337,7 @@ paths: // Call the API - var response = client.customGet( + var response = client.customPost( path = "test/minimal", ) @@ -328,7 +357,7 @@ paths: // Call the API - $response = $client->customGet( + $response = $client->customPost( 'test/minimal', ); @@ -343,7 +372,7 @@ paths: _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") # Call the API - resp = await _client.custom_get( + resp = await _client.custom_post( path="test/minimal", ) @@ -359,7 +388,7 @@ paths: client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') # Call the API - resp = client.custom_get("test/minimal") + resp = client.custom_post("test/minimal") # use the class directly puts resp @@ -377,7 +406,7 @@ paths: // Call the API - val res = client.customGet[JObject]( + val res = client.customPost[JObject]( path = "test/minimal" ) @@ -396,9 +425,9 @@ paths: // Call the API - _ = try await client.customGet(path: "test/minimal") - post: - operationId: customPost + _ = try await client.customPost(path: "test/minimal") + put: + operationId: customPut requestBody: description: Parameters to send with the custom request. content: @@ -437,7 +466,7 @@ paths: // Call the API - var response = await client.CustomPostAsync("test/minimal"); + var response = await client.CustomPutAsync("test/minimal"); - lang: go label: Go source: | @@ -449,7 +478,7 @@ paths: } // Call the API - resp, err := client.CustomPost(client.NewApiCustomPostRequest( + resp, err := client.CustomPut(client.NewApiCustomPutRequest( "test/minimal", )) if err != nil { @@ -466,7 +495,7 @@ paths: UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); // Call the API - client.customPost("test/minimal"); + client.customPut("test/minimal"); - lang: javascript label: JavaScript source: | @@ -474,7 +503,7 @@ paths: const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); // Call the API - const response = await client.customPost({ path: 'test/minimal' }); + const response = await client.customPut({ path: 'test/minimal' }); // use typed response console.log(response); @@ -489,7 +518,7 @@ paths: // Call the API - var response = client.customPost( + var response = client.customPut( path = "test/minimal", ) @@ -509,7 +538,7 @@ paths: // Call the API - $response = $client->customPost( + $response = $client->customPut( 'test/minimal', ); @@ -524,7 +553,7 @@ paths: _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") # Call the API - resp = await _client.custom_post( + resp = await _client.custom_put( path="test/minimal", ) @@ -540,7 +569,7 @@ paths: client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') # Call the API - resp = client.custom_post("test/minimal") + resp = client.custom_put("test/minimal") # use the class directly puts resp @@ -558,7 +587,7 @@ paths: // Call the API - val res = client.customPost[JObject]( + val res = client.customPut[JObject]( path = "test/minimal" ) @@ -577,7 +606,30 @@ paths: // Call the API - _ = try await client.customPost(path: "test/minimal") + _ = try await client.customPut(path: "test/minimal") + delete: + operationId: customDelete + summary: Send requests to the Algolia REST API + description: This method allow you to send requests to the Algolia REST API. + parameters: + - $ref: '#/components/parameters/PathInPath' + - $ref: '#/components/parameters/Parameters' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + '400': + $ref: '#/components/responses/BadRequest' + '402': + $ref: '#/components/responses/FeatureNotEnabled' + '403': + $ref: '#/components/responses/MethodNotAllowed' + '404': + $ref: '#/components/responses/IndexNotFound' + x-codeSamples: - lang: csharp label: C# source: > @@ -589,7 +641,7 @@ paths: // Call the API - var response = await client.CustomPostAsync("test/minimal"); + var response = await client.CustomDeleteAsync("test/minimal"); - lang: go label: Go source: | @@ -601,7 +653,7 @@ paths: } // Call the API - resp, err := client.CustomPost(client.NewApiCustomPostRequest( + resp, err := client.CustomDelete(client.NewApiCustomDeleteRequest( "test/minimal", )) if err != nil { @@ -618,17 +670,23 @@ paths: UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); // Call the API - client.customPost("test/minimal"); + client.customDelete("test/minimal"); - lang: javascript label: JavaScript - source: | + source: > // Initialize the client + const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); + // Call the API - const response = await client.customPost({ path: 'test/minimal' }); + + const response = await client.customDelete({ path: 'test/minimal' + }); + // use typed response + console.log(response); - lang: kotlin label: Kotlin @@ -641,7 +699,7 @@ paths: // Call the API - var response = client.customPost( + var response = client.customDelete( path = "test/minimal", ) @@ -661,7 +719,7 @@ paths: // Call the API - $response = $client->customPost( + $response = $client->customDelete( 'test/minimal', ); @@ -676,7 +734,7 @@ paths: _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") # Call the API - resp = await _client.custom_post( + resp = await _client.custom_delete( path="test/minimal", ) @@ -692,7 +750,7 @@ paths: client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') # Call the API - resp = client.custom_post("test/minimal") + resp = client.custom_delete("test/minimal") # use the class directly puts resp @@ -710,7 +768,7 @@ paths: // Call the API - val res = client.customPost[JObject]( + val res = client.customDelete[JObject]( path = "test/minimal" ) @@ -729,35 +787,31 @@ paths: // Call the API - _ = try await client.customPost(path: "test/minimal") - put: - operationId: customPut - requestBody: - description: Parameters to send with the custom request. - content: - application/json: - schema: - type: object - summary: Send requests to the Algolia REST API - description: This method allow you to send requests to the Algolia REST API. + _ = try await client.customDelete(path: "test/minimal") + /1/usage/{statistic}: + get: + operationId: getUsage + summary: Retrieve usage information + description: | + Retrieves usage statistics evaluated over a specified period. parameters: - - $ref: '#/components/parameters/PathInPath' - - $ref: '#/components/parameters/Parameters' + - $ref: '#/components/parameters/statisticParameter' + - $ref: '#/components/parameters/StartDateRequired' + - $ref: '#/components/parameters/EndDateRequired' + - $ref: '#/components/parameters/granularityParameter' responses: '200': - description: OK - content: - application/json: - schema: - type: object + $ref: '#/components/responses/Success' '400': - $ref: '#/components/responses/BadRequest' - '402': - $ref: '#/components/responses/FeatureNotEnabled' + $ref: '#/components/responses/InvalidRequest' + '401': + $ref: '#/components/responses/Unauthorized' '403': - $ref: '#/components/responses/MethodNotAllowed' + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/IndexNotFound' + '422': + $ref: '#/components/responses/UnprocessableEntity' x-codeSamples: - lang: csharp label: C# @@ -770,7 +824,11 @@ paths: // Call the API - var response = await client.CustomPutAsync("test/minimal"); + var response = await client.GetUsageAsync( + Enum.Parse("QueriesOperations"), + "2024-04-03T12:46:43Z", + "2024-04-05T12:46:43Z" + ); - lang: go label: Go source: | @@ -782,8 +840,8 @@ paths: } // Call the API - resp, err := client.CustomPut(client.NewApiCustomPutRequest( - "test/minimal", + resp, err := client.GetUsage(client.NewApiGetUsageRequest( + usage.Statistic("queries_operations"), "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z", )) if err != nil { // handle the eventual error @@ -794,12 +852,16 @@ paths: print(resp) - lang: java label: Java - source: | + source: > // Initialize the client + UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); + // Call the API - client.customPut("test/minimal"); + + client.getUsage(Statistic.fromValue("queries_operations"), + "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z"); - lang: javascript label: JavaScript source: | @@ -807,7 +869,11 @@ paths: const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); // Call the API - const response = await client.customPut({ path: 'test/minimal' }); + const response = await client.getUsage({ + statistic: 'queries_operations', + startDate: '2024-04-03T12:46:43Z', + endDate: '2024-04-05T12:46:43Z', + }); // use typed response console.log(response); @@ -822,8 +888,10 @@ paths: // Call the API - var response = client.customPut( - path = "test/minimal", + var response = client.getUsage( + statistic = Statistic.entries.first { it.value == "queries_operations" }, + startDate = "2024-04-03T12:46:43Z", + endDate = "2024-04-05T12:46:43Z", ) @@ -842,8 +910,10 @@ paths: // Call the API - $response = $client->customPut( - 'test/minimal', + $response = $client->getUsage( + 'queries_operations', + '2024-04-03T12:46:43Z', + '2024-04-05T12:46:43Z', ); @@ -857,8 +927,10 @@ paths: _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") # Call the API - resp = await _client.custom_put( - path="test/minimal", + resp = await _client.get_usage( + statistic="queries_operations", + start_date="2024-04-03T12:46:43Z", + end_date="2024-04-05T12:46:43Z", ) # use the class directly @@ -868,17 +940,25 @@ paths: print(resp.to_json()) - lang: ruby label: Ruby - source: | + source: > # Initialize the client + client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') + # Call the API - resp = client.custom_put("test/minimal") + + resp = client.get_usage('queries_operations', + "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z") + # use the class directly + puts resp + # print the JSON response + puts resp.to_json - lang: scala label: Scala @@ -891,888 +971,10 @@ paths: // Call the API - val res = client.customPut[JObject]( - path = "test/minimal" - ) - - - // Use the response - - val value = Await.result(res, Duration(100, "sec")) - - lang: swift - label: Swift - source: > - // Initialize the client - - let client = try UsageClient(appID: "YOUR_APP_ID", apiKey: - "YOUR_API_KEY") - - - // Call the API - - _ = try await client.customPut(path: "test/minimal") - - lang: csharp - label: C# - source: > - // Initialize the client - - var client = new UsageClient(new UsageConfig("YOUR_APP_ID", - "YOUR_API_KEY")); - - - // Call the API - - var response = await client.CustomPutAsync("test/minimal"); - - lang: go - label: Go - source: | - // 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 - resp, err := client.CustomPut(client.NewApiCustomPutRequest( - "test/minimal", - )) - if err != nil { - // handle the eventual error - panic(err) - } - - // use the model directly - print(resp) - - lang: java - label: Java - source: | - // Initialize the client - UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); - - // Call the API - client.customPut("test/minimal"); - - lang: javascript - label: JavaScript - source: | - // Initialize the client - const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); - - // Call the API - const response = await client.customPut({ path: 'test/minimal' }); - - // use typed response - console.log(response); - - lang: kotlin - label: Kotlin - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - var response = client.customPut( - path = "test/minimal", - ) - - - // Use the response - - println(response) - - lang: php - label: PHP - source: > - // Initialize the client - - $client = - Algolia\AlgoliaSearch\Api\UsageClient::create('', - ''); - - - // Call the API - - $response = $client->customPut( - 'test/minimal', - ); - - - // play with the response - - var_dump($response); - - lang: python - label: Python - source: | - # Initialize the client - _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") - - # Call the API - resp = await _client.custom_put( - path="test/minimal", - ) - - # use the class directly - print(resp) - - # print the JSON response - print(resp.to_json()) - - lang: ruby - label: Ruby - source: | - # Initialize the client - client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') - - # Call the API - resp = client.custom_put("test/minimal") - - # use the class directly - puts resp - - # print the JSON response - puts resp.to_json - - lang: scala - label: Scala - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - val res = client.customPut[JObject]( - path = "test/minimal" - ) - - - // Use the response - - val value = Await.result(res, Duration(100, "sec")) - - lang: swift - label: Swift - source: > - // Initialize the client - - let client = try UsageClient(appID: "YOUR_APP_ID", apiKey: - "YOUR_API_KEY") - - - // Call the API - - _ = try await client.customPut(path: "test/minimal") - delete: - operationId: customDelete - summary: Send requests to the Algolia REST API - description: This method allow you to send requests to the Algolia REST API. - parameters: - - $ref: '#/components/parameters/PathInPath' - - $ref: '#/components/parameters/Parameters' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - '400': - $ref: '#/components/responses/BadRequest' - '402': - $ref: '#/components/responses/FeatureNotEnabled' - '403': - $ref: '#/components/responses/MethodNotAllowed' - '404': - $ref: '#/components/responses/IndexNotFound' - x-codeSamples: - - lang: csharp - label: C# - source: > - // Initialize the client - - var client = new UsageClient(new UsageConfig("YOUR_APP_ID", - "YOUR_API_KEY")); - - - // Call the API - - var response = await client.CustomDeleteAsync("test/minimal"); - - lang: go - label: Go - source: | - // 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 - resp, err := client.CustomDelete(client.NewApiCustomDeleteRequest( - "test/minimal", - )) - if err != nil { - // handle the eventual error - panic(err) - } - - // use the model directly - print(resp) - - lang: java - label: Java - source: | - // Initialize the client - UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); - - // Call the API - client.customDelete("test/minimal"); - - lang: javascript - label: JavaScript - source: > - // Initialize the client - - const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); - - - // Call the API - - const response = await client.customDelete({ path: 'test/minimal' - }); - - - // use typed response - - console.log(response); - - lang: kotlin - label: Kotlin - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - var response = client.customDelete( - path = "test/minimal", - ) - - - // Use the response - - println(response) - - lang: php - label: PHP - source: > - // Initialize the client - - $client = - Algolia\AlgoliaSearch\Api\UsageClient::create('', - ''); - - - // Call the API - - $response = $client->customDelete( - 'test/minimal', - ); - - - // play with the response - - var_dump($response); - - lang: python - label: Python - source: | - # Initialize the client - _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") - - # Call the API - resp = await _client.custom_delete( - path="test/minimal", - ) - - # use the class directly - print(resp) - - # print the JSON response - print(resp.to_json()) - - lang: ruby - label: Ruby - source: | - # Initialize the client - client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') - - # Call the API - resp = client.custom_delete("test/minimal") - - # use the class directly - puts resp - - # print the JSON response - puts resp.to_json - - lang: scala - label: Scala - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - val res = client.customDelete[JObject]( - path = "test/minimal" - ) - - - // Use the response - - val value = Await.result(res, Duration(100, "sec")) - - lang: swift - label: Swift - source: > - // Initialize the client - - let client = try UsageClient(appID: "YOUR_APP_ID", apiKey: - "YOUR_API_KEY") - - - // Call the API - - _ = try await client.customDelete(path: "test/minimal") - - lang: csharp - label: C# - source: > - // Initialize the client - - var client = new UsageClient(new UsageConfig("YOUR_APP_ID", - "YOUR_API_KEY")); - - - // Call the API - - var response = await client.CustomDeleteAsync("test/minimal"); - - lang: go - label: Go - source: | - // 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 - resp, err := client.CustomDelete(client.NewApiCustomDeleteRequest( - "test/minimal", - )) - if err != nil { - // handle the eventual error - panic(err) - } - - // use the model directly - print(resp) - - lang: java - label: Java - source: | - // Initialize the client - UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); - - // Call the API - client.customDelete("test/minimal"); - - lang: javascript - label: JavaScript - source: > - // Initialize the client - - const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); - - - // Call the API - - const response = await client.customDelete({ path: 'test/minimal' - }); - - - // use typed response - - console.log(response); - - lang: kotlin - label: Kotlin - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - var response = client.customDelete( - path = "test/minimal", - ) - - - // Use the response - - println(response) - - lang: php - label: PHP - source: > - // Initialize the client - - $client = - Algolia\AlgoliaSearch\Api\UsageClient::create('', - ''); - - - // Call the API - - $response = $client->customDelete( - 'test/minimal', - ); - - - // play with the response - - var_dump($response); - - lang: python - label: Python - source: | - # Initialize the client - _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") - - # Call the API - resp = await _client.custom_delete( - path="test/minimal", - ) - - # use the class directly - print(resp) - - # print the JSON response - print(resp.to_json()) - - lang: ruby - label: Ruby - source: | - # Initialize the client - client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') - - # Call the API - resp = client.custom_delete("test/minimal") - - # use the class directly - puts resp - - # print the JSON response - puts resp.to_json - - lang: scala - label: Scala - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - val res = client.customDelete[JObject]( - path = "test/minimal" - ) - - - // Use the response - - val value = Await.result(res, Duration(100, "sec")) - - lang: swift - label: Swift - source: > - // Initialize the client - - let client = try UsageClient(appID: "YOUR_APP_ID", apiKey: - "YOUR_API_KEY") - - - // Call the API - - _ = try await client.customDelete(path: "test/minimal") - /1/usage/{statistic}: - get: - operationId: getUsage - summary: Retrieve usage information - description: | - Retrieves usage statistics evaluated over a specified period. - parameters: - - $ref: '#/components/parameters/statisticParameter' - - $ref: '#/components/parameters/StartDateRequired' - - $ref: '#/components/parameters/EndDateRequired' - - $ref: '#/components/parameters/granularityParameter' - responses: - '200': - $ref: '#/components/responses/Success' - '400': - $ref: '#/components/responses/InvalidRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/UnprocessableEntity' - x-codeSamples: - - lang: csharp - label: C# - source: > - // Initialize the client - - var client = new UsageClient(new UsageConfig("YOUR_APP_ID", - "YOUR_API_KEY")); - - - // Call the API - - var response = await client.GetUsageAsync( - Enum.Parse("QueriesOperations"), - "2024-04-03T12:46:43Z", - "2024-04-05T12:46:43Z" - ); - - lang: go - label: Go - source: | - // 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 - resp, err := client.GetUsage(client.NewApiGetUsageRequest( - usage.Statistic("queries_operations"), "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z", - )) - if err != nil { - // handle the eventual error - panic(err) - } - - // use the model directly - print(resp) - - lang: java - label: Java - source: > - // Initialize the client - - UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); - - - // Call the API - - client.getUsage(Statistic.fromValue("queries_operations"), - "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z"); - - lang: javascript - label: JavaScript - source: | - // Initialize the client - const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); - - // Call the API - const response = await client.getUsage({ - statistic: 'queries_operations', - startDate: '2024-04-03T12:46:43Z', - endDate: '2024-04-05T12:46:43Z', - }); - - // use typed response - console.log(response); - - lang: kotlin - label: Kotlin - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - var response = client.getUsage( - statistic = Statistic.entries.first { it.value == "queries_operations" }, - startDate = "2024-04-03T12:46:43Z", - endDate = "2024-04-05T12:46:43Z", - ) - - - // Use the response - - println(response) - - lang: php - label: PHP - source: > - // Initialize the client - - $client = - Algolia\AlgoliaSearch\Api\UsageClient::create('', - ''); - - - // Call the API - - $response = $client->getUsage( - 'queries_operations', - '2024-04-03T12:46:43Z', - '2024-04-05T12:46:43Z', - ); - - - // play with the response - - var_dump($response); - - lang: python - label: Python - source: | - # Initialize the client - _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") - - # Call the API - resp = await _client.get_usage( - statistic="queries_operations", - start_date="2024-04-03T12:46:43Z", - end_date="2024-04-05T12:46:43Z", - ) - - # use the class directly - print(resp) - - # print the JSON response - print(resp.to_json()) - - lang: ruby - label: Ruby - source: > - # Initialize the client - - client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') - - - # Call the API - - resp = client.get_usage('queries_operations', - "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z") - - - # use the class directly - - puts resp - - - # print the JSON response - - puts resp.to_json - - lang: scala - label: Scala - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - val res = client.getUsage( - statistic = Statistic.withName("queries_operations"), - startDate = "2024-04-03T12:46:43Z", - endDate = "2024-04-05T12:46:43Z" - ) - - - // Use the response - - val value = Await.result(res, Duration(100, "sec")) - - lang: swift - label: Swift - source: > - // Initialize the client - - let client = try UsageClient(appID: "YOUR_APP_ID", apiKey: - "YOUR_API_KEY") - - - // Call the API - - _ = try await client.getUsage( - statistic: Statistic.queriesOperations, - startDate: "2024-04-03T12:46:43Z", - endDate: "2024-04-05T12:46:43Z" - ) - - lang: csharp - label: C# - source: > - // Initialize the client - - var client = new UsageClient(new UsageConfig("YOUR_APP_ID", - "YOUR_API_KEY")); - - - // Call the API - - var response = await client.GetUsageAsync( - Enum.Parse("QueriesOperations"), - "2024-04-03T12:46:43Z", - "2024-04-05T12:46:43Z" - ); - - lang: go - label: Go - source: | - // 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 - resp, err := client.GetUsage(client.NewApiGetUsageRequest( - usage.Statistic("queries_operations"), "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z", - )) - if err != nil { - // handle the eventual error - panic(err) - } - - // use the model directly - print(resp) - - lang: java - label: Java - source: > - // Initialize the client - - UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); - - - // Call the API - - client.getUsage(Statistic.fromValue("queries_operations"), - "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z"); - - lang: javascript - label: JavaScript - source: | - // Initialize the client - const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); - - // Call the API - const response = await client.getUsage({ - statistic: 'queries_operations', - startDate: '2024-04-03T12:46:43Z', - endDate: '2024-04-05T12:46:43Z', - }); - - // use typed response - console.log(response); - - lang: kotlin - label: Kotlin - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - var response = client.getUsage( - statistic = Statistic.entries.first { it.value == "queries_operations" }, - startDate = "2024-04-03T12:46:43Z", - endDate = "2024-04-05T12:46:43Z", - ) - - - // Use the response - - println(response) - - lang: php - label: PHP - source: > - // Initialize the client - - $client = - Algolia\AlgoliaSearch\Api\UsageClient::create('', - ''); - - - // Call the API - - $response = $client->getUsage( - 'queries_operations', - '2024-04-03T12:46:43Z', - '2024-04-05T12:46:43Z', - ); - - - // play with the response - - var_dump($response); - - lang: python - label: Python - source: | - # Initialize the client - _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") - - # Call the API - resp = await _client.get_usage( - statistic="queries_operations", - start_date="2024-04-03T12:46:43Z", - end_date="2024-04-05T12:46:43Z", - ) - - # use the class directly - print(resp) - - # print the JSON response - print(resp.to_json()) - - lang: ruby - label: Ruby - source: > - # Initialize the client - - client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') - - - # Call the API - - resp = client.get_usage('queries_operations', - "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z") - - - # use the class directly - - puts resp - - - # print the JSON response - - puts resp.to_json - - lang: scala - label: Scala - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - val res = client.getUsage( - statistic = Statistic.withName("queries_operations"), - startDate = "2024-04-03T12:46:43Z", - endDate = "2024-04-05T12:46:43Z" + val res = client.getUsage( + statistic = Statistic.withName("queries_operations"), + startDate = "2024-04-03T12:46:43Z", + endDate = "2024-04-05T12:46:43Z" ) @@ -2001,194 +1203,6 @@ paths: "YOUR_API_KEY") - // Call the API - - _ = try await client.getIndexUsage( - statistic: Statistic.queriesOperations, - indexName: "myIndexName", - startDate: "2024-04-03T12:46:43Z", - endDate: "2024-04-05T12:46:43Z" - ) - - lang: csharp - label: C# - source: > - // Initialize the client - - var client = new UsageClient(new UsageConfig("YOUR_APP_ID", - "YOUR_API_KEY")); - - - // Call the API - - var response = await client.GetIndexUsageAsync( - Enum.Parse("QueriesOperations"), - "myIndexName", - "2024-04-03T12:46:43Z", - "2024-04-05T12:46:43Z" - ); - - lang: go - label: Go - source: | - // 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 - resp, err := client.GetIndexUsage(client.NewApiGetIndexUsageRequest( - usage.Statistic("queries_operations"), "myIndexName", "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z", - )) - if err != nil { - // handle the eventual error - panic(err) - } - - // use the model directly - print(resp) - - lang: java - label: Java - source: > - // Initialize the client - - UsageClient client = new UsageClient("YOUR_APP_ID", "YOUR_API_KEY"); - - - // Call the API - - client.getIndexUsage(Statistic.fromValue("queries_operations"), - "myIndexName", "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z"); - - lang: javascript - label: JavaScript - source: | - // Initialize the client - const client = usageClient('YOUR_APP_ID', 'YOUR_API_KEY'); - - // Call the API - const response = await client.getIndexUsage({ - statistic: 'queries_operations', - indexName: 'myIndexName', - startDate: '2024-04-03T12:46:43Z', - endDate: '2024-04-05T12:46:43Z', - }); - - // use typed response - console.log(response); - - lang: kotlin - label: Kotlin - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - var response = client.getIndexUsage( - statistic = Statistic.entries.first { it.value == "queries_operations" }, - indexName = "myIndexName", - startDate = "2024-04-03T12:46:43Z", - endDate = "2024-04-05T12:46:43Z", - ) - - - // Use the response - - println(response) - - lang: php - label: PHP - source: > - // Initialize the client - - $client = - Algolia\AlgoliaSearch\Api\UsageClient::create('', - ''); - - - // Call the API - - $response = $client->getIndexUsage( - 'queries_operations', - 'myIndexName', - '2024-04-03T12:46:43Z', - '2024-04-05T12:46:43Z', - ); - - - // play with the response - - var_dump($response); - - lang: python - label: Python - source: | - # Initialize the client - _client = UsageClient("YOUR_APP_ID", "YOUR_API_KEY") - - # Call the API - resp = await _client.get_index_usage( - statistic="queries_operations", - index_name="myIndexName", - start_date="2024-04-03T12:46:43Z", - end_date="2024-04-05T12:46:43Z", - ) - - # use the class directly - print(resp) - - # print the JSON response - print(resp.to_json()) - - lang: ruby - label: Ruby - source: | - # Initialize the client - client = Algolia::UsageClient.create('YOUR_APP_ID', 'YOUR_API_KEY') - - # Call the API - resp = client.get_index_usage( - 'queries_operations', - "myIndexName", - "2024-04-03T12:46:43Z", - "2024-04-05T12:46:43Z" - ) - - # use the class directly - puts resp - - # print the JSON response - puts resp.to_json - - lang: scala - label: Scala - source: > - // Initialize the client - - val client = UsageClient(appId = "YOUR_APP_ID", apiKey = - "YOUR_API_KEY") - - - // Call the API - - val res = client.getIndexUsage( - statistic = Statistic.withName("queries_operations"), - indexName = "myIndexName", - startDate = "2024-04-03T12:46:43Z", - endDate = "2024-04-05T12:46:43Z" - ) - - - // Use the response - - val value = Await.result(res, Duration(100, "sec")) - - lang: swift - label: Swift - source: > - // Initialize the client - - let client = try UsageClient(appID: "YOUR_APP_ID", apiKey: - "YOUR_API_KEY") - - // Call the API _ = try await client.getIndexUsage( diff --git a/tests/output/csharp/src/generated/requests/Insights.test.cs b/tests/output/csharp/src/generated/requests/Insights.test.cs index 655f1d97e6..e588b21fe1 100644 --- a/tests/output/csharp/src/generated/requests/Insights.test.cs +++ b/tests/output/csharp/src/generated/requests/Insights.test.cs @@ -602,7 +602,7 @@ await _client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1715904000000L, + Timestamp = 1716163200000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, QueryID = "43b15df305339e827f0ac0bdc5ebcaa7", } @@ -615,7 +615,7 @@ await _client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1715904000000L, + Timestamp = 1716163200000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, } ) @@ -627,7 +627,7 @@ await _client.PushEventsAsync( Assert.Equal("/1/events", req.Path); Assert.Equal("POST", req.Method.ToString()); JsonAssert.EqualOverrideDefault( - "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1715904000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1715904000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", + "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1716163200000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1716163200000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", req.Body, new JsonDiffConfig(false) ); @@ -648,7 +648,7 @@ await _client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1715904000000L, + Timestamp = 1716163200000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, QueryID = "43b15df305339e827f0ac0bdc5ebcaa7", } @@ -661,7 +661,7 @@ await _client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1715904000000L, + Timestamp = 1716163200000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, } ) diff --git a/tests/output/dart/test/requests/insights_test.dart b/tests/output/dart/test/requests/insights_test.dart index e196dbc00f..c06051aa2b 100644 --- a/tests/output/dart/test/requests/insights_test.dart +++ b/tests/output/dart/test/requests/insights_test.dart @@ -633,7 +633,7 @@ void main() { index: "products", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: 1715904000000, + timestamp: 1716163200000, objectIDs: [ "9780545139700", "9780439784542", @@ -646,7 +646,7 @@ void main() { index: "products", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: 1715904000000, + timestamp: 1716163200000, objectIDs: [ "9780545139700", "9780439784542", @@ -659,7 +659,7 @@ void main() { expectPath(request.path, '/1/events'); expect(request.method, 'post'); expectBody(request.body, - """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"]}]}"""); + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"]}]}"""); }, ), ); diff --git a/tests/output/go/tests/requests/insights_test.go b/tests/output/go/tests/requests/insights_test.go index aacfedc3aa..ff150aa432 100644 --- a/tests/output/go/tests/requests/insights_test.go +++ b/tests/output/go/tests/requests/insights_test.go @@ -453,9 +453,9 @@ func TestInsights_PushEvents(t *testing.T) { insights.NewEmptyInsightsEvents().SetEvents( []insights.EventsItems{*insights.ConvertedObjectIDsAfterSearchAsEventsItems( - insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1715904000000).SetObjectIDs( + insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1716163200000).SetObjectIDs( []string{"9780545139700", "9780439784542"}).SetQueryID("43b15df305339e827f0ac0bdc5ebcaa7")), *insights.ViewedObjectIDsAsEventsItems( - insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1715904000000).SetObjectIDs( + insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1716163200000).SetObjectIDs( []string{"9780545139700", "9780439784542"}))}), )) require.NoError(t, err) @@ -464,15 +464,15 @@ func TestInsights_PushEvents(t *testing.T) { require.Equal(t, "POST", echo.Method) ja := jsonassert.New(t) - ja.Assertf(*echo.Body, `{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"]}]}`) + ja.Assertf(*echo.Body, `{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"]}]}`) clientE2E := createE2EInsightsClient(t) res, err := clientE2E.PushEvents(client.NewApiPushEventsRequest( insights.NewEmptyInsightsEvents().SetEvents( []insights.EventsItems{*insights.ConvertedObjectIDsAfterSearchAsEventsItems( - insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1715904000000).SetObjectIDs( + insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1716163200000).SetObjectIDs( []string{"9780545139700", "9780439784542"}).SetQueryID("43b15df305339e827f0ac0bdc5ebcaa7")), *insights.ViewedObjectIDsAsEventsItems( - insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1715904000000).SetObjectIDs( + insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1716163200000).SetObjectIDs( []string{"9780545139700", "9780439784542"}))}), )) require.NoError(t, err) diff --git a/tests/output/java/src/test/java/com/algolia/requests/Insights.test.java b/tests/output/java/src/test/java/com/algolia/requests/Insights.test.java index 1b7aeb5774..fb8f2152a8 100644 --- a/tests/output/java/src/test/java/com/algolia/requests/Insights.test.java +++ b/tests/output/java/src/test/java/com/algolia/requests/Insights.test.java @@ -615,7 +615,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1715904000000L) + .setTimestamp(1716163200000L) .setObjectIDs(List.of("9780545139700", "9780439784542")) .setQueryID("43b15df305339e827f0ac0bdc5ebcaa7"), new ViewedObjectIDs() @@ -624,7 +624,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1715904000000L) + .setTimestamp(1716163200000L) .setObjectIDs(List.of("9780545139700", "9780439784542")) ) ) @@ -636,9 +636,9 @@ void pushEventsTest1() { assertDoesNotThrow(() -> JSONAssert.assertEquals( "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product" + - " Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1715904000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product" + + " Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1716163200000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product" + " Detail Page" + - " Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1715904000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", + " Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1716163200000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", req.body, JSONCompareMode.STRICT ) @@ -654,7 +654,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1715904000000L) + .setTimestamp(1716163200000L) .setObjectIDs(List.of("9780545139700", "9780439784542")) .setQueryID("43b15df305339e827f0ac0bdc5ebcaa7"), new ViewedObjectIDs() @@ -663,7 +663,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1715904000000L) + .setTimestamp(1716163200000L) .setObjectIDs(List.of("9780545139700", "9780439784542")) ) ) diff --git a/tests/output/javascript/package.json b/tests/output/javascript/package.json index 1aae908710..cf6120452b 100644 --- a/tests/output/javascript/package.json +++ b/tests/output/javascript/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@types/jest": "29.5.12", - "@types/node": "20.12.11", + "@types/node": "20.12.12", "dotenv": "16.4.5", "jest": "29.7.0", "typescript": "5.4.5" diff --git a/tests/output/javascript/src/requests/insights.test.ts b/tests/output/javascript/src/requests/insights.test.ts index a65aeec535..64c9c1a005 100644 --- a/tests/output/javascript/src/requests/insights.test.ts +++ b/tests/output/javascript/src/requests/insights.test.ts @@ -428,7 +428,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1715904000000, + timestamp: 1716163200000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -438,7 +438,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1715904000000, + timestamp: 1716163200000, objectIDs: ['9780545139700', '9780439784542'], }, ], @@ -454,7 +454,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1715904000000, + timestamp: 1716163200000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -464,7 +464,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1715904000000, + timestamp: 1716163200000, objectIDs: ['9780545139700', '9780439784542'], }, ], @@ -479,7 +479,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1715904000000, + timestamp: 1716163200000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -489,7 +489,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1715904000000, + timestamp: 1716163200000, objectIDs: ['9780545139700', '9780439784542'], }, ], diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/InsightsTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/InsightsTest.kt index 2e821a8580..a8903127bc 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/InsightsTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/InsightsTest.kt @@ -529,7 +529,7 @@ class InsightsTest { index = "products", userToken = "user-123456", authenticatedUserToken = "user-123456", - timestamp = 1715904000000L, + timestamp = 1716163200000L, objectIDs = listOf("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7", ), @@ -539,7 +539,7 @@ class InsightsTest { index = "products", userToken = "user-123456", authenticatedUserToken = "user-123456", - timestamp = 1715904000000L, + timestamp = 1716163200000L, objectIDs = listOf("9780545139700", "9780439784542"), ), ), @@ -549,7 +549,7 @@ class InsightsTest { intercept = { assertEquals("/1/events".toPathSegments(), it.url.pathSegments) assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"]}]}""", it.body) + assertJsonBody("""{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"]}]}""", it.body) }, ) } diff --git a/tests/output/php/src/requests/InsightsTest.php b/tests/output/php/src/requests/InsightsTest.php index f651522269..8945226318 100644 --- a/tests/output/php/src/requests/InsightsTest.php +++ b/tests/output/php/src/requests/InsightsTest.php @@ -632,7 +632,7 @@ public function testPushEvents1() 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1715904000000, + 'timestamp' => 1716163200000, 'objectIDs' => [ '9780545139700', @@ -646,7 +646,7 @@ public function testPushEvents1() 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1715904000000, + 'timestamp' => 1716163200000, 'objectIDs' => [ '9780545139700', @@ -661,7 +661,7 @@ public function testPushEvents1() [ 'path' => '/1/events', 'method' => 'POST', - 'body' => json_decode('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"]}]}'), + 'body' => json_decode('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"]}]}'), ], ]); @@ -673,7 +673,7 @@ public function testPushEvents1() 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1715904000000, + 'timestamp' => 1716163200000, 'objectIDs' => [ '9780545139700', @@ -687,7 +687,7 @@ public function testPushEvents1() 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1715904000000, + 'timestamp' => 1716163200000, 'objectIDs' => [ '9780545139700', diff --git a/tests/output/python/tests/requests/insights_test.py b/tests/output/python/tests/requests/insights_test.py index 810fb07ac9..92f3223139 100644 --- a/tests/output/python/tests/requests/insights_test.py +++ b/tests/output/python/tests/requests/insights_test.py @@ -481,7 +481,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1715904000000, + "timestamp": 1716163200000, "objectIDs": [ "9780545139700", "9780439784542", @@ -494,7 +494,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1715904000000, + "timestamp": 1716163200000, "objectIDs": [ "9780545139700", "9780439784542", @@ -509,7 +509,7 @@ async def test_push_events_1(self): assert _req.query_parameters.items() == {}.items() assert _req.headers.items() >= {}.items() assert loads(_req.data) == loads( - """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"]}]}""" + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"]}]}""" ) raw_resp = await InsightsClient( @@ -523,7 +523,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1715904000000, + "timestamp": 1716163200000, "objectIDs": [ "9780545139700", "9780439784542", @@ -536,7 +536,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1715904000000, + "timestamp": 1716163200000, "objectIDs": [ "9780545139700", "9780439784542", @@ -558,7 +558,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1715904000000, + "timestamp": 1716163200000, "objectIDs": [ "9780545139700", "9780439784542", @@ -571,7 +571,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1715904000000, + "timestamp": 1716163200000, "objectIDs": [ "9780545139700", "9780439784542", diff --git a/tests/output/ruby/test/requests/insights_test.rb b/tests/output/ruby/test/requests/insights_test.rb index c3cbcac144..360a16cf29 100644 --- a/tests/output/ruby/test/requests/insights_test.rb +++ b/tests/output/ruby/test/requests/insights_test.rb @@ -365,7 +365,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_715_904_000_000, + timestamp: 1_716_163_200_000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -375,7 +375,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_715_904_000_000, + timestamp: 1_716_163_200_000, object_ids: ["9780545139700", "9780439784542"] ) ] @@ -387,7 +387,7 @@ def test_push_events1 assert_equal({}.to_a, req.query_params.to_a) assert(({}.to_a - req.headers.to_a).empty?, req.headers.to_s) assert_equal( - JSON.parse('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"]}]}'), JSON.parse(req.body) + JSON.parse('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"]}]}'), JSON.parse(req.body) ) res = @e2e_client.push_events_with_http_info( @@ -399,7 +399,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_715_904_000_000, + timestamp: 1_716_163_200_000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -409,7 +409,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_715_904_000_000, + timestamp: 1_716_163_200_000, object_ids: ["9780545139700", "9780439784542"] ) ] @@ -426,7 +426,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_715_904_000_000, + timestamp: 1_716_163_200_000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -436,7 +436,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_715_904_000_000, + timestamp: 1_716_163_200_000, object_ids: ["9780545139700", "9780439784542"] ) ] diff --git a/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala b/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala index ad8597ea1d..20178959c4 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala @@ -597,7 +597,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1715904000000L), + timestamp = Some(1716163200000L), objectIDs = Seq("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -607,7 +607,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1715904000000L), + timestamp = Some(1716163200000L), objectIDs = Seq("9780545139700", "9780439784542") ) ) @@ -620,7 +620,7 @@ class InsightsTest extends AnyFunSuite { assert(res.path == "/1/events") assert(res.method == "POST") val expectedBody = parse( - """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1715904000000,"objectIDs":["9780545139700","9780439784542"]}]}""" + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1716163200000,"objectIDs":["9780545139700","9780439784542"]}]}""" ) val actualBody = parse(res.body.get) assert(actualBody == expectedBody) @@ -634,7 +634,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1715904000000L), + timestamp = Some(1716163200000L), objectIDs = Seq("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -644,7 +644,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1715904000000L), + timestamp = Some(1716163200000L), objectIDs = Seq("9780545139700", "9780439784542") ) ) diff --git a/tests/output/swift/Tests/requests/InsightsTests.swift b/tests/output/swift/Tests/requests/InsightsTests.swift index efa45ca43b..d0cd79847a 100644 --- a/tests/output/swift/Tests/requests/InsightsTests.swift +++ b/tests/output/swift/Tests/requests/InsightsTests.swift @@ -843,7 +843,7 @@ final class InsightsClientRequestsTests: XCTestCase { queryID: "43b15df305339e827f0ac0bdc5ebcaa7", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_715_904_000_000) + timestamp: Int64(1_716_163_200_000) )), EventsItems.viewedObjectIDs(ViewedObjectIDs( eventName: "Product Detail Page Viewed", @@ -852,7 +852,7 @@ final class InsightsClientRequestsTests: XCTestCase { objectIDs: ["9780545139700", "9780439784542"], userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_715_904_000_000) + timestamp: Int64(1_716_163_200_000) )), ])) let responseBodyData = try XCTUnwrap(response.bodyData) @@ -862,7 +862,7 @@ final class InsightsClientRequestsTests: XCTestCase { let echoResponseBodyJSON = try XCTUnwrap(echoResponseBodyData.jsonString) let expectedBodyData = - "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1715904000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1715904000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}" + "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1716163200000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1716163200000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}" .data(using: .utf8) let expectedBodyJSON = try XCTUnwrap(expectedBodyData?.jsonString) @@ -887,7 +887,7 @@ final class InsightsClientRequestsTests: XCTestCase { queryID: "43b15df305339e827f0ac0bdc5ebcaa7", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_715_904_000_000) + timestamp: Int64(1_716_163_200_000) )), EventsItems.viewedObjectIDs(ViewedObjectIDs( eventName: "Product Detail Page Viewed", @@ -896,7 +896,7 @@ final class InsightsClientRequestsTests: XCTestCase { objectIDs: ["9780545139700", "9780439784542"], userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_715_904_000_000) + timestamp: Int64(1_716_163_200_000) )), ])) let e2eResponseBody = try XCTUnwrap(e2eResponse.body)