diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 21fa4455..d940b600 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.54.0"
+ ".": "0.55.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index db850fa2..fa5ea03f 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 103
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-d4de4432ed5c94723a807b2ac182da745b8fee526789255579af38561763c7e0.yml
-openapi_spec_hash: c217ca0ab6d9e5ace83fea51c21febdd
-config_hash: f47f5fe0661d0c081ac6f2364b4cf41a
+configured_endpoints: 102
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-7f89d003ee5886a49dcba4317709b3631185a517c455e0dbf12130dadc1a73c3.yml
+openapi_spec_hash: b6057ce27ebb04cdd19c0f006774ce65
+config_hash: ff20af11692df5be71f1ef46d41ef365
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c2bff0f6..20628def 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,17 @@
# Changelog
+## 0.55.0 (2026-07-30)
+
+Full Changelog: [v0.54.0...v0.55.0](https://github.com/cooper-square-technologies/profound-python-sdk/compare/v0.54.0...v0.55.0)
+
+### Features
+
+* **api:** api update ([2c7ba50](https://github.com/cooper-square-technologies/profound-python-sdk/commit/2c7ba503a35b7048c33de728d0fce1c5c211b423))
+* **api:** api update ([6b26be9](https://github.com/cooper-square-technologies/profound-python-sdk/commit/6b26be92d4436ac73524028399810067c59ad83c))
+* **api:** api update ([bdcfe8e](https://github.com/cooper-square-technologies/profound-python-sdk/commit/bdcfe8e2187683fae95a5ff46e4db4990127f0cd))
+* **api:** api update ([3776adc](https://github.com/cooper-square-technologies/profound-python-sdk/commit/3776adca4919f63f811ad563550a80e1dfda8eaf))
+* **api:** shopping v2 endpoints ([c1b09be](https://github.com/cooper-square-technologies/profound-python-sdk/commit/c1b09be0bbcda1b4fbd243ff8aa834bc86492027))
+
## 0.54.0 (2026-07-24)
Full Changelog: [v0.53.0...v0.54.0](https://github.com/cooper-square-technologies/profound-python-sdk/compare/v0.53.0...v0.54.0)
diff --git a/api.md b/api.md
index ffcbbbf3..6b557ba0 100644
--- a/api.md
+++ b/api.md
@@ -64,6 +64,7 @@ from profound.types.organizations import (
CategoryAssetsResponse,
CategoryCreatePromptsResponse,
CategoryGetCategoryPersonasResponse,
+ CategoryGetCitationCategoriesResponse,
CategoryPromptsResponse,
CategoryRetrieveRegionsResponse,
CategoryTagsResponse,
@@ -79,6 +80,7 @@ Methods:
- client.organizations.categories.assets(category_id) -> CategoryAssetsResponse
- client.organizations.categories.create_prompts(category_id, \*\*params) -> CategoryCreatePromptsResponse
- client.organizations.categories.get_category_personas(category_id) -> CategoryGetCategoryPersonasResponse
+- client.organizations.categories.get_citation_categories(category_id) -> CategoryGetCitationCategoriesResponse
- client.organizations.categories.prompts(category_id, \*\*params) -> CategoryPromptsResponse
- client.organizations.categories.retrieve_regions(category_id) -> CategoryRetrieveRegionsResponse
- client.organizations.categories.tags(category_id) -> CategoryTagsResponse
@@ -180,31 +182,27 @@ from profound.types.reports import (
BrandNameFilter,
MerchantNameFilter,
ProductNameFilter,
- ShoppingAllItemsWithMerchantsResponse,
- ShoppingExecutionsResponse,
- ShoppingItemVisibilityResponse,
- ShoppingMerchantByItemsResponse,
- ShoppingMerchantDistributionResponse,
- ShoppingMerchantShareResponse,
- ShoppingMerchantVisibilityByBrandResponse,
- ShoppingProductMerchantURLsResponse,
+ ShoppingBrandsResponse,
+ ShoppingMerchantsResponse,
+ ShoppingProductsResponse,
+ ShoppingStreamBrandsResponse,
+ ShoppingStreamMerchantsResponse,
+ ShoppingStreamProductsResponse,
+ ShoppingStreamTriggerRateResponse,
ShoppingTriggerRateResponse,
- ShoppingVisibilityResponse,
)
```
Methods:
-- client.reports.shopping.all_items_with_merchants(\*\*params) -> ShoppingAllItemsWithMerchantsResponse
-- client.reports.shopping.executions(\*\*params) -> ShoppingExecutionsResponse
-- client.reports.shopping.item_visibility(\*\*params) -> ShoppingItemVisibilityResponse
-- client.reports.shopping.merchant_by_items(\*\*params) -> ShoppingMerchantByItemsResponse
-- client.reports.shopping.merchant_distribution(\*\*params) -> ShoppingMerchantDistributionResponse
-- client.reports.shopping.merchant_share(\*\*params) -> ShoppingMerchantShareResponse
-- client.reports.shopping.merchant_visibility_by_brand(\*\*params) -> ShoppingMerchantVisibilityByBrandResponse
-- client.reports.shopping.product_merchant_urls(\*\*params) -> ShoppingProductMerchantURLsResponse
-- client.reports.shopping.trigger_rate(\*\*params) -> ShoppingTriggerRateResponse
-- client.reports.shopping.visibility(\*\*params) -> ShoppingVisibilityResponse
+- client.reports.shopping.brands(\*\*params) -> ShoppingBrandsResponse
+- client.reports.shopping.merchants(\*\*params) -> ShoppingMerchantsResponse
+- client.reports.shopping.products(\*\*params) -> ShoppingProductsResponse
+- client.reports.shopping.stream_brands(\*\*params) -> ShoppingStreamBrandsResponse
+- client.reports.shopping.stream_merchants(\*\*params) -> ShoppingStreamMerchantsResponse
+- client.reports.shopping.stream_products(\*\*params) -> ShoppingStreamProductsResponse
+- client.reports.shopping.stream_trigger_rate(\*\*params) -> ShoppingStreamTriggerRateResponse
+- client.reports.shopping.trigger_rate(\*\*params) -> ShoppingTriggerRateResponse
## Accuracy
diff --git a/pyproject.toml b/pyproject.toml
index ac99ab4a..9c36160a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "profound"
-version = "0.54.0"
+version = "0.55.0"
description = "The official Python library for the profound API"
dynamic = ["readme"]
license = "Apache-2.0"
diff --git a/src/profound/_version.py b/src/profound/_version.py
index 735d55b2..08b468b7 100644
--- a/src/profound/_version.py
+++ b/src/profound/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "profound"
-__version__ = "0.54.0" # x-release-please-version
+__version__ = "0.55.0" # x-release-please-version
diff --git a/src/profound/resources/organizations/categories.py b/src/profound/resources/organizations/categories.py
index de074b28..0cdfb20f 100644
--- a/src/profound/resources/organizations/categories.py
+++ b/src/profound/resources/organizations/categories.py
@@ -35,6 +35,7 @@
from ...types.organizations.category_retrieve_regions_response import CategoryRetrieveRegionsResponse
from ...types.organizations.category_update_prompt_status_response import CategoryUpdatePromptStatusResponse
from ...types.organizations.category_get_category_personas_response import CategoryGetCategoryPersonasResponse
+from ...types.organizations.category_get_citation_categories_response import CategoryGetCitationCategoriesResponse
__all__ = ["CategoriesResource", "AsyncCategoriesResource"]
@@ -214,6 +215,40 @@ def get_category_personas(
cast_to=CategoryGetCategoryPersonasResponse,
)
+ def get_citation_categories(
+ self,
+ category_id: str,
+ *,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> CategoryGetCitationCategoriesResponse:
+ """
+ Get the citation categories for a category: the built-in buckets plus any custom
+ categories.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not category_id:
+ raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}")
+ return self._get(
+ path_template("/v1/org/categories/{category_id}/citation-categories", category_id=category_id),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=CategoryGetCitationCategoriesResponse,
+ )
+
def prompts(
self,
category_id: str,
@@ -690,6 +725,40 @@ async def get_category_personas(
cast_to=CategoryGetCategoryPersonasResponse,
)
+ async def get_citation_categories(
+ self,
+ category_id: str,
+ *,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> CategoryGetCitationCategoriesResponse:
+ """
+ Get the citation categories for a category: the built-in buckets plus any custom
+ categories.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not category_id:
+ raise ValueError(f"Expected a non-empty value for `category_id` but received {category_id!r}")
+ return await self._get(
+ path_template("/v1/org/categories/{category_id}/citation-categories", category_id=category_id),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=CategoryGetCitationCategoriesResponse,
+ )
+
async def prompts(
self,
category_id: str,
@@ -1005,6 +1074,9 @@ def __init__(self, categories: CategoriesResource) -> None:
self.get_category_personas = to_raw_response_wrapper(
categories.get_category_personas,
)
+ self.get_citation_categories = to_raw_response_wrapper(
+ categories.get_citation_categories,
+ )
self.prompts = to_raw_response_wrapper(
categories.prompts,
)
@@ -1041,6 +1113,9 @@ def __init__(self, categories: AsyncCategoriesResource) -> None:
self.get_category_personas = async_to_raw_response_wrapper(
categories.get_category_personas,
)
+ self.get_citation_categories = async_to_raw_response_wrapper(
+ categories.get_citation_categories,
+ )
self.prompts = async_to_raw_response_wrapper(
categories.prompts,
)
@@ -1077,6 +1152,9 @@ def __init__(self, categories: CategoriesResource) -> None:
self.get_category_personas = to_streamed_response_wrapper(
categories.get_category_personas,
)
+ self.get_citation_categories = to_streamed_response_wrapper(
+ categories.get_citation_categories,
+ )
self.prompts = to_streamed_response_wrapper(
categories.prompts,
)
@@ -1113,6 +1191,9 @@ def __init__(self, categories: AsyncCategoriesResource) -> None:
self.get_category_personas = async_to_streamed_response_wrapper(
categories.get_category_personas,
)
+ self.get_citation_categories = async_to_streamed_response_wrapper(
+ categories.get_citation_categories,
+ )
self.prompts = async_to_streamed_response_wrapper(
categories.prompts,
)
diff --git a/src/profound/resources/prompts.py b/src/profound/resources/prompts.py
index aea37d94..49dd4f2b 100644
--- a/src/profound/resources/prompts.py
+++ b/src/profound/resources/prompts.py
@@ -124,6 +124,7 @@ def answers_v2(
"response",
"mentions",
"citations",
+ "citation_details",
"search_queries",
"analysis_types",
"sentiment_claims",
@@ -152,8 +153,9 @@ def answers_v2(
include: Which row fields to return: `run_id`, `date`, `model`, `topic`, `topic_id`,
`region`, `persona`, `tags`, `prompt`, `prompt_id`, `response`, `mentions`,
- `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for
- all of them.
+ `citations`, `citation_details`, `search_queries`, `analysis_types`,
+ `sentiment_claims`. Omit for all fields except `citation_details`, which must be
+ requested explicitly because it is expensive.
limit: Page size; default 10, max 200.
@@ -212,6 +214,7 @@ def stream_answers_v2(
"response",
"mentions",
"citations",
+ "citation_details",
"search_queries",
"analysis_types",
"sentiment_claims",
@@ -240,8 +243,9 @@ def stream_answers_v2(
include: Which row fields to return: `run_id`, `date`, `model`, `topic`, `topic_id`,
`region`, `persona`, `tags`, `prompt`, `prompt_id`, `response`, `mentions`,
- `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for
- all of them.
+ `citations`, `citation_details`, `search_queries`, `analysis_types`,
+ `sentiment_claims`. Omit for all fields except `citation_details`, which must be
+ requested explicitly because it is expensive.
limit: Page size; default 10, max 200.
@@ -377,6 +381,7 @@ async def answers_v2(
"response",
"mentions",
"citations",
+ "citation_details",
"search_queries",
"analysis_types",
"sentiment_claims",
@@ -405,8 +410,9 @@ async def answers_v2(
include: Which row fields to return: `run_id`, `date`, `model`, `topic`, `topic_id`,
`region`, `persona`, `tags`, `prompt`, `prompt_id`, `response`, `mentions`,
- `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for
- all of them.
+ `citations`, `citation_details`, `search_queries`, `analysis_types`,
+ `sentiment_claims`. Omit for all fields except `citation_details`, which must be
+ requested explicitly because it is expensive.
limit: Page size; default 10, max 200.
@@ -465,6 +471,7 @@ async def stream_answers_v2(
"response",
"mentions",
"citations",
+ "citation_details",
"search_queries",
"analysis_types",
"sentiment_claims",
@@ -493,8 +500,9 @@ async def stream_answers_v2(
include: Which row fields to return: `run_id`, `date`, `model`, `topic`, `topic_id`,
`region`, `persona`, `tags`, `prompt`, `prompt_id`, `response`, `mentions`,
- `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for
- all of them.
+ `citations`, `citation_details`, `search_queries`, `analysis_types`,
+ `sentiment_claims`. Omit for all fields except `citation_details`, which must be
+ requested explicitly because it is expensive.
limit: Page size; default 10, max 200.
diff --git a/src/profound/resources/reports/reports.py b/src/profound/resources/reports/reports.py
index d491ac7e..a43f2e51 100644
--- a/src/profound/resources/reports/reports.py
+++ b/src/profound/resources/reports/reports.py
@@ -725,6 +725,8 @@ def query_fanouts(
Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ metrics: Metrics to return for each row.
+
start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
date_interval: Date interval for the report. (only used with date dimension)
@@ -2538,6 +2540,8 @@ async def query_fanouts(
Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ metrics: Metrics to return for each row.
+
start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
date_interval: Date interval for the report. (only used with date dimension)
diff --git a/src/profound/resources/reports/shopping.py b/src/profound/resources/reports/shopping.py
index 60b4371c..f7af32f9 100644
--- a/src/profound/resources/reports/shopping.py
+++ b/src/profound/resources/reports/shopping.py
@@ -2,8 +2,7 @@
from __future__ import annotations
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
+from typing import Any, List, Union, Optional, cast
from typing_extensions import Literal
import httpx
@@ -18,30 +17,26 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
+from ..._streaming import Stream, AsyncStream
from ..._base_client import make_request_options
from ...types.reports import (
- shopping_executions_params,
- shopping_visibility_params,
+ shopping_brands_params,
+ shopping_products_params,
+ shopping_merchants_params,
shopping_trigger_rate_params,
- shopping_merchant_share_params,
- shopping_item_visibility_params,
- shopping_merchant_by_items_params,
- shopping_merchant_distribution_params,
- shopping_product_merchant_urls_params,
- shopping_all_items_with_merchants_params,
- shopping_merchant_visibility_by_brand_params,
+ shopping_stream_brands_params,
+ shopping_stream_products_params,
+ shopping_stream_merchants_params,
+ shopping_stream_trigger_rate_params,
)
-from ...types.shared_params.pagination import Pagination
-from ...types.reports.shopping_executions_response import ShoppingExecutionsResponse
-from ...types.reports.shopping_visibility_response import ShoppingVisibilityResponse
+from ...types.reports.shopping_brands_response import ShoppingBrandsResponse
+from ...types.reports.shopping_products_response import ShoppingProductsResponse
+from ...types.reports.shopping_merchants_response import ShoppingMerchantsResponse
from ...types.reports.shopping_trigger_rate_response import ShoppingTriggerRateResponse
-from ...types.reports.shopping_merchant_share_response import ShoppingMerchantShareResponse
-from ...types.reports.shopping_item_visibility_response import ShoppingItemVisibilityResponse
-from ...types.reports.shopping_merchant_by_items_response import ShoppingMerchantByItemsResponse
-from ...types.reports.shopping_merchant_distribution_response import ShoppingMerchantDistributionResponse
-from ...types.reports.shopping_product_merchant_urls_response import ShoppingProductMerchantURLsResponse
-from ...types.reports.shopping_all_items_with_merchants_response import ShoppingAllItemsWithMerchantsResponse
-from ...types.reports.shopping_merchant_visibility_by_brand_response import ShoppingMerchantVisibilityByBrandResponse
+from ...types.reports.shopping_stream_brands_response import ShoppingStreamBrandsResponse
+from ...types.reports.shopping_stream_products_response import ShoppingStreamProductsResponse
+from ...types.reports.shopping_stream_merchants_response import ShoppingStreamMerchantsResponse
+from ...types.reports.shopping_stream_trigger_rate_response import ShoppingStreamTriggerRateResponse
__all__ = ["ShoppingResource", "AsyncShoppingResource"]
@@ -66,70 +61,43 @@ def with_streaming_response(self) -> ShoppingResourceWithStreamingResponse:
"""
return ShoppingResourceWithStreamingResponse(self)
- def all_items_with_merchants(
+ def brands(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal[
- "period",
- "product_name",
- "brand_name",
- "product_url",
- "product_image_urls",
- "product_price",
- "merchant_names",
- "merchant_prices",
- ]
- ]
- | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_all_items_with_merchants_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_items: SequenceNotStr[str] | Omit = omit,
- include_no_tag: bool | Omit = omit,
- merchant_filter_type: Literal["any", "all"] | Omit = omit,
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "product_rating",
- "product_num_reviews",
- "total_count",
- ]
- ]
- | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- rank_by: Literal["visibility", "average_position", "name"] | Omit = omit,
- search_item: Optional[str] | Omit = omit,
- sort_order: Literal["asc", "desc"] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
+ end_date: str,
+ start_date: str,
+ assets: Union[str, SequenceNotStr[str], None] | Omit = omit,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_brands_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "region", "prompt"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[List[Literal["visibility_score", "average_position", "visibility_rank"]]] | Omit = omit,
+ scope: Literal["owned", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingAllItemsWithMerchantsResponse:
- """Shopping All Items With Merchants
+ ) -> ShoppingBrandsResponse:
+ """
+ Query Shopping Brands V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
+
+ start_date: YYYY-MM-DD, ET, inclusive
+
+ assets: Restrict to these asset names (a name or list). Overrides `scope`.
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ limit: Page size for scope=all; default 10, max 50.
- pagination: Offset-based pagination parameters.
+ max_results: Stream endpoint only: cap the number of streamed rows (default: all).
extra_headers: Send extra headers
@@ -140,75 +108,82 @@ def all_items_with_merchants(
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
- "/v1/reports/shopping/all-items-with-merchants",
+ "/v2/reports/shopping/brands",
body=maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_items": include_items,
- "include_no_tag": include_no_tag,
- "merchant_filter_type": merchant_filter_type,
+ "assets": assets,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "rank_by": rank_by,
- "search_item": search_item,
- "sort_order": sort_order,
- "tag_filter_type": tag_filter_type,
+ "scope": scope,
},
- shopping_all_items_with_merchants_params.ShoppingAllItemsWithMerchantsParams,
+ shopping_brands_params.ShoppingBrandsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingAllItemsWithMerchantsResponse,
+ cast_to=ShoppingBrandsResponse,
)
- def executions(
+ def merchants(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- analysis_filter_type: Literal["any", "all"] | Omit = omit,
- analysis_types: List[Literal["visibility", "sentiment", "sentiment_v2", "accuracy"]] | Omit = omit,
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_executions_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
+ end_date: str,
+ start_date: str,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_merchants_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "brand", "product"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[
+ List[
+ Literal[
+ "merchant_share",
+ "merchant_share_rank",
+ "merchant_visibility",
+ "merchant_visibility_rank",
+ "visibility_rank",
+ "brand_share",
+ "product_visibility",
+ "product_rank",
+ ]
+ ]
+ ]
+ | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingExecutionsResponse:
- """Shopping Executions
+ ) -> ShoppingMerchantsResponse:
+ """
+ Query Shopping Merchants V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ start_date: YYYY-MM-DD, ET, inclusive
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- pagination: Offset-based pagination parameters.
+ group_by: `[]` = distribution; `[brand]` = brand share within each merchant; `[product]` =
+ top products per merchant. `date` (distribution only) adds a time series.
+
+ limit: Page size; default 10, max 50.
+
+ max_results: Stream endpoint only: cap streamed rows.
+
+ metrics: Defaults to the chosen view's metrics; must be valid for that view.
extra_headers: Send extra headers
@@ -219,89 +194,58 @@ def executions(
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
- "/v1/reports/shopping/executions",
+ "/v2/reports/shopping/merchants",
body=maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "analysis_filter_type": analysis_filter_type,
- "analysis_types": analysis_types,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "tag_filter_type": tag_filter_type,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
+ "metrics": metrics,
},
- shopping_executions_params.ShoppingExecutionsParams,
+ shopping_merchants_params.ShoppingMerchantsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingExecutionsResponse,
+ cast_to=ShoppingMerchantsResponse,
)
- def item_visibility(
+ def products(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
+ end_date: str,
+ start_date: str,
competitor_limit: int | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal[
- "period",
- "product_key",
- "product_name",
- "brand_name",
- "date",
- "topic_id",
- "prompt_id",
- "prompt",
- "product_url",
- "product_image_urls",
- "product_price",
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_products_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "prompt"]] | Omit = omit,
+ include_merchants: bool | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[
+ List[
+ Literal[
+ "visibility_score",
+ "average_position",
+ "visibility_rank",
+ "position1_percentage",
+ "position2_percentage",
+ "position3_percentage",
+ "position_above3_percentage",
+ "product_rating",
+ "product_num_reviews",
+ ]
]
]
| Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_item_visibility_params.Filter] | Omit = omit,
- include_competitors: bool | Omit = omit,
- include_count: bool | Omit = omit,
- include_items: SequenceNotStr[str] | Omit = omit,
- include_no_tag: bool | Omit = omit,
- include_position_frequency: bool | Omit = omit,
- merchant_filter_type: Literal["any", "all"] | Omit = omit,
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "position1_percentage",
- "position2_percentage",
- "position3_percentage",
- "position_above3_percentage",
- "product_rating",
- "product_num_reviews",
- "total_count",
- ]
- ]
- | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- search_item: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
target_product: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -309,17 +253,26 @@ def item_visibility(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingItemVisibilityResponse:
- """Shopping Item Visibility
+ ) -> ShoppingProductsResponse:
+ """
+ Query Shopping Products V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
+
+ start_date: YYYY-MM-DD, ET, inclusive
+
+ competitor_limit: Competitors returned when `target_product` is set.
+
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
+
+ include_merchants: Include per-product merchant offers (names, prices, urls, images).
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ limit: Page size; default 10, max 50.
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ max_results: Stream endpoint only: cap streamed rows.
- pagination: Offset-based pagination parameters.
+ target_product: Return this product plus its top competitors (item view only).
extra_headers: Send extra headers
@@ -330,94 +283,68 @@ def item_visibility(
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
- "/v1/reports/shopping/item-visibility",
+ "/v2/reports/shopping/products",
body=maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
"competitor_limit": competitor_limit,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_competitors": include_competitors,
- "include_count": include_count,
- "include_items": include_items,
- "include_no_tag": include_no_tag,
- "include_position_frequency": include_position_frequency,
- "merchant_filter_type": merchant_filter_type,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "include_merchants": include_merchants,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "search_item": search_item,
- "tag_filter_type": tag_filter_type,
"target_product": target_product,
},
- shopping_item_visibility_params.ShoppingItemVisibilityParams,
+ shopping_products_params.ShoppingProductsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingItemVisibilityResponse,
+ cast_to=ShoppingProductsResponse,
)
- def merchant_by_items(
+ def stream_brands(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal[
- "period",
- "merchant_name",
- "product_name",
- "brand_name",
- "product_image_urls",
- "product_price",
- "merchant_prices",
- "has_instant_checkout",
- "delivery_options",
- "merchant_url",
- ]
- ]
- | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_merchant_by_items_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[
- Literal["merchant_visibility", "product_visibility", "product_rank", "avg_position", "total_count"]
- ]
- | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- product_name: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
+ end_date: str,
+ start_date: str,
+ assets: Union[str, SequenceNotStr[str], None] | Omit = omit,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_stream_brands_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "region", "prompt"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[List[Literal["visibility_score", "average_position", "visibility_rank"]]] | Omit = omit,
+ scope: Literal["owned", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingMerchantByItemsResponse:
- """Shopping Merchant By Items
+ ) -> Stream[ShoppingStreamBrandsResponse]:
+ """
+ Stream Shopping Brands V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
+
+ start_date: YYYY-MM-DD, ET, inclusive
+
+ assets: Restrict to these asset names (a name or list). Overrides `scope`.
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ limit: Page size for scope=all; default 10, max 50.
- pagination: Offset-based pagination parameters.
+ max_results: Stream endpoint only: cap the number of streamed rows (default: all).
extra_headers: Send extra headers
@@ -427,151 +354,88 @@ def merchant_by_items(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return self._post(
- "/v1/reports/shopping/merchant-by-items",
+ "/v2/reports/shopping/brands/stream",
body=maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
+ "assets": assets,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "pagination": pagination,
- "product_name": product_name,
- "tag_filter_type": tag_filter_type,
+ "scope": scope,
},
- shopping_merchant_by_items_params.ShoppingMerchantByItemsParams,
+ shopping_stream_brands_params.ShoppingStreamBrandsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingMerchantByItemsResponse,
+ cast_to=cast(
+ Any, ShoppingStreamBrandsResponse
+ ), # Union types cannot be passed in as arguments in the type system
+ stream=True,
+ stream_cls=Stream[ShoppingStreamBrandsResponse],
)
- def merchant_distribution(
+ def stream_merchants(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[Literal["period", "merchant_name", "date", "owned_asset_name"]] | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_merchant_distribution_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[
- Literal["offer_count", "product_count", "average_rank", "share_of_offers", "visibility_rank", "total_count"]
+ end_date: str,
+ start_date: str,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_stream_merchants_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "brand", "product"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[
+ List[
+ Literal[
+ "merchant_share",
+ "merchant_share_rank",
+ "merchant_visibility",
+ "merchant_visibility_rank",
+ "visibility_rank",
+ "brand_share",
+ "product_visibility",
+ "product_rank",
+ ]
+ ]
]
| Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- search_merchant: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingMerchantDistributionResponse:
- """Shopping Merchant Distribution
+ ) -> Stream[ShoppingStreamMerchantsResponse]:
+ """
+ Stream Shopping Merchants V2
Args:
- end_date: End date.
-
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
-
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ end_date: YYYY-MM-DD, ET, inclusive
- pagination: Offset-based pagination parameters.
+ start_date: YYYY-MM-DD, ET, inclusive
- extra_headers: Send extra headers
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- extra_query: Add additional query parameters to the request
+ group_by: `[]` = distribution; `[brand]` = brand share within each merchant; `[product]` =
+ top products per merchant. `date` (distribution only) adds a time series.
- extra_body: Add additional JSON properties to the request
+ limit: Page size; default 10, max 50.
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/reports/shopping/merchant-distribution",
- body=maybe_transform(
- {
- "category_id": category_id,
- "end_date": end_date,
- "start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
- "metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "search_merchant": search_merchant,
- "tag_filter_type": tag_filter_type,
- },
- shopping_merchant_distribution_params.ShoppingMerchantDistributionParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ShoppingMerchantDistributionResponse,
- )
+ max_results: Stream endpoint only: cap streamed rows.
- def merchant_share(
- self,
- *,
- category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[Literal["period", "topic_id", "prompt_id"]] | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_merchant_share_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[Literal["merchant_share"]] | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
- target_asset_names: SequenceNotStr[str] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingMerchantShareResponse:
- """Shopping Merchant Share
-
- Args:
- end_date: End date.
-
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
-
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
-
- pagination: Offset-based pagination parameters.
+ metrics: Defaults to the chosen view's metrics; must be valid for that view.
extra_headers: Send extra headers
@@ -581,137 +445,92 @@ def merchant_share(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return self._post(
- "/v1/reports/shopping/merchant-share",
+ "/v2/reports/shopping/merchants/stream",
body=maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "tag_filter_type": tag_filter_type,
- "target_asset_names": target_asset_names,
},
- shopping_merchant_share_params.ShoppingMerchantShareParams,
+ shopping_stream_merchants_params.ShoppingStreamMerchantsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingMerchantShareResponse,
+ cast_to=cast(
+ Any, ShoppingStreamMerchantsResponse
+ ), # Union types cannot be passed in as arguments in the type system
+ stream=True,
+ stream_cls=Stream[ShoppingStreamMerchantsResponse],
)
- def merchant_visibility_by_brand(
+ def stream_products(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[Literal["period", "merchant_name", "brand_name"]] | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_merchant_visibility_by_brand_params.Filter] | Omit = omit,
- include_brand: Optional[str] | Omit = omit,
- include_brand_only: bool | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[
- Literal["visibility_score", "share_of_voice", "average_position", "visibility_rank", "total_count"]
+ end_date: str,
+ start_date: str,
+ competitor_limit: int | Omit = omit,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_stream_products_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "prompt"]] | Omit = omit,
+ include_merchants: bool | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[
+ List[
+ Literal[
+ "visibility_score",
+ "average_position",
+ "visibility_rank",
+ "position1_percentage",
+ "position2_percentage",
+ "position3_percentage",
+ "position_above3_percentage",
+ "product_rating",
+ "product_num_reviews",
+ ]
+ ]
]
| Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- search_brand: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
+ target_product: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingMerchantVisibilityByBrandResponse:
- """Shopping Merchant Visibility By Brand
+ ) -> Stream[ShoppingStreamProductsResponse]:
+ """
+ Stream Shopping Products V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ start_date: YYYY-MM-DD, ET, inclusive
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ competitor_limit: Competitors returned when `target_product` is set.
- pagination: Offset-based pagination parameters.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
+ include_merchants: Include per-product merchant offers (names, prices, urls, images).
- extra_body: Add additional JSON properties to the request
+ limit: Page size; default 10, max 50.
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/reports/shopping/merchant-visibility-by-brand",
- body=maybe_transform(
- {
- "category_id": category_id,
- "end_date": end_date,
- "start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_brand": include_brand,
- "include_brand_only": include_brand_only,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
- "metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "search_brand": search_brand,
- "tag_filter_type": tag_filter_type,
- },
- shopping_merchant_visibility_by_brand_params.ShoppingMerchantVisibilityByBrandParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ShoppingMerchantVisibilityByBrandResponse,
- )
+ max_results: Stream endpoint only: cap streamed rows.
- def product_merchant_urls(
- self,
- *,
- category_id: str,
- end_date: Union[str, datetime],
- product_names: SequenceNotStr[str],
- start_date: Union[str, datetime],
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingProductMerchantURLsResponse:
- """
- Shopping Product Merchant Urls
+ target_product: Return this product plus its top competitors (item view only).
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -720,61 +539,73 @@ def product_merchant_urls(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return self._post(
- "/v1/reports/shopping/product-merchant-urls",
+ "/v2/reports/shopping/products/stream",
body=maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
- "product_names": product_names,
"start_date": start_date,
+ "competitor_limit": competitor_limit,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "include_merchants": include_merchants,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
+ "metrics": metrics,
+ "target_product": target_product,
},
- shopping_product_merchant_urls_params.ShoppingProductMerchantURLsParams,
+ shopping_stream_products_params.ShoppingStreamProductsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingProductMerchantURLsResponse,
+ cast_to=cast(
+ Any, ShoppingStreamProductsResponse
+ ), # Union types cannot be passed in as arguments in the type system
+ stream=True,
+ stream_cls=Stream[ShoppingStreamProductsResponse],
)
- def trigger_rate(
+ def stream_trigger_rate(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal["period", "date", "model_id", "topic_id", "region_id", "persona_id", "prompt_id", "prompt"]
- ]
+ end_date: str,
+ start_date: str,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_stream_trigger_rate_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "region", "persona", "prompt"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]]]
| Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_trigger_rate_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]] | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingTriggerRateResponse:
- """Shopping Trigger Rate
+ ) -> Stream[ShoppingStreamTriggerRateResponse]:
+ """
+ Stream Shopping Trigger Rate V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
+
+ start_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ group_by: Group by `prompt`/`topic` for the per-prompt/-topic trigger rate.
- pagination: Offset-based pagination parameters.
+ limit: Page size; default 10, max 50.
+
+ max_results: Stream endpoint only: cap streamed rows.
extra_headers: Send extra headers
@@ -784,93 +615,70 @@ def trigger_rate(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return self._post(
- "/v1/reports/shopping/trigger-rate",
+ "/v2/reports/shopping/trigger-rate/stream",
body=maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "pagination": pagination,
- "tag_filter_type": tag_filter_type,
},
- shopping_trigger_rate_params.ShoppingTriggerRateParams,
+ shopping_stream_trigger_rate_params.ShoppingStreamTriggerRateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingTriggerRateResponse,
+ cast_to=cast(
+ Any, ShoppingStreamTriggerRateResponse
+ ), # Union types cannot be passed in as arguments in the type system
+ stream=True,
+ stream_cls=Stream[ShoppingStreamTriggerRateResponse],
)
- def visibility(
+ def trigger_rate(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal["period", "asset_name", "date", "model_id", "topic_id", "region_id", "prompt_id", "prompt"]
- ]
- | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_visibility_params.Filter] | Omit = omit,
- include_asset: Optional[str] | Omit = omit,
- include_asset_only: bool | Omit = omit,
- include_assets_only: SequenceNotStr[str] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- include_position_frequency: bool | Omit = omit,
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "average_position_rank",
- "position1_percentage",
- "position2_percentage",
- "position3_percentage",
- "position_above3_percentage",
- "total_count",
- ]
- ]
+ end_date: str,
+ start_date: str,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_trigger_rate_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "region", "persona", "prompt"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]]]
| Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- rank_by: Literal["visibility_score", "average_position"] | Omit = omit,
- search_asset: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingVisibilityResponse:
- """Shopping Visibility
+ ) -> ShoppingTriggerRateResponse:
+ """
+ Query Shopping Trigger Rate V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ start_date: YYYY-MM-DD, ET, inclusive
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- pagination: Offset-based pagination parameters.
+ group_by: Group by `prompt`/`topic` for the per-prompt/-topic trigger rate.
+
+ limit: Page size; default 10, max 50.
+
+ max_results: Stream endpoint only: cap streamed rows.
extra_headers: Send extra headers
@@ -881,38 +689,26 @@ def visibility(
timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
- "/v1/reports/shopping/visibility",
+ "/v2/reports/shopping/trigger-rate",
body=maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_asset": include_asset,
- "include_asset_only": include_asset_only,
- "include_assets_only": include_assets_only,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
- "include_position_frequency": include_position_frequency,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "rank_by": rank_by,
- "search_asset": search_asset,
- "tag_filter_type": tag_filter_type,
},
- shopping_visibility_params.ShoppingVisibilityParams,
+ shopping_trigger_rate_params.ShoppingTriggerRateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingVisibilityResponse,
+ cast_to=ShoppingTriggerRateResponse,
)
@@ -936,70 +732,43 @@ def with_streaming_response(self) -> AsyncShoppingResourceWithStreamingResponse:
"""
return AsyncShoppingResourceWithStreamingResponse(self)
- async def all_items_with_merchants(
+ async def brands(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal[
- "period",
- "product_name",
- "brand_name",
- "product_url",
- "product_image_urls",
- "product_price",
- "merchant_names",
- "merchant_prices",
- ]
- ]
- | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_all_items_with_merchants_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_items: SequenceNotStr[str] | Omit = omit,
- include_no_tag: bool | Omit = omit,
- merchant_filter_type: Literal["any", "all"] | Omit = omit,
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "product_rating",
- "product_num_reviews",
- "total_count",
- ]
- ]
- | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- rank_by: Literal["visibility", "average_position", "name"] | Omit = omit,
- search_item: Optional[str] | Omit = omit,
- sort_order: Literal["asc", "desc"] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
+ end_date: str,
+ start_date: str,
+ assets: Union[str, SequenceNotStr[str], None] | Omit = omit,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_brands_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "region", "prompt"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[List[Literal["visibility_score", "average_position", "visibility_rank"]]] | Omit = omit,
+ scope: Literal["owned", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingAllItemsWithMerchantsResponse:
- """Shopping All Items With Merchants
+ ) -> ShoppingBrandsResponse:
+ """
+ Query Shopping Brands V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
+
+ start_date: YYYY-MM-DD, ET, inclusive
+
+ assets: Restrict to these asset names (a name or list). Overrides `scope`.
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ limit: Page size for scope=all; default 10, max 50.
- pagination: Offset-based pagination parameters.
+ max_results: Stream endpoint only: cap the number of streamed rows (default: all).
extra_headers: Send extra headers
@@ -1010,75 +779,82 @@ async def all_items_with_merchants(
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
- "/v1/reports/shopping/all-items-with-merchants",
+ "/v2/reports/shopping/brands",
body=await async_maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_items": include_items,
- "include_no_tag": include_no_tag,
- "merchant_filter_type": merchant_filter_type,
+ "assets": assets,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "rank_by": rank_by,
- "search_item": search_item,
- "sort_order": sort_order,
- "tag_filter_type": tag_filter_type,
+ "scope": scope,
},
- shopping_all_items_with_merchants_params.ShoppingAllItemsWithMerchantsParams,
+ shopping_brands_params.ShoppingBrandsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingAllItemsWithMerchantsResponse,
+ cast_to=ShoppingBrandsResponse,
)
- async def executions(
+ async def merchants(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- analysis_filter_type: Literal["any", "all"] | Omit = omit,
- analysis_types: List[Literal["visibility", "sentiment", "sentiment_v2", "accuracy"]] | Omit = omit,
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_executions_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
+ end_date: str,
+ start_date: str,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_merchants_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "brand", "product"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[
+ List[
+ Literal[
+ "merchant_share",
+ "merchant_share_rank",
+ "merchant_visibility",
+ "merchant_visibility_rank",
+ "visibility_rank",
+ "brand_share",
+ "product_visibility",
+ "product_rank",
+ ]
+ ]
+ ]
+ | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingExecutionsResponse:
- """Shopping Executions
+ ) -> ShoppingMerchantsResponse:
+ """
+ Query Shopping Merchants V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ start_date: YYYY-MM-DD, ET, inclusive
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- pagination: Offset-based pagination parameters.
+ group_by: `[]` = distribution; `[brand]` = brand share within each merchant; `[product]` =
+ top products per merchant. `date` (distribution only) adds a time series.
+
+ limit: Page size; default 10, max 50.
+
+ max_results: Stream endpoint only: cap streamed rows.
+
+ metrics: Defaults to the chosen view's metrics; must be valid for that view.
extra_headers: Send extra headers
@@ -1089,89 +865,58 @@ async def executions(
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
- "/v1/reports/shopping/executions",
+ "/v2/reports/shopping/merchants",
body=await async_maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "analysis_filter_type": analysis_filter_type,
- "analysis_types": analysis_types,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "tag_filter_type": tag_filter_type,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
+ "metrics": metrics,
},
- shopping_executions_params.ShoppingExecutionsParams,
+ shopping_merchants_params.ShoppingMerchantsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingExecutionsResponse,
+ cast_to=ShoppingMerchantsResponse,
)
- async def item_visibility(
+ async def products(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
+ end_date: str,
+ start_date: str,
competitor_limit: int | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal[
- "period",
- "product_key",
- "product_name",
- "brand_name",
- "date",
- "topic_id",
- "prompt_id",
- "prompt",
- "product_url",
- "product_image_urls",
- "product_price",
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_products_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "prompt"]] | Omit = omit,
+ include_merchants: bool | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[
+ List[
+ Literal[
+ "visibility_score",
+ "average_position",
+ "visibility_rank",
+ "position1_percentage",
+ "position2_percentage",
+ "position3_percentage",
+ "position_above3_percentage",
+ "product_rating",
+ "product_num_reviews",
+ ]
]
]
| Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_item_visibility_params.Filter] | Omit = omit,
- include_competitors: bool | Omit = omit,
- include_count: bool | Omit = omit,
- include_items: SequenceNotStr[str] | Omit = omit,
- include_no_tag: bool | Omit = omit,
- include_position_frequency: bool | Omit = omit,
- merchant_filter_type: Literal["any", "all"] | Omit = omit,
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "position1_percentage",
- "position2_percentage",
- "position3_percentage",
- "position_above3_percentage",
- "product_rating",
- "product_num_reviews",
- "total_count",
- ]
- ]
- | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- search_item: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
target_product: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1179,17 +924,26 @@ async def item_visibility(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingItemVisibilityResponse:
- """Shopping Item Visibility
+ ) -> ShoppingProductsResponse:
+ """
+ Query Shopping Products V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ start_date: YYYY-MM-DD, ET, inclusive
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ competitor_limit: Competitors returned when `target_product` is set.
- pagination: Offset-based pagination parameters.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
+
+ include_merchants: Include per-product merchant offers (names, prices, urls, images).
+
+ limit: Page size; default 10, max 50.
+
+ max_results: Stream endpoint only: cap streamed rows.
+
+ target_product: Return this product plus its top competitors (item view only).
extra_headers: Send extra headers
@@ -1200,94 +954,68 @@ async def item_visibility(
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
- "/v1/reports/shopping/item-visibility",
+ "/v2/reports/shopping/products",
body=await async_maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
"competitor_limit": competitor_limit,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_competitors": include_competitors,
- "include_count": include_count,
- "include_items": include_items,
- "include_no_tag": include_no_tag,
- "include_position_frequency": include_position_frequency,
- "merchant_filter_type": merchant_filter_type,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "include_merchants": include_merchants,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "search_item": search_item,
- "tag_filter_type": tag_filter_type,
"target_product": target_product,
},
- shopping_item_visibility_params.ShoppingItemVisibilityParams,
+ shopping_products_params.ShoppingProductsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingItemVisibilityResponse,
+ cast_to=ShoppingProductsResponse,
)
- async def merchant_by_items(
+ async def stream_brands(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal[
- "period",
- "merchant_name",
- "product_name",
- "brand_name",
- "product_image_urls",
- "product_price",
- "merchant_prices",
- "has_instant_checkout",
- "delivery_options",
- "merchant_url",
- ]
- ]
- | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_merchant_by_items_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[
- Literal["merchant_visibility", "product_visibility", "product_rank", "avg_position", "total_count"]
- ]
- | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- product_name: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
+ end_date: str,
+ start_date: str,
+ assets: Union[str, SequenceNotStr[str], None] | Omit = omit,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_stream_brands_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "region", "prompt"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[List[Literal["visibility_score", "average_position", "visibility_rank"]]] | Omit = omit,
+ scope: Literal["owned", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingMerchantByItemsResponse:
- """Shopping Merchant By Items
+ ) -> AsyncStream[ShoppingStreamBrandsResponse]:
+ """
+ Stream Shopping Brands V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
+
+ start_date: YYYY-MM-DD, ET, inclusive
+
+ assets: Restrict to these asset names (a name or list). Overrides `scope`.
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ limit: Page size for scope=all; default 10, max 50.
- pagination: Offset-based pagination parameters.
+ max_results: Stream endpoint only: cap the number of streamed rows (default: all).
extra_headers: Send extra headers
@@ -1297,151 +1025,88 @@ async def merchant_by_items(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return await self._post(
- "/v1/reports/shopping/merchant-by-items",
+ "/v2/reports/shopping/brands/stream",
body=await async_maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
+ "assets": assets,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "pagination": pagination,
- "product_name": product_name,
- "tag_filter_type": tag_filter_type,
+ "scope": scope,
},
- shopping_merchant_by_items_params.ShoppingMerchantByItemsParams,
+ shopping_stream_brands_params.ShoppingStreamBrandsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingMerchantByItemsResponse,
+ cast_to=cast(
+ Any, ShoppingStreamBrandsResponse
+ ), # Union types cannot be passed in as arguments in the type system
+ stream=True,
+ stream_cls=AsyncStream[ShoppingStreamBrandsResponse],
)
- async def merchant_distribution(
+ async def stream_merchants(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[Literal["period", "merchant_name", "date", "owned_asset_name"]] | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_merchant_distribution_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[
- Literal["offer_count", "product_count", "average_rank", "share_of_offers", "visibility_rank", "total_count"]
+ end_date: str,
+ start_date: str,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_stream_merchants_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "brand", "product"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[
+ List[
+ Literal[
+ "merchant_share",
+ "merchant_share_rank",
+ "merchant_visibility",
+ "merchant_visibility_rank",
+ "visibility_rank",
+ "brand_share",
+ "product_visibility",
+ "product_rank",
+ ]
+ ]
]
| Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- search_merchant: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingMerchantDistributionResponse:
- """Shopping Merchant Distribution
+ ) -> AsyncStream[ShoppingStreamMerchantsResponse]:
+ """
+ Stream Shopping Merchants V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ start_date: YYYY-MM-DD, ET, inclusive
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- pagination: Offset-based pagination parameters.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/reports/shopping/merchant-distribution",
- body=await async_maybe_transform(
- {
- "category_id": category_id,
- "end_date": end_date,
- "start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
- "metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "search_merchant": search_merchant,
- "tag_filter_type": tag_filter_type,
- },
- shopping_merchant_distribution_params.ShoppingMerchantDistributionParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ShoppingMerchantDistributionResponse,
- )
-
- async def merchant_share(
- self,
- *,
- category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[Literal["period", "topic_id", "prompt_id"]] | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_merchant_share_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[Literal["merchant_share"]] | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
- target_asset_names: SequenceNotStr[str] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingMerchantShareResponse:
- """Shopping Merchant Share
-
- Args:
- end_date: End date.
+ group_by: `[]` = distribution; `[brand]` = brand share within each merchant; `[product]` =
+ top products per merchant. `date` (distribution only) adds a time series.
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ limit: Page size; default 10, max 50.
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ max_results: Stream endpoint only: cap streamed rows.
- pagination: Offset-based pagination parameters.
+ metrics: Defaults to the chosen view's metrics; must be valid for that view.
extra_headers: Send extra headers
@@ -1451,137 +1116,92 @@ async def merchant_share(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return await self._post(
- "/v1/reports/shopping/merchant-share",
+ "/v2/reports/shopping/merchants/stream",
body=await async_maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "tag_filter_type": tag_filter_type,
- "target_asset_names": target_asset_names,
},
- shopping_merchant_share_params.ShoppingMerchantShareParams,
+ shopping_stream_merchants_params.ShoppingStreamMerchantsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingMerchantShareResponse,
+ cast_to=cast(
+ Any, ShoppingStreamMerchantsResponse
+ ), # Union types cannot be passed in as arguments in the type system
+ stream=True,
+ stream_cls=AsyncStream[ShoppingStreamMerchantsResponse],
)
- async def merchant_visibility_by_brand(
+ async def stream_products(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[Literal["period", "merchant_name", "brand_name"]] | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_merchant_visibility_by_brand_params.Filter] | Omit = omit,
- include_brand: Optional[str] | Omit = omit,
- include_brand_only: bool | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[
- Literal["visibility_score", "share_of_voice", "average_position", "visibility_rank", "total_count"]
+ end_date: str,
+ start_date: str,
+ competitor_limit: int | Omit = omit,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_stream_products_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "prompt"]] | Omit = omit,
+ include_merchants: bool | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[
+ List[
+ Literal[
+ "visibility_score",
+ "average_position",
+ "visibility_rank",
+ "position1_percentage",
+ "position2_percentage",
+ "position3_percentage",
+ "position_above3_percentage",
+ "product_rating",
+ "product_num_reviews",
+ ]
+ ]
]
| Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- search_brand: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
+ target_product: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingMerchantVisibilityByBrandResponse:
- """Shopping Merchant Visibility By Brand
+ ) -> AsyncStream[ShoppingStreamProductsResponse]:
+ """
+ Stream Shopping Products V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ start_date: YYYY-MM-DD, ET, inclusive
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ competitor_limit: Competitors returned when `target_product` is set.
- pagination: Offset-based pagination parameters.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
+ include_merchants: Include per-product merchant offers (names, prices, urls, images).
- extra_body: Add additional JSON properties to the request
+ limit: Page size; default 10, max 50.
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/reports/shopping/merchant-visibility-by-brand",
- body=await async_maybe_transform(
- {
- "category_id": category_id,
- "end_date": end_date,
- "start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_brand": include_brand,
- "include_brand_only": include_brand_only,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
- "metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "search_brand": search_brand,
- "tag_filter_type": tag_filter_type,
- },
- shopping_merchant_visibility_by_brand_params.ShoppingMerchantVisibilityByBrandParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ShoppingMerchantVisibilityByBrandResponse,
- )
+ max_results: Stream endpoint only: cap streamed rows.
- async def product_merchant_urls(
- self,
- *,
- category_id: str,
- end_date: Union[str, datetime],
- product_names: SequenceNotStr[str],
- start_date: Union[str, datetime],
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingProductMerchantURLsResponse:
- """
- Shopping Product Merchant Urls
+ target_product: Return this product plus its top competitors (item view only).
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -1590,61 +1210,73 @@ async def product_merchant_urls(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return await self._post(
- "/v1/reports/shopping/product-merchant-urls",
+ "/v2/reports/shopping/products/stream",
body=await async_maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
- "product_names": product_names,
"start_date": start_date,
+ "competitor_limit": competitor_limit,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "include_merchants": include_merchants,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
+ "metrics": metrics,
+ "target_product": target_product,
},
- shopping_product_merchant_urls_params.ShoppingProductMerchantURLsParams,
+ shopping_stream_products_params.ShoppingStreamProductsParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingProductMerchantURLsResponse,
+ cast_to=cast(
+ Any, ShoppingStreamProductsResponse
+ ), # Union types cannot be passed in as arguments in the type system
+ stream=True,
+ stream_cls=AsyncStream[ShoppingStreamProductsResponse],
)
- async def trigger_rate(
+ async def stream_trigger_rate(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal["period", "date", "model_id", "topic_id", "region_id", "persona_id", "prompt_id", "prompt"]
- ]
+ end_date: str,
+ start_date: str,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_stream_trigger_rate_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "region", "persona", "prompt"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]]]
| Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_trigger_rate_params.Filter] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- metrics: List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]] | Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingTriggerRateResponse:
- """Shopping Trigger Rate
+ ) -> AsyncStream[ShoppingStreamTriggerRateResponse]:
+ """
+ Stream Shopping Trigger Rate V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
+
+ start_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ group_by: Group by `prompt`/`topic` for the per-prompt/-topic trigger rate.
- pagination: Offset-based pagination parameters.
+ limit: Page size; default 10, max 50.
+
+ max_results: Stream endpoint only: cap streamed rows.
extra_headers: Send extra headers
@@ -1654,93 +1286,70 @@ async def trigger_rate(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return await self._post(
- "/v1/reports/shopping/trigger-rate",
+ "/v2/reports/shopping/trigger-rate/stream",
body=await async_maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "pagination": pagination,
- "tag_filter_type": tag_filter_type,
},
- shopping_trigger_rate_params.ShoppingTriggerRateParams,
+ shopping_stream_trigger_rate_params.ShoppingStreamTriggerRateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingTriggerRateResponse,
+ cast_to=cast(
+ Any, ShoppingStreamTriggerRateResponse
+ ), # Union types cannot be passed in as arguments in the type system
+ stream=True,
+ stream_cls=AsyncStream[ShoppingStreamTriggerRateResponse],
)
- async def visibility(
+ async def trigger_rate(
self,
*,
category_id: str,
- end_date: Union[str, datetime],
- start_date: Union[str, datetime],
- comparison_end_date: Union[str, datetime, None] | Omit = omit,
- comparison_start_date: Union[str, datetime, None] | Omit = omit,
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit,
- dimensions: List[
- Literal["period", "asset_name", "date", "model_id", "topic_id", "region_id", "prompt_id", "prompt"]
- ]
- | Omit = omit,
- exclude_topic_ids: bool | Omit = omit,
- filters: Iterable[shopping_visibility_params.Filter] | Omit = omit,
- include_asset: Optional[str] | Omit = omit,
- include_asset_only: bool | Omit = omit,
- include_assets_only: SequenceNotStr[str] | Omit = omit,
- include_count: bool | Omit = omit,
- include_no_tag: bool | Omit = omit,
- include_position_frequency: bool | Omit = omit,
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "average_position_rank",
- "position1_percentage",
- "position2_percentage",
- "position3_percentage",
- "position_above3_percentage",
- "total_count",
- ]
- ]
+ end_date: str,
+ start_date: str,
+ cursor: Optional[str] | Omit = omit,
+ filter: Optional[shopping_trigger_rate_params.Filter] | Omit = omit,
+ group_by: List[Literal["date", "topic", "region", "persona", "prompt"]] | Omit = omit,
+ interval: Literal["day", "week", "month"] | Omit = omit,
+ limit: Optional[int] | Omit = omit,
+ max_results: Optional[int] | Omit = omit,
+ metrics: Optional[List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]]]
| Omit = omit,
- order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit,
- owned_asset_names: SequenceNotStr[str] | Omit = omit,
- pagination: Optional[Pagination] | Omit = omit,
- rank_by: Literal["visibility_score", "average_position"] | Omit = omit,
- search_asset: Optional[str] | Omit = omit,
- tag_filter_type: Literal["any", "all"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ShoppingVisibilityResponse:
- """Shopping Visibility
+ ) -> ShoppingTriggerRateResponse:
+ """
+ Query Shopping Trigger Rate V2
Args:
- end_date: End date.
+ end_date: YYYY-MM-DD, ET, inclusive
- Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ start_date: YYYY-MM-DD, ET, inclusive
- start_date: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
+ filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
- pagination: Offset-based pagination parameters.
+ group_by: Group by `prompt`/`topic` for the per-prompt/-topic trigger rate.
+
+ limit: Page size; default 10, max 50.
+
+ max_results: Stream endpoint only: cap streamed rows.
extra_headers: Send extra headers
@@ -1751,38 +1360,26 @@ async def visibility(
timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
- "/v1/reports/shopping/visibility",
+ "/v2/reports/shopping/trigger-rate",
body=await async_maybe_transform(
{
"category_id": category_id,
"end_date": end_date,
"start_date": start_date,
- "comparison_end_date": comparison_end_date,
- "comparison_start_date": comparison_start_date,
- "date_interval": date_interval,
- "dimensions": dimensions,
- "exclude_topic_ids": exclude_topic_ids,
- "filters": filters,
- "include_asset": include_asset,
- "include_asset_only": include_asset_only,
- "include_assets_only": include_assets_only,
- "include_count": include_count,
- "include_no_tag": include_no_tag,
- "include_position_frequency": include_position_frequency,
+ "cursor": cursor,
+ "filter": filter,
+ "group_by": group_by,
+ "interval": interval,
+ "limit": limit,
+ "max_results": max_results,
"metrics": metrics,
- "order_by": order_by,
- "owned_asset_names": owned_asset_names,
- "pagination": pagination,
- "rank_by": rank_by,
- "search_asset": search_asset,
- "tag_filter_type": tag_filter_type,
},
- shopping_visibility_params.ShoppingVisibilityParams,
+ shopping_trigger_rate_params.ShoppingTriggerRateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ShoppingVisibilityResponse,
+ cast_to=ShoppingTriggerRateResponse,
)
@@ -1790,141 +1387,117 @@ class ShoppingResourceWithRawResponse:
def __init__(self, shopping: ShoppingResource) -> None:
self._shopping = shopping
- self.all_items_with_merchants = to_raw_response_wrapper(
- shopping.all_items_with_merchants,
+ self.brands = to_raw_response_wrapper(
+ shopping.brands,
)
- self.executions = to_raw_response_wrapper(
- shopping.executions,
+ self.merchants = to_raw_response_wrapper(
+ shopping.merchants,
)
- self.item_visibility = to_raw_response_wrapper(
- shopping.item_visibility,
+ self.products = to_raw_response_wrapper(
+ shopping.products,
)
- self.merchant_by_items = to_raw_response_wrapper(
- shopping.merchant_by_items,
+ self.stream_brands = to_raw_response_wrapper(
+ shopping.stream_brands,
)
- self.merchant_distribution = to_raw_response_wrapper(
- shopping.merchant_distribution,
+ self.stream_merchants = to_raw_response_wrapper(
+ shopping.stream_merchants,
)
- self.merchant_share = to_raw_response_wrapper(
- shopping.merchant_share,
+ self.stream_products = to_raw_response_wrapper(
+ shopping.stream_products,
)
- self.merchant_visibility_by_brand = to_raw_response_wrapper(
- shopping.merchant_visibility_by_brand,
- )
- self.product_merchant_urls = to_raw_response_wrapper(
- shopping.product_merchant_urls,
+ self.stream_trigger_rate = to_raw_response_wrapper(
+ shopping.stream_trigger_rate,
)
self.trigger_rate = to_raw_response_wrapper(
shopping.trigger_rate,
)
- self.visibility = to_raw_response_wrapper(
- shopping.visibility,
- )
class AsyncShoppingResourceWithRawResponse:
def __init__(self, shopping: AsyncShoppingResource) -> None:
self._shopping = shopping
- self.all_items_with_merchants = async_to_raw_response_wrapper(
- shopping.all_items_with_merchants,
+ self.brands = async_to_raw_response_wrapper(
+ shopping.brands,
)
- self.executions = async_to_raw_response_wrapper(
- shopping.executions,
+ self.merchants = async_to_raw_response_wrapper(
+ shopping.merchants,
)
- self.item_visibility = async_to_raw_response_wrapper(
- shopping.item_visibility,
+ self.products = async_to_raw_response_wrapper(
+ shopping.products,
)
- self.merchant_by_items = async_to_raw_response_wrapper(
- shopping.merchant_by_items,
+ self.stream_brands = async_to_raw_response_wrapper(
+ shopping.stream_brands,
)
- self.merchant_distribution = async_to_raw_response_wrapper(
- shopping.merchant_distribution,
+ self.stream_merchants = async_to_raw_response_wrapper(
+ shopping.stream_merchants,
)
- self.merchant_share = async_to_raw_response_wrapper(
- shopping.merchant_share,
+ self.stream_products = async_to_raw_response_wrapper(
+ shopping.stream_products,
)
- self.merchant_visibility_by_brand = async_to_raw_response_wrapper(
- shopping.merchant_visibility_by_brand,
- )
- self.product_merchant_urls = async_to_raw_response_wrapper(
- shopping.product_merchant_urls,
+ self.stream_trigger_rate = async_to_raw_response_wrapper(
+ shopping.stream_trigger_rate,
)
self.trigger_rate = async_to_raw_response_wrapper(
shopping.trigger_rate,
)
- self.visibility = async_to_raw_response_wrapper(
- shopping.visibility,
- )
class ShoppingResourceWithStreamingResponse:
def __init__(self, shopping: ShoppingResource) -> None:
self._shopping = shopping
- self.all_items_with_merchants = to_streamed_response_wrapper(
- shopping.all_items_with_merchants,
+ self.brands = to_streamed_response_wrapper(
+ shopping.brands,
)
- self.executions = to_streamed_response_wrapper(
- shopping.executions,
+ self.merchants = to_streamed_response_wrapper(
+ shopping.merchants,
)
- self.item_visibility = to_streamed_response_wrapper(
- shopping.item_visibility,
+ self.products = to_streamed_response_wrapper(
+ shopping.products,
)
- self.merchant_by_items = to_streamed_response_wrapper(
- shopping.merchant_by_items,
+ self.stream_brands = to_streamed_response_wrapper(
+ shopping.stream_brands,
)
- self.merchant_distribution = to_streamed_response_wrapper(
- shopping.merchant_distribution,
+ self.stream_merchants = to_streamed_response_wrapper(
+ shopping.stream_merchants,
)
- self.merchant_share = to_streamed_response_wrapper(
- shopping.merchant_share,
+ self.stream_products = to_streamed_response_wrapper(
+ shopping.stream_products,
)
- self.merchant_visibility_by_brand = to_streamed_response_wrapper(
- shopping.merchant_visibility_by_brand,
- )
- self.product_merchant_urls = to_streamed_response_wrapper(
- shopping.product_merchant_urls,
+ self.stream_trigger_rate = to_streamed_response_wrapper(
+ shopping.stream_trigger_rate,
)
self.trigger_rate = to_streamed_response_wrapper(
shopping.trigger_rate,
)
- self.visibility = to_streamed_response_wrapper(
- shopping.visibility,
- )
class AsyncShoppingResourceWithStreamingResponse:
def __init__(self, shopping: AsyncShoppingResource) -> None:
self._shopping = shopping
- self.all_items_with_merchants = async_to_streamed_response_wrapper(
- shopping.all_items_with_merchants,
+ self.brands = async_to_streamed_response_wrapper(
+ shopping.brands,
)
- self.executions = async_to_streamed_response_wrapper(
- shopping.executions,
+ self.merchants = async_to_streamed_response_wrapper(
+ shopping.merchants,
)
- self.item_visibility = async_to_streamed_response_wrapper(
- shopping.item_visibility,
+ self.products = async_to_streamed_response_wrapper(
+ shopping.products,
)
- self.merchant_by_items = async_to_streamed_response_wrapper(
- shopping.merchant_by_items,
+ self.stream_brands = async_to_streamed_response_wrapper(
+ shopping.stream_brands,
)
- self.merchant_distribution = async_to_streamed_response_wrapper(
- shopping.merchant_distribution,
+ self.stream_merchants = async_to_streamed_response_wrapper(
+ shopping.stream_merchants,
)
- self.merchant_share = async_to_streamed_response_wrapper(
- shopping.merchant_share,
+ self.stream_products = async_to_streamed_response_wrapper(
+ shopping.stream_products,
)
- self.merchant_visibility_by_brand = async_to_streamed_response_wrapper(
- shopping.merchant_visibility_by_brand,
- )
- self.product_merchant_urls = async_to_streamed_response_wrapper(
- shopping.product_merchant_urls,
+ self.stream_trigger_rate = async_to_streamed_response_wrapper(
+ shopping.stream_trigger_rate,
)
self.trigger_rate = async_to_streamed_response_wrapper(
shopping.trigger_rate,
)
- self.visibility = async_to_streamed_response_wrapper(
- shopping.visibility,
- )
diff --git a/src/profound/types/integration_list_response.py b/src/profound/types/integration_list_response.py
index b605e567..61788219 100644
--- a/src/profound/types/integration_list_response.py
+++ b/src/profound/types/integration_list_response.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List
+from typing import List, Optional
from typing_extensions import Literal
from .._models import BaseModel
@@ -14,6 +14,14 @@ class Data(BaseModel):
id: str
"""Installation id to bind to a hub-backed node's `integration_id`."""
+ account: Optional[str] = None
+ """Connected account identity as the provider reports it, e.g.
+
+ the Google account email or the WordPress site URL. This is what tells two
+ connections of the same provider apart; `label` often repeats across them. Null
+ when the provider reports no identity.
+ """
+
label: str
"""Human-readable account label for the connection."""
diff --git a/src/profound/types/organizations/__init__.py b/src/profound/types/organizations/__init__.py
index 2195b7b9..f0857317 100644
--- a/src/profound/types/organizations/__init__.py
+++ b/src/profound/types/organizations/__init__.py
@@ -24,3 +24,6 @@
from .category_get_category_personas_response import (
CategoryGetCategoryPersonasResponse as CategoryGetCategoryPersonasResponse,
)
+from .category_get_citation_categories_response import (
+ CategoryGetCitationCategoriesResponse as CategoryGetCitationCategoriesResponse,
+)
diff --git a/src/profound/types/organizations/category_create_prompts_params.py b/src/profound/types/organizations/category_create_prompts_params.py
index 99ca9641..d5c5e2df 100644
--- a/src/profound/types/organizations/category_create_prompts_params.py
+++ b/src/profound/types/organizations/category_create_prompts_params.py
@@ -36,6 +36,14 @@ class Prompt(TypedDict, total=False):
topic: Required[IDOrNameParam]
"""Topic to assign. A new topic is created if the name doesn't exist."""
+ id: Optional[str]
+ """Optional client-generated UUID for the prompt.
+
+ When provided, creation is idempotent: retrying a request with the same id will
+ not create a duplicate prompt. Omit to have the server generate one
+ (non-idempotent).
+ """
+
analysis_types: Optional[List[Literal["visibility", "sentiment", "sentiment_v2", "accuracy"]]]
"""Analysis types: 'visibility', 'sentiment', 'accuracy'.
diff --git a/src/profound/types/organizations/category_get_citation_categories_response.py b/src/profound/types/organizations/category_get_citation_categories_response.py
new file mode 100644
index 00000000..739e0ab1
--- /dev/null
+++ b/src/profound/types/organizations/category_get_citation_categories_response.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List
+
+from ..._models import BaseModel
+
+__all__ = ["CategoryGetCitationCategoriesResponse", "Data"]
+
+
+class Data(BaseModel):
+ name: str
+ """Display name."""
+
+ value: str
+ """Value to pass to the v2 citations `citation_category` filter."""
+
+
+class CategoryGetCitationCategoriesResponse(BaseModel):
+ data: List[Data]
diff --git a/src/profound/types/prompt_answers_v2_params.py b/src/profound/types/prompt_answers_v2_params.py
index 4700da28..a1712c52 100644
--- a/src/profound/types/prompt_answers_v2_params.py
+++ b/src/profound/types/prompt_answers_v2_params.py
@@ -38,6 +38,7 @@ class PromptAnswersV2Params(TypedDict, total=False):
"response",
"mentions",
"citations",
+ "citation_details",
"search_queries",
"analysis_types",
"sentiment_claims",
@@ -47,8 +48,9 @@ class PromptAnswersV2Params(TypedDict, total=False):
"""
Which row fields to return: `run_id`, `date`, `model`, `topic`, `topic_id`,
`region`, `persona`, `tags`, `prompt`, `prompt_id`, `response`, `mentions`,
- `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for
- all of them.
+ `citations`, `citation_details`, `search_queries`, `analysis_types`,
+ `sentiment_claims`. Omit for all fields except `citation_details`, which must be
+ requested explicitly because it is expensive.
"""
limit: Optional[int]
diff --git a/src/profound/types/prompt_answers_v2_response.py b/src/profound/types/prompt_answers_v2_response.py
index b8712765..143aa83a 100644
--- a/src/profound/types/prompt_answers_v2_response.py
+++ b/src/profound/types/prompt_answers_v2_response.py
@@ -6,13 +6,29 @@
from .._models import BaseModel
-__all__ = ["PromptAnswersV2Response", "Data", "DataModel", "Info"]
+__all__ = ["PromptAnswersV2Response", "Data", "DataCitationDetail", "DataModel", "Info"]
+
+
+class DataCitationDetail(BaseModel):
+ clean_url: str
+
+ hostname: str
+
+ path: str
+
+ title: str
+
+ url: str
+
+ citation_category: Optional[str] = None
+
+ first_cited_at: Optional[str] = None
+
+ text: Optional[str] = None
class DataModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -27,6 +43,8 @@ class Data(BaseModel):
analysis_types: Optional[List[str]] = None
+ citation_details: Optional[List[DataCitationDetail]] = None
+
citations: Optional[List[str]] = None
date: Optional[str] = None
@@ -34,10 +52,7 @@ class Data(BaseModel):
mentions: Optional[List[str]] = None
model: Optional[DataModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
persona: Optional[str] = None
diff --git a/src/profound/types/prompt_stream_answers_v2_params.py b/src/profound/types/prompt_stream_answers_v2_params.py
index 10a7a2cb..7c568deb 100644
--- a/src/profound/types/prompt_stream_answers_v2_params.py
+++ b/src/profound/types/prompt_stream_answers_v2_params.py
@@ -38,6 +38,7 @@ class PromptStreamAnswersV2Params(TypedDict, total=False):
"response",
"mentions",
"citations",
+ "citation_details",
"search_queries",
"analysis_types",
"sentiment_claims",
@@ -47,8 +48,9 @@ class PromptStreamAnswersV2Params(TypedDict, total=False):
"""
Which row fields to return: `run_id`, `date`, `model`, `topic`, `topic_id`,
`region`, `persona`, `tags`, `prompt`, `prompt_id`, `response`, `mentions`,
- `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for
- all of them.
+ `citations`, `citation_details`, `search_queries`, `analysis_types`,
+ `sentiment_claims`. Omit for all fields except `citation_details`, which must be
+ requested explicitly because it is expensive.
"""
limit: Optional[int]
diff --git a/src/profound/types/prompt_stream_answers_v2_response.py b/src/profound/types/prompt_stream_answers_v2_response.py
index 6b19e3d2..d3a30a6e 100644
--- a/src/profound/types/prompt_stream_answers_v2_response.py
+++ b/src/profound/types/prompt_stream_answers_v2_response.py
@@ -7,7 +7,7 @@
from .._models import BaseModel
-__all__ = ["PromptStreamAnswersV2Response", "AnswersV2Info", "AnswerRow", "AnswerRowModel"]
+__all__ = ["PromptStreamAnswersV2Response", "AnswersV2Info", "AnswerRow", "AnswerRowCitationDetail", "AnswerRowModel"]
class AnswersV2Info(BaseModel):
@@ -50,10 +50,26 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class AnswerRowCitationDetail(BaseModel):
+ clean_url: str
+
+ hostname: str
+
+ path: str
+
+ title: str
+
+ url: str
+
+ citation_category: Optional[str] = None
+
+ first_cited_at: Optional[str] = None
+
+ text: Optional[str] = None
+
+
class AnswerRowModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -65,6 +81,8 @@ class AnswerRow(BaseModel):
analysis_types: Optional[List[str]] = None
+ citation_details: Optional[List[AnswerRowCitationDetail]] = None
+
citations: Optional[List[str]] = None
date: Optional[str] = None
@@ -72,10 +90,7 @@ class AnswerRow(BaseModel):
mentions: Optional[List[str]] = None
model: Optional[AnswerRowModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
persona: Optional[str] = None
diff --git a/src/profound/types/report_query_citations_response.py b/src/profound/types/report_query_citations_response.py
index 6827ccf0..794f2124 100644
--- a/src/profound/types/report_query_citations_response.py
+++ b/src/profound/types/report_query_citations_response.py
@@ -19,9 +19,7 @@
class DataModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -29,9 +27,7 @@ class DataModel(BaseModel):
class DataPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -39,9 +35,7 @@ class DataPersona(BaseModel):
class DataPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -49,9 +43,7 @@ class DataPrompt(BaseModel):
class DataRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -59,9 +51,7 @@ class DataRegion(BaseModel):
class DataTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -86,38 +76,23 @@ class Data(BaseModel):
"""Pages only."""
model: Optional[DataModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
page: Optional[str] = None
persona: Optional[DataPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
prompt: Optional[DataPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
rank: Optional[int] = None
region: Optional[DataRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
topic: Optional[DataTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
if TYPE_CHECKING:
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
diff --git a/src/profound/types/report_query_fanouts_params.py b/src/profound/types/report_query_fanouts_params.py
index f7a4339c..26c07b50 100644
--- a/src/profound/types/report_query_fanouts_params.py
+++ b/src/profound/types/report_query_fanouts_params.py
@@ -28,6 +28,7 @@ class ReportQueryFanoutsParams(TypedDict, total=False):
"""End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
metrics: Required[List[Literal["fanouts_per_execution", "total_fanouts", "share", "query_variations"]]]
+ """Metrics to return for each row."""
start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
"""Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
diff --git a/src/profound/types/report_query_sentiment_response.py b/src/profound/types/report_query_sentiment_response.py
index c0415c28..e0828b6b 100644
--- a/src/profound/types/report_query_sentiment_response.py
+++ b/src/profound/types/report_query_sentiment_response.py
@@ -25,9 +25,7 @@
class DataClaim(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -35,9 +33,7 @@ class DataClaim(BaseModel):
class DataCompetitor(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -45,9 +41,7 @@ class DataCompetitor(BaseModel):
class DataModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -55,9 +49,7 @@ class DataModel(BaseModel):
class DataPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -87,9 +79,7 @@ def __getattr__(self, attr: str) -> object: ...
class DataPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -97,9 +87,7 @@ class DataPrompt(BaseModel):
class DataRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -107,9 +95,7 @@ class DataRegion(BaseModel):
class DataRun(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -117,9 +103,7 @@ class DataRun(BaseModel):
class DataTag(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -127,9 +111,7 @@ class DataTag(BaseModel):
class DataTheme(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -137,9 +119,7 @@ class DataTheme(BaseModel):
class DataTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -155,34 +135,22 @@ class Data(BaseModel):
cited_websites: Optional[List[str]] = None
claim: Optional[DataClaim] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
competitor: Optional[DataCompetitor] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
date: Optional[str] = None
model: Optional[DataModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
negative_sentiment: Optional[float] = None
occurrence: Optional[float] = None
persona: Optional[DataPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
positive_sentiment: Optional[float] = None
@@ -192,42 +160,24 @@ class Data(BaseModel):
"""Comparison-window metrics (when requested)."""
prompt: Optional[DataPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
rank: Optional[int] = None
region: Optional[DataRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
run: Optional[DataRun] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
tag: Optional[DataTag] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
theme: Optional[DataTheme] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
topic: Optional[DataTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
if TYPE_CHECKING:
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
diff --git a/src/profound/types/report_query_visibility_response.py b/src/profound/types/report_query_visibility_response.py
index 41c6221f..fbdc3047 100644
--- a/src/profound/types/report_query_visibility_response.py
+++ b/src/profound/types/report_query_visibility_response.py
@@ -27,9 +27,7 @@ class DataAsset(BaseModel):
class DataModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -37,9 +35,7 @@ class DataModel(BaseModel):
class DataPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -47,9 +43,7 @@ class DataPersona(BaseModel):
class DataPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -57,9 +51,7 @@ class DataPrompt(BaseModel):
class DataRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -67,9 +59,7 @@ class DataRegion(BaseModel):
class DataTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -89,39 +79,24 @@ class Data(BaseModel):
date: Optional[str] = None
model: Optional[DataModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
persona: Optional[DataPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
prompt: Optional[DataPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
rank: Optional[int] = None
"""Asset rank (only when not grouped)."""
region: Optional[DataRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
share_of_voice: Optional[float] = None
topic: Optional[DataTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
visibility_score: Optional[float] = None
diff --git a/src/profound/types/report_stream_citations_v2_response.py b/src/profound/types/report_stream_citations_v2_response.py
index 71cfefec..470b72bd 100644
--- a/src/profound/types/report_stream_citations_v2_response.py
+++ b/src/profound/types/report_stream_citations_v2_response.py
@@ -66,9 +66,7 @@ def __getattr__(self, attr: str) -> object: ...
class CitationRowModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -76,9 +74,7 @@ class CitationRowModel(BaseModel):
class CitationRowPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -86,9 +82,7 @@ class CitationRowPersona(BaseModel):
class CitationRowPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -96,9 +90,7 @@ class CitationRowPrompt(BaseModel):
class CitationRowRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -106,9 +98,7 @@ class CitationRowRegion(BaseModel):
class CitationRowTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -130,38 +120,23 @@ class CitationRow(BaseModel):
"""Pages only."""
model: Optional[CitationRowModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
page: Optional[str] = None
persona: Optional[CitationRowPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
prompt: Optional[CitationRowPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
rank: Optional[int] = None
region: Optional[CitationRowRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
topic: Optional[CitationRowTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
if TYPE_CHECKING:
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
diff --git a/src/profound/types/report_stream_sentiment_v2_response.py b/src/profound/types/report_stream_sentiment_v2_response.py
index 2fc57aad..9ca39f8d 100644
--- a/src/profound/types/report_stream_sentiment_v2_response.py
+++ b/src/profound/types/report_stream_sentiment_v2_response.py
@@ -75,9 +75,7 @@ def __getattr__(self, attr: str) -> object: ...
class SentimentRowClaim(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -85,9 +83,7 @@ class SentimentRowClaim(BaseModel):
class SentimentRowCompetitor(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -95,9 +91,7 @@ class SentimentRowCompetitor(BaseModel):
class SentimentRowModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -105,9 +99,7 @@ class SentimentRowModel(BaseModel):
class SentimentRowPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -137,9 +129,7 @@ def __getattr__(self, attr: str) -> object: ...
class SentimentRowPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -147,9 +137,7 @@ class SentimentRowPrompt(BaseModel):
class SentimentRowRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -157,9 +145,7 @@ class SentimentRowRegion(BaseModel):
class SentimentRowRun(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -167,9 +153,7 @@ class SentimentRowRun(BaseModel):
class SentimentRowTag(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -177,9 +161,7 @@ class SentimentRowTag(BaseModel):
class SentimentRowTheme(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -187,9 +169,7 @@ class SentimentRowTheme(BaseModel):
class SentimentRowTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -202,34 +182,22 @@ class SentimentRow(BaseModel):
cited_websites: Optional[List[str]] = None
claim: Optional[SentimentRowClaim] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
competitor: Optional[SentimentRowCompetitor] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
date: Optional[str] = None
model: Optional[SentimentRowModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
negative_sentiment: Optional[float] = None
occurrence: Optional[float] = None
persona: Optional[SentimentRowPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
positive_sentiment: Optional[float] = None
@@ -239,42 +207,24 @@ class SentimentRow(BaseModel):
"""Comparison-window metrics (when requested)."""
prompt: Optional[SentimentRowPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
rank: Optional[int] = None
region: Optional[SentimentRowRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
run: Optional[SentimentRowRun] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
tag: Optional[SentimentRowTag] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
theme: Optional[SentimentRowTheme] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
topic: Optional[SentimentRowTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
if TYPE_CHECKING:
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
diff --git a/src/profound/types/report_stream_visibility_v2_response.py b/src/profound/types/report_stream_visibility_v2_response.py
index 75b3e58e..714a8a56 100644
--- a/src/profound/types/report_stream_visibility_v2_response.py
+++ b/src/profound/types/report_stream_visibility_v2_response.py
@@ -71,9 +71,7 @@ class VisibilityRowAsset(BaseModel):
class VisibilityRowModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -81,9 +79,7 @@ class VisibilityRowModel(BaseModel):
class VisibilityRowPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -91,9 +87,7 @@ class VisibilityRowPersona(BaseModel):
class VisibilityRowPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -101,9 +95,7 @@ class VisibilityRowPrompt(BaseModel):
class VisibilityRowRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -111,9 +103,7 @@ class VisibilityRowRegion(BaseModel):
class VisibilityRowTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -130,39 +120,24 @@ class VisibilityRow(BaseModel):
date: Optional[str] = None
model: Optional[VisibilityRowModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
persona: Optional[VisibilityRowPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
prompt: Optional[VisibilityRowPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
rank: Optional[int] = None
"""Asset rank (only when not grouped)."""
region: Optional[VisibilityRowRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
share_of_voice: Optional[float] = None
topic: Optional[VisibilityRowTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
visibility_score: Optional[float] = None
diff --git a/src/profound/types/reports/__init__.py b/src/profound/types/reports/__init__.py
index ba3ddac3..38d21899 100644
--- a/src/profound/types/reports/__init__.py
+++ b/src/profound/types/reports/__init__.py
@@ -2,40 +2,37 @@
from __future__ import annotations
-from .brand_name_filter_param import BrandNameFilterParam as BrandNameFilterParam
-from .product_name_filter_param import ProductNameFilterParam as ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam as MerchantNameFilterParam
-from .shopping_executions_params import ShoppingExecutionsParams as ShoppingExecutionsParams
-from .shopping_visibility_params import ShoppingVisibilityParams as ShoppingVisibilityParams
-from .shopping_executions_response import ShoppingExecutionsResponse as ShoppingExecutionsResponse
+from .shopping_brands_params import ShoppingBrandsParams as ShoppingBrandsParams
+from .shopping_brands_response import ShoppingBrandsResponse as ShoppingBrandsResponse
+from .shopping_products_params import ShoppingProductsParams as ShoppingProductsParams
+from .shopping_merchants_params import ShoppingMerchantsParams as ShoppingMerchantsParams
+from .shopping_products_response import ShoppingProductsResponse as ShoppingProductsResponse
+from .shopping_merchants_response import ShoppingMerchantsResponse as ShoppingMerchantsResponse
from .shopping_trigger_rate_params import ShoppingTriggerRateParams as ShoppingTriggerRateParams
-from .shopping_visibility_response import ShoppingVisibilityResponse as ShoppingVisibilityResponse
from .factcheck_query_scores_params import FactcheckQueryScoresParams as FactcheckQueryScoresParams
+from .shopping_stream_brands_params import ShoppingStreamBrandsParams as ShoppingStreamBrandsParams
from .factcheck_stream_scores_params import FactcheckStreamScoresParams as FactcheckStreamScoresParams
-from .shopping_merchant_share_params import ShoppingMerchantShareParams as ShoppingMerchantShareParams
from .shopping_trigger_rate_response import ShoppingTriggerRateResponse as ShoppingTriggerRateResponse
from .web_search_result_query_params import WebSearchResultQueryParams as WebSearchResultQueryParams
from .accuracy_create_overview_params import AccuracyCreateOverviewParams as AccuracyCreateOverviewParams
from .factcheck_query_scores_response import FactcheckQueryScoresResponse as FactcheckQueryScoresResponse
-from .shopping_item_visibility_params import ShoppingItemVisibilityParams as ShoppingItemVisibilityParams
+from .shopping_stream_brands_response import ShoppingStreamBrandsResponse as ShoppingStreamBrandsResponse
+from .shopping_stream_products_params import ShoppingStreamProductsParams as ShoppingStreamProductsParams
from .web_search_result_stream_params import WebSearchResultStreamParams as WebSearchResultStreamParams
from .accuracy_create_breakdown_params import AccuracyCreateBreakdownParams as AccuracyCreateBreakdownParams
from .accuracy_create_topic_ids_params import AccuracyCreateTopicIDsParams as AccuracyCreateTopicIDsParams
from .factcheck_stream_scores_response import FactcheckStreamScoresResponse as FactcheckStreamScoresResponse
-from .shopping_merchant_share_response import ShoppingMerchantShareResponse as ShoppingMerchantShareResponse
+from .shopping_stream_merchants_params import ShoppingStreamMerchantsParams as ShoppingStreamMerchantsParams
from .web_search_result_query_response import WebSearchResultQueryResponse as WebSearchResultQueryResponse
from .accuracy_create_overview_response import AccuracyCreateOverviewResponse as AccuracyCreateOverviewResponse
-from .shopping_item_visibility_response import ShoppingItemVisibilityResponse as ShoppingItemVisibilityResponse
-from .shopping_merchant_by_items_params import ShoppingMerchantByItemsParams as ShoppingMerchantByItemsParams
+from .shopping_stream_products_response import ShoppingStreamProductsResponse as ShoppingStreamProductsResponse
from .web_search_result_stream_response import WebSearchResultStreamResponse as WebSearchResultStreamResponse
from .accuracy_create_breakdown_response import AccuracyCreateBreakdownResponse as AccuracyCreateBreakdownResponse
from .accuracy_create_topic_ids_response import AccuracyCreateTopicIDsResponse as AccuracyCreateTopicIDsResponse
-from .shopping_merchant_by_items_response import ShoppingMerchantByItemsResponse as ShoppingMerchantByItemsResponse
-from .shopping_merchant_distribution_params import (
- ShoppingMerchantDistributionParams as ShoppingMerchantDistributionParams,
-)
-from .shopping_product_merchant_urls_params import (
- ShoppingProductMerchantURLsParams as ShoppingProductMerchantURLsParams,
+from .shopping_stream_merchants_response import ShoppingStreamMerchantsResponse as ShoppingStreamMerchantsResponse
+from .shopping_stream_trigger_rate_params import ShoppingStreamTriggerRateParams as ShoppingStreamTriggerRateParams
+from .shopping_stream_trigger_rate_response import (
+ ShoppingStreamTriggerRateResponse as ShoppingStreamTriggerRateResponse,
)
from .accuracy_create_claim_breakdown_params import (
AccuracyCreateClaimBreakdownParams as AccuracyCreateClaimBreakdownParams,
@@ -43,12 +40,6 @@
from .accuracy_create_claim_citations_params import (
AccuracyCreateClaimCitationsParams as AccuracyCreateClaimCitationsParams,
)
-from .shopping_merchant_distribution_response import (
- ShoppingMerchantDistributionResponse as ShoppingMerchantDistributionResponse,
-)
-from .shopping_product_merchant_urls_response import (
- ShoppingProductMerchantURLsResponse as ShoppingProductMerchantURLsResponse,
-)
from .accuracy_create_citation_analysis_params import (
AccuracyCreateCitationAnalysisParams as AccuracyCreateCitationAnalysisParams,
)
@@ -61,9 +52,6 @@
from .accuracy_create_inaccurate_themes_params import (
AccuracyCreateInaccurateThemesParams as AccuracyCreateInaccurateThemesParams,
)
-from .shopping_all_items_with_merchants_params import (
- ShoppingAllItemsWithMerchantsParams as ShoppingAllItemsWithMerchantsParams,
-)
from .accuracy_create_inaccuracy_drivers_params import (
AccuracyCreateInaccuracyDriversParams as AccuracyCreateInaccuracyDriversParams,
)
@@ -76,9 +64,6 @@
from .accuracy_create_inaccurate_themes_response import (
AccuracyCreateInaccurateThemesResponse as AccuracyCreateInaccurateThemesResponse,
)
-from .shopping_all_items_with_merchants_response import (
- ShoppingAllItemsWithMerchantsResponse as ShoppingAllItemsWithMerchantsResponse,
-)
from .accuracy_create_cluster_example_runs_params import (
AccuracyCreateClusterExampleRunsParams as AccuracyCreateClusterExampleRunsParams,
)
@@ -91,9 +76,6 @@
from .accuracy_create_top_inaccurate_claims_params import (
AccuracyCreateTopInaccurateClaimsParams as AccuracyCreateTopInaccurateClaimsParams,
)
-from .shopping_merchant_visibility_by_brand_params import (
- ShoppingMerchantVisibilityByBrandParams as ShoppingMerchantVisibilityByBrandParams,
-)
from .accuracy_create_cluster_example_runs_response import (
AccuracyCreateClusterExampleRunsResponse as AccuracyCreateClusterExampleRunsResponse,
)
@@ -103,9 +85,6 @@
from .accuracy_create_top_inaccurate_claims_response import (
AccuracyCreateTopInaccurateClaimsResponse as AccuracyCreateTopInaccurateClaimsResponse,
)
-from .shopping_merchant_visibility_by_brand_response import (
- ShoppingMerchantVisibilityByBrandResponse as ShoppingMerchantVisibilityByBrandResponse,
-)
from .accuracy_create_factcheck_setup_status_response import (
AccuracyCreateFactcheckSetupStatusResponse as AccuracyCreateFactcheckSetupStatusResponse,
)
diff --git a/src/profound/types/reports/brand_name_filter_param.py b/src/profound/types/reports/brand_name_filter_param.py
deleted file mode 100644
index 4e617b00..00000000
--- a/src/profound/types/reports/brand_name_filter_param.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union
-from typing_extensions import Literal, Required, TypedDict
-
-from ..._types import SequenceNotStr
-
-__all__ = ["BrandNameFilterParam"]
-
-
-class BrandNameFilterParam(TypedDict, total=False):
- field: Required[Literal["brand_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
diff --git a/src/profound/types/reports/factcheck/claim_query_claims_response.py b/src/profound/types/reports/factcheck/claim_query_claims_response.py
index aae68bb6..b813bb18 100644
--- a/src/profound/types/reports/factcheck/claim_query_claims_response.py
+++ b/src/profound/types/reports/factcheck/claim_query_claims_response.py
@@ -120,9 +120,7 @@ class DataEvidence(BaseModel):
class DataModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -130,9 +128,7 @@ class DataModel(BaseModel):
class DataPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -140,9 +136,7 @@ class DataPersona(BaseModel):
class DataPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -150,9 +144,7 @@ class DataPrompt(BaseModel):
class DataRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -160,9 +152,7 @@ class DataRegion(BaseModel):
class DataTag(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -170,9 +160,7 @@ class DataTag(BaseModel):
class DataThemeDimensionRef(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -183,9 +171,7 @@ class DataThemeDimensionRef(BaseModel):
class DataTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -216,49 +202,31 @@ class Data(BaseModel):
inaccurate: Optional[int] = None
model: Optional[DataModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
models: Optional[List[DataModel]] = None
occurrence: Optional[float] = None
persona: Optional[DataPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
prompt: Optional[DataPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
reasoning: Optional[str] = None
region: Optional[DataRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
tag: Optional[DataTag] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
theme: Optional[DataTheme] = None
"""Claim theme (string), or an `{id, name}` ref when sectioning by `theme`."""
topic: Optional[DataTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
total_claims: Optional[int] = None
diff --git a/src/profound/types/reports/factcheck/claim_stream_claims_response.py b/src/profound/types/reports/factcheck/claim_stream_claims_response.py
index bac661f2..9d71dc29 100644
--- a/src/profound/types/reports/factcheck/claim_stream_claims_response.py
+++ b/src/profound/types/reports/factcheck/claim_stream_claims_response.py
@@ -163,9 +163,7 @@ class FactcheckClaimsRowEvidence(BaseModel):
class FactcheckClaimsRowModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -173,9 +171,7 @@ class FactcheckClaimsRowModel(BaseModel):
class FactcheckClaimsRowPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -183,9 +179,7 @@ class FactcheckClaimsRowPersona(BaseModel):
class FactcheckClaimsRowPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -193,9 +187,7 @@ class FactcheckClaimsRowPrompt(BaseModel):
class FactcheckClaimsRowRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -203,9 +195,7 @@ class FactcheckClaimsRowRegion(BaseModel):
class FactcheckClaimsRowTag(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -213,9 +203,7 @@ class FactcheckClaimsRowTag(BaseModel):
class FactcheckClaimsRowThemeDimensionRef(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -226,9 +214,7 @@ class FactcheckClaimsRowThemeDimensionRef(BaseModel):
class FactcheckClaimsRowTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -255,49 +241,31 @@ class FactcheckClaimsRow(BaseModel):
inaccurate: Optional[int] = None
model: Optional[FactcheckClaimsRowModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
models: Optional[List[FactcheckClaimsRowModel]] = None
occurrence: Optional[float] = None
persona: Optional[FactcheckClaimsRowPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
prompt: Optional[FactcheckClaimsRowPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
reasoning: Optional[str] = None
region: Optional[FactcheckClaimsRowRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
tag: Optional[FactcheckClaimsRowTag] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
theme: Optional[FactcheckClaimsRowTheme] = None
"""Claim theme (string), or an `{id, name}` ref when sectioning by `theme`."""
topic: Optional[FactcheckClaimsRowTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
total_claims: Optional[int] = None
diff --git a/src/profound/types/reports/factcheck_query_scores_response.py b/src/profound/types/reports/factcheck_query_scores_response.py
index d199cf1e..889bc9b7 100644
--- a/src/profound/types/reports/factcheck_query_scores_response.py
+++ b/src/profound/types/reports/factcheck_query_scores_response.py
@@ -28,9 +28,7 @@ class DataCitation(BaseModel):
class DataModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -38,9 +36,7 @@ class DataModel(BaseModel):
class DataPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -48,9 +44,7 @@ class DataPersona(BaseModel):
class DataPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -58,9 +52,7 @@ class DataPrompt(BaseModel):
class DataRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -68,9 +60,7 @@ class DataRegion(BaseModel):
class DataTag(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -78,9 +68,7 @@ class DataTag(BaseModel):
class DataTheme(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -88,9 +76,7 @@ class DataTheme(BaseModel):
class DataTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -113,46 +99,25 @@ class Data(BaseModel):
inaccurate: Optional[int] = None
model: Optional[DataModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
persona: Optional[DataPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
prompt: Optional[DataPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
region: Optional[DataRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
tag: Optional[DataTag] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
theme: Optional[DataTheme] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
topic: Optional[DataTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
if TYPE_CHECKING:
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
diff --git a/src/profound/types/reports/factcheck_stream_scores_response.py b/src/profound/types/reports/factcheck_stream_scores_response.py
index 8e84473b..1a1bd2db 100644
--- a/src/profound/types/reports/factcheck_stream_scores_response.py
+++ b/src/profound/types/reports/factcheck_stream_scores_response.py
@@ -69,9 +69,7 @@ class FactcheckScoreRowCitation(BaseModel):
class FactcheckScoreRowModel(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -79,9 +77,7 @@ class FactcheckScoreRowModel(BaseModel):
class FactcheckScoreRowPersona(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -89,9 +85,7 @@ class FactcheckScoreRowPersona(BaseModel):
class FactcheckScoreRowPrompt(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -99,9 +93,7 @@ class FactcheckScoreRowPrompt(BaseModel):
class FactcheckScoreRowRegion(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -109,9 +101,7 @@ class FactcheckScoreRowRegion(BaseModel):
class FactcheckScoreRowTag(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -119,9 +109,7 @@ class FactcheckScoreRowTag(BaseModel):
class FactcheckScoreRowTheme(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -129,9 +117,7 @@ class FactcheckScoreRowTheme(BaseModel):
class FactcheckScoreRowTopic(BaseModel):
- """
- An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …).
- """
+ """An ``{id, name}`` reference for a grouped dimension value."""
id: Optional[str] = None
@@ -152,46 +138,25 @@ class FactcheckScoreRow(BaseModel):
inaccurate: Optional[int] = None
model: Optional[FactcheckScoreRowModel] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
persona: Optional[FactcheckScoreRowPersona] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
prompt: Optional[FactcheckScoreRowPrompt] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
region: Optional[FactcheckScoreRowRegion] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
tag: Optional[FactcheckScoreRowTag] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
theme: Optional[FactcheckScoreRowTheme] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
topic: Optional[FactcheckScoreRowTopic] = None
- """
- An `{id, name}` reference for a grouped dimension value (model, topic, region,
- …).
- """
+ """An `{id, name}` reference for a grouped dimension value."""
if TYPE_CHECKING:
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
diff --git a/src/profound/types/reports/merchant_name_filter_param.py b/src/profound/types/reports/merchant_name_filter_param.py
deleted file mode 100644
index 5c7c136c..00000000
--- a/src/profound/types/reports/merchant_name_filter_param.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union
-from typing_extensions import Literal, Required, TypedDict
-
-from ..._types import SequenceNotStr
-
-__all__ = ["MerchantNameFilterParam"]
-
-
-class MerchantNameFilterParam(TypedDict, total=False):
- field: Required[Literal["merchant_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
diff --git a/src/profound/types/reports/product_name_filter_param.py b/src/profound/types/reports/product_name_filter_param.py
deleted file mode 100644
index 3e3ee951..00000000
--- a/src/profound/types/reports/product_name_filter_param.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union
-from typing_extensions import Literal, Required, TypedDict
-
-from ..._types import SequenceNotStr
-
-__all__ = ["ProductNameFilterParam"]
-
-
-class ProductNameFilterParam(TypedDict, total=False):
- field: Required[Literal["product_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
diff --git a/src/profound/types/reports/shopping_all_items_with_merchants_params.py b/src/profound/types/reports/shopping_all_items_with_merchants_params.py
deleted file mode 100644
index 323cf9b9..00000000
--- a/src/profound/types/reports/shopping_all_items_with_merchants_params.py
+++ /dev/null
@@ -1,124 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingAllItemsWithMerchantsParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
-
-
-class ShoppingAllItemsWithMerchantsParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
-
- dimensions: List[
- Literal[
- "period",
- "product_name",
- "brand_name",
- "product_url",
- "product_image_urls",
- "product_price",
- "merchant_names",
- "merchant_prices",
- ]
- ]
-
- exclude_topic_ids: bool
-
- filters: Iterable[Filter]
-
- include_count: bool
-
- include_items: SequenceNotStr[str]
-
- include_no_tag: bool
-
- merchant_filter_type: Literal["any", "all"]
-
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "product_rating",
- "product_num_reviews",
- "total_count",
- ]
- ]
-
- order_by: Dict[str, Literal["asc", "desc"]]
-
- owned_asset_names: SequenceNotStr[str]
-
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
-
- rank_by: Literal["visibility", "average_position", "name"]
-
- search_item: Optional[str]
-
- sort_order: Literal["asc", "desc"]
-
- tag_filter_type: Literal["any", "all"]
-
-
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
-
-
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
diff --git a/src/profound/types/reports/shopping_all_items_with_merchants_response.py b/src/profound/types/reports/shopping_all_items_with_merchants_response.py
deleted file mode 100644
index bd2fed48..00000000
--- a/src/profound/types/reports/shopping_all_items_with_merchants_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingAllItemsWithMerchantsResponse"]
-
-
-class ShoppingAllItemsWithMerchantsResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/src/profound/types/reports/shopping_brands_params.py b/src/profound/types/reports/shopping_brands_params.py
new file mode 100644
index 00000000..475b17b5
--- /dev/null
+++ b/src/profound/types/reports/shopping_brands_params.py
@@ -0,0 +1,63 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Iterable, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+from ..._types import SequenceNotStr
+
+__all__ = ["ShoppingBrandsParams", "Filter"]
+
+
+class ShoppingBrandsParams(TypedDict, total=False):
+ category_id: Required[str]
+
+ end_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ start_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ assets: Union[str, SequenceNotStr[str], None]
+ """Restrict to these asset names (a name or list). Overrides `scope`."""
+
+ cursor: Optional[str]
+
+ filter: Optional[Filter]
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ group_by: List[Literal["date", "topic", "region", "prompt"]]
+
+ interval: Literal["day", "week", "month"]
+
+ limit: Optional[int]
+ """Page size for scope=all; default 10, max 50."""
+
+ max_results: Optional[int]
+ """Stream endpoint only: cap the number of streamed rows (default: all)."""
+
+ metrics: Optional[List[Literal["visibility_score", "average_position", "visibility_rank"]]]
+
+ scope: Literal["owned", "all"]
+
+
+_FilterReservedKeywords = TypedDict(
+ "_FilterReservedKeywords",
+ {
+ "and": Optional[Iterable[object]],
+ "not": object,
+ "or": Optional[Iterable[object]],
+ },
+ total=False,
+)
+
+
+class Filter(_FilterReservedKeywords, total=False):
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ field: Optional[str]
+
+ op: Optional[str]
+
+ value: object
diff --git a/src/profound/types/reports/shopping_brands_response.py b/src/profound/types/reports/shopping_brands_response.py
new file mode 100644
index 00000000..0f1eb41e
--- /dev/null
+++ b/src/profound/types/reports/shopping_brands_response.py
@@ -0,0 +1,129 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+
+from pydantic import Field as FieldInfo
+
+from ..._models import BaseModel
+
+__all__ = ["ShoppingBrandsResponse", "Data", "DataPrompt", "DataRegion", "DataTopic", "Info"]
+
+
+class DataPrompt(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class DataRegion(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class DataTopic(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class Data(BaseModel):
+ """One (asset x group) row.
+
+ Group dims/metrics present depend on `group_by`/`metrics`.
+ """
+
+ asset: Optional[Dict[str, object]] = None
+
+ average_position: Optional[float] = None
+
+ date: Optional[str] = None
+
+ prompt: Optional[DataPrompt] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ rank: Optional[int] = None
+ """Asset visibility rank as a top-level field (ungrouped only)."""
+
+ region: Optional[DataRegion] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ topic: Optional[DataTopic] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ visibility_rank: Optional[int] = None
+ """Asset visibility rank (present on grouped rows)."""
+
+ visibility_score: Optional[float] = None
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class Info(BaseModel):
+ count: int
+ """Number of assets on this page.
+
+ When grouped by `date`, `data` holds one row per asset x bucket, so `len(data)`
+ can exceed `count`.
+ """
+
+ end_date: str
+ """Echoed request end date (YYYY-MM-DD, ET)."""
+
+ metrics: List[str]
+ """Metrics returned per row."""
+
+ models: List[str]
+ """Display names of the models the report covers."""
+
+ scope: str
+ """Asset scope: `all`, `owned`, or `custom` when `assets` was given."""
+
+ start_date: str
+ """Echoed request start date (YYYY-MM-DD, ET)."""
+
+ assets: Union[str, List[str], None] = None
+ """Echoed `assets` selection; when set it overrides `scope`."""
+
+ filter: Optional[Dict[str, object]] = None
+ """Echoed normalized filter tree, or null when no filter was sent."""
+
+ next_cursor: Optional[str] = None
+ """Opaque cursor for the next page; null on the last page."""
+
+ total_results: Optional[int] = None
+ """Total assets matching the query before pagination."""
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class ShoppingBrandsResponse(BaseModel):
+ data: List[Data]
+
+ info: Info
diff --git a/src/profound/types/reports/shopping_executions_params.py b/src/profound/types/reports/shopping_executions_params.py
deleted file mode 100644
index 1156bd02..00000000
--- a/src/profound/types/reports/shopping_executions_params.py
+++ /dev/null
@@ -1,93 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingExecutionsParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
-
-
-class ShoppingExecutionsParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- analysis_filter_type: Literal["any", "all"]
-
- analysis_types: List[Literal["visibility", "sentiment", "sentiment_v2", "accuracy"]]
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
-
- exclude_topic_ids: bool
-
- filters: Iterable[Filter]
-
- include_count: bool
-
- include_no_tag: bool
-
- order_by: Dict[str, Literal["asc", "desc"]]
-
- owned_asset_names: SequenceNotStr[str]
-
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
-
- tag_filter_type: Literal["any", "all"]
-
-
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
-
-
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
diff --git a/src/profound/types/reports/shopping_executions_response.py b/src/profound/types/reports/shopping_executions_response.py
deleted file mode 100644
index 740e04b2..00000000
--- a/src/profound/types/reports/shopping_executions_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingExecutionsResponse"]
-
-
-class ShoppingExecutionsResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/src/profound/types/reports/shopping_item_visibility_params.py b/src/profound/types/reports/shopping_item_visibility_params.py
deleted file mode 100644
index 85a19c6a..00000000
--- a/src/profound/types/reports/shopping_item_visibility_params.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingItemVisibilityParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
-
-
-class ShoppingItemVisibilityParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- competitor_limit: int
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
-
- dimensions: List[
- Literal[
- "period",
- "product_key",
- "product_name",
- "brand_name",
- "date",
- "topic_id",
- "prompt_id",
- "prompt",
- "product_url",
- "product_image_urls",
- "product_price",
- ]
- ]
-
- exclude_topic_ids: bool
-
- filters: Iterable[Filter]
-
- include_competitors: bool
-
- include_count: bool
-
- include_items: SequenceNotStr[str]
-
- include_no_tag: bool
-
- include_position_frequency: bool
-
- merchant_filter_type: Literal["any", "all"]
-
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "position1_percentage",
- "position2_percentage",
- "position3_percentage",
- "position_above3_percentage",
- "product_rating",
- "product_num_reviews",
- "total_count",
- ]
- ]
-
- order_by: Dict[str, Literal["asc", "desc"]]
-
- owned_asset_names: SequenceNotStr[str]
-
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
-
- search_item: Optional[str]
-
- tag_filter_type: Literal["any", "all"]
-
- target_product: Optional[str]
-
-
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
-
-
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
diff --git a/src/profound/types/reports/shopping_item_visibility_response.py b/src/profound/types/reports/shopping_item_visibility_response.py
deleted file mode 100644
index 886750a4..00000000
--- a/src/profound/types/reports/shopping_item_visibility_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingItemVisibilityResponse"]
-
-
-class ShoppingItemVisibilityResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/src/profound/types/reports/shopping_merchant_by_items_params.py b/src/profound/types/reports/shopping_merchant_by_items_params.py
deleted file mode 100644
index 4bf22acd..00000000
--- a/src/profound/types/reports/shopping_merchant_by_items_params.py
+++ /dev/null
@@ -1,106 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingMerchantByItemsParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
-
-
-class ShoppingMerchantByItemsParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
-
- dimensions: List[
- Literal[
- "period",
- "merchant_name",
- "product_name",
- "brand_name",
- "product_image_urls",
- "product_price",
- "merchant_prices",
- "has_instant_checkout",
- "delivery_options",
- "merchant_url",
- ]
- ]
-
- exclude_topic_ids: bool
-
- filters: Iterable[Filter]
-
- include_count: bool
-
- include_no_tag: bool
-
- metrics: List[Literal["merchant_visibility", "product_visibility", "product_rank", "avg_position", "total_count"]]
-
- order_by: Dict[str, Literal["asc", "desc"]]
-
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
-
- product_name: Optional[str]
-
- tag_filter_type: Literal["any", "all"]
-
-
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
-
-
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
diff --git a/src/profound/types/reports/shopping_merchant_by_items_response.py b/src/profound/types/reports/shopping_merchant_by_items_response.py
deleted file mode 100644
index 483832db..00000000
--- a/src/profound/types/reports/shopping_merchant_by_items_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingMerchantByItemsResponse"]
-
-
-class ShoppingMerchantByItemsResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/src/profound/types/reports/shopping_merchant_distribution_params.py b/src/profound/types/reports/shopping_merchant_distribution_params.py
deleted file mode 100644
index acbc2090..00000000
--- a/src/profound/types/reports/shopping_merchant_distribution_params.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingMerchantDistributionParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
-
-
-class ShoppingMerchantDistributionParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
-
- dimensions: List[Literal["period", "merchant_name", "date", "owned_asset_name"]]
-
- exclude_topic_ids: bool
-
- filters: Iterable[Filter]
-
- include_count: bool
-
- include_no_tag: bool
-
- metrics: List[
- Literal["offer_count", "product_count", "average_rank", "share_of_offers", "visibility_rank", "total_count"]
- ]
-
- order_by: Dict[str, Literal["asc", "desc"]]
-
- owned_asset_names: SequenceNotStr[str]
-
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
-
- search_merchant: Optional[str]
-
- tag_filter_type: Literal["any", "all"]
-
-
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
-
-
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
diff --git a/src/profound/types/reports/shopping_merchant_distribution_response.py b/src/profound/types/reports/shopping_merchant_distribution_response.py
deleted file mode 100644
index 81c457e4..00000000
--- a/src/profound/types/reports/shopping_merchant_distribution_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingMerchantDistributionResponse"]
-
-
-class ShoppingMerchantDistributionResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/src/profound/types/reports/shopping_merchant_share_params.py b/src/profound/types/reports/shopping_merchant_share_params.py
deleted file mode 100644
index 3fac8b67..00000000
--- a/src/profound/types/reports/shopping_merchant_share_params.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingMerchantShareParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
-
-
-class ShoppingMerchantShareParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
-
- dimensions: List[Literal["period", "topic_id", "prompt_id"]]
-
- exclude_topic_ids: bool
-
- filters: Iterable[Filter]
-
- include_count: bool
-
- include_no_tag: bool
-
- metrics: List[Literal["merchant_share"]]
-
- order_by: Dict[str, Literal["asc", "desc"]]
-
- owned_asset_names: SequenceNotStr[str]
-
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
-
- tag_filter_type: Literal["any", "all"]
-
- target_asset_names: SequenceNotStr[str]
-
-
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
-
-
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
diff --git a/src/profound/types/reports/shopping_merchant_share_response.py b/src/profound/types/reports/shopping_merchant_share_response.py
deleted file mode 100644
index 46e1b03e..00000000
--- a/src/profound/types/reports/shopping_merchant_share_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingMerchantShareResponse"]
-
-
-class ShoppingMerchantShareResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/src/profound/types/reports/shopping_merchant_visibility_by_brand_params.py b/src/profound/types/reports/shopping_merchant_visibility_by_brand_params.py
deleted file mode 100644
index 3c87bdce..00000000
--- a/src/profound/types/reports/shopping_merchant_visibility_by_brand_params.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingMerchantVisibilityByBrandParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
-
-
-class ShoppingMerchantVisibilityByBrandParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
-
- dimensions: List[Literal["period", "merchant_name", "brand_name"]]
-
- exclude_topic_ids: bool
-
- filters: Iterable[Filter]
-
- include_brand: Optional[str]
-
- include_brand_only: bool
-
- include_count: bool
-
- include_no_tag: bool
-
- metrics: List[Literal["visibility_score", "share_of_voice", "average_position", "visibility_rank", "total_count"]]
-
- order_by: Dict[str, Literal["asc", "desc"]]
-
- owned_asset_names: SequenceNotStr[str]
-
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
-
- search_brand: Optional[str]
-
- tag_filter_type: Literal["any", "all"]
-
-
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
-
-
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
diff --git a/src/profound/types/reports/shopping_merchant_visibility_by_brand_response.py b/src/profound/types/reports/shopping_merchant_visibility_by_brand_response.py
deleted file mode 100644
index 0766be29..00000000
--- a/src/profound/types/reports/shopping_merchant_visibility_by_brand_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingMerchantVisibilityByBrandResponse"]
-
-
-class ShoppingMerchantVisibilityByBrandResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/src/profound/types/reports/shopping_merchants_params.py b/src/profound/types/reports/shopping_merchants_params.py
new file mode 100644
index 00000000..741b4d50
--- /dev/null
+++ b/src/profound/types/reports/shopping_merchants_params.py
@@ -0,0 +1,74 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Iterable, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ShoppingMerchantsParams", "Filter"]
+
+
+class ShoppingMerchantsParams(TypedDict, total=False):
+ category_id: Required[str]
+
+ end_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ start_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ cursor: Optional[str]
+
+ filter: Optional[Filter]
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ group_by: List[Literal["date", "brand", "product"]]
+ """
+ `[]` = distribution; `[brand]` = brand share within each merchant; `[product]` =
+ top products per merchant. `date` (distribution only) adds a time series.
+ """
+
+ interval: Literal["day", "week", "month"]
+
+ limit: Optional[int]
+ """Page size; default 10, max 50."""
+
+ max_results: Optional[int]
+ """Stream endpoint only: cap streamed rows."""
+
+ metrics: Optional[
+ List[
+ Literal[
+ "merchant_share",
+ "merchant_share_rank",
+ "merchant_visibility",
+ "merchant_visibility_rank",
+ "visibility_rank",
+ "brand_share",
+ "product_visibility",
+ "product_rank",
+ ]
+ ]
+ ]
+ """Defaults to the chosen view's metrics; must be valid for that view."""
+
+
+_FilterReservedKeywords = TypedDict(
+ "_FilterReservedKeywords",
+ {
+ "and": Optional[Iterable[object]],
+ "not": object,
+ "or": Optional[Iterable[object]],
+ },
+ total=False,
+)
+
+
+class Filter(_FilterReservedKeywords, total=False):
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ field: Optional[str]
+
+ op: Optional[str]
+
+ value: object
diff --git a/src/profound/types/reports/shopping_merchants_response.py b/src/profound/types/reports/shopping_merchants_response.py
new file mode 100644
index 00000000..18759a17
--- /dev/null
+++ b/src/profound/types/reports/shopping_merchants_response.py
@@ -0,0 +1,100 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import TYPE_CHECKING, Dict, List, Optional
+
+from pydantic import Field as FieldInfo
+
+from ..._models import BaseModel
+
+__all__ = ["ShoppingMerchantsResponse", "Data", "Info"]
+
+
+class Data(BaseModel):
+ """One merchant row.
+
+ `brand_name`/`brand_share` appear in the brand-share view; `product`/product
+ metrics in the top-products view; metrics vary by view.
+ """
+
+ brand_name: Optional[str] = None
+
+ brand_share: Optional[float] = None
+
+ date: Optional[str] = None
+
+ merchant_name: Optional[str] = None
+
+ merchant_share: Optional[float] = None
+
+ merchant_share_rank: Optional[int] = None
+
+ merchant_visibility: Optional[float] = None
+
+ merchant_visibility_rank: Optional[int] = None
+
+ product: Optional[Dict[str, object]] = None
+
+ product_rank: Optional[int] = None
+
+ product_visibility: Optional[float] = None
+
+ visibility_rank: Optional[int] = None
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class Info(BaseModel):
+ count: int
+ """Number of rows returned in `data` for this page."""
+
+ end_date: str
+ """Echoed request end date (YYYY-MM-DD, ET)."""
+
+ metrics: List[str]
+ """Metrics returned per row."""
+
+ models: List[str]
+ """Display names of the models the report covers."""
+
+ start_date: str
+ """Echoed request start date (YYYY-MM-DD, ET)."""
+
+ view: str
+ """`distribution`, `brand_share`, or `top_products`."""
+
+ filter: Optional[Dict[str, object]] = None
+ """Echoed normalized filter tree, or null when no filter was sent."""
+
+ next_cursor: Optional[str] = None
+ """Opaque cursor for the next page; null on the last page."""
+
+ total_results: Optional[int] = None
+ """Total rows matching the query before pagination (null when not computed)."""
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class ShoppingMerchantsResponse(BaseModel):
+ data: List[Data]
+
+ info: Info
diff --git a/src/profound/types/reports/shopping_product_merchant_urls_params.py b/src/profound/types/reports/shopping_product_merchant_urls_params.py
deleted file mode 100644
index b489f821..00000000
--- a/src/profound/types/reports/shopping_product_merchant_urls_params.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union
-from datetime import datetime
-from typing_extensions import Required, Annotated, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-
-__all__ = ["ShoppingProductMerchantURLsParams"]
-
-
-class ShoppingProductMerchantURLsParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
-
- product_names: Required[SequenceNotStr[str]]
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
diff --git a/src/profound/types/reports/shopping_product_merchant_urls_response.py b/src/profound/types/reports/shopping_product_merchant_urls_response.py
deleted file mode 100644
index 1a46836c..00000000
--- a/src/profound/types/reports/shopping_product_merchant_urls_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingProductMerchantURLsResponse"]
-
-
-class ShoppingProductMerchantURLsResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/src/profound/types/reports/shopping_products_params.py b/src/profound/types/reports/shopping_products_params.py
new file mode 100644
index 00000000..b26007a0
--- /dev/null
+++ b/src/profound/types/reports/shopping_products_params.py
@@ -0,0 +1,79 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Iterable, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ShoppingProductsParams", "Filter"]
+
+
+class ShoppingProductsParams(TypedDict, total=False):
+ category_id: Required[str]
+
+ end_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ start_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ competitor_limit: int
+ """Competitors returned when `target_product` is set."""
+
+ cursor: Optional[str]
+
+ filter: Optional[Filter]
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ group_by: List[Literal["date", "topic", "prompt"]]
+
+ include_merchants: bool
+ """Include per-product merchant offers (names, prices, urls, images)."""
+
+ interval: Literal["day", "week", "month"]
+
+ limit: Optional[int]
+ """Page size; default 10, max 50."""
+
+ max_results: Optional[int]
+ """Stream endpoint only: cap streamed rows."""
+
+ metrics: Optional[
+ List[
+ Literal[
+ "visibility_score",
+ "average_position",
+ "visibility_rank",
+ "position1_percentage",
+ "position2_percentage",
+ "position3_percentage",
+ "position_above3_percentage",
+ "product_rating",
+ "product_num_reviews",
+ ]
+ ]
+ ]
+
+ target_product: Optional[str]
+ """Return this product plus its top competitors (item view only)."""
+
+
+_FilterReservedKeywords = TypedDict(
+ "_FilterReservedKeywords",
+ {
+ "and": Optional[Iterable[object]],
+ "not": object,
+ "or": Optional[Iterable[object]],
+ },
+ total=False,
+)
+
+
+class Filter(_FilterReservedKeywords, total=False):
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ field: Optional[str]
+
+ op: Optional[str]
+
+ value: object
diff --git a/src/profound/types/reports/shopping_products_response.py b/src/profound/types/reports/shopping_products_response.py
new file mode 100644
index 00000000..3ca3091b
--- /dev/null
+++ b/src/profound/types/reports/shopping_products_response.py
@@ -0,0 +1,127 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import TYPE_CHECKING, Dict, List, Optional
+
+from pydantic import Field as FieldInfo
+
+from ..._models import BaseModel
+
+__all__ = ["ShoppingProductsResponse", "Data", "DataPrompt", "DataTopic", "Info"]
+
+
+class DataPrompt(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class DataTopic(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class Data(BaseModel):
+ """One product row. Merchant fields present only when `include_merchants` is true."""
+
+ average_position: Optional[float] = None
+
+ date: Optional[str] = None
+
+ merchants: Optional[List[Dict[str, object]]] = None
+ """Per-product merchant offers `{name, price}` (only with `include_merchants`)."""
+
+ position_above3_percentage: Optional[float] = None
+
+ position1_percentage: Optional[float] = None
+
+ position2_percentage: Optional[float] = None
+
+ position3_percentage: Optional[float] = None
+
+ product: Optional[Dict[str, object]] = None
+
+ product_image_urls: Optional[List[str]] = None
+
+ product_num_reviews: Optional[int] = None
+
+ product_rating: Optional[float] = None
+
+ product_url: Optional[str] = None
+
+ prompt: Optional[DataPrompt] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ topic: Optional[DataTopic] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ visibility_rank: Optional[int] = None
+
+ visibility_score: Optional[float] = None
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class Info(BaseModel):
+ count: int
+ """Number of products on this page.
+
+ When grouped by `date`/`topic`/`prompt`, `data` holds one row per product x
+ bucket, so `len(data)` can exceed `count`.
+ """
+
+ end_date: str
+ """Echoed request end date (YYYY-MM-DD, ET)."""
+
+ include_merchants: bool
+ """Whether merchant offers are included in each row."""
+
+ metrics: List[str]
+ """Metrics returned per row."""
+
+ models: List[str]
+ """Display names of the models the report covers."""
+
+ start_date: str
+ """Echoed request start date (YYYY-MM-DD, ET)."""
+
+ filter: Optional[Dict[str, object]] = None
+ """Echoed normalized filter tree, or null when no filter was sent."""
+
+ next_cursor: Optional[str] = None
+ """Opaque cursor for the next page; null on the last page."""
+
+ total_results: Optional[int] = None
+ """Total products matching the query before pagination."""
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class ShoppingProductsResponse(BaseModel):
+ data: List[Data]
+
+ info: Info
diff --git a/src/profound/types/reports/shopping_stream_brands_params.py b/src/profound/types/reports/shopping_stream_brands_params.py
new file mode 100644
index 00000000..a0ae59b9
--- /dev/null
+++ b/src/profound/types/reports/shopping_stream_brands_params.py
@@ -0,0 +1,63 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Iterable, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+from ..._types import SequenceNotStr
+
+__all__ = ["ShoppingStreamBrandsParams", "Filter"]
+
+
+class ShoppingStreamBrandsParams(TypedDict, total=False):
+ category_id: Required[str]
+
+ end_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ start_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ assets: Union[str, SequenceNotStr[str], None]
+ """Restrict to these asset names (a name or list). Overrides `scope`."""
+
+ cursor: Optional[str]
+
+ filter: Optional[Filter]
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ group_by: List[Literal["date", "topic", "region", "prompt"]]
+
+ interval: Literal["day", "week", "month"]
+
+ limit: Optional[int]
+ """Page size for scope=all; default 10, max 50."""
+
+ max_results: Optional[int]
+ """Stream endpoint only: cap the number of streamed rows (default: all)."""
+
+ metrics: Optional[List[Literal["visibility_score", "average_position", "visibility_rank"]]]
+
+ scope: Literal["owned", "all"]
+
+
+_FilterReservedKeywords = TypedDict(
+ "_FilterReservedKeywords",
+ {
+ "and": Optional[Iterable[object]],
+ "not": object,
+ "or": Optional[Iterable[object]],
+ },
+ total=False,
+)
+
+
+class Filter(_FilterReservedKeywords, total=False):
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ field: Optional[str]
+
+ op: Optional[str]
+
+ value: object
diff --git a/src/profound/types/reports/shopping_stream_brands_response.py b/src/profound/types/reports/shopping_stream_brands_response.py
new file mode 100644
index 00000000..c0ac8a88
--- /dev/null
+++ b/src/profound/types/reports/shopping_stream_brands_response.py
@@ -0,0 +1,133 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import TypeAlias
+
+from pydantic import Field as FieldInfo
+
+from ..._models import BaseModel
+
+__all__ = [
+ "ShoppingStreamBrandsResponse",
+ "ShoppingBrandsV2Info",
+ "ShoppingBrandRow",
+ "ShoppingBrandRowPrompt",
+ "ShoppingBrandRowRegion",
+ "ShoppingBrandRowTopic",
+]
+
+
+class ShoppingBrandsV2Info(BaseModel):
+ """`summary` event payload (the report `info` block)."""
+
+ count: int
+ """Number of assets on this page.
+
+ When grouped by `date`, `data` holds one row per asset x bucket, so `len(data)`
+ can exceed `count`.
+ """
+
+ end_date: str
+ """Echoed request end date (YYYY-MM-DD, ET)."""
+
+ metrics: List[str]
+ """Metrics returned per row."""
+
+ models: List[str]
+ """Display names of the models the report covers."""
+
+ scope: str
+ """Asset scope: `all`, `owned`, or `custom` when `assets` was given."""
+
+ start_date: str
+ """Echoed request start date (YYYY-MM-DD, ET)."""
+
+ assets: Union[str, List[str], None] = None
+ """Echoed `assets` selection; when set it overrides `scope`."""
+
+ filter: Optional[Dict[str, object]] = None
+ """Echoed normalized filter tree, or null when no filter was sent."""
+
+ next_cursor: Optional[str] = None
+ """Opaque cursor for the next page; null on the last page."""
+
+ total_results: Optional[int] = None
+ """Total assets matching the query before pagination."""
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class ShoppingBrandRowPrompt(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingBrandRowRegion(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingBrandRowTopic(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingBrandRow(BaseModel):
+ """`result` event payload — one visibility row."""
+
+ asset: Optional[Dict[str, object]] = None
+
+ average_position: Optional[float] = None
+
+ date: Optional[str] = None
+
+ prompt: Optional[ShoppingBrandRowPrompt] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ rank: Optional[int] = None
+ """Asset visibility rank as a top-level field (ungrouped only)."""
+
+ region: Optional[ShoppingBrandRowRegion] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ topic: Optional[ShoppingBrandRowTopic] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ visibility_rank: Optional[int] = None
+ """Asset visibility rank (present on grouped rows)."""
+
+ visibility_score: Optional[float] = None
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+ShoppingStreamBrandsResponse: TypeAlias = Union[ShoppingBrandsV2Info, ShoppingBrandRow]
diff --git a/src/profound/types/reports/shopping_stream_merchants_params.py b/src/profound/types/reports/shopping_stream_merchants_params.py
new file mode 100644
index 00000000..f1a4a117
--- /dev/null
+++ b/src/profound/types/reports/shopping_stream_merchants_params.py
@@ -0,0 +1,74 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Iterable, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ShoppingStreamMerchantsParams", "Filter"]
+
+
+class ShoppingStreamMerchantsParams(TypedDict, total=False):
+ category_id: Required[str]
+
+ end_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ start_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ cursor: Optional[str]
+
+ filter: Optional[Filter]
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ group_by: List[Literal["date", "brand", "product"]]
+ """
+ `[]` = distribution; `[brand]` = brand share within each merchant; `[product]` =
+ top products per merchant. `date` (distribution only) adds a time series.
+ """
+
+ interval: Literal["day", "week", "month"]
+
+ limit: Optional[int]
+ """Page size; default 10, max 50."""
+
+ max_results: Optional[int]
+ """Stream endpoint only: cap streamed rows."""
+
+ metrics: Optional[
+ List[
+ Literal[
+ "merchant_share",
+ "merchant_share_rank",
+ "merchant_visibility",
+ "merchant_visibility_rank",
+ "visibility_rank",
+ "brand_share",
+ "product_visibility",
+ "product_rank",
+ ]
+ ]
+ ]
+ """Defaults to the chosen view's metrics; must be valid for that view."""
+
+
+_FilterReservedKeywords = TypedDict(
+ "_FilterReservedKeywords",
+ {
+ "and": Optional[Iterable[object]],
+ "not": object,
+ "or": Optional[Iterable[object]],
+ },
+ total=False,
+)
+
+
+class Filter(_FilterReservedKeywords, total=False):
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ field: Optional[str]
+
+ op: Optional[str]
+
+ value: object
diff --git a/src/profound/types/reports/shopping_stream_merchants_response.py b/src/profound/types/reports/shopping_stream_merchants_response.py
new file mode 100644
index 00000000..e1263b06
--- /dev/null
+++ b/src/profound/types/reports/shopping_stream_merchants_response.py
@@ -0,0 +1,96 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import TypeAlias
+
+from pydantic import Field as FieldInfo
+
+from ..._models import BaseModel
+
+__all__ = ["ShoppingStreamMerchantsResponse", "ShoppingMerchantsV2Info", "ShoppingMerchantRow"]
+
+
+class ShoppingMerchantsV2Info(BaseModel):
+ """`summary` event payload (the report `info` block)."""
+
+ count: int
+ """Number of rows returned in `data` for this page."""
+
+ end_date: str
+ """Echoed request end date (YYYY-MM-DD, ET)."""
+
+ metrics: List[str]
+ """Metrics returned per row."""
+
+ models: List[str]
+ """Display names of the models the report covers."""
+
+ start_date: str
+ """Echoed request start date (YYYY-MM-DD, ET)."""
+
+ view: str
+ """`distribution`, `brand_share`, or `top_products`."""
+
+ filter: Optional[Dict[str, object]] = None
+ """Echoed normalized filter tree, or null when no filter was sent."""
+
+ next_cursor: Optional[str] = None
+ """Opaque cursor for the next page; null on the last page."""
+
+ total_results: Optional[int] = None
+ """Total rows matching the query before pagination (null when not computed)."""
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class ShoppingMerchantRow(BaseModel):
+ """`result` event payload — one merchant row."""
+
+ brand_name: Optional[str] = None
+
+ brand_share: Optional[float] = None
+
+ date: Optional[str] = None
+
+ merchant_name: Optional[str] = None
+
+ merchant_share: Optional[float] = None
+
+ merchant_share_rank: Optional[int] = None
+
+ merchant_visibility: Optional[float] = None
+
+ merchant_visibility_rank: Optional[int] = None
+
+ product: Optional[Dict[str, object]] = None
+
+ product_rank: Optional[int] = None
+
+ product_visibility: Optional[float] = None
+
+ visibility_rank: Optional[int] = None
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+ShoppingStreamMerchantsResponse: TypeAlias = Union[ShoppingMerchantsV2Info, ShoppingMerchantRow]
diff --git a/src/profound/types/reports/shopping_stream_products_params.py b/src/profound/types/reports/shopping_stream_products_params.py
new file mode 100644
index 00000000..daa77060
--- /dev/null
+++ b/src/profound/types/reports/shopping_stream_products_params.py
@@ -0,0 +1,79 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Iterable, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ShoppingStreamProductsParams", "Filter"]
+
+
+class ShoppingStreamProductsParams(TypedDict, total=False):
+ category_id: Required[str]
+
+ end_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ start_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ competitor_limit: int
+ """Competitors returned when `target_product` is set."""
+
+ cursor: Optional[str]
+
+ filter: Optional[Filter]
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ group_by: List[Literal["date", "topic", "prompt"]]
+
+ include_merchants: bool
+ """Include per-product merchant offers (names, prices, urls, images)."""
+
+ interval: Literal["day", "week", "month"]
+
+ limit: Optional[int]
+ """Page size; default 10, max 50."""
+
+ max_results: Optional[int]
+ """Stream endpoint only: cap streamed rows."""
+
+ metrics: Optional[
+ List[
+ Literal[
+ "visibility_score",
+ "average_position",
+ "visibility_rank",
+ "position1_percentage",
+ "position2_percentage",
+ "position3_percentage",
+ "position_above3_percentage",
+ "product_rating",
+ "product_num_reviews",
+ ]
+ ]
+ ]
+
+ target_product: Optional[str]
+ """Return this product plus its top competitors (item view only)."""
+
+
+_FilterReservedKeywords = TypedDict(
+ "_FilterReservedKeywords",
+ {
+ "and": Optional[Iterable[object]],
+ "not": object,
+ "or": Optional[Iterable[object]],
+ },
+ total=False,
+)
+
+
+class Filter(_FilterReservedKeywords, total=False):
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ field: Optional[str]
+
+ op: Optional[str]
+
+ value: object
diff --git a/src/profound/types/reports/shopping_stream_products_response.py b/src/profound/types/reports/shopping_stream_products_response.py
new file mode 100644
index 00000000..2353b023
--- /dev/null
+++ b/src/profound/types/reports/shopping_stream_products_response.py
@@ -0,0 +1,133 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import TypeAlias
+
+from pydantic import Field as FieldInfo
+
+from ..._models import BaseModel
+
+__all__ = [
+ "ShoppingStreamProductsResponse",
+ "ShoppingProductsV2Info",
+ "ShoppingProductRow",
+ "ShoppingProductRowPrompt",
+ "ShoppingProductRowTopic",
+]
+
+
+class ShoppingProductsV2Info(BaseModel):
+ """`summary` event payload (the report `info` block)."""
+
+ count: int
+ """Number of products on this page.
+
+ When grouped by `date`/`topic`/`prompt`, `data` holds one row per product x
+ bucket, so `len(data)` can exceed `count`.
+ """
+
+ end_date: str
+ """Echoed request end date (YYYY-MM-DD, ET)."""
+
+ include_merchants: bool
+ """Whether merchant offers are included in each row."""
+
+ metrics: List[str]
+ """Metrics returned per row."""
+
+ models: List[str]
+ """Display names of the models the report covers."""
+
+ start_date: str
+ """Echoed request start date (YYYY-MM-DD, ET)."""
+
+ filter: Optional[Dict[str, object]] = None
+ """Echoed normalized filter tree, or null when no filter was sent."""
+
+ next_cursor: Optional[str] = None
+ """Opaque cursor for the next page; null on the last page."""
+
+ total_results: Optional[int] = None
+ """Total products matching the query before pagination."""
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class ShoppingProductRowPrompt(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingProductRowTopic(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingProductRow(BaseModel):
+ """`result` event payload — one product row."""
+
+ average_position: Optional[float] = None
+
+ date: Optional[str] = None
+
+ merchants: Optional[List[Dict[str, object]]] = None
+ """Per-product merchant offers `{name, price}` (only with `include_merchants`)."""
+
+ position_above3_percentage: Optional[float] = None
+
+ position1_percentage: Optional[float] = None
+
+ position2_percentage: Optional[float] = None
+
+ position3_percentage: Optional[float] = None
+
+ product: Optional[Dict[str, object]] = None
+
+ product_image_urls: Optional[List[str]] = None
+
+ product_num_reviews: Optional[int] = None
+
+ product_rating: Optional[float] = None
+
+ product_url: Optional[str] = None
+
+ prompt: Optional[ShoppingProductRowPrompt] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ topic: Optional[ShoppingProductRowTopic] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ visibility_rank: Optional[int] = None
+
+ visibility_score: Optional[float] = None
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+ShoppingStreamProductsResponse: TypeAlias = Union[ShoppingProductsV2Info, ShoppingProductRow]
diff --git a/src/profound/types/reports/shopping_stream_trigger_rate_params.py b/src/profound/types/reports/shopping_stream_trigger_rate_params.py
new file mode 100644
index 00000000..61dc49c2
--- /dev/null
+++ b/src/profound/types/reports/shopping_stream_trigger_rate_params.py
@@ -0,0 +1,57 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Iterable, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ShoppingStreamTriggerRateParams", "Filter"]
+
+
+class ShoppingStreamTriggerRateParams(TypedDict, total=False):
+ category_id: Required[str]
+
+ end_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ start_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
+
+ cursor: Optional[str]
+
+ filter: Optional[Filter]
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ group_by: List[Literal["date", "topic", "region", "persona", "prompt"]]
+ """Group by `prompt`/`topic` for the per-prompt/-topic trigger rate."""
+
+ interval: Literal["day", "week", "month"]
+
+ limit: Optional[int]
+ """Page size; default 10, max 50."""
+
+ max_results: Optional[int]
+ """Stream endpoint only: cap streamed rows."""
+
+ metrics: Optional[List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]]]
+
+
+_FilterReservedKeywords = TypedDict(
+ "_FilterReservedKeywords",
+ {
+ "and": Optional[Iterable[object]],
+ "not": object,
+ "or": Optional[Iterable[object]],
+ },
+ total=False,
+)
+
+
+class Filter(_FilterReservedKeywords, total=False):
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
+
+ field: Optional[str]
+
+ op: Optional[str]
+
+ value: object
diff --git a/src/profound/types/reports/shopping_stream_trigger_rate_response.py b/src/profound/types/reports/shopping_stream_trigger_rate_response.py
new file mode 100644
index 00000000..2c6de9cb
--- /dev/null
+++ b/src/profound/types/reports/shopping_stream_trigger_rate_response.py
@@ -0,0 +1,129 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import TypeAlias
+
+from pydantic import Field as FieldInfo
+
+from ..._models import BaseModel
+
+__all__ = [
+ "ShoppingStreamTriggerRateResponse",
+ "ShoppingTriggerRateV2Info",
+ "ShoppingTriggerRateRow",
+ "ShoppingTriggerRateRowPersona",
+ "ShoppingTriggerRateRowPrompt",
+ "ShoppingTriggerRateRowRegion",
+ "ShoppingTriggerRateRowTopic",
+]
+
+
+class ShoppingTriggerRateV2Info(BaseModel):
+ """`summary` event payload (the report `info` block)."""
+
+ count: int
+ """Number of rows returned in `data` for this page."""
+
+ end_date: str
+ """Echoed request end date (YYYY-MM-DD, ET)."""
+
+ metrics: List[str]
+ """Metrics returned per row."""
+
+ models: List[str]
+ """Display names of the models the report covers."""
+
+ start_date: str
+ """Echoed request start date (YYYY-MM-DD, ET)."""
+
+ filter: Optional[Dict[str, object]] = None
+ """Echoed normalized filter tree, or null when no filter was sent."""
+
+ next_cursor: Optional[str] = None
+ """Opaque cursor for the next page; null on the last page."""
+
+ total_results: Optional[int] = None
+ """Total rows matching the query before pagination (null when not computed)."""
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class ShoppingTriggerRateRowPersona(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingTriggerRateRowPrompt(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingTriggerRateRowRegion(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingTriggerRateRowTopic(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class ShoppingTriggerRateRow(BaseModel):
+ """`result` event payload — one trigger row."""
+
+ date: Optional[str] = None
+
+ persona: Optional[ShoppingTriggerRateRowPersona] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ prompt: Optional[ShoppingTriggerRateRowPrompt] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ region: Optional[ShoppingTriggerRateRowRegion] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ shopping_triggered_runs: Optional[int] = None
+
+ topic: Optional[ShoppingTriggerRateRowTopic] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ total_runs: Optional[int] = None
+
+ trigger_rate_percentage: Optional[float] = None
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+ShoppingStreamTriggerRateResponse: TypeAlias = Union[ShoppingTriggerRateV2Info, ShoppingTriggerRateRow]
diff --git a/src/profound/types/reports/shopping_trigger_rate_params.py b/src/profound/types/reports/shopping_trigger_rate_params.py
index bbf83eca..919c4a0b 100644
--- a/src/profound/types/reports/shopping_trigger_rate_params.py
+++ b/src/profound/types/reports/shopping_trigger_rate_params.py
@@ -2,92 +2,56 @@
from __future__ import annotations
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingTriggerRateParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
+from typing import List, Iterable, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ShoppingTriggerRateParams", "Filter"]
class ShoppingTriggerRateParams(TypedDict, total=False):
category_id: Required[str]
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
+ end_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
- dimensions: List[
- Literal["period", "date", "model_id", "topic_id", "region_id", "persona_id", "prompt_id", "prompt"]
- ]
+ start_date: Required[str]
+ """YYYY-MM-DD, ET, inclusive"""
- exclude_topic_ids: bool
+ cursor: Optional[str]
- filters: Iterable[Filter]
+ filter: Optional[Filter]
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
- include_count: bool
+ group_by: List[Literal["date", "topic", "region", "persona", "prompt"]]
+ """Group by `prompt`/`topic` for the per-prompt/-topic trigger rate."""
- include_no_tag: bool
+ interval: Literal["day", "week", "month"]
- metrics: List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]]
+ limit: Optional[int]
+ """Page size; default 10, max 50."""
- order_by: Dict[str, Literal["asc", "desc"]]
+ max_results: Optional[int]
+ """Stream endpoint only: cap streamed rows."""
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
+ metrics: Optional[List[Literal["total_runs", "shopping_triggered_runs", "trigger_rate_percentage"]]]
- tag_filter_type: Literal["any", "all"]
+_FilterReservedKeywords = TypedDict(
+ "_FilterReservedKeywords",
+ {
+ "and": Optional[Iterable[object]],
+ "not": object,
+ "or": Optional[Iterable[object]],
+ },
+ total=False,
+)
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
+class Filter(_FilterReservedKeywords, total=False):
+ """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group."""
- value: Required[Union[str, SequenceNotStr[str]]]
+ field: Optional[str]
+ op: Optional[str]
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
+ value: object
diff --git a/src/profound/types/reports/shopping_trigger_rate_response.py b/src/profound/types/reports/shopping_trigger_rate_response.py
index 45b4e554..91ac2a94 100644
--- a/src/profound/types/reports/shopping_trigger_rate_response.py
+++ b/src/profound/types/reports/shopping_trigger_rate_response.py
@@ -1,15 +1,121 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List
+from typing import TYPE_CHECKING, Dict, List, Optional
+
+from pydantic import Field as FieldInfo
from ..._models import BaseModel
-from ..report_info import ReportInfo
-__all__ = ["ShoppingTriggerRateResponse"]
+__all__ = ["ShoppingTriggerRateResponse", "Data", "DataPersona", "DataPrompt", "DataRegion", "DataTopic", "Info"]
+
+
+class DataPersona(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class DataPrompt(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class DataRegion(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class DataTopic(BaseModel):
+ """An ``{id, name}`` reference for a grouped dimension value."""
+
+ id: Optional[str] = None
+
+ name: Optional[str] = None
+
+
+class Data(BaseModel):
+ """One trigger-rate row. Group dims present depend on `group_by`."""
+
+ date: Optional[str] = None
+
+ persona: Optional[DataPersona] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ prompt: Optional[DataPrompt] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ region: Optional[DataRegion] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ shopping_triggered_runs: Optional[int] = None
+
+ topic: Optional[DataTopic] = None
+ """An `{id, name}` reference for a grouped dimension value."""
+
+ total_runs: Optional[int] = None
+
+ trigger_rate_percentage: Optional[float] = None
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
+
+
+class Info(BaseModel):
+ count: int
+ """Number of rows returned in `data` for this page."""
+
+ end_date: str
+ """Echoed request end date (YYYY-MM-DD, ET)."""
+
+ metrics: List[str]
+ """Metrics returned per row."""
+
+ models: List[str]
+ """Display names of the models the report covers."""
+
+ start_date: str
+ """Echoed request start date (YYYY-MM-DD, ET)."""
+
+ filter: Optional[Dict[str, object]] = None
+ """Echoed normalized filter tree, or null when no filter was sent."""
+
+ next_cursor: Optional[str] = None
+ """Opaque cursor for the next page; null on the last page."""
+
+ total_results: Optional[int] = None
+ """Total rows matching the query before pagination (null when not computed)."""
+
+ if TYPE_CHECKING:
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
+ # value to this field, so for compatibility we avoid doing it at runtime.
+ __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ # Stub to indicate that arbitrary properties are accepted.
+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
+ # `getattr(obj, '$type')`
+ def __getattr__(self, attr: str) -> object: ...
+ else:
+ __pydantic_extra__: Dict[str, object]
class ShoppingTriggerRateResponse(BaseModel):
- data: List[Dict[str, object]]
+ data: List[Data]
- info: ReportInfo
- """Base model for report information."""
+ info: Info
diff --git a/src/profound/types/reports/shopping_visibility_params.py b/src/profound/types/reports/shopping_visibility_params.py
deleted file mode 100644
index 85b6ef4a..00000000
--- a/src/profound/types/reports/shopping_visibility_params.py
+++ /dev/null
@@ -1,120 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Dict, List, Union, Iterable, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from ..._utils import PropertyInfo
-from ..prompt_id_filter_param import PromptIDFilterParam
-from .brand_name_filter_param import BrandNameFilterParam
-from ..shared_params.pagination import Pagination
-from .product_name_filter_param import ProductNameFilterParam
-from .merchant_name_filter_param import MerchantNameFilterParam
-from ..shared_params.tag_id_filter import TagIDFilter
-from ..shared_params.model_id_filter import ModelIDFilter
-from ..shared_params.topic_id_filter import TopicIDFilter
-from ..shared_params.region_id_filter import RegionIDFilter
-from ..shared_params.persona_id_filter import PersonaIDFilter
-
-__all__ = ["ShoppingVisibilityParams", "Filter", "FilterProfoundShoppingAPIAssetNameFilter"]
-
-
-class ShoppingVisibilityParams(TypedDict, total=False):
- category_id: Required[str]
-
- end_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
- """Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp."""
-
- comparison_end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- comparison_start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
-
- date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"]
-
- dimensions: List[
- Literal["period", "asset_name", "date", "model_id", "topic_id", "region_id", "prompt_id", "prompt"]
- ]
-
- exclude_topic_ids: bool
-
- filters: Iterable[Filter]
-
- include_asset: Optional[str]
-
- include_asset_only: bool
-
- include_assets_only: SequenceNotStr[str]
-
- include_count: bool
-
- include_no_tag: bool
-
- include_position_frequency: bool
-
- metrics: List[
- Literal[
- "visibility_score",
- "share_of_voice",
- "average_position",
- "visibility_rank",
- "average_position_rank",
- "position1_percentage",
- "position2_percentage",
- "position3_percentage",
- "position_above3_percentage",
- "total_count",
- ]
- ]
-
- order_by: Dict[str, Literal["asc", "desc"]]
-
- owned_asset_names: SequenceNotStr[str]
-
- pagination: Optional[Pagination]
- """Offset-based pagination parameters."""
-
- rank_by: Literal["visibility_score", "average_position"]
-
- search_asset: Optional[str]
-
- tag_filter_type: Literal["any", "all"]
-
-
-class FilterProfoundShoppingAPIAssetNameFilter(TypedDict, total=False):
- field: Required[Literal["asset_name"]]
-
- operator: Required[
- Literal[
- "is",
- "not_is",
- "in",
- "not_in",
- "contains",
- "not_contains",
- "matches",
- "contains_case_insensitive",
- "not_contains_case_insensitive",
- ]
- ]
-
- value: Required[Union[str, SequenceNotStr[str]]]
-
-
-Filter: TypeAlias = Union[
- RegionIDFilter,
- ModelIDFilter,
- TopicIDFilter,
- TagIDFilter,
- PromptIDFilterParam,
- PersonaIDFilter,
- BrandNameFilterParam,
- MerchantNameFilterParam,
- ProductNameFilterParam,
- FilterProfoundShoppingAPIAssetNameFilter,
-]
diff --git a/src/profound/types/reports/shopping_visibility_response.py b/src/profound/types/reports/shopping_visibility_response.py
deleted file mode 100644
index 2080cc45..00000000
--- a/src/profound/types/reports/shopping_visibility_response.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, List
-
-from ..._models import BaseModel
-from ..report_info import ReportInfo
-
-__all__ = ["ShoppingVisibilityResponse"]
-
-
-class ShoppingVisibilityResponse(BaseModel):
- data: List[Dict[str, object]]
-
- info: ReportInfo
- """Base model for report information."""
diff --git a/tests/api_resources/organizations/test_categories.py b/tests/api_resources/organizations/test_categories.py
index 421745b6..9fdb6c69 100644
--- a/tests/api_resources/organizations/test_categories.py
+++ b/tests/api_resources/organizations/test_categories.py
@@ -20,6 +20,7 @@
CategoryRetrieveRegionsResponse,
CategoryUpdatePromptStatusResponse,
CategoryGetCategoryPersonasResponse,
+ CategoryGetCitationCategoriesResponse,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -148,6 +149,7 @@ def test_method_create_prompts_with_all_params(self, client: Profound) -> None:
"id": "id",
"name": "name",
},
+ "id": "id",
"analysis_types": ["visibility"],
"asset": {
"id": "id",
@@ -275,6 +277,48 @@ def test_path_params_get_category_personas(self, client: Profound) -> None:
"",
)
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_method_get_citation_categories(self, client: Profound) -> None:
+ category = client.organizations.categories.get_citation_categories(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(CategoryGetCitationCategoriesResponse, category, path=["response"])
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_raw_response_get_citation_categories(self, client: Profound) -> None:
+ response = client.organizations.categories.with_raw_response.get_citation_categories(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ category = response.parse()
+ assert_matches_type(CategoryGetCitationCategoriesResponse, category, path=["response"])
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_streaming_response_get_citation_categories(self, client: Profound) -> None:
+ with client.organizations.categories.with_streaming_response.get_citation_categories(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ category = response.parse()
+ assert_matches_type(CategoryGetCitationCategoriesResponse, category, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_path_params_get_citation_categories(self, client: Profound) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `category_id` but received ''"):
+ client.organizations.categories.with_raw_response.get_citation_categories(
+ "",
+ )
+
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_prompts(self, client: Profound) -> None:
@@ -746,6 +790,7 @@ async def test_method_create_prompts_with_all_params(self, async_client: AsyncPr
"id": "id",
"name": "name",
},
+ "id": "id",
"analysis_types": ["visibility"],
"asset": {
"id": "id",
@@ -873,6 +918,48 @@ async def test_path_params_get_category_personas(self, async_client: AsyncProfou
"",
)
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_method_get_citation_categories(self, async_client: AsyncProfound) -> None:
+ category = await async_client.organizations.categories.get_citation_categories(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(CategoryGetCitationCategoriesResponse, category, path=["response"])
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_raw_response_get_citation_categories(self, async_client: AsyncProfound) -> None:
+ response = await async_client.organizations.categories.with_raw_response.get_citation_categories(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ category = await response.parse()
+ assert_matches_type(CategoryGetCitationCategoriesResponse, category, path=["response"])
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_streaming_response_get_citation_categories(self, async_client: AsyncProfound) -> None:
+ async with async_client.organizations.categories.with_streaming_response.get_citation_categories(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ category = await response.parse()
+ assert_matches_type(CategoryGetCitationCategoriesResponse, category, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_path_params_get_citation_categories(self, async_client: AsyncProfound) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `category_id` but received ''"):
+ await async_client.organizations.categories.with_raw_response.get_citation_categories(
+ "",
+ )
+
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_prompts(self, async_client: AsyncProfound) -> None:
diff --git a/tests/api_resources/reports/test_shopping.py b/tests/api_resources/reports/test_shopping.py
index da87bf84..59919ecb 100644
--- a/tests/api_resources/reports/test_shopping.py
+++ b/tests/api_resources/reports/test_shopping.py
@@ -9,18 +9,11 @@
from profound import Profound, AsyncProfound
from tests.utils import assert_matches_type
-from profound._utils import parse_datetime
from profound.types.reports import (
- ShoppingExecutionsResponse,
- ShoppingVisibilityResponse,
+ ShoppingBrandsResponse,
+ ShoppingProductsResponse,
+ ShoppingMerchantsResponse,
ShoppingTriggerRateResponse,
- ShoppingMerchantShareResponse,
- ShoppingItemVisibilityResponse,
- ShoppingMerchantByItemsResponse,
- ShoppingProductMerchantURLsResponse,
- ShoppingMerchantDistributionResponse,
- ShoppingAllItemsWithMerchantsResponse,
- ShoppingMerchantVisibilityByBrandResponse,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -31,565 +24,448 @@ class TestShopping:
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_method_all_items_with_merchants(self, client: Profound) -> None:
- shopping = client.reports.shopping.all_items_with_merchants(
+ def test_method_brands(self, client: Profound) -> None:
+ shopping = client.reports.shopping.brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingAllItemsWithMerchantsResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_all_items_with_merchants_with_all_params(self, client: Profound) -> None:
- shopping = client.reports.shopping.all_items_with_merchants(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_items=["string"],
- include_no_tag=True,
- merchant_filter_type="any",
- metrics=["visibility_score"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ assert_matches_type(ShoppingBrandsResponse, shopping, path=["response"])
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_method_brands_with_all_params(self, client: Profound) -> None:
+ shopping = client.reports.shopping.brands(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ assets="string",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- rank_by="visibility",
- search_item="search_item",
- sort_order="asc",
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["visibility_score"],
+ scope="owned",
)
- assert_matches_type(ShoppingAllItemsWithMerchantsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingBrandsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_raw_response_all_items_with_merchants(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.all_items_with_merchants(
+ def test_raw_response_brands(self, client: Profound) -> None:
+ response = client.reports.shopping.with_raw_response.brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = response.parse()
- assert_matches_type(ShoppingAllItemsWithMerchantsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingBrandsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_streaming_response_all_items_with_merchants(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.all_items_with_merchants(
+ def test_streaming_response_brands(self, client: Profound) -> None:
+ with client.reports.shopping.with_streaming_response.brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = response.parse()
- assert_matches_type(ShoppingAllItemsWithMerchantsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingBrandsResponse, shopping, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_method_executions(self, client: Profound) -> None:
- shopping = client.reports.shopping.executions(
+ def test_method_merchants(self, client: Profound) -> None:
+ shopping = client.reports.shopping.merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingExecutionsResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_executions_with_all_params(self, client: Profound) -> None:
- shopping = client.reports.shopping.executions(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- analysis_filter_type="any",
- analysis_types=["visibility"],
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ assert_matches_type(ShoppingMerchantsResponse, shopping, path=["response"])
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_method_merchants_with_all_params(self, client: Profound) -> None:
+ shopping = client.reports.shopping.merchants(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["merchant_share"],
)
- assert_matches_type(ShoppingExecutionsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingMerchantsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_raw_response_executions(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.executions(
+ def test_raw_response_merchants(self, client: Profound) -> None:
+ response = client.reports.shopping.with_raw_response.merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = response.parse()
- assert_matches_type(ShoppingExecutionsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingMerchantsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_streaming_response_executions(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.executions(
+ def test_streaming_response_merchants(self, client: Profound) -> None:
+ with client.reports.shopping.with_streaming_response.merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = response.parse()
- assert_matches_type(ShoppingExecutionsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingMerchantsResponse, shopping, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_method_item_visibility(self, client: Profound) -> None:
- shopping = client.reports.shopping.item_visibility(
+ def test_method_products(self, client: Profound) -> None:
+ shopping = client.reports.shopping.products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingItemVisibilityResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingProductsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_method_item_visibility_with_all_params(self, client: Profound) -> None:
- shopping = client.reports.shopping.item_visibility(
+ def test_method_products_with_all_params(self, client: Profound) -> None:
+ shopping = client.reports.shopping.products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
competitor_limit=1,
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_competitors=True,
- include_count=True,
- include_items=["string"],
- include_no_tag=True,
- include_position_frequency=True,
- merchant_filter_type="any",
- metrics=["visibility_score"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- search_item="search_item",
- tag_filter_type="any",
- target_product="target_product",
+ group_by=["date"],
+ include_merchants=True,
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["visibility_score"],
+ target_product="x",
)
- assert_matches_type(ShoppingItemVisibilityResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingProductsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_raw_response_item_visibility(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.item_visibility(
+ def test_raw_response_products(self, client: Profound) -> None:
+ response = client.reports.shopping.with_raw_response.products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = response.parse()
- assert_matches_type(ShoppingItemVisibilityResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingProductsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_streaming_response_item_visibility(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.item_visibility(
+ def test_streaming_response_products(self, client: Profound) -> None:
+ with client.reports.shopping.with_streaming_response.products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = response.parse()
- assert_matches_type(ShoppingItemVisibilityResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingProductsResponse, shopping, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_method_merchant_by_items(self, client: Profound) -> None:
- shopping = client.reports.shopping.merchant_by_items(
+ def test_method_stream_brands(self, client: Profound) -> None:
+ shopping_stream = client.reports.shopping.stream_brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingMerchantByItemsResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_merchant_by_items_with_all_params(self, client: Profound) -> None:
- shopping = client.reports.shopping.merchant_by_items(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- metrics=["merchant_visibility"],
- order_by={"foo": "asc"},
- pagination={
- "limit": 1,
- "offset": 0,
+ shopping_stream.response.close()
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_method_stream_brands_with_all_params(self, client: Profound) -> None:
+ shopping_stream = client.reports.shopping.stream_brands(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ assets="string",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- product_name="product_name",
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["visibility_score"],
+ scope="owned",
)
- assert_matches_type(ShoppingMerchantByItemsResponse, shopping, path=["response"])
+ shopping_stream.response.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_raw_response_merchant_by_items(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.merchant_by_items(
+ def test_raw_response_stream_brands(self, client: Profound) -> None:
+ response = client.reports.shopping.with_raw_response.stream_brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingMerchantByItemsResponse, shopping, path=["response"])
+ stream = response.parse()
+ stream.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_streaming_response_merchant_by_items(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.merchant_by_items(
+ def test_streaming_response_stream_brands(self, client: Profound) -> None:
+ with client.reports.shopping.with_streaming_response.stream_brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingMerchantByItemsResponse, shopping, path=["response"])
+ stream = response.parse()
+ stream.close()
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_method_merchant_distribution(self, client: Profound) -> None:
- shopping = client.reports.shopping.merchant_distribution(
+ def test_method_stream_merchants(self, client: Profound) -> None:
+ shopping_stream = client.reports.shopping.stream_merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingMerchantDistributionResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_merchant_distribution_with_all_params(self, client: Profound) -> None:
- shopping = client.reports.shopping.merchant_distribution(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- metrics=["offer_count"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ shopping_stream.response.close()
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_method_stream_merchants_with_all_params(self, client: Profound) -> None:
+ shopping_stream = client.reports.shopping.stream_merchants(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- search_merchant="search_merchant",
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["merchant_share"],
)
- assert_matches_type(ShoppingMerchantDistributionResponse, shopping, path=["response"])
+ shopping_stream.response.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_raw_response_merchant_distribution(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.merchant_distribution(
+ def test_raw_response_stream_merchants(self, client: Profound) -> None:
+ response = client.reports.shopping.with_raw_response.stream_merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingMerchantDistributionResponse, shopping, path=["response"])
+ stream = response.parse()
+ stream.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_streaming_response_merchant_distribution(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.merchant_distribution(
+ def test_streaming_response_stream_merchants(self, client: Profound) -> None:
+ with client.reports.shopping.with_streaming_response.stream_merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingMerchantDistributionResponse, shopping, path=["response"])
+ stream = response.parse()
+ stream.close()
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_method_merchant_share(self, client: Profound) -> None:
- shopping = client.reports.shopping.merchant_share(
+ def test_method_stream_products(self, client: Profound) -> None:
+ shopping_stream = client.reports.shopping.stream_products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingMerchantShareResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_merchant_share_with_all_params(self, client: Profound) -> None:
- shopping = client.reports.shopping.merchant_share(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- metrics=["merchant_share"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ shopping_stream.response.close()
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ def test_method_stream_products_with_all_params(self, client: Profound) -> None:
+ shopping_stream = client.reports.shopping.stream_products(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ competitor_limit=1,
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- tag_filter_type="any",
- target_asset_names=["string"],
+ group_by=["date"],
+ include_merchants=True,
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["visibility_score"],
+ target_product="x",
)
- assert_matches_type(ShoppingMerchantShareResponse, shopping, path=["response"])
+ shopping_stream.response.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_raw_response_merchant_share(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.merchant_share(
+ def test_raw_response_stream_products(self, client: Profound) -> None:
+ response = client.reports.shopping.with_raw_response.stream_products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingMerchantShareResponse, shopping, path=["response"])
+ stream = response.parse()
+ stream.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_streaming_response_merchant_share(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.merchant_share(
+ def test_streaming_response_stream_products(self, client: Profound) -> None:
+ with client.reports.shopping.with_streaming_response.stream_products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingMerchantShareResponse, shopping, path=["response"])
+ stream = response.parse()
+ stream.close()
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_method_merchant_visibility_by_brand(self, client: Profound) -> None:
- shopping = client.reports.shopping.merchant_visibility_by_brand(
+ def test_method_stream_trigger_rate(self, client: Profound) -> None:
+ shopping_stream = client.reports.shopping.stream_trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- )
- assert_matches_type(ShoppingMerchantVisibilityByBrandResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_merchant_visibility_by_brand_with_all_params(self, client: Profound) -> None:
- shopping = client.reports.shopping.merchant_visibility_by_brand(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_brand="include_brand",
- include_brand_only=True,
- include_count=True,
- include_no_tag=True,
- metrics=["visibility_score"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
- },
- search_brand="search_brand",
- tag_filter_type="any",
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingMerchantVisibilityByBrandResponse, shopping, path=["response"])
+ shopping_stream.response.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_raw_response_merchant_visibility_by_brand(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.merchant_visibility_by_brand(
+ def test_method_stream_trigger_rate_with_all_params(self, client: Profound) -> None:
+ shopping_stream = client.reports.shopping.stream_trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingMerchantVisibilityByBrandResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_streaming_response_merchant_visibility_by_brand(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.merchant_visibility_by_brand(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- shopping = response.parse()
- assert_matches_type(ShoppingMerchantVisibilityByBrandResponse, shopping, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_product_merchant_urls(self, client: Profound) -> None:
- shopping = client.reports.shopping.product_merchant_urls(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- product_names=["string"],
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
+ },
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["total_runs"],
)
- assert_matches_type(ShoppingProductMerchantURLsResponse, shopping, path=["response"])
+ shopping_stream.response.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_raw_response_product_merchant_urls(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.product_merchant_urls(
+ def test_raw_response_stream_trigger_rate(self, client: Profound) -> None:
+ response = client.reports.shopping.with_raw_response.stream_trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- product_names=["string"],
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingProductMerchantURLsResponse, shopping, path=["response"])
+ stream = response.parse()
+ stream.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- def test_streaming_response_product_merchant_urls(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.product_merchant_urls(
+ def test_streaming_response_stream_trigger_rate(self, client: Profound) -> None:
+ with client.reports.shopping.with_streaming_response.stream_trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- product_names=["string"],
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingProductMerchantURLsResponse, shopping, path=["response"])
+ stream = response.parse()
+ stream.close()
assert cast(Any, response.is_closed) is True
@@ -598,8 +474,8 @@ def test_streaming_response_product_merchant_urls(self, client: Profound) -> Non
def test_method_trigger_rate(self, client: Profound) -> None:
shopping = client.reports.shopping.trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert_matches_type(ShoppingTriggerRateResponse, shopping, path=["response"])
@@ -608,29 +484,21 @@ def test_method_trigger_rate(self, client: Profound) -> None:
def test_method_trigger_rate_with_all_params(self, client: Profound) -> None:
shopping = client.reports.shopping.trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- metrics=["total_runs"],
- order_by={"foo": "asc"},
- pagination={
- "limit": 1,
- "offset": 0,
+ end_date="end_date",
+ start_date="start_date",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["total_runs"],
)
assert_matches_type(ShoppingTriggerRateResponse, shopping, path=["response"])
@@ -639,8 +507,8 @@ def test_method_trigger_rate_with_all_params(self, client: Profound) -> None:
def test_raw_response_trigger_rate(self, client: Profound) -> None:
response = client.reports.shopping.with_raw_response.trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert response.is_closed is True
@@ -653,8 +521,8 @@ def test_raw_response_trigger_rate(self, client: Profound) -> None:
def test_streaming_response_trigger_rate(self, client: Profound) -> None:
with client.reports.shopping.with_streaming_response.trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -664,84 +532,6 @@ def test_streaming_response_trigger_rate(self, client: Profound) -> None:
assert cast(Any, response.is_closed) is True
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_visibility(self, client: Profound) -> None:
- shopping = client.reports.shopping.visibility(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- )
- assert_matches_type(ShoppingVisibilityResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_method_visibility_with_all_params(self, client: Profound) -> None:
- shopping = client.reports.shopping.visibility(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_asset="include_asset",
- include_asset_only=True,
- include_assets_only=["string"],
- include_count=True,
- include_no_tag=True,
- include_position_frequency=True,
- metrics=["visibility_score"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
- },
- rank_by="visibility_score",
- search_asset="search_asset",
- tag_filter_type="any",
- )
- assert_matches_type(ShoppingVisibilityResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_raw_response_visibility(self, client: Profound) -> None:
- response = client.reports.shopping.with_raw_response.visibility(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = response.parse()
- assert_matches_type(ShoppingVisibilityResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- def test_streaming_response_visibility(self, client: Profound) -> None:
- with client.reports.shopping.with_streaming_response.visibility(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- shopping = response.parse()
- assert_matches_type(ShoppingVisibilityResponse, shopping, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
class TestAsyncShopping:
parametrize = pytest.mark.parametrize(
@@ -750,565 +540,448 @@ class TestAsyncShopping:
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_method_all_items_with_merchants(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.all_items_with_merchants(
+ async def test_method_brands(self, async_client: AsyncProfound) -> None:
+ shopping = await async_client.reports.shopping.brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingAllItemsWithMerchantsResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_all_items_with_merchants_with_all_params(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.all_items_with_merchants(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_items=["string"],
- include_no_tag=True,
- merchant_filter_type="any",
- metrics=["visibility_score"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ assert_matches_type(ShoppingBrandsResponse, shopping, path=["response"])
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_method_brands_with_all_params(self, async_client: AsyncProfound) -> None:
+ shopping = await async_client.reports.shopping.brands(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ assets="string",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- rank_by="visibility",
- search_item="search_item",
- sort_order="asc",
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["visibility_score"],
+ scope="owned",
)
- assert_matches_type(ShoppingAllItemsWithMerchantsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingBrandsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_raw_response_all_items_with_merchants(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.all_items_with_merchants(
+ async def test_raw_response_brands(self, async_client: AsyncProfound) -> None:
+ response = await async_client.reports.shopping.with_raw_response.brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = await response.parse()
- assert_matches_type(ShoppingAllItemsWithMerchantsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingBrandsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_streaming_response_all_items_with_merchants(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.all_items_with_merchants(
+ async def test_streaming_response_brands(self, async_client: AsyncProfound) -> None:
+ async with async_client.reports.shopping.with_streaming_response.brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = await response.parse()
- assert_matches_type(ShoppingAllItemsWithMerchantsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingBrandsResponse, shopping, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_method_executions(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.executions(
+ async def test_method_merchants(self, async_client: AsyncProfound) -> None:
+ shopping = await async_client.reports.shopping.merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingExecutionsResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_executions_with_all_params(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.executions(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- analysis_filter_type="any",
- analysis_types=["visibility"],
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ assert_matches_type(ShoppingMerchantsResponse, shopping, path=["response"])
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_method_merchants_with_all_params(self, async_client: AsyncProfound) -> None:
+ shopping = await async_client.reports.shopping.merchants(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["merchant_share"],
)
- assert_matches_type(ShoppingExecutionsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingMerchantsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_raw_response_executions(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.executions(
+ async def test_raw_response_merchants(self, async_client: AsyncProfound) -> None:
+ response = await async_client.reports.shopping.with_raw_response.merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = await response.parse()
- assert_matches_type(ShoppingExecutionsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingMerchantsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_streaming_response_executions(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.executions(
+ async def test_streaming_response_merchants(self, async_client: AsyncProfound) -> None:
+ async with async_client.reports.shopping.with_streaming_response.merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = await response.parse()
- assert_matches_type(ShoppingExecutionsResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingMerchantsResponse, shopping, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_method_item_visibility(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.item_visibility(
+ async def test_method_products(self, async_client: AsyncProfound) -> None:
+ shopping = await async_client.reports.shopping.products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingItemVisibilityResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingProductsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_method_item_visibility_with_all_params(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.item_visibility(
+ async def test_method_products_with_all_params(self, async_client: AsyncProfound) -> None:
+ shopping = await async_client.reports.shopping.products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
competitor_limit=1,
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_competitors=True,
- include_count=True,
- include_items=["string"],
- include_no_tag=True,
- include_position_frequency=True,
- merchant_filter_type="any",
- metrics=["visibility_score"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- search_item="search_item",
- tag_filter_type="any",
- target_product="target_product",
+ group_by=["date"],
+ include_merchants=True,
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["visibility_score"],
+ target_product="x",
)
- assert_matches_type(ShoppingItemVisibilityResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingProductsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_raw_response_item_visibility(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.item_visibility(
+ async def test_raw_response_products(self, async_client: AsyncProfound) -> None:
+ response = await async_client.reports.shopping.with_raw_response.products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = await response.parse()
- assert_matches_type(ShoppingItemVisibilityResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingProductsResponse, shopping, path=["response"])
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_streaming_response_item_visibility(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.item_visibility(
+ async def test_streaming_response_products(self, async_client: AsyncProfound) -> None:
+ async with async_client.reports.shopping.with_streaming_response.products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
shopping = await response.parse()
- assert_matches_type(ShoppingItemVisibilityResponse, shopping, path=["response"])
+ assert_matches_type(ShoppingProductsResponse, shopping, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_method_merchant_by_items(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.merchant_by_items(
+ async def test_method_stream_brands(self, async_client: AsyncProfound) -> None:
+ shopping_stream = await async_client.reports.shopping.stream_brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingMerchantByItemsResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_merchant_by_items_with_all_params(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.merchant_by_items(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- metrics=["merchant_visibility"],
- order_by={"foo": "asc"},
- pagination={
- "limit": 1,
- "offset": 0,
+ await shopping_stream.response.aclose()
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_method_stream_brands_with_all_params(self, async_client: AsyncProfound) -> None:
+ shopping_stream = await async_client.reports.shopping.stream_brands(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ assets="string",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- product_name="product_name",
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["visibility_score"],
+ scope="owned",
)
- assert_matches_type(ShoppingMerchantByItemsResponse, shopping, path=["response"])
+ await shopping_stream.response.aclose()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_raw_response_merchant_by_items(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.merchant_by_items(
+ async def test_raw_response_stream_brands(self, async_client: AsyncProfound) -> None:
+ response = await async_client.reports.shopping.with_raw_response.stream_brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingMerchantByItemsResponse, shopping, path=["response"])
+ stream = await response.parse()
+ await stream.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_streaming_response_merchant_by_items(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.merchant_by_items(
+ async def test_streaming_response_stream_brands(self, async_client: AsyncProfound) -> None:
+ async with async_client.reports.shopping.with_streaming_response.stream_brands(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingMerchantByItemsResponse, shopping, path=["response"])
+ stream = await response.parse()
+ await stream.close()
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_method_merchant_distribution(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.merchant_distribution(
+ async def test_method_stream_merchants(self, async_client: AsyncProfound) -> None:
+ shopping_stream = await async_client.reports.shopping.stream_merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingMerchantDistributionResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_merchant_distribution_with_all_params(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.merchant_distribution(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- metrics=["offer_count"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ await shopping_stream.response.aclose()
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_method_stream_merchants_with_all_params(self, async_client: AsyncProfound) -> None:
+ shopping_stream = await async_client.reports.shopping.stream_merchants(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- search_merchant="search_merchant",
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["merchant_share"],
)
- assert_matches_type(ShoppingMerchantDistributionResponse, shopping, path=["response"])
+ await shopping_stream.response.aclose()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_raw_response_merchant_distribution(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.merchant_distribution(
+ async def test_raw_response_stream_merchants(self, async_client: AsyncProfound) -> None:
+ response = await async_client.reports.shopping.with_raw_response.stream_merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingMerchantDistributionResponse, shopping, path=["response"])
+ stream = await response.parse()
+ await stream.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_streaming_response_merchant_distribution(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.merchant_distribution(
+ async def test_streaming_response_stream_merchants(self, async_client: AsyncProfound) -> None:
+ async with async_client.reports.shopping.with_streaming_response.stream_merchants(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingMerchantDistributionResponse, shopping, path=["response"])
+ stream = await response.parse()
+ await stream.close()
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_method_merchant_share(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.merchant_share(
+ async def test_method_stream_products(self, async_client: AsyncProfound) -> None:
+ shopping_stream = await async_client.reports.shopping.stream_products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingMerchantShareResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_merchant_share_with_all_params(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.merchant_share(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- metrics=["merchant_share"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
+ await shopping_stream.response.aclose()
+
+ @pytest.mark.skip(reason="Mock server tests are disabled")
+ @parametrize
+ async def test_method_stream_products_with_all_params(self, async_client: AsyncProfound) -> None:
+ shopping_stream = await async_client.reports.shopping.stream_products(
+ category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end_date="end_date",
+ start_date="start_date",
+ competitor_limit=1,
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- tag_filter_type="any",
- target_asset_names=["string"],
+ group_by=["date"],
+ include_merchants=True,
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["visibility_score"],
+ target_product="x",
)
- assert_matches_type(ShoppingMerchantShareResponse, shopping, path=["response"])
+ await shopping_stream.response.aclose()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_raw_response_merchant_share(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.merchant_share(
+ async def test_raw_response_stream_products(self, async_client: AsyncProfound) -> None:
+ response = await async_client.reports.shopping.with_raw_response.stream_products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingMerchantShareResponse, shopping, path=["response"])
+ stream = await response.parse()
+ await stream.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_streaming_response_merchant_share(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.merchant_share(
+ async def test_streaming_response_stream_products(self, async_client: AsyncProfound) -> None:
+ async with async_client.reports.shopping.with_streaming_response.stream_products(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingMerchantShareResponse, shopping, path=["response"])
+ stream = await response.parse()
+ await stream.close()
assert cast(Any, response.is_closed) is True
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_method_merchant_visibility_by_brand(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.merchant_visibility_by_brand(
+ async def test_method_stream_trigger_rate(self, async_client: AsyncProfound) -> None:
+ shopping_stream = await async_client.reports.shopping.stream_trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- )
- assert_matches_type(ShoppingMerchantVisibilityByBrandResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_merchant_visibility_by_brand_with_all_params(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.merchant_visibility_by_brand(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_brand="include_brand",
- include_brand_only=True,
- include_count=True,
- include_no_tag=True,
- metrics=["visibility_score"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
- },
- search_brand="search_brand",
- tag_filter_type="any",
+ end_date="end_date",
+ start_date="start_date",
)
- assert_matches_type(ShoppingMerchantVisibilityByBrandResponse, shopping, path=["response"])
+ await shopping_stream.response.aclose()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_raw_response_merchant_visibility_by_brand(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.merchant_visibility_by_brand(
+ async def test_method_stream_trigger_rate_with_all_params(self, async_client: AsyncProfound) -> None:
+ shopping_stream = await async_client.reports.shopping.stream_trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingMerchantVisibilityByBrandResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_streaming_response_merchant_visibility_by_brand(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.merchant_visibility_by_brand(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- shopping = await response.parse()
- assert_matches_type(ShoppingMerchantVisibilityByBrandResponse, shopping, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_product_merchant_urls(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.product_merchant_urls(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- product_names=["string"],
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
+ },
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["total_runs"],
)
- assert_matches_type(ShoppingProductMerchantURLsResponse, shopping, path=["response"])
+ await shopping_stream.response.aclose()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_raw_response_product_merchant_urls(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.product_merchant_urls(
+ async def test_raw_response_stream_trigger_rate(self, async_client: AsyncProfound) -> None:
+ response = await async_client.reports.shopping.with_raw_response.stream_trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- product_names=["string"],
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
- assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingProductMerchantURLsResponse, shopping, path=["response"])
+ stream = await response.parse()
+ await stream.close()
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
- async def test_streaming_response_product_merchant_urls(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.product_merchant_urls(
+ async def test_streaming_response_stream_trigger_rate(self, async_client: AsyncProfound) -> None:
+ async with async_client.reports.shopping.with_streaming_response.stream_trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- product_names=["string"],
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingProductMerchantURLsResponse, shopping, path=["response"])
+ stream = await response.parse()
+ await stream.close()
assert cast(Any, response.is_closed) is True
@@ -1317,8 +990,8 @@ async def test_streaming_response_product_merchant_urls(self, async_client: Asyn
async def test_method_trigger_rate(self, async_client: AsyncProfound) -> None:
shopping = await async_client.reports.shopping.trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert_matches_type(ShoppingTriggerRateResponse, shopping, path=["response"])
@@ -1327,29 +1000,21 @@ async def test_method_trigger_rate(self, async_client: AsyncProfound) -> None:
async def test_method_trigger_rate_with_all_params(self, async_client: AsyncProfound) -> None:
shopping = await async_client.reports.shopping.trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_count=True,
- include_no_tag=True,
- metrics=["total_runs"],
- order_by={"foo": "asc"},
- pagination={
- "limit": 1,
- "offset": 0,
+ end_date="end_date",
+ start_date="start_date",
+ cursor="cursor",
+ filter={
+ "and": [],
+ "field": "field",
+ "op": "op",
+ "or": [],
+ "value": {},
},
- tag_filter_type="any",
+ group_by=["date"],
+ interval="day",
+ limit=1,
+ max_results=1,
+ metrics=["total_runs"],
)
assert_matches_type(ShoppingTriggerRateResponse, shopping, path=["response"])
@@ -1358,8 +1023,8 @@ async def test_method_trigger_rate_with_all_params(self, async_client: AsyncProf
async def test_raw_response_trigger_rate(self, async_client: AsyncProfound) -> None:
response = await async_client.reports.shopping.with_raw_response.trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
)
assert response.is_closed is True
@@ -1372,8 +1037,8 @@ async def test_raw_response_trigger_rate(self, async_client: AsyncProfound) -> N
async def test_streaming_response_trigger_rate(self, async_client: AsyncProfound) -> None:
async with async_client.reports.shopping.with_streaming_response.trigger_rate(
category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end_date="end_date",
+ start_date="start_date",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -1382,81 +1047,3 @@ async def test_streaming_response_trigger_rate(self, async_client: AsyncProfound
assert_matches_type(ShoppingTriggerRateResponse, shopping, path=["response"])
assert cast(Any, response.is_closed) is True
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_visibility(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.visibility(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- )
- assert_matches_type(ShoppingVisibilityResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_method_visibility_with_all_params(self, async_client: AsyncProfound) -> None:
- shopping = await async_client.reports.shopping.visibility(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- comparison_start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- date_interval="hour",
- dimensions=["period"],
- exclude_topic_ids=True,
- filters=[
- {
- "field": "region_id",
- "operator": "is",
- "value": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- }
- ],
- include_asset="include_asset",
- include_asset_only=True,
- include_assets_only=["string"],
- include_count=True,
- include_no_tag=True,
- include_position_frequency=True,
- metrics=["visibility_score"],
- order_by={"foo": "asc"},
- owned_asset_names=["string"],
- pagination={
- "limit": 1,
- "offset": 0,
- },
- rank_by="visibility_score",
- search_asset="search_asset",
- tag_filter_type="any",
- )
- assert_matches_type(ShoppingVisibilityResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_raw_response_visibility(self, async_client: AsyncProfound) -> None:
- response = await async_client.reports.shopping.with_raw_response.visibility(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- shopping = await response.parse()
- assert_matches_type(ShoppingVisibilityResponse, shopping, path=["response"])
-
- @pytest.mark.skip(reason="Mock server tests are disabled")
- @parametrize
- async def test_streaming_response_visibility(self, async_client: AsyncProfound) -> None:
- async with async_client.reports.shopping.with_streaming_response.visibility(
- category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- end_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- start_date=parse_datetime("2019-12-27T18:11:19.117Z"),
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- shopping = await response.parse()
- assert_matches_type(ShoppingVisibilityResponse, shopping, path=["response"])
-
- assert cast(Any, response.is_closed) is True