diff --git a/clients/algoliasearch-client-python/algoliasearch/abtesting/client.py b/clients/algoliasearch-client-python/algoliasearch/abtesting/client.py index 5ee554d995..2cb500990e 100644 --- a/clients/algoliasearch-client-python/algoliasearch/abtesting/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/abtesting/client.py @@ -132,6 +132,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def add_ab_tests_with_http_info( self, add_ab_tests_request: Union[AddABTestsRequest, dict[str, Any]], @@ -977,6 +981,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def add_ab_tests_with_http_info( self, add_ab_tests_request: Union[AddABTestsRequest, dict[str, Any]], diff --git a/clients/algoliasearch-client-python/algoliasearch/abtesting/config.py b/clients/algoliasearch-client-python/algoliasearch/abtesting/config.py index bf86abf447..3f56da768a 100644 --- a/clients/algoliasearch-client-python/algoliasearch/abtesting/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/abtesting/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -15,7 +16,8 @@ def __init__( ) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("Abtesting") + self._user_agent = UserAgent() + self.add_user_agent("Abtesting", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -26,7 +28,7 @@ def __init__( self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/clients/algoliasearch-client-python/algoliasearch/analytics/client.py b/clients/algoliasearch-client-python/algoliasearch/analytics/client.py index aac6b2e165..b86810e107 100644 --- a/clients/algoliasearch-client-python/algoliasearch/analytics/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/analytics/client.py @@ -172,6 +172,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def custom_delete_with_http_info( self, path: Annotated[ @@ -3207,6 +3211,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/analytics/config.py b/clients/algoliasearch-client-python/algoliasearch/analytics/config.py index ffdf6eff15..48394efee1 100644 --- a/clients/algoliasearch-client-python/algoliasearch/analytics/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/analytics/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -15,7 +16,8 @@ def __init__( ) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("Analytics") + self._user_agent = UserAgent() + self.add_user_agent("Analytics", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -26,7 +28,7 @@ def __init__( self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/clients/algoliasearch-client-python/algoliasearch/ingestion/client.py b/clients/algoliasearch-client-python/algoliasearch/ingestion/client.py index ef54ff3637..730c0dff6b 100644 --- a/clients/algoliasearch-client-python/algoliasearch/ingestion/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/ingestion/client.py @@ -209,6 +209,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def create_authentication_with_http_info( self, authentication_create: Union[AuthenticationCreate, dict[str, Any]], @@ -4933,6 +4937,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def create_authentication_with_http_info( self, authentication_create: Union[AuthenticationCreate, dict[str, Any]], diff --git a/clients/algoliasearch-client-python/algoliasearch/ingestion/config.py b/clients/algoliasearch-client-python/algoliasearch/ingestion/config.py index eab033954b..d2502218f1 100644 --- a/clients/algoliasearch-client-python/algoliasearch/ingestion/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/ingestion/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -12,7 +13,8 @@ def __init__( ) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("Ingestion") + self._user_agent = UserAgent() + self.add_user_agent("Ingestion", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -23,7 +25,7 @@ def __init__( self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/clients/algoliasearch-client-python/algoliasearch/insights/client.py b/clients/algoliasearch-client-python/algoliasearch/insights/client.py index b32da7720d..784d513465 100644 --- a/clients/algoliasearch-client-python/algoliasearch/insights/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/insights/client.py @@ -118,6 +118,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def custom_delete_with_http_info( self, path: Annotated[ @@ -653,6 +657,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/insights/config.py b/clients/algoliasearch-client-python/algoliasearch/insights/config.py index 076c7ebb79..c636a67279 100644 --- a/clients/algoliasearch-client-python/algoliasearch/insights/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/insights/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -15,7 +16,8 @@ def __init__( ) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("Insights") + self._user_agent = UserAgent() + self.add_user_agent("Insights", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -26,7 +28,7 @@ def __init__( self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/clients/algoliasearch-client-python/algoliasearch/monitoring/client.py b/clients/algoliasearch-client-python/algoliasearch/monitoring/client.py index 9a31ae2ca2..f61736c47c 100644 --- a/clients/algoliasearch-client-python/algoliasearch/monitoring/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/monitoring/client.py @@ -124,6 +124,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def custom_delete_with_http_info( self, path: Annotated[ @@ -995,6 +999,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/monitoring/config.py b/clients/algoliasearch-client-python/algoliasearch/monitoring/config.py index 1f4d3856e0..035d4eaccb 100644 --- a/clients/algoliasearch-client-python/algoliasearch/monitoring/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/monitoring/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -10,7 +11,8 @@ class MonitoringConfig(BaseConfig): def __init__(self, app_id: Optional[str], api_key: Optional[str]) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("Monitoring") + self._user_agent = UserAgent() + self.add_user_agent("Monitoring", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -21,7 +23,7 @@ def __init__(self, app_id: Optional[str], api_key: Optional[str]) -> None: self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/clients/algoliasearch-client-python/algoliasearch/personalization/client.py b/clients/algoliasearch-client-python/algoliasearch/personalization/client.py index 809f9589d2..4fa105c787 100644 --- a/clients/algoliasearch-client-python/algoliasearch/personalization/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/personalization/client.py @@ -128,6 +128,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def custom_delete_with_http_info( self, path: Annotated[ @@ -777,6 +781,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def custom_delete_with_http_info( self, path: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/personalization/config.py b/clients/algoliasearch-client-python/algoliasearch/personalization/config.py index 077ea60a92..c538a140bc 100644 --- a/clients/algoliasearch-client-python/algoliasearch/personalization/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/personalization/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -12,7 +13,8 @@ def __init__( ) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("Personalization") + self._user_agent = UserAgent() + self.add_user_agent("Personalization", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -23,7 +25,7 @@ def __init__( self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/clients/algoliasearch-client-python/algoliasearch/query_suggestions/client.py b/clients/algoliasearch-client-python/algoliasearch/query_suggestions/client.py index e01bc8f365..b5db2a19a6 100644 --- a/clients/algoliasearch-client-python/algoliasearch/query_suggestions/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/query_suggestions/client.py @@ -126,6 +126,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def create_config_with_http_info( self, configuration_with_index: Union[ConfigurationWithIndex, dict[str, Any]], @@ -941,6 +945,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def create_config_with_http_info( self, configuration_with_index: Union[ConfigurationWithIndex, dict[str, Any]], diff --git a/clients/algoliasearch-client-python/algoliasearch/query_suggestions/config.py b/clients/algoliasearch-client-python/algoliasearch/query_suggestions/config.py index d47b95ba75..c4d6621226 100644 --- a/clients/algoliasearch-client-python/algoliasearch/query_suggestions/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/query_suggestions/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -12,7 +13,8 @@ def __init__( ) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("QuerySuggestions") + self._user_agent = UserAgent() + self.add_user_agent("QuerySuggestions", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -23,7 +25,7 @@ def __init__( self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/client.py b/clients/algoliasearch-client-python/algoliasearch/recommend/client.py index 77768ae5d6..1996e67ec7 100644 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/client.py @@ -135,6 +135,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def batch_recommend_rules_with_http_info( self, index_name: Annotated[ @@ -1115,6 +1119,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def batch_recommend_rules_with_http_info( self, index_name: Annotated[ diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/config.py b/clients/algoliasearch-client-python/algoliasearch/recommend/config.py index 1c01a3c183..c68016c6b6 100644 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import CallType, Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -10,7 +11,8 @@ class RecommendConfig(BaseConfig): def __init__(self, app_id: Optional[str], api_key: Optional[str]) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("Recommend") + self._user_agent = UserAgent() + self.add_user_agent("Recommend", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -21,7 +23,7 @@ def __init__(self, app_id: Optional[str], api_key: Optional[str]) -> None: self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/clients/algoliasearch-client-python/algoliasearch/search/client.py b/clients/algoliasearch-client-python/algoliasearch/search/client.py index 48583a7923..d808fa3336 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/client.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/client.py @@ -216,6 +216,10 @@ async 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_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + async def wait_for_task( self, index_name: str, @@ -5228,6 +5232,10 @@ 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) + def add_user_agent(self, segment: str, version: Optional[str] = None) -> None: + """adds a segment to the default user agent, and update the headers sent with each requests as well""" + self._transporter.config.add_user_agent(segment, version) + def wait_for_task( self, index_name: str, diff --git a/clients/algoliasearch-client-python/algoliasearch/search/config.py b/clients/algoliasearch-client-python/algoliasearch/search/config.py index 4e2ff94a1b..56dda56afb 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/config.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/config.py @@ -1,6 +1,7 @@ from os import environ from typing import Optional +from algoliasearch import __version__ from algoliasearch.http.base_config import BaseConfig from algoliasearch.http.hosts import CallType, Host, HostsCollection from algoliasearch.http.user_agent import UserAgent @@ -10,7 +11,8 @@ class SearchConfig(BaseConfig): def __init__(self, app_id: Optional[str], api_key: Optional[str]) -> None: super().__init__(app_id, api_key) - user_agent = UserAgent().add("Search") + self._user_agent = UserAgent() + self.add_user_agent("Search", __version__) if app_id is None or not app_id: raise ValueError("`app_id` is missing.") @@ -21,7 +23,7 @@ def __init__(self, app_id: Optional[str], api_key: Optional[str]) -> None: self.headers = { "x-algolia-application-id": app_id, "x-algolia-api-key": api_key, - "user-agent": user_agent.get(), + "user-agent": self._user_agent.get(), "content-type": "application/json", } diff --git a/tests/output/csharp/src/generated/e2e/Insights.test.cs b/tests/output/csharp/src/generated/e2e/Insights.test.cs index db2f52728a..059b2d5f68 100644 --- a/tests/output/csharp/src/generated/e2e/Insights.test.cs +++ b/tests/output/csharp/src/generated/e2e/Insights.test.cs @@ -63,7 +63,7 @@ public async Task PushEventsTest1() Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1731974400000L, + Timestamp = 1732233600000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, QueryID = "43b15df305339e827f0ac0bdc5ebcaa7", } @@ -76,7 +76,7 @@ public async Task PushEventsTest1() Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1731974400000L, + Timestamp = 1732233600000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, } ), diff --git a/tests/output/csharp/src/generated/requests/Insights.test.cs b/tests/output/csharp/src/generated/requests/Insights.test.cs index 9a2e270534..176005a5b4 100644 --- a/tests/output/csharp/src/generated/requests/Insights.test.cs +++ b/tests/output/csharp/src/generated/requests/Insights.test.cs @@ -580,7 +580,7 @@ await client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1731974400000L, + Timestamp = 1732233600000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, QueryID = "43b15df305339e827f0ac0bdc5ebcaa7", } @@ -593,7 +593,7 @@ await client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1731974400000L, + Timestamp = 1732233600000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, } ), @@ -605,7 +605,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\":1731974400000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1731974400000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", + "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1732233600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1732233600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", req.Body, new JsonDiffConfig(false) ); diff --git a/tests/output/dart/test/requests/insights_test.dart b/tests/output/dart/test/requests/insights_test.dart index 5a84b7503c..4805b8a631 100644 --- a/tests/output/dart/test/requests/insights_test.dart +++ b/tests/output/dart/test/requests/insights_test.dart @@ -635,7 +635,7 @@ void main() { index: "products", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: 1731974400000, + timestamp: 1732233600000, objectIDs: [ "9780545139700", "9780439784542", @@ -648,7 +648,7 @@ void main() { index: "products", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: 1731974400000, + timestamp: 1732233600000, objectIDs: [ "9780545139700", "9780439784542", @@ -661,7 +661,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":1731974400000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1731974400000,"objectIDs":["9780545139700","9780439784542"]}]}"""); + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"]}]}"""); }, ), ); diff --git a/tests/output/go/tests/e2e/insights_test.go b/tests/output/go/tests/e2e/insights_test.go index 0583813bce..49e4852661 100644 --- a/tests/output/go/tests/e2e/insights_test.go +++ b/tests/output/go/tests/e2e/insights_test.go @@ -38,9 +38,9 @@ func TestInsightsE2E_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(1731974400000).SetObjectIDs( + insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1732233600000).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(1731974400000).SetObjectIDs( + insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1732233600000).SetObjectIDs( []string{"9780545139700", "9780439784542"}))}), )) require.NoError(t, err) diff --git a/tests/output/go/tests/requests/insights_test.go b/tests/output/go/tests/requests/insights_test.go index 7bcf77ed38..87a245aeb2 100644 --- a/tests/output/go/tests/requests/insights_test.go +++ b/tests/output/go/tests/requests/insights_test.go @@ -433,9 +433,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(1731974400000).SetObjectIDs( + insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1732233600000).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(1731974400000).SetObjectIDs( + insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1732233600000).SetObjectIDs( []string{"9780545139700", "9780439784542"}))}), )) require.NoError(t, err) @@ -444,7 +444,7 @@ 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":1731974400000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1731974400000,"objectIDs":["9780545139700","9780439784542"]}]}`) + ja.Assertf(*echo.Body, `{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"]}]}`) }) t.Run("ConvertedObjectIDsAfterSearch", func(t *testing.T) { _, err := client.PushEvents(client.NewApiPushEventsRequest( diff --git a/tests/output/java/src/test/java/com/algolia/e2e/Insights.test.java b/tests/output/java/src/test/java/com/algolia/e2e/Insights.test.java index 2f4a808626..913309ccda 100644 --- a/tests/output/java/src/test/java/com/algolia/e2e/Insights.test.java +++ b/tests/output/java/src/test/java/com/algolia/e2e/Insights.test.java @@ -50,7 +50,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1731974400000L) + .setTimestamp(1732233600000L) .setObjectIDs(Arrays.asList("9780545139700", "9780439784542")) .setQueryID("43b15df305339e827f0ac0bdc5ebcaa7"), new ViewedObjectIDs() @@ -59,7 +59,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1731974400000L) + .setTimestamp(1732233600000L) .setObjectIDs(Arrays.asList("9780545139700", "9780439784542")) ) ) 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 6e7cc7aa81..a5c073ff21 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 @@ -720,7 +720,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1731974400000L) + .setTimestamp(1732233600000L) .setObjectIDs(Arrays.asList("9780545139700", "9780439784542")) .setQueryID("43b15df305339e827f0ac0bdc5ebcaa7"), new ViewedObjectIDs() @@ -729,7 +729,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1731974400000L) + .setTimestamp(1732233600000L) .setObjectIDs(Arrays.asList("9780545139700", "9780439784542")) ) ) @@ -741,9 +741,9 @@ void pushEventsTest1() { assertDoesNotThrow(() -> JSONAssert.assertEquals( "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product" + - " Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1731974400000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product" + + " Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1732233600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product" + " Detail Page" + - " Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1731974400000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", + " Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1732233600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", req.body, JSONCompareMode.STRICT ) diff --git a/tests/output/javascript/src/e2e/insights.test.ts b/tests/output/javascript/src/e2e/insights.test.ts index b64d098ca6..a8b56600eb 100644 --- a/tests/output/javascript/src/e2e/insights.test.ts +++ b/tests/output/javascript/src/e2e/insights.test.ts @@ -30,7 +30,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1731974400000, + timestamp: 1732233600000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -40,7 +40,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1731974400000, + timestamp: 1732233600000, objectIDs: ['9780545139700', '9780439784542'], }, ], diff --git a/tests/output/javascript/src/requests/insights.test.ts b/tests/output/javascript/src/requests/insights.test.ts index 4e7312ece1..46d350872a 100644 --- a/tests/output/javascript/src/requests/insights.test.ts +++ b/tests/output/javascript/src/requests/insights.test.ts @@ -311,7 +311,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1731974400000, + timestamp: 1732233600000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -321,7 +321,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1731974400000, + timestamp: 1732233600000, objectIDs: ['9780545139700', '9780439784542'], }, ], @@ -337,7 +337,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1731974400000, + timestamp: 1732233600000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -347,7 +347,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1731974400000, + timestamp: 1732233600000, objectIDs: ['9780545139700', '9780439784542'], }, ], diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/e2e/InsightsTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/e2e/InsightsTest.kt index 3569e1899f..46fb8acdf9 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/e2e/InsightsTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/e2e/InsightsTest.kt @@ -41,7 +41,7 @@ class InsightsTest { index = "products", userToken = "user-123456", authenticatedUserToken = "user-123456", - timestamp = 1731974400000L, + timestamp = 1732233600000L, objectIDs = listOf("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7", ), @@ -51,7 +51,7 @@ class InsightsTest { index = "products", userToken = "user-123456", authenticatedUserToken = "user-123456", - timestamp = 1731974400000L, + timestamp = 1732233600000L, objectIDs = listOf("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 c6c14b3519..3e7f823e44 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 = 1731974400000L, + timestamp = 1732233600000L, objectIDs = listOf("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7", ), @@ -539,7 +539,7 @@ class InsightsTest { index = "products", userToken = "user-123456", authenticatedUserToken = "user-123456", - timestamp = 1731974400000L, + timestamp = 1732233600000L, 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":1731974400000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1731974400000,"objectIDs":["9780545139700","9780439784542"]}]}""", it.body) + assertJsonBody("""{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"]}]}""", it.body) }, ) } diff --git a/tests/output/php/src/e2e/InsightsTest.php b/tests/output/php/src/e2e/InsightsTest.php index a5f5c624cf..03a87b769b 100644 --- a/tests/output/php/src/e2e/InsightsTest.php +++ b/tests/output/php/src/e2e/InsightsTest.php @@ -35,7 +35,7 @@ public function testPushEvents1(): void 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1731974400000, + 'timestamp' => 1732233600000, 'objectIDs' => [ '9780545139700', @@ -49,7 +49,7 @@ public function testPushEvents1(): void 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1731974400000, + 'timestamp' => 1732233600000, 'objectIDs' => [ '9780545139700', diff --git a/tests/output/php/src/requests/InsightsTest.php b/tests/output/php/src/requests/InsightsTest.php index 75e6e3ea2d..57e273a89a 100644 --- a/tests/output/php/src/requests/InsightsTest.php +++ b/tests/output/php/src/requests/InsightsTest.php @@ -527,7 +527,7 @@ public function testPushEvents1(): void 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1731974400000, + 'timestamp' => 1732233600000, 'objectIDs' => [ '9780545139700', @@ -541,7 +541,7 @@ public function testPushEvents1(): void 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1731974400000, + 'timestamp' => 1732233600000, 'objectIDs' => [ '9780545139700', @@ -556,7 +556,7 @@ public function testPushEvents1(): void [ 'path' => '/1/events', 'method' => 'POST', - 'body' => json_decode('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1731974400000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1731974400000,"objectIDs":["9780545139700","9780439784542"]}]}'), + 'body' => json_decode('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"]}]}'), ], ]); } diff --git a/tests/output/python/tests/e2e/insights_test.py b/tests/output/python/tests/e2e/insights_test.py index e98e7370be..1a8f80e5e8 100644 --- a/tests/output/python/tests/e2e/insights_test.py +++ b/tests/output/python/tests/e2e/insights_test.py @@ -36,7 +36,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -49,7 +49,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -71,7 +71,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -84,7 +84,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -127,7 +127,7 @@ def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -140,7 +140,7 @@ def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -162,7 +162,7 @@ def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -175,7 +175,7 @@ def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", diff --git a/tests/output/python/tests/requests/insights_test.py b/tests/output/python/tests/requests/insights_test.py index 1a63fec844..7e0ff6348f 100644 --- a/tests/output/python/tests/requests/insights_test.py +++ b/tests/output/python/tests/requests/insights_test.py @@ -463,7 +463,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -476,7 +476,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -491,7 +491,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":1731974400000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1731974400000,"objectIDs":["9780545139700","9780439784542"]}]}""" + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"]}]}""" ) async def test_push_events_2(self): @@ -1060,7 +1060,7 @@ def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -1073,7 +1073,7 @@ def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1731974400000, + "timestamp": 1732233600000, "objectIDs": [ "9780545139700", "9780439784542", @@ -1088,7 +1088,7 @@ 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":1731974400000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1731974400000,"objectIDs":["9780545139700","9780439784542"]}]}""" + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"]}]}""" ) def test_push_events_2(self): diff --git a/tests/output/ruby/test/e2e/insights_test.rb b/tests/output/ruby/test/e2e/insights_test.rb index ff17c89900..d1ba1b1f65 100644 --- a/tests/output/ruby/test/e2e/insights_test.rb +++ b/tests/output/ruby/test/e2e/insights_test.rb @@ -27,7 +27,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1731974400000, + timestamp: 1732233600000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -37,7 +37,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1731974400000, + timestamp: 1732233600000, object_ids: ["9780545139700", "9780439784542"] ) ] @@ -54,7 +54,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1731974400000, + timestamp: 1732233600000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -64,7 +64,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1731974400000, + timestamp: 1732233600000, object_ids: ["9780545139700", "9780439784542"] ) ] diff --git a/tests/output/ruby/test/requests/insights_test.rb b/tests/output/ruby/test/requests/insights_test.rb index d584acf0ce..66e502019a 100644 --- a/tests/output/ruby/test/requests/insights_test.rb +++ b/tests/output/ruby/test/requests/insights_test.rb @@ -337,7 +337,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1731974400000, + timestamp: 1732233600000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -347,7 +347,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1731974400000, + timestamp: 1732233600000, object_ids: ["9780545139700", "9780439784542"] ) ] @@ -360,7 +360,7 @@ def test_push_events1 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\":1731974400000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1731974400000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}" + "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1732233600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1732233600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}" ), JSON.parse(req.body) ) diff --git a/tests/output/scala/src/test/scala/algoliasearch/e2e/InsightsTest.scala b/tests/output/scala/src/test/scala/algoliasearch/e2e/InsightsTest.scala index a4da796de7..6cc9bb6846 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/e2e/InsightsTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/e2e/InsightsTest.scala @@ -49,7 +49,7 @@ class InsightsTestE2E extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1731974400000L), + timestamp = Some(1732233600000L), objectIDs = Seq("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -59,7 +59,7 @@ class InsightsTestE2E extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1731974400000L), + timestamp = Some(1732233600000L), objectIDs = Seq("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 3f8d1d504f..4d3a4d0b46 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala @@ -574,7 +574,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1731974400000L), + timestamp = Some(1732233600000L), objectIDs = Seq("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -584,7 +584,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1731974400000L), + timestamp = Some(1732233600000L), objectIDs = Seq("9780545139700", "9780439784542") ) ) @@ -597,7 +597,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":1731974400000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1731974400000,"objectIDs":["9780545139700","9780439784542"]}]}""" + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1732233600000,"objectIDs":["9780545139700","9780439784542"]}]}""" ) val actualBody = parse(res.body.get) assert(actualBody == expectedBody) diff --git a/tests/output/swift/Tests/e2e/InsightsTests.swift b/tests/output/swift/Tests/e2e/InsightsTests.swift index bafd443a56..66b00b2b52 100644 --- a/tests/output/swift/Tests/e2e/InsightsTests.swift +++ b/tests/output/swift/Tests/e2e/InsightsTests.swift @@ -65,7 +65,7 @@ final class InsightsClientRequestsTestsE2E: XCTestCase { queryID: "43b15df305339e827f0ac0bdc5ebcaa7", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_731_974_400_000) + timestamp: Int64(1_732_233_600_000) )), EventsItems.viewedObjectIDs(ViewedObjectIDs( eventName: "Product Detail Page Viewed", @@ -74,7 +74,7 @@ final class InsightsClientRequestsTestsE2E: XCTestCase { objectIDs: ["9780545139700", "9780439784542"], userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_731_974_400_000) + timestamp: Int64(1_732_233_600_000) )), ])) let responseBody = try XCTUnwrap(response.body) diff --git a/tests/output/swift/Tests/requests/InsightsTests.swift b/tests/output/swift/Tests/requests/InsightsTests.swift index 8833097e9e..dc0093d189 100644 --- a/tests/output/swift/Tests/requests/InsightsTests.swift +++ b/tests/output/swift/Tests/requests/InsightsTests.swift @@ -785,7 +785,7 @@ final class InsightsClientRequestsTests: XCTestCase { queryID: "43b15df305339e827f0ac0bdc5ebcaa7", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_731_974_400_000) + timestamp: Int64(1_732_233_600_000) )), EventsItems.viewedObjectIDs(ViewedObjectIDs( eventName: "Product Detail Page Viewed", @@ -794,7 +794,7 @@ final class InsightsClientRequestsTests: XCTestCase { objectIDs: ["9780545139700", "9780439784542"], userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_731_974_400_000) + timestamp: Int64(1_732_233_600_000) )), ])) let responseBodyData = try XCTUnwrap(response.bodyData) @@ -804,7 +804,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\":1731974400000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1731974400000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}" + "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1732233600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1732233600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}" .data(using: .utf8) let expectedBodyJSON = try XCTUnwrap(expectedBodyData?.jsonString)