From fb7137024b31e2182b378c826a6725507dc93a85 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 19:11:01 +0000 Subject: [PATCH 1/2] feat(api): add x_account_id/x_environment_id header parameters across resources --- .stats.yml | 4 +- README.md | 16 +- src/stigg/resources/v1/addons/addons.py | 200 +++++++++++++++- src/stigg/resources/v1/addons/entitlements.py | 98 +++++++- src/stigg/resources/v1/coupons.py | 112 ++++++++- src/stigg/resources/v1/credits/credits.py | 68 +++++- .../resources/v1/credits/custom_currencies.py | 134 ++++++++++- src/stigg/resources/v1/credits/grants.py | 68 +++++- src/stigg/resources/v1/customers/customers.py | 222 +++++++++++++++++- .../resources/v1/customers/integrations.py | 112 ++++++++- .../resources/v1/customers/payment_method.py | 46 +++- .../v1/customers/promotional_entitlements.py | 68 +++++- .../v1/events/beta/customers/assignments.py | 46 +++- .../v1/events/beta/customers/entities.py | 112 ++++++++- .../v1/events/beta/customers/entitlements.py | 24 +- .../resources/v1/events/beta/entity_types.py | 46 +++- src/stigg/resources/v1/events/events.py | 26 +- src/stigg/resources/v1/features.py | 134 ++++++++++- src/stigg/resources/v1/plans/entitlements.py | 98 +++++++- src/stigg/resources/v1/plans/plans.py | 222 +++++++++++++++++- src/stigg/resources/v1/products.py | 134 ++++++++++- .../v1/subscriptions/future_update.py | 48 +++- .../resources/v1/subscriptions/invoice.py | 26 +- .../v1/subscriptions/subscriptions.py | 222 +++++++++++++++++- src/stigg/resources/v1/subscriptions/usage.py | 46 +++- src/stigg/resources/v1/usage.py | 46 +++- src/stigg/types/v1/addon_create_params.py | 4 + .../types/v1/addon_list_charges_params.py | 8 +- src/stigg/types/v1/addon_list_params.py | 4 + src/stigg/types/v1/addon_publish_params.py | 4 + src/stigg/types/v1/addon_update_params.py | 4 + .../v1/addons/entitlement_create_params.py | 4 + .../v1/addons/entitlement_update_params.py | 8 + src/stigg/types/v1/coupon_create_params.py | 4 + src/stigg/types/v1/coupon_list_params.py | 4 + .../types/v1/coupon_update_coupon_params.py | 8 +- .../v1/credit_get_auto_recharge_params.py | 4 + src/stigg/types/v1/credit_get_usage_params.py | 4 + .../types/v1/credit_list_ledger_params.py | 4 + .../credits/custom_currency_create_params.py | 4 + .../v1/credits/custom_currency_list_params.py | 8 +- .../credits/custom_currency_update_params.py | 4 + .../types/v1/credits/grant_create_params.py | 4 + .../types/v1/credits/grant_list_params.py | 4 + .../v1/customer_check_entitlement_params.py | 4 + src/stigg/types/v1/customer_import_params.py | 4 + src/stigg/types/v1/customer_list_params.py | 4 + .../v1/customer_list_resources_params.py | 8 +- .../types/v1/customer_provision_params.py | 4 + .../customer_retrieve_entitlements_params.py | 4 + src/stigg/types/v1/customer_update_params.py | 4 + .../v1/customers/integration_link_params.py | 4 + .../v1/customers/integration_list_params.py | 4 + .../v1/customers/integration_update_params.py | 4 + .../customers/payment_method_attach_params.py | 4 + .../promotional_entitlement_create_params.py | 4 + .../promotional_entitlement_list_params.py | 4 + src/stigg/types/v1/event_report_params.py | 4 + .../beta/customers/assignment_list_params.py | 4 + .../customers/assignment_upsert_params.py | 4 + .../customers/entitlement_check_params.py | 4 + .../beta/customers/entity_archive_params.py | 7 +- .../beta/customers/entity_list_params.py | 4 + .../beta/customers/entity_unarchive_params.py | 7 +- .../beta/customers/entity_upsert_params.py | 4 + .../v1/events/beta/entity_type_list_params.py | 8 +- .../events/beta/entity_type_upsert_params.py | 4 + .../types/v1/feature_create_feature_params.py | 4 + .../types/v1/feature_list_features_params.py | 4 + .../types/v1/feature_update_feature_params.py | 4 + src/stigg/types/v1/plan_create_params.py | 4 + .../types/v1/plan_list_charges_params.py | 8 +- .../v1/plan_list_overage_charges_params.py | 8 +- src/stigg/types/v1/plan_list_params.py | 4 + src/stigg/types/v1/plan_publish_params.py | 4 + src/stigg/types/v1/plan_update_params.py | 4 + .../v1/plans/entitlement_create_params.py | 4 + .../v1/plans/entitlement_update_params.py | 8 + .../types/v1/product_create_product_params.py | 4 + .../v1/product_duplicate_product_params.py | 4 + .../types/v1/product_list_products_params.py | 4 + .../types/v1/product_update_product_params.py | 4 + .../types/v1/subscription_cancel_params.py | 4 + .../types/v1/subscription_delegate_params.py | 4 + .../types/v1/subscription_import_params.py | 4 + .../types/v1/subscription_list_params.py | 4 + .../types/v1/subscription_migrate_params.py | 4 + .../types/v1/subscription_preview_params.py | 4 + .../types/v1/subscription_provision_params.py | 4 + .../types/v1/subscription_transfer_params.py | 4 + .../types/v1/subscription_update_params.py | 4 + .../usage_charge_usage_params.py | 4 + src/stigg/types/v1/usage_history_params.py | 4 + src/stigg/types/v1/usage_report_params.py | 4 + .../v1/addons/test_entitlements.py | 128 +++++++++- .../v1/credits/test_custom_currencies.py | 120 ++++++++-- tests/api_resources/v1/credits/test_grants.py | 44 +++- .../v1/customers/test_integrations.py | 98 ++++++++ .../v1/customers/test_payment_method.py | 40 +++- .../test_promotional_entitlements.py | 78 ++++++ .../events/beta/customers/test_assignments.py | 52 ++++ .../v1/events/beta/customers/test_entities.py | 120 ++++++++++ .../beta/customers/test_entitlements.py | 4 + .../v1/events/beta/test_entity_types.py | 46 ++++ .../v1/plans/test_entitlements.py | 128 +++++++++- .../v1/subscriptions/test_future_update.py | 72 ++++-- .../v1/subscriptions/test_invoice.py | 36 ++- .../v1/subscriptions/test_usage.py | 40 +++- tests/api_resources/v1/test_addons.py | 182 +++++++++++--- tests/api_resources/v1/test_coupons.py | 122 ++++++++-- tests/api_resources/v1/test_credits.py | 30 +++ tests/api_resources/v1/test_customers.py | 136 +++++++++-- tests/api_resources/v1/test_events.py | 39 +++ tests/api_resources/v1/test_features.py | 120 ++++++++-- tests/api_resources/v1/test_plans.py | 186 ++++++++++++--- tests/api_resources/v1/test_products.py | 88 +++++-- tests/api_resources/v1/test_subscriptions.py | 108 ++++++++- tests/api_resources/v1/test_usage.py | 44 ++++ tests/test_client.py | 22 +- 119 files changed, 4479 insertions(+), 296 deletions(-) diff --git a/.stats.yml b/.stats.yml index aa3e9e0f..34ef2fd2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 108 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stigg/stigg-0e7a852999fb6517cef96afbdb99e46f08db292a85a5d209e5e5172792eb4a7c.yml -openapi_spec_hash: 53ace6b360ff3441f3e46e12ddcf34a6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stigg/stigg-88f0d558bab37f46f8961eb9ef3a985ec282251991f28863d7b1738927900d6e.yml +openapi_spec_hash: 4aaa720e9246944b90c95405efd652aa config_hash: 0ab0f5c37a96aad83824aad473011f38 diff --git a/README.md b/README.md index f0a639d7..50d4792a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ client = Stigg( ) customer_response = client.v1.customers.retrieve( - "REPLACE_ME", + id="REPLACE_ME", ) print(customer_response.data) ``` @@ -68,7 +68,7 @@ client = AsyncStigg( async def main() -> None: customer_response = await client.v1.customers.retrieve( - "REPLACE_ME", + id="REPLACE_ME", ) print(customer_response.data) @@ -104,7 +104,7 @@ async def main() -> None: http_client=DefaultAioHttpClient(), ) as client: customer_response = await client.v1.customers.retrieve( - "REPLACE_ME", + id="REPLACE_ME", ) print(customer_response.data) @@ -225,7 +225,7 @@ client = Stigg() try: client.v1.customers.retrieve( - "REPLACE_ME", + id="REPLACE_ME", ) except stigg.APIConnectionError as e: print("The server could not be reached") @@ -270,7 +270,7 @@ client = Stigg( # Or, configure per-request: client.with_options(max_retries=5).v1.customers.retrieve( - "REPLACE_ME", + id="REPLACE_ME", ) ``` @@ -295,7 +295,7 @@ client = Stigg( # Override per-request: client.with_options(timeout=5.0).v1.customers.retrieve( - "REPLACE_ME", + id="REPLACE_ME", ) ``` @@ -338,7 +338,7 @@ from stigg import Stigg client = Stigg() response = client.v1.customers.with_raw_response.retrieve( - "REPLACE_ME", + id="REPLACE_ME", ) print(response.headers.get('X-My-Header')) @@ -358,7 +358,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi ```python with client.v1.customers.with_streaming_response.retrieve( - "REPLACE_ME", + id="REPLACE_ME", ) as response: print(response.headers.get("X-My-Header")) diff --git a/src/stigg/resources/v1/addons/addons.py b/src/stigg/resources/v1/addons/addons.py index e8ddd0fa..21d7a061 100644 --- a/src/stigg/resources/v1/addons/addons.py +++ b/src/stigg/resources/v1/addons/addons.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ....types.v1 import ( addon_list_params, @@ -81,6 +81,8 @@ def create( metadata: Dict[str, str] | Omit = omit, pricing_type: Optional[Literal["FREE", "PAID", "CUSTOM"]] | Omit = omit, status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -118,6 +120,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/addons", body=maybe_transform( @@ -144,6 +155,8 @@ def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -166,6 +179,15 @@ def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/addons/{id}", id=id), options=make_request_options( @@ -186,6 +208,8 @@ def update( max_quantity: Optional[int] | Omit = omit, metadata: Dict[str, str] | Omit = omit, status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -224,6 +248,15 @@ def update( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/addons/{id}", id=id), body=maybe_transform( @@ -254,6 +287,8 @@ def list( limit: int | Omit = omit, product_id: str | Omit = omit, status: List[Literal["DRAFT", "PUBLISHED", "ARCHIVED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -285,6 +320,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/addons", page=SyncMyCursorIDPage[AddonListResponse], @@ -312,6 +356,8 @@ def archive( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -333,6 +379,15 @@ def archive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/addons/{id}/archive", id=id), options=make_request_options( @@ -345,6 +400,8 @@ def create_draft( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -366,6 +423,15 @@ def create_draft( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/addons/{id}/draft", id=id), options=make_request_options( @@ -381,6 +447,8 @@ def list_charges( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -408,6 +476,15 @@ def list_charges( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/addons/{id}/charges", id=id), page=SyncMyCursorIDPage[AddonListChargesResponse], @@ -433,6 +510,8 @@ def publish( id: str, *, migration_type: Literal["NEW_CUSTOMERS", "ALL_CUSTOMERS"], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -456,6 +535,15 @@ def publish( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/addons/{id}/publish", id=id), body=maybe_transform({"migration_type": migration_type}, addon_publish_params.AddonPublishParams), @@ -469,6 +557,8 @@ def remove_draft( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -490,6 +580,15 @@ def remove_draft( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/addons/{id}/draft", id=id), options=make_request_options( @@ -537,6 +636,8 @@ async def create( metadata: Dict[str, str] | Omit = omit, pricing_type: Optional[Literal["FREE", "PAID", "CUSTOM"]] | Omit = omit, status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -574,6 +675,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/addons", body=await async_maybe_transform( @@ -600,6 +710,8 @@ async def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -622,6 +734,15 @@ async def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/addons/{id}", id=id), options=make_request_options( @@ -642,6 +763,8 @@ async def update( max_quantity: Optional[int] | Omit = omit, metadata: Dict[str, str] | Omit = omit, status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -680,6 +803,15 @@ async def update( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/addons/{id}", id=id), body=await async_maybe_transform( @@ -710,6 +842,8 @@ def list( limit: int | Omit = omit, product_id: str | Omit = omit, status: List[Literal["DRAFT", "PUBLISHED", "ARCHIVED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -741,6 +875,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/addons", page=AsyncMyCursorIDPage[AddonListResponse], @@ -768,6 +911,8 @@ async def archive( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -789,6 +934,15 @@ async def archive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/addons/{id}/archive", id=id), options=make_request_options( @@ -801,6 +955,8 @@ async def create_draft( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -822,6 +978,15 @@ async def create_draft( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/addons/{id}/draft", id=id), options=make_request_options( @@ -837,6 +1002,8 @@ def list_charges( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -864,6 +1031,15 @@ def list_charges( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/addons/{id}/charges", id=id), page=AsyncMyCursorIDPage[AddonListChargesResponse], @@ -889,6 +1065,8 @@ async def publish( id: str, *, migration_type: Literal["NEW_CUSTOMERS", "ALL_CUSTOMERS"], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -912,6 +1090,15 @@ async def publish( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/addons/{id}/publish", id=id), body=await async_maybe_transform( @@ -927,6 +1114,8 @@ async def remove_draft( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -948,6 +1137,15 @@ async def remove_draft( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/addons/{id}/draft", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/addons/entitlements.py b/src/stigg/resources/v1/addons/entitlements.py index 03af582d..2dc63786 100644 --- a/src/stigg/resources/v1/addons/entitlements.py +++ b/src/stigg/resources/v1/addons/entitlements.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ...._utils import path_template, required_args, maybe_transform, async_maybe_transform +from ...._utils import path_template, required_args, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,6 +51,8 @@ def create( addon_id: str, *, entitlements: Iterable[entitlement_create_params.Entitlement], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -74,6 +76,15 @@ def create( """ if not addon_id: raise ValueError(f"Expected a non-empty value for `addon_id` but received {addon_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/addons/{addon_id}/entitlements", addon_id=addon_id), body=maybe_transform({"entitlements": entitlements}, entitlement_create_params.EntitlementCreateParams), @@ -114,6 +125,8 @@ def update( entitlement_update_params.UpdateFeatureEntitlementRequestYearlyResetPeriodConfiguration ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -184,6 +197,8 @@ def update( is_custom: bool | Omit = omit, is_granted: bool | Omit = omit, order: float | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -259,6 +274,8 @@ def update( entitlement_update_params.UpdateFeatureEntitlementRequestYearlyResetPeriodConfiguration ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: str | Omit = omit, amount: float | Omit = omit, cadence: Literal["MONTH", "YEAR"] | Omit = omit, dependency_feature_id: Optional[str] | Omit = omit, @@ -273,6 +290,15 @@ def update( raise ValueError(f"Expected a non-empty value for `addon_id` but received {addon_id!r}") if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/addons/{addon_id}/entitlements/{id}", addon_id=addon_id, id=id), body=maybe_transform( @@ -309,6 +335,8 @@ def list( self, addon_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -330,6 +358,15 @@ def list( """ if not addon_id: raise ValueError(f"Expected a non-empty value for `addon_id` but received {addon_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/addons/{addon_id}/entitlements", addon_id=addon_id), options=make_request_options( @@ -343,6 +380,8 @@ def delete( id: str, *, addon_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -366,6 +405,15 @@ def delete( raise ValueError(f"Expected a non-empty value for `addon_id` but received {addon_id!r}") if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/addons/{addon_id}/entitlements/{id}", addon_id=addon_id, id=id), options=make_request_options( @@ -400,6 +448,8 @@ async def create( addon_id: str, *, entitlements: Iterable[entitlement_create_params.Entitlement], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -423,6 +473,15 @@ async def create( """ if not addon_id: raise ValueError(f"Expected a non-empty value for `addon_id` but received {addon_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/addons/{addon_id}/entitlements", addon_id=addon_id), body=await async_maybe_transform( @@ -465,6 +524,8 @@ async def update( entitlement_update_params.UpdateFeatureEntitlementRequestYearlyResetPeriodConfiguration ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -535,6 +596,8 @@ async def update( is_custom: bool | Omit = omit, is_granted: bool | Omit = omit, order: float | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -610,6 +673,8 @@ async def update( entitlement_update_params.UpdateFeatureEntitlementRequestYearlyResetPeriodConfiguration ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: str | Omit = omit, amount: float | Omit = omit, cadence: Literal["MONTH", "YEAR"] | Omit = omit, dependency_feature_id: Optional[str] | Omit = omit, @@ -624,6 +689,15 @@ async def update( raise ValueError(f"Expected a non-empty value for `addon_id` but received {addon_id!r}") if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/addons/{addon_id}/entitlements/{id}", addon_id=addon_id, id=id), body=await async_maybe_transform( @@ -660,6 +734,8 @@ async def list( self, addon_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -681,6 +757,15 @@ async def list( """ if not addon_id: raise ValueError(f"Expected a non-empty value for `addon_id` but received {addon_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/addons/{addon_id}/entitlements", addon_id=addon_id), options=make_request_options( @@ -694,6 +779,8 @@ async def delete( id: str, *, addon_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -717,6 +804,15 @@ async def delete( raise ValueError(f"Expected a non-empty value for `addon_id` but received {addon_id!r}") if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/addons/{addon_id}/entitlements/{id}", addon_id=addon_id, id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/coupons.py b/src/stigg/resources/v1/coupons.py index 885edf91..758674d0 100644 --- a/src/stigg/resources/v1/coupons.py +++ b/src/stigg/resources/v1/coupons.py @@ -8,7 +8,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ...types.v1 import coupon_list_params, coupon_create_params, coupon_update_coupon_params from ..._resource import SyncAPIResource, AsyncAPIResource @@ -58,6 +58,8 @@ def create( metadata: Optional[Dict[str, str]], name: str, percent_off: Optional[float], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -92,6 +94,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/coupons", body=maybe_transform( @@ -116,6 +127,8 @@ def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -137,6 +150,15 @@ def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/coupons/{id}", id=id), options=make_request_options( @@ -155,6 +177,8 @@ def list( limit: int | Omit = omit, status: List[Literal["ACTIVE", "ARCHIVED"]] | Omit = omit, type: Literal["FIXED", "PERCENTAGE"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -188,6 +212,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/coupons", page=SyncMyCursorIDPage[CouponListResponse], @@ -216,6 +249,8 @@ def archive_coupon( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -237,6 +272,15 @@ def archive_coupon( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/coupons/{id}/archive", id=id), options=make_request_options( @@ -252,6 +296,8 @@ def update_coupon( description: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -279,6 +325,15 @@ def update_coupon( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/coupons/{id}", id=id), body=maybe_transform( @@ -328,6 +383,8 @@ async def create( metadata: Optional[Dict[str, str]], name: str, percent_off: Optional[float], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -362,6 +419,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/coupons", body=await async_maybe_transform( @@ -386,6 +452,8 @@ async def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -407,6 +475,15 @@ async def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/coupons/{id}", id=id), options=make_request_options( @@ -425,6 +502,8 @@ def list( limit: int | Omit = omit, status: List[Literal["ACTIVE", "ARCHIVED"]] | Omit = omit, type: Literal["FIXED", "PERCENTAGE"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -458,6 +537,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/coupons", page=AsyncMyCursorIDPage[CouponListResponse], @@ -486,6 +574,8 @@ async def archive_coupon( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -507,6 +597,15 @@ async def archive_coupon( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/coupons/{id}/archive", id=id), options=make_request_options( @@ -522,6 +621,8 @@ async def update_coupon( description: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -549,6 +650,15 @@ async def update_coupon( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/coupons/{id}", id=id), body=await async_maybe_transform( diff --git a/src/stigg/resources/v1/credits/credits.py b/src/stigg/resources/v1/credits/credits.py index e6d94356..3622519f 100644 --- a/src/stigg/resources/v1/credits/credits.py +++ b/src/stigg/resources/v1/credits/credits.py @@ -17,7 +17,7 @@ AsyncGrantsResourceWithStreamingResponse, ) from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import maybe_transform, async_maybe_transform +from ...._utils import maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ....types.v1 import credit_get_usage_params, credit_list_ledger_params, credit_get_auto_recharge_params from ...._resource import SyncAPIResource, AsyncAPIResource @@ -79,6 +79,8 @@ def get_auto_recharge( *, currency_id: str, customer_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -103,6 +105,15 @@ def get_auto_recharge( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( "/api/v1/credits/auto-recharge", options=make_request_options( @@ -134,6 +145,8 @@ def get_usage( resource_id: str | Omit = omit, start_date: Union[str, datetime] | Omit = omit, time_range: Literal["LAST_DAY", "LAST_WEEK", "LAST_MONTH", "LAST_YEAR"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -178,6 +191,15 @@ def get_usage( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( "/api/v1/credits/usage", options=make_request_options( @@ -213,6 +235,8 @@ def list_ledger( currency_id: str | Omit = omit, limit: int | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -244,6 +268,15 @@ def list_ledger( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/credits/ledger", page=SyncMyCursorIDPage[CreditListLedgerResponse], @@ -303,6 +336,8 @@ async def get_auto_recharge( *, currency_id: str, customer_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -327,6 +362,15 @@ async def get_auto_recharge( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( "/api/v1/credits/auto-recharge", options=make_request_options( @@ -358,6 +402,8 @@ async def get_usage( resource_id: str | Omit = omit, start_date: Union[str, datetime] | Omit = omit, time_range: Literal["LAST_DAY", "LAST_WEEK", "LAST_MONTH", "LAST_YEAR"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -402,6 +448,15 @@ async def get_usage( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( "/api/v1/credits/usage", options=make_request_options( @@ -437,6 +492,8 @@ def list_ledger( currency_id: str | Omit = omit, limit: int | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -468,6 +525,15 @@ def list_ledger( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/credits/ledger", page=AsyncMyCursorIDPage[CreditListLedgerResponse], diff --git a/src/stigg/resources/v1/credits/custom_currencies.py b/src/stigg/resources/v1/credits/custom_currencies.py index ccc5e5f3..b49750a9 100644 --- a/src/stigg/resources/v1/credits/custom_currencies.py +++ b/src/stigg/resources/v1/credits/custom_currencies.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -64,6 +64,8 @@ def create( metadata: Dict[str, str] | Omit = omit, symbol: str | Omit = omit, units: custom_currency_create_params.Units | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -96,6 +98,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/credits/custom-currencies", body=maybe_transform( @@ -124,6 +135,8 @@ def update( metadata: Optional[Dict[str, str]] | Omit = omit, symbol: Optional[str] | Omit = omit, units: custom_currency_update_params.Units | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -158,6 +171,15 @@ def update( """ if not currency_id: raise ValueError(f"Expected a non-empty value for `currency_id` but received {currency_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/credits/custom-currencies/{currency_id}", currency_id=currency_id), body=maybe_transform( @@ -183,6 +205,8 @@ def list( before: str | Omit = omit, limit: int | Omit = omit, status: List[Literal["ACTIVE", "ARCHIVED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -214,6 +238,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/credits/custom-currencies", page=SyncMyCursorIDPage[CustomCurrencyListResponse], @@ -239,6 +272,8 @@ def archive( self, currency_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -263,6 +298,15 @@ def archive( """ if not currency_id: raise ValueError(f"Expected a non-empty value for `currency_id` but received {currency_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/credits/custom-currencies/{currency_id}/archive", currency_id=currency_id), options=make_request_options( @@ -275,6 +319,8 @@ def list_associated_entities( self, currency_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -298,6 +344,15 @@ def list_associated_entities( """ if not currency_id: raise ValueError(f"Expected a non-empty value for `currency_id` but received {currency_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template( "/api/v1/credits/custom-currencies/{currency_id}/associated-entities", currency_id=currency_id @@ -312,6 +367,8 @@ def unarchive( self, currency_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -335,6 +392,15 @@ def unarchive( """ if not currency_id: raise ValueError(f"Expected a non-empty value for `currency_id` but received {currency_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/credits/custom-currencies/{currency_id}/unarchive", currency_id=currency_id), options=make_request_options( @@ -375,6 +441,8 @@ async def create( metadata: Dict[str, str] | Omit = omit, symbol: str | Omit = omit, units: custom_currency_create_params.Units | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -407,6 +475,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/credits/custom-currencies", body=await async_maybe_transform( @@ -435,6 +512,8 @@ async def update( metadata: Optional[Dict[str, str]] | Omit = omit, symbol: Optional[str] | Omit = omit, units: custom_currency_update_params.Units | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -469,6 +548,15 @@ async def update( """ if not currency_id: raise ValueError(f"Expected a non-empty value for `currency_id` but received {currency_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/credits/custom-currencies/{currency_id}", currency_id=currency_id), body=await async_maybe_transform( @@ -494,6 +582,8 @@ def list( before: str | Omit = omit, limit: int | Omit = omit, status: List[Literal["ACTIVE", "ARCHIVED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -525,6 +615,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/credits/custom-currencies", page=AsyncMyCursorIDPage[CustomCurrencyListResponse], @@ -550,6 +649,8 @@ async def archive( self, currency_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -574,6 +675,15 @@ async def archive( """ if not currency_id: raise ValueError(f"Expected a non-empty value for `currency_id` but received {currency_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/credits/custom-currencies/{currency_id}/archive", currency_id=currency_id), options=make_request_options( @@ -586,6 +696,8 @@ async def list_associated_entities( self, currency_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -609,6 +721,15 @@ async def list_associated_entities( """ if not currency_id: raise ValueError(f"Expected a non-empty value for `currency_id` but received {currency_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template( "/api/v1/credits/custom-currencies/{currency_id}/associated-entities", currency_id=currency_id @@ -623,6 +744,8 @@ async def unarchive( self, currency_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -646,6 +769,15 @@ async def unarchive( """ if not currency_id: raise ValueError(f"Expected a non-empty value for `currency_id` but received {currency_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/credits/custom-currencies/{currency_id}/unarchive", currency_id=currency_id), options=make_request_options( diff --git a/src/stigg/resources/v1/credits/grants.py b/src/stigg/resources/v1/credits/grants.py index 2562c856..1abbcc0e 100644 --- a/src/stigg/resources/v1/credits/grants.py +++ b/src/stigg/resources/v1/credits/grants.py @@ -9,7 +9,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -67,6 +67,8 @@ def create( payment_collection_method: Literal["CHARGE", "INVOICE", "NONE"] | Omit = omit, priority: int | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -117,6 +119,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/credits/grants", body=maybe_transform( @@ -155,6 +166,8 @@ def list( currency_id: str | Omit = omit, limit: int | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -188,6 +201,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/credits/grants", page=SyncMyCursorIDPage[GrantListResponse], @@ -216,6 +238,8 @@ def void( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -238,6 +262,15 @@ def void( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/credits/grants/{id}/void", id=id), options=make_request_options( @@ -287,6 +320,8 @@ async def create( payment_collection_method: Literal["CHARGE", "INVOICE", "NONE"] | Omit = omit, priority: int | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -337,6 +372,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/credits/grants", body=await async_maybe_transform( @@ -375,6 +419,8 @@ def list( currency_id: str | Omit = omit, limit: int | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -408,6 +454,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/credits/grants", page=AsyncMyCursorIDPage[GrantListResponse], @@ -436,6 +491,8 @@ async def void( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -458,6 +515,15 @@ async def void( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/credits/grants/{id}/void", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/customers/customers.py b/src/stigg/resources/v1/customers/customers.py index 5d9a8cb5..12e218be 100644 --- a/src/stigg/resources/v1/customers/customers.py +++ b/src/stigg/resources/v1/customers/customers.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ....types.v1 import ( customer_list_params, @@ -100,6 +100,8 @@ def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -122,6 +124,15 @@ def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/customers/{id}", id=id), options=make_request_options( @@ -264,6 +275,8 @@ def update( name: Optional[str] | Omit = omit, passthrough: customer_update_params.Passthrough | Omit = omit, timezone: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -306,6 +319,15 @@ def update( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/customers/{id}", id=id), body=maybe_transform( @@ -338,6 +360,8 @@ def list( email: str | Omit = omit, limit: int | Omit = omit, name: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -369,6 +393,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/customers", page=SyncMyCursorIDPage[CustomerListResponse], @@ -396,6 +429,8 @@ def archive( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -419,6 +454,15 @@ def archive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/customers/{id}/archive", id=id), options=make_request_options( @@ -436,6 +480,8 @@ def check_entitlement( requested_usage: int | Omit = omit, requested_values: SequenceNotStr[str] | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -476,6 +522,15 @@ def check_entitlement( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/customers/{id}/entitlements/check", id=id), options=make_request_options( @@ -502,6 +557,8 @@ def import_( *, customers: Iterable[customer_import_params.Customer], integration_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -527,6 +584,15 @@ def import_( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/customers/import", body=maybe_transform( @@ -549,6 +615,8 @@ def list_resources( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -576,6 +644,15 @@ def list_resources( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/customers/{id}/resources", id=id), page=SyncMyCursorIDPage[CustomerListResourcesResponse], @@ -731,6 +808,8 @@ def provision( name: Optional[str] | Omit = omit, passthrough: customer_provision_params.Passthrough | Omit = omit, timezone: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -775,6 +854,15 @@ def provision( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/customers", body=maybe_transform( @@ -805,6 +893,8 @@ def retrieve_entitlements( id: str, *, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -834,6 +924,15 @@ def retrieve_entitlements( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/customers/{id}/entitlements", id=id), options=make_request_options( @@ -853,6 +952,8 @@ def unarchive( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -874,6 +975,15 @@ def unarchive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/customers/{id}/unarchive", id=id), options=make_request_options( @@ -921,6 +1031,8 @@ async def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -943,6 +1055,15 @@ async def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/customers/{id}", id=id), options=make_request_options( @@ -1085,6 +1206,8 @@ async def update( name: Optional[str] | Omit = omit, passthrough: customer_update_params.Passthrough | Omit = omit, timezone: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1127,6 +1250,15 @@ async def update( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/customers/{id}", id=id), body=await async_maybe_transform( @@ -1159,6 +1291,8 @@ def list( email: str | Omit = omit, limit: int | Omit = omit, name: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1190,6 +1324,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/customers", page=AsyncMyCursorIDPage[CustomerListResponse], @@ -1217,6 +1360,8 @@ async def archive( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1240,6 +1385,15 @@ async def archive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/customers/{id}/archive", id=id), options=make_request_options( @@ -1257,6 +1411,8 @@ async def check_entitlement( requested_usage: int | Omit = omit, requested_values: SequenceNotStr[str] | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1297,6 +1453,15 @@ async def check_entitlement( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/customers/{id}/entitlements/check", id=id), options=make_request_options( @@ -1323,6 +1488,8 @@ async def import_( *, customers: Iterable[customer_import_params.Customer], integration_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1348,6 +1515,15 @@ async def import_( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/customers/import", body=await async_maybe_transform( @@ -1370,6 +1546,8 @@ def list_resources( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1397,6 +1575,15 @@ def list_resources( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/customers/{id}/resources", id=id), page=AsyncMyCursorIDPage[CustomerListResourcesResponse], @@ -1552,6 +1739,8 @@ async def provision( name: Optional[str] | Omit = omit, passthrough: customer_provision_params.Passthrough | Omit = omit, timezone: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1596,6 +1785,15 @@ async def provision( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/customers", body=await async_maybe_transform( @@ -1626,6 +1824,8 @@ async def retrieve_entitlements( id: str, *, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1655,6 +1855,15 @@ async def retrieve_entitlements( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/customers/{id}/entitlements", id=id), options=make_request_options( @@ -1674,6 +1883,8 @@ async def unarchive( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1695,6 +1906,15 @@ async def unarchive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/customers/{id}/unarchive", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/customers/integrations.py b/src/stigg/resources/v1/customers/integrations.py index 704382e3..5f77effa 100644 --- a/src/stigg/resources/v1/customers/integrations.py +++ b/src/stigg/resources/v1/customers/integrations.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,6 +51,8 @@ def retrieve( integration_id: str, *, id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -74,6 +76,15 @@ def retrieve( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/customers/{id}/integrations/{integration_id}", id=id, integration_id=integration_id), options=make_request_options( @@ -88,6 +99,8 @@ def update( *, id: str, synced_entity_id: Optional[str], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -114,6 +127,15 @@ def update( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/customers/{id}/integrations/{integration_id}", id=id, integration_id=integration_id), body=maybe_transform( @@ -149,6 +171,8 @@ def list( ] ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -180,6 +204,15 @@ def list( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/customers/{id}/integrations", id=id), page=SyncMyCursorIDPage[IntegrationListResponse], @@ -221,6 +254,8 @@ def link( "RECEIVED", "PREQUEL", ], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -249,6 +284,15 @@ def link( """ if not path_id: raise ValueError(f"Expected a non-empty value for `path_id` but received {path_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/customers/{path_id}/integrations", path_id=path_id), body=maybe_transform( @@ -270,6 +314,8 @@ def unlink( integration_id: str, *, id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -293,6 +339,15 @@ def unlink( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/customers/{id}/integrations/{integration_id}", id=id, integration_id=integration_id), options=make_request_options( @@ -327,6 +382,8 @@ async def retrieve( integration_id: str, *, id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -350,6 +407,15 @@ async def retrieve( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/customers/{id}/integrations/{integration_id}", id=id, integration_id=integration_id), options=make_request_options( @@ -364,6 +430,8 @@ async def update( *, id: str, synced_entity_id: Optional[str], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -390,6 +458,15 @@ async def update( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/customers/{id}/integrations/{integration_id}", id=id, integration_id=integration_id), body=await async_maybe_transform( @@ -425,6 +502,8 @@ def list( ] ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -456,6 +535,15 @@ def list( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/customers/{id}/integrations", id=id), page=AsyncMyCursorIDPage[IntegrationListResponse], @@ -497,6 +585,8 @@ async def link( "RECEIVED", "PREQUEL", ], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -525,6 +615,15 @@ async def link( """ if not path_id: raise ValueError(f"Expected a non-empty value for `path_id` but received {path_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/customers/{path_id}/integrations", path_id=path_id), body=await async_maybe_transform( @@ -546,6 +645,8 @@ async def unlink( integration_id: str, *, id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -569,6 +670,15 @@ async def unlink( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/customers/{id}/integrations/{integration_id}", id=id, integration_id=integration_id), options=make_request_options( diff --git a/src/stigg/resources/v1/customers/payment_method.py b/src/stigg/resources/v1/customers/payment_method.py index 1c77c4d7..df9edcc4 100644 --- a/src/stigg/resources/v1/customers/payment_method.py +++ b/src/stigg/resources/v1/customers/payment_method.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -187,6 +187,8 @@ def attach( ] ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -218,6 +220,15 @@ def attach( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/customers/{id}/payment-method", id=id), body=maybe_transform( @@ -239,6 +250,8 @@ def detach( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -262,6 +275,15 @@ def detach( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/customers/{id}/payment-method", id=id), options=make_request_options( @@ -434,6 +456,8 @@ async def attach( ] ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -465,6 +489,15 @@ async def attach( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/customers/{id}/payment-method", id=id), body=await async_maybe_transform( @@ -486,6 +519,8 @@ async def detach( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -509,6 +544,15 @@ async def detach( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/customers/{id}/payment-method", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/customers/promotional_entitlements.py b/src/stigg/resources/v1/customers/promotional_entitlements.py index d1ea0d8f..06e5d239 100644 --- a/src/stigg/resources/v1/customers/promotional_entitlements.py +++ b/src/stigg/resources/v1/customers/promotional_entitlements.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -54,6 +54,8 @@ def create( id: str, *, promotional_entitlements: Iterable[promotional_entitlement_create_params.PromotionalEntitlement], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -78,6 +80,15 @@ def create( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/customers/{id}/promotional-entitlements", id=id), body=maybe_transform( @@ -99,6 +110,8 @@ def list( created_at: promotional_entitlement_list_params.CreatedAt | Omit = omit, limit: int | Omit = omit, status: List[Literal["Active", "Expired", "Paused"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -131,6 +144,15 @@ def list( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/customers/{id}/promotional-entitlements", id=id), page=SyncMyCursorIDPage[PromotionalEntitlementListResponse], @@ -158,6 +180,8 @@ def revoke( feature_id: str, *, id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -182,6 +206,15 @@ def revoke( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not feature_id: raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/customers/{id}/promotional-entitlements/{feature_id}", id=id, feature_id=feature_id), options=make_request_options( @@ -218,6 +251,8 @@ async def create( id: str, *, promotional_entitlements: Iterable[promotional_entitlement_create_params.PromotionalEntitlement], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -242,6 +277,15 @@ async def create( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/customers/{id}/promotional-entitlements", id=id), body=await async_maybe_transform( @@ -263,6 +307,8 @@ def list( created_at: promotional_entitlement_list_params.CreatedAt | Omit = omit, limit: int | Omit = omit, status: List[Literal["Active", "Expired", "Paused"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -295,6 +341,15 @@ def list( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/customers/{id}/promotional-entitlements", id=id), page=AsyncMyCursorIDPage[PromotionalEntitlementListResponse], @@ -322,6 +377,8 @@ async def revoke( feature_id: str, *, id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -346,6 +403,15 @@ async def revoke( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not feature_id: raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/customers/{id}/promotional-entitlements/{feature_id}", id=id, feature_id=feature_id), options=make_request_options( diff --git a/src/stigg/resources/v1/events/beta/customers/assignments.py b/src/stigg/resources/v1/events/beta/customers/assignments.py index 36925bf8..9e3dc3c6 100644 --- a/src/stigg/resources/v1/events/beta/customers/assignments.py +++ b/src/stigg/resources/v1/events/beta/customers/assignments.py @@ -7,7 +7,7 @@ import httpx from ......_types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ......_utils import path_template, maybe_transform, async_maybe_transform +from ......_utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -54,6 +54,8 @@ def list( capability_id: str | Omit = omit, entity_id: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -88,6 +90,15 @@ def list( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1-beta/customers/{id}/assignments", id=id), page=SyncMyCursorIDPage[AssignmentListResponse], @@ -115,6 +126,8 @@ def upsert( id: str, *, assignments: Iterable[assignment_upsert_params.Assignment], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -142,6 +155,15 @@ def upsert( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._put( path_template("/api/v1-beta/customers/{id}/assignments", id=id), body=maybe_transform({"assignments": assignments}, assignment_upsert_params.AssignmentUpsertParams), @@ -181,6 +203,8 @@ def list( capability_id: str | Omit = omit, entity_id: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -215,6 +239,15 @@ def list( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1-beta/customers/{id}/assignments", id=id), page=AsyncMyCursorIDPage[AssignmentListResponse], @@ -242,6 +275,8 @@ async def upsert( id: str, *, assignments: Iterable[assignment_upsert_params.Assignment], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -269,6 +304,15 @@ async def upsert( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._put( path_template("/api/v1-beta/customers/{id}/assignments", id=id), body=await async_maybe_transform( diff --git a/src/stigg/resources/v1/events/beta/customers/entities.py b/src/stigg/resources/v1/events/beta/customers/entities.py index be8dae3b..948d1325 100644 --- a/src/stigg/resources/v1/events/beta/customers/entities.py +++ b/src/stigg/resources/v1/events/beta/customers/entities.py @@ -8,7 +8,7 @@ import httpx from ......_types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ......_utils import path_template, maybe_transform, async_maybe_transform +from ......_utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -59,6 +59,8 @@ def retrieve( entity_id: str, *, id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -82,6 +84,15 @@ def retrieve( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not entity_id: raise ValueError(f"Expected a non-empty value for `entity_id` but received {entity_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1-beta/customers/{id}/entities/{entity_id}", id=id, entity_id=entity_id), options=make_request_options( @@ -99,6 +110,8 @@ def list( include_archived: Literal["true", "false"] | Omit = omit, limit: int | Omit = omit, type_ref_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -130,6 +143,15 @@ def list( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1-beta/customers/{id}/entities", id=id), page=SyncMyCursorIDPage[EntityListResponse], @@ -157,6 +179,8 @@ def archive( id: str, *, ids: SequenceNotStr[str], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -180,6 +204,15 @@ def archive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1-beta/customers/{id}/entities/archive", id=id), body=maybe_transform({"ids": ids}, entity_archive_params.EntityArchiveParams), @@ -194,6 +227,8 @@ def unarchive( id: str, *, ids: SequenceNotStr[str], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -217,6 +252,15 @@ def unarchive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1-beta/customers/{id}/entities/unarchive", id=id), body=maybe_transform({"ids": ids}, entity_unarchive_params.EntityUnarchiveParams), @@ -231,6 +275,8 @@ def upsert( id: str, *, entities: Iterable[entity_upsert_params.Entity], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -256,6 +302,15 @@ def upsert( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._put( path_template("/api/v1-beta/customers/{id}/entities", id=id), body=maybe_transform({"entities": entities}, entity_upsert_params.EntityUpsertParams), @@ -291,6 +346,8 @@ async def retrieve( entity_id: str, *, id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -314,6 +371,15 @@ async def retrieve( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") if not entity_id: raise ValueError(f"Expected a non-empty value for `entity_id` but received {entity_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1-beta/customers/{id}/entities/{entity_id}", id=id, entity_id=entity_id), options=make_request_options( @@ -331,6 +397,8 @@ def list( include_archived: Literal["true", "false"] | Omit = omit, limit: int | Omit = omit, type_ref_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -362,6 +430,15 @@ def list( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1-beta/customers/{id}/entities", id=id), page=AsyncMyCursorIDPage[EntityListResponse], @@ -389,6 +466,8 @@ async def archive( id: str, *, ids: SequenceNotStr[str], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -412,6 +491,15 @@ async def archive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1-beta/customers/{id}/entities/archive", id=id), body=await async_maybe_transform({"ids": ids}, entity_archive_params.EntityArchiveParams), @@ -426,6 +514,8 @@ async def unarchive( id: str, *, ids: SequenceNotStr[str], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -449,6 +539,15 @@ async def unarchive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1-beta/customers/{id}/entities/unarchive", id=id), body=await async_maybe_transform({"ids": ids}, entity_unarchive_params.EntityUnarchiveParams), @@ -463,6 +562,8 @@ async def upsert( id: str, *, entities: Iterable[entity_upsert_params.Entity], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -488,6 +589,15 @@ async def upsert( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._put( path_template("/api/v1-beta/customers/{id}/entities", id=id), body=await async_maybe_transform({"entities": entities}, entity_upsert_params.EntityUpsertParams), diff --git a/src/stigg/resources/v1/events/beta/customers/entitlements.py b/src/stigg/resources/v1/events/beta/customers/entitlements.py index 83c745e3..e9464f90 100644 --- a/src/stigg/resources/v1/events/beta/customers/entitlements.py +++ b/src/stigg/resources/v1/events/beta/customers/entitlements.py @@ -7,7 +7,7 @@ import httpx from ......_types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ......_utils import path_template, maybe_transform, async_maybe_transform +from ......_utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -53,6 +53,8 @@ def check( requested_usage: int | Omit = omit, requested_values: SequenceNotStr[str] | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -92,6 +94,15 @@ def check( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1-beta/customers/{id}/entitlements/check", id=id), options=make_request_options( @@ -145,6 +156,8 @@ async def check( requested_usage: int | Omit = omit, requested_values: SequenceNotStr[str] | Omit = omit, resource_id: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -184,6 +197,15 @@ async def check( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1-beta/customers/{id}/entitlements/check", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/events/beta/entity_types.py b/src/stigg/resources/v1/events/beta/entity_types.py index e45b6002..9a3a3d58 100644 --- a/src/stigg/resources/v1/events/beta/entity_types.py +++ b/src/stigg/resources/v1/events/beta/entity_types.py @@ -7,7 +7,7 @@ import httpx from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ....._utils import maybe_transform, async_maybe_transform +from ....._utils import maybe_transform, strip_not_given, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -51,6 +51,8 @@ def list( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -78,6 +80,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1-beta/entity-types", page=SyncMyCursorIDPage[EntityTypeListResponse], @@ -102,6 +113,8 @@ def upsert( self, *, types: Iterable[entity_type_upsert_params.Type], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -126,6 +139,15 @@ def upsert( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._put( "/api/v1-beta/entity-types", body=maybe_transform({"types": types}, entity_type_upsert_params.EntityTypeUpsertParams), @@ -162,6 +184,8 @@ def list( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -189,6 +213,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1-beta/entity-types", page=AsyncMyCursorIDPage[EntityTypeListResponse], @@ -213,6 +246,8 @@ async def upsert( self, *, types: Iterable[entity_type_upsert_params.Type], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -237,6 +272,15 @@ async def upsert( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._put( "/api/v1-beta/entity-types", body=await async_maybe_transform({"types": types}, entity_type_upsert_params.EntityTypeUpsertParams), diff --git a/src/stigg/resources/v1/events/events.py b/src/stigg/resources/v1/events/events.py index 8a467467..1b6e2bbe 100644 --- a/src/stigg/resources/v1/events/events.py +++ b/src/stigg/resources/v1/events/events.py @@ -6,8 +6,8 @@ import httpx -from ...._types import Body, Query, Headers, NotGiven, not_given -from ...._utils import maybe_transform, async_maybe_transform +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import maybe_transform, strip_not_given, async_maybe_transform from .beta.beta import ( BetaResource, AsyncBetaResource, @@ -73,6 +73,8 @@ def report( self, *, events: Iterable[event_report_params.Event], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -96,6 +98,15 @@ def report( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/events", body=maybe_transform({"events": events}, event_report_params.EventReportParams), @@ -140,6 +151,8 @@ async def report( self, *, events: Iterable[event_report_params.Event], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -163,6 +176,15 @@ async def report( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/events", body=await async_maybe_transform({"events": events}, event_report_params.EventReportParams), diff --git a/src/stigg/resources/v1/features.py b/src/stigg/resources/v1/features.py index f8026b86..bc5f9c98 100644 --- a/src/stigg/resources/v1/features.py +++ b/src/stigg/resources/v1/features.py @@ -8,7 +8,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ...types.v1 import feature_list_features_params, feature_create_feature_params, feature_update_feature_params from ..._resource import SyncAPIResource, AsyncAPIResource @@ -52,6 +52,8 @@ def archive_feature( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -73,6 +75,15 @@ def archive_feature( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/features/{id}/archive", id=id), options=make_request_options( @@ -95,6 +106,8 @@ def create_feature( metadata: Dict[str, str] | Omit = omit, meter_type: Literal["None", "FLUCTUATING", "INCREMENTAL"] | Omit = omit, unit_transformation: Optional[feature_create_feature_params.UnitTransformation] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -136,6 +149,15 @@ def create_feature( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/features", body=maybe_transform( @@ -171,6 +193,8 @@ def list_features( limit: int | Omit = omit, meter_type: List[Literal["None", "FLUCTUATING", "INCREMENTAL"]] | Omit = omit, status: List[Literal["NEW", "SUSPENDED", "ACTIVE"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -206,6 +230,15 @@ def list_features( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/features", page=SyncMyCursorIDPage[FeatureListFeaturesResponse], @@ -235,6 +268,8 @@ def retrieve_feature( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -256,6 +291,15 @@ def retrieve_feature( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/features/{id}", id=id), options=make_request_options( @@ -268,6 +312,8 @@ def unarchive_feature( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -289,6 +335,15 @@ def unarchive_feature( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/features/{id}/unarchive", id=id), options=make_request_options( @@ -309,6 +364,8 @@ def update_feature( metadata: Dict[str, str] | Omit = omit, meter: feature_update_feature_params.Meter | Omit = omit, unit_transformation: Optional[feature_update_feature_params.UnitTransformation] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -345,6 +402,15 @@ def update_feature( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/features/{id}", id=id), body=maybe_transform( @@ -393,6 +459,8 @@ async def archive_feature( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -414,6 +482,15 @@ async def archive_feature( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/features/{id}/archive", id=id), options=make_request_options( @@ -436,6 +513,8 @@ async def create_feature( metadata: Dict[str, str] | Omit = omit, meter_type: Literal["None", "FLUCTUATING", "INCREMENTAL"] | Omit = omit, unit_transformation: Optional[feature_create_feature_params.UnitTransformation] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -477,6 +556,15 @@ async def create_feature( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/features", body=await async_maybe_transform( @@ -512,6 +600,8 @@ def list_features( limit: int | Omit = omit, meter_type: List[Literal["None", "FLUCTUATING", "INCREMENTAL"]] | Omit = omit, status: List[Literal["NEW", "SUSPENDED", "ACTIVE"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -547,6 +637,15 @@ def list_features( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/features", page=AsyncMyCursorIDPage[FeatureListFeaturesResponse], @@ -576,6 +675,8 @@ async def retrieve_feature( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -597,6 +698,15 @@ async def retrieve_feature( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/features/{id}", id=id), options=make_request_options( @@ -609,6 +719,8 @@ async def unarchive_feature( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -630,6 +742,15 @@ async def unarchive_feature( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/features/{id}/unarchive", id=id), options=make_request_options( @@ -650,6 +771,8 @@ async def update_feature( metadata: Dict[str, str] | Omit = omit, meter: feature_update_feature_params.Meter | Omit = omit, unit_transformation: Optional[feature_update_feature_params.UnitTransformation] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -686,6 +809,15 @@ async def update_feature( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/features/{id}", id=id), body=await async_maybe_transform( diff --git a/src/stigg/resources/v1/plans/entitlements.py b/src/stigg/resources/v1/plans/entitlements.py index 8f478e50..02967861 100644 --- a/src/stigg/resources/v1/plans/entitlements.py +++ b/src/stigg/resources/v1/plans/entitlements.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ...._utils import path_template, required_args, maybe_transform, async_maybe_transform +from ...._utils import path_template, required_args, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,6 +51,8 @@ def create( plan_id: str, *, entitlements: Iterable[entitlement_create_params.Entitlement], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -74,6 +76,15 @@ def create( """ if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/plans/{plan_id}/entitlements", plan_id=plan_id), body=maybe_transform({"entitlements": entitlements}, entitlement_create_params.EntitlementCreateParams), @@ -114,6 +125,8 @@ def update( entitlement_update_params.UpdateFeatureEntitlementRequestYearlyResetPeriodConfiguration ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -184,6 +197,8 @@ def update( is_custom: bool | Omit = omit, is_granted: bool | Omit = omit, order: float | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -259,6 +274,8 @@ def update( entitlement_update_params.UpdateFeatureEntitlementRequestYearlyResetPeriodConfiguration ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: str | Omit = omit, amount: float | Omit = omit, cadence: Literal["MONTH", "YEAR"] | Omit = omit, dependency_feature_id: Optional[str] | Omit = omit, @@ -273,6 +290,15 @@ def update( raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/plans/{plan_id}/entitlements/{id}", plan_id=plan_id, id=id), body=maybe_transform( @@ -309,6 +335,8 @@ def list( self, plan_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -330,6 +358,15 @@ def list( """ if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/plans/{plan_id}/entitlements", plan_id=plan_id), options=make_request_options( @@ -343,6 +380,8 @@ def delete( id: str, *, plan_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -366,6 +405,15 @@ def delete( raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/plans/{plan_id}/entitlements/{id}", plan_id=plan_id, id=id), options=make_request_options( @@ -400,6 +448,8 @@ async def create( plan_id: str, *, entitlements: Iterable[entitlement_create_params.Entitlement], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -423,6 +473,15 @@ async def create( """ if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/plans/{plan_id}/entitlements", plan_id=plan_id), body=await async_maybe_transform( @@ -465,6 +524,8 @@ async def update( entitlement_update_params.UpdateFeatureEntitlementRequestYearlyResetPeriodConfiguration ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -535,6 +596,8 @@ async def update( is_custom: bool | Omit = omit, is_granted: bool | Omit = omit, order: float | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -610,6 +673,8 @@ async def update( entitlement_update_params.UpdateFeatureEntitlementRequestYearlyResetPeriodConfiguration ] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: str | Omit = omit, amount: float | Omit = omit, cadence: Literal["MONTH", "YEAR"] | Omit = omit, dependency_feature_id: Optional[str] | Omit = omit, @@ -624,6 +689,15 @@ async def update( raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/plans/{plan_id}/entitlements/{id}", plan_id=plan_id, id=id), body=await async_maybe_transform( @@ -660,6 +734,8 @@ async def list( self, plan_id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -681,6 +757,15 @@ async def list( """ if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/plans/{plan_id}/entitlements", plan_id=plan_id), options=make_request_options( @@ -694,6 +779,8 @@ async def delete( id: str, *, plan_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -717,6 +804,15 @@ async def delete( raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/plans/{plan_id}/entitlements/{id}", plan_id=plan_id, id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/plans/plans.py b/src/stigg/resources/v1/plans/plans.py index 2a8052ab..f1b7635a 100644 --- a/src/stigg/resources/v1/plans/plans.py +++ b/src/stigg/resources/v1/plans/plans.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ....types.v1 import ( plan_list_params, @@ -84,6 +84,8 @@ def create( parent_plan_id: Optional[str] | Omit = omit, pricing_type: Optional[Literal["FREE", "PAID", "CUSTOM"]] | Omit = omit, status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -123,6 +125,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/plans", body=maybe_transform( @@ -150,6 +161,8 @@ def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -172,6 +185,15 @@ def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/plans/{id}", id=id), options=make_request_options( @@ -192,6 +214,8 @@ def update( display_name: str | Omit = omit, metadata: Dict[str, str] | Omit = omit, parent_plan_id: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -228,6 +252,15 @@ def update( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/plans/{id}", id=id), body=maybe_transform( @@ -258,6 +291,8 @@ def list( limit: int | Omit = omit, product_id: str | Omit = omit, status: List[Literal["DRAFT", "PUBLISHED", "ARCHIVED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -289,6 +324,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/plans", page=SyncMyCursorIDPage[PlanListResponse], @@ -316,6 +360,8 @@ def archive( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -337,6 +383,15 @@ def archive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/plans/{id}/archive", id=id), options=make_request_options( @@ -349,6 +404,8 @@ def create_draft( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -370,6 +427,15 @@ def create_draft( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/plans/{id}/draft", id=id), options=make_request_options( @@ -385,6 +451,8 @@ def list_charges( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -412,6 +480,15 @@ def list_charges( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/plans/{id}/charges", id=id), page=SyncMyCursorIDPage[PlanListChargesResponse], @@ -439,6 +516,8 @@ def list_overage_charges( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -466,6 +545,15 @@ def list_overage_charges( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/plans/{id}/overage-charges", id=id), page=SyncMyCursorIDPage[PlanListOverageChargesResponse], @@ -491,6 +579,8 @@ def publish( id: str, *, migration_type: Literal["NEW_CUSTOMERS", "ALL_CUSTOMERS"], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -514,6 +604,15 @@ def publish( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/plans/{id}/publish", id=id), body=maybe_transform({"migration_type": migration_type}, plan_publish_params.PlanPublishParams), @@ -527,6 +626,8 @@ def remove_draft( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -548,6 +649,15 @@ def remove_draft( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/plans/{id}/draft", id=id), options=make_request_options( @@ -596,6 +706,8 @@ async def create( parent_plan_id: Optional[str] | Omit = omit, pricing_type: Optional[Literal["FREE", "PAID", "CUSTOM"]] | Omit = omit, status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -635,6 +747,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/plans", body=await async_maybe_transform( @@ -662,6 +783,8 @@ async def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -684,6 +807,15 @@ async def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/plans/{id}", id=id), options=make_request_options( @@ -704,6 +836,8 @@ async def update( display_name: str | Omit = omit, metadata: Dict[str, str] | Omit = omit, parent_plan_id: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -740,6 +874,15 @@ async def update( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/plans/{id}", id=id), body=await async_maybe_transform( @@ -770,6 +913,8 @@ def list( limit: int | Omit = omit, product_id: str | Omit = omit, status: List[Literal["DRAFT", "PUBLISHED", "ARCHIVED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -801,6 +946,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/plans", page=AsyncMyCursorIDPage[PlanListResponse], @@ -828,6 +982,8 @@ async def archive( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -849,6 +1005,15 @@ async def archive( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/plans/{id}/archive", id=id), options=make_request_options( @@ -861,6 +1026,8 @@ async def create_draft( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -882,6 +1049,15 @@ async def create_draft( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/plans/{id}/draft", id=id), options=make_request_options( @@ -897,6 +1073,8 @@ def list_charges( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -924,6 +1102,15 @@ def list_charges( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/plans/{id}/charges", id=id), page=AsyncMyCursorIDPage[PlanListChargesResponse], @@ -951,6 +1138,8 @@ def list_overage_charges( after: str | Omit = omit, before: str | Omit = omit, limit: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -978,6 +1167,15 @@ def list_overage_charges( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( path_template("/api/v1/plans/{id}/overage-charges", id=id), page=AsyncMyCursorIDPage[PlanListOverageChargesResponse], @@ -1003,6 +1201,8 @@ async def publish( id: str, *, migration_type: Literal["NEW_CUSTOMERS", "ALL_CUSTOMERS"], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1026,6 +1226,15 @@ async def publish( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/plans/{id}/publish", id=id), body=await async_maybe_transform({"migration_type": migration_type}, plan_publish_params.PlanPublishParams), @@ -1039,6 +1248,8 @@ async def remove_draft( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1060,6 +1271,15 @@ async def remove_draft( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/plans/{id}/draft", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/products.py b/src/stigg/resources/v1/products.py index f8347fc1..464f4f68 100644 --- a/src/stigg/resources/v1/products.py +++ b/src/stigg/resources/v1/products.py @@ -8,7 +8,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ...types.v1 import ( product_list_products_params, @@ -57,6 +57,8 @@ def archive_product( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -80,6 +82,15 @@ def archive_product( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/products/{id}/archive", id=id), options=make_request_options( @@ -96,6 +107,8 @@ def create_product( description: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, multiple_subscriptions: bool | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -125,6 +138,15 @@ def create_product( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/products", body=maybe_transform( @@ -150,6 +172,8 @@ def duplicate_product( target_id: str, description: Optional[str] | Omit = omit, display_name: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -177,6 +201,15 @@ def duplicate_product( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/products/{id}/duplicate", id=id), body=maybe_transform( @@ -202,6 +235,8 @@ def list_products( created_at: product_list_products_params.CreatedAt | Omit = omit, limit: int | Omit = omit, status: List[Literal["PUBLISHED", "ARCHIVED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -233,6 +268,15 @@ def list_products( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/products", page=SyncMyCursorIDPage[ProductListProductsResponse], @@ -260,6 +304,8 @@ def unarchive_product( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -281,6 +327,15 @@ def unarchive_product( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/products/{id}/unarchive", id=id), options=make_request_options( @@ -299,6 +354,8 @@ def update_product( multiple_subscriptions: bool | Omit = omit, product_settings: product_update_product_params.ProductSettings | Omit = omit, usage_reset_cutoff_rule: product_update_product_params.UsageResetCutoffRule | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -331,6 +388,15 @@ def update_product( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/products/{id}", id=id), body=maybe_transform( @@ -377,6 +443,8 @@ async def archive_product( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -400,6 +468,15 @@ async def archive_product( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/products/{id}/archive", id=id), options=make_request_options( @@ -416,6 +493,8 @@ async def create_product( description: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, multiple_subscriptions: bool | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -445,6 +524,15 @@ async def create_product( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/products", body=await async_maybe_transform( @@ -470,6 +558,8 @@ async def duplicate_product( target_id: str, description: Optional[str] | Omit = omit, display_name: str | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -497,6 +587,15 @@ async def duplicate_product( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/products/{id}/duplicate", id=id), body=await async_maybe_transform( @@ -522,6 +621,8 @@ def list_products( created_at: product_list_products_params.CreatedAt | Omit = omit, limit: int | Omit = omit, status: List[Literal["PUBLISHED", "ARCHIVED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -553,6 +654,15 @@ def list_products( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/products", page=AsyncMyCursorIDPage[ProductListProductsResponse], @@ -580,6 +690,8 @@ async def unarchive_product( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -601,6 +713,15 @@ async def unarchive_product( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/products/{id}/unarchive", id=id), options=make_request_options( @@ -619,6 +740,8 @@ async def update_product( multiple_subscriptions: bool | Omit = omit, product_settings: product_update_product_params.ProductSettings | Omit = omit, usage_reset_cutoff_rule: product_update_product_params.UsageResetCutoffRule | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -651,6 +774,15 @@ async def update_product( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/products/{id}", id=id), body=await async_maybe_transform( diff --git a/src/stigg/resources/v1/subscriptions/future_update.py b/src/stigg/resources/v1/subscriptions/future_update.py index 242a5229..ac75aa4d 100644 --- a/src/stigg/resources/v1/subscriptions/future_update.py +++ b/src/stigg/resources/v1/subscriptions/future_update.py @@ -4,8 +4,8 @@ import httpx -from ...._types import Body, Query, Headers, NotGiven, not_given -from ...._utils import path_template +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import path_template, strip_not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -46,6 +46,8 @@ def cancel_pending_payment( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -67,6 +69,15 @@ def cancel_pending_payment( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/subscriptions/{id}/future-update/pending-payment", id=id), options=make_request_options( @@ -79,6 +90,8 @@ def cancel_schedule( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -101,6 +114,15 @@ def cancel_schedule( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._delete( path_template("/api/v1/subscriptions/{id}/future-update/schedule", id=id), options=make_request_options( @@ -136,6 +158,8 @@ async def cancel_pending_payment( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -157,6 +181,15 @@ async def cancel_pending_payment( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/subscriptions/{id}/future-update/pending-payment", id=id), options=make_request_options( @@ -169,6 +202,8 @@ async def cancel_schedule( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -191,6 +226,15 @@ async def cancel_schedule( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._delete( path_template("/api/v1/subscriptions/{id}/future-update/schedule", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/subscriptions/invoice.py b/src/stigg/resources/v1/subscriptions/invoice.py index 1c9708a1..89045a34 100644 --- a/src/stigg/resources/v1/subscriptions/invoice.py +++ b/src/stigg/resources/v1/subscriptions/invoice.py @@ -4,8 +4,8 @@ import httpx -from ...._types import Body, Query, Headers, NotGiven, not_given -from ...._utils import path_template +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import path_template, strip_not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -46,6 +46,8 @@ def mark_as_paid( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -69,6 +71,15 @@ def mark_as_paid( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/subscriptions/{id}/invoice/paid", id=id), options=make_request_options( @@ -104,6 +115,8 @@ async def mark_as_paid( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -127,6 +140,15 @@ async def mark_as_paid( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/subscriptions/{id}/invoice/paid", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/subscriptions/subscriptions.py b/src/stigg/resources/v1/subscriptions/subscriptions.py index 857bb035..f799f644 100644 --- a/src/stigg/resources/v1/subscriptions/subscriptions.py +++ b/src/stigg/resources/v1/subscriptions/subscriptions.py @@ -25,7 +25,7 @@ AsyncInvoiceResourceWithStreamingResponse, ) from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ....types.v1 import ( subscription_list_params, @@ -103,6 +103,8 @@ def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -125,6 +127,15 @@ def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template("/api/v1/subscriptions/{id}", id=id), options=make_request_options( @@ -153,6 +164,8 @@ def update( promotion_code: str | Omit = omit, schedule_strategy: Literal["END_OF_BILLING_PERIOD", "END_OF_BILLING_MONTH", "IMMEDIATE"] | Omit = omit, trial_end_date: Union[str, datetime] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -187,6 +200,15 @@ def update( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._patch( path_template("/api/v1/subscriptions/{id}", id=id), body=maybe_transform( @@ -229,6 +251,8 @@ def list( resource_id: str | Omit = omit, status: List[Literal["PAYMENT_PENDING", "ACTIVE", "EXPIRED", "IN_TRIAL", "CANCELED", "NOT_STARTED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -268,6 +292,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/subscriptions", page=SyncMyCursorIDPage[SubscriptionListResponse], @@ -302,6 +335,8 @@ def cancel( cancellation_time: Literal["END_OF_BILLING_PERIOD", "IMMEDIATE", "SPECIFIC_DATE"] | Omit = omit, end_date: Union[str, datetime] | Omit = omit, prorate: bool | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -332,6 +367,15 @@ def cancel( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/subscriptions/{id}/cancel", id=id), body=maybe_transform( @@ -354,6 +398,8 @@ def delegate( id: str, *, target_customer_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -380,6 +426,15 @@ def delegate( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/subscriptions/{id}/delegate", id=id), body=maybe_transform( @@ -396,6 +451,8 @@ def import_( *, subscriptions: Iterable[subscription_import_params.Subscription], integration_id: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -421,6 +478,15 @@ def import_( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/subscriptions/import", body=maybe_transform( @@ -441,6 +507,8 @@ def migrate( id: str, *, subscription_migration_time: Literal["END_OF_BILLING_PERIOD", "IMMEDIATE"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -465,6 +533,15 @@ def migrate( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/subscriptions/{id}/migrate", id=id), body=maybe_transform( @@ -496,6 +573,8 @@ def preview( start_date: Union[str, datetime] | Omit = omit, trial_override_configuration: subscription_preview_params.TrialOverrideConfiguration | Omit = omit, unit_quantity: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -548,6 +627,15 @@ def preview( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/subscriptions/preview", body=maybe_transform( @@ -607,6 +695,8 @@ def provision( start_date: Union[str, datetime] | Omit = omit, trial_override_configuration: subscription_provision_params.TrialOverrideConfiguration | Omit = omit, unit_quantity: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -670,6 +760,15 @@ def provision( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/subscriptions", body=maybe_transform( @@ -715,6 +814,8 @@ def transfer( id: str, *, destination_resource_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -740,6 +841,15 @@ def transfer( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/subscriptions/{id}/transfer", id=id), body=maybe_transform( @@ -792,6 +902,8 @@ async def retrieve( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -814,6 +926,15 @@ async def retrieve( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template("/api/v1/subscriptions/{id}", id=id), options=make_request_options( @@ -842,6 +963,8 @@ async def update( promotion_code: str | Omit = omit, schedule_strategy: Literal["END_OF_BILLING_PERIOD", "END_OF_BILLING_MONTH", "IMMEDIATE"] | Omit = omit, trial_end_date: Union[str, datetime] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -876,6 +999,15 @@ async def update( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._patch( path_template("/api/v1/subscriptions/{id}", id=id), body=await async_maybe_transform( @@ -918,6 +1050,8 @@ def list( resource_id: str | Omit = omit, status: List[Literal["PAYMENT_PENDING", "ACTIVE", "EXPIRED", "IN_TRIAL", "CANCELED", "NOT_STARTED"]] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -957,6 +1091,15 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get_api_list( "/api/v1/subscriptions", page=AsyncMyCursorIDPage[SubscriptionListResponse], @@ -991,6 +1134,8 @@ async def cancel( cancellation_time: Literal["END_OF_BILLING_PERIOD", "IMMEDIATE", "SPECIFIC_DATE"] | Omit = omit, end_date: Union[str, datetime] | Omit = omit, prorate: bool | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1021,6 +1166,15 @@ async def cancel( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/subscriptions/{id}/cancel", id=id), body=await async_maybe_transform( @@ -1043,6 +1197,8 @@ async def delegate( id: str, *, target_customer_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1069,6 +1225,15 @@ async def delegate( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/subscriptions/{id}/delegate", id=id), body=await async_maybe_transform( @@ -1085,6 +1250,8 @@ async def import_( *, subscriptions: Iterable[subscription_import_params.Subscription], integration_id: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1110,6 +1277,15 @@ async def import_( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/subscriptions/import", body=await async_maybe_transform( @@ -1130,6 +1306,8 @@ async def migrate( id: str, *, subscription_migration_time: Literal["END_OF_BILLING_PERIOD", "IMMEDIATE"] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1154,6 +1332,15 @@ async def migrate( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/subscriptions/{id}/migrate", id=id), body=await async_maybe_transform( @@ -1185,6 +1372,8 @@ async def preview( start_date: Union[str, datetime] | Omit = omit, trial_override_configuration: subscription_preview_params.TrialOverrideConfiguration | Omit = omit, unit_quantity: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1237,6 +1426,15 @@ async def preview( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/subscriptions/preview", body=await async_maybe_transform( @@ -1296,6 +1494,8 @@ async def provision( start_date: Union[str, datetime] | Omit = omit, trial_override_configuration: subscription_provision_params.TrialOverrideConfiguration | Omit = omit, unit_quantity: int | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1359,6 +1559,15 @@ async def provision( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/subscriptions", body=await async_maybe_transform( @@ -1404,6 +1613,8 @@ async def transfer( id: str, *, destination_resource_id: str, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -1429,6 +1640,15 @@ async def transfer( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/subscriptions/{id}/transfer", id=id), body=await async_maybe_transform( diff --git a/src/stigg/resources/v1/subscriptions/usage.py b/src/stigg/resources/v1/subscriptions/usage.py index 2c4bd8c4..fc46f213 100644 --- a/src/stigg/resources/v1/subscriptions/usage.py +++ b/src/stigg/resources/v1/subscriptions/usage.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,6 +52,8 @@ def charge_usage( id: str, *, until_date: Union[str, datetime] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -76,6 +78,15 @@ def charge_usage( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/subscriptions/{id}/usage/charge", id=id), body=maybe_transform({"until_date": until_date}, usage_charge_usage_params.UsageChargeUsageParams), @@ -89,6 +100,8 @@ def sync( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -111,6 +124,15 @@ def sync( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( path_template("/api/v1/subscriptions/{id}/usage/sync", id=id), options=make_request_options( @@ -147,6 +169,8 @@ async def charge_usage( id: str, *, until_date: Union[str, datetime] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -171,6 +195,15 @@ async def charge_usage( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/subscriptions/{id}/usage/charge", id=id), body=await async_maybe_transform( @@ -186,6 +219,8 @@ async def sync( self, id: str, *, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -208,6 +243,15 @@ async def sync( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( path_template("/api/v1/subscriptions/{id}/usage/sync", id=id), options=make_request_options( diff --git a/src/stigg/resources/v1/usage.py b/src/stigg/resources/v1/usage.py index d4e3d490..ccf9a73d 100644 --- a/src/stigg/resources/v1/usage.py +++ b/src/stigg/resources/v1/usage.py @@ -8,7 +8,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ...types.v1 import usage_report_params, usage_history_params from ..._resource import SyncAPIResource, AsyncAPIResource @@ -56,6 +56,8 @@ def history( end_date: Union[str, datetime] | Omit = omit, group_by: str | Omit = omit, resource_id: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -87,6 +89,15 @@ def history( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") if not feature_id: raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._get( path_template( "/api/v1/usage/{customer_id}/history/{feature_id}", customer_id=customer_id, feature_id=feature_id @@ -113,6 +124,8 @@ def report( self, *, usages: Iterable[usage_report_params.Usage], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -136,6 +149,15 @@ def report( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return self._post( "/api/v1/usage", body=maybe_transform({"usages": usages}, usage_report_params.UsageReportParams), @@ -177,6 +199,8 @@ async def history( end_date: Union[str, datetime] | Omit = omit, group_by: str | Omit = omit, resource_id: Optional[str] | Omit = omit, + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -208,6 +232,15 @@ async def history( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") if not feature_id: raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}") + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._get( path_template( "/api/v1/usage/{customer_id}/history/{feature_id}", customer_id=customer_id, feature_id=feature_id @@ -234,6 +267,8 @@ async def report( self, *, usages: Iterable[usage_report_params.Usage], + x_account_id: str | Omit = omit, + x_environment_id: 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, @@ -257,6 +292,15 @@ async def report( timeout: Override the client-level default timeout for this request, in seconds """ + extra_headers = { + **strip_not_given( + { + "X-ACCOUNT-ID": x_account_id, + "X-ENVIRONMENT-ID": x_environment_id, + } + ), + **(extra_headers or {}), + } return await self._post( "/api/v1/usage", body=await async_maybe_transform({"usages": usages}, usage_report_params.UsageReportParams), diff --git a/src/stigg/types/v1/addon_create_params.py b/src/stigg/types/v1/addon_create_params.py index 378aa87b..2fd59ca4 100644 --- a/src/stigg/types/v1/addon_create_params.py +++ b/src/stigg/types/v1/addon_create_params.py @@ -37,3 +37,7 @@ class AddonCreateParams(TypedDict, total=False): status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] """The status of the package""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/addon_list_charges_params.py b/src/stigg/types/v1/addon_list_charges_params.py index 08779f8c..01094069 100644 --- a/src/stigg/types/v1/addon_list_charges_params.py +++ b/src/stigg/types/v1/addon_list_charges_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["AddonListChargesParams"] @@ -16,3 +18,7 @@ class AddonListChargesParams(TypedDict, total=False): limit: int """Maximum number of items to return""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/addon_list_params.py b/src/stigg/types/v1/addon_list_params.py index 8111c87e..808bbe4a 100644 --- a/src/stigg/types/v1/addon_list_params.py +++ b/src/stigg/types/v1/addon_list_params.py @@ -30,6 +30,10 @@ class AddonListParams(TypedDict, total=False): status: List[Literal["DRAFT", "PUBLISHED", "ARCHIVED"]] """Filter by status. Supports comma-separated values for multiple statuses""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/addon_publish_params.py b/src/stigg/types/v1/addon_publish_params.py index 022e0973..640d4c60 100644 --- a/src/stigg/types/v1/addon_publish_params.py +++ b/src/stigg/types/v1/addon_publish_params.py @@ -12,3 +12,7 @@ class AddonPublishParams(TypedDict, total=False): migration_type: Required[Annotated[Literal["NEW_CUSTOMERS", "ALL_CUSTOMERS"], PropertyInfo(alias="migrationType")]] """The migration type of the package""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/addon_update_params.py b/src/stigg/types/v1/addon_update_params.py index 8aecd459..1f1ceade 100644 --- a/src/stigg/types/v1/addon_update_params.py +++ b/src/stigg/types/v1/addon_update_params.py @@ -62,6 +62,10 @@ class AddonUpdateParams(TypedDict, total=False): status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] """The status of the package""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class ChargesMinimumSpendMinimum(TypedDict, total=False): """The minimum spend amount""" diff --git a/src/stigg/types/v1/addons/entitlement_create_params.py b/src/stigg/types/v1/addons/entitlement_create_params.py index a0990370..5d7c436f 100644 --- a/src/stigg/types/v1/addons/entitlement_create_params.py +++ b/src/stigg/types/v1/addons/entitlement_create_params.py @@ -23,6 +23,10 @@ class EntitlementCreateParams(TypedDict, total=False): entitlements: Required[Iterable[Entitlement]] """Entitlements to create""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class EntitlementFeatureMonthlyResetPeriodConfiguration(TypedDict, total=False): """Configuration for monthly reset period""" diff --git a/src/stigg/types/v1/addons/entitlement_update_params.py b/src/stigg/types/v1/addons/entitlement_update_params.py index 0c5a8c03..7a6ef4b5 100644 --- a/src/stigg/types/v1/addons/entitlement_update_params.py +++ b/src/stigg/types/v1/addons/entitlement_update_params.py @@ -80,6 +80,10 @@ class UpdateFeatureEntitlementRequest(TypedDict, total=False): ] """Configuration for yearly reset period""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class UpdateFeatureEntitlementRequestMonthlyResetPeriodConfiguration(TypedDict, total=False): """Configuration for monthly reset period""" @@ -160,5 +164,9 @@ class UpdateCreditEntitlementRequest(TypedDict, total=False): order: float """Display order of the entitlement""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + EntitlementUpdateParams: TypeAlias = Union[UpdateFeatureEntitlementRequest, UpdateCreditEntitlementRequest] diff --git a/src/stigg/types/v1/coupon_create_params.py b/src/stigg/types/v1/coupon_create_params.py index 538b4ad4..dbd1732f 100644 --- a/src/stigg/types/v1/coupon_create_params.py +++ b/src/stigg/types/v1/coupon_create_params.py @@ -32,6 +32,10 @@ class CouponCreateParams(TypedDict, total=False): percent_off: Required[Annotated[Optional[float], PropertyInfo(alias="percentOff")]] """Percentage discount off the original price""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class AmountsOff(TypedDict, total=False): """Monetary amount with currency""" diff --git a/src/stigg/types/v1/coupon_list_params.py b/src/stigg/types/v1/coupon_list_params.py index f218aecd..b6c4baf8 100644 --- a/src/stigg/types/v1/coupon_list_params.py +++ b/src/stigg/types/v1/coupon_list_params.py @@ -33,6 +33,10 @@ class CouponListParams(TypedDict, total=False): type: Literal["FIXED", "PERCENTAGE"] """Filter by coupon type (FIXED or PERCENTAGE)""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/coupon_update_coupon_params.py b/src/stigg/types/v1/coupon_update_coupon_params.py index 175f6c51..44f24ddd 100644 --- a/src/stigg/types/v1/coupon_update_coupon_params.py +++ b/src/stigg/types/v1/coupon_update_coupon_params.py @@ -3,7 +3,9 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["CouponUpdateCouponParams"] @@ -17,3 +19,7 @@ class CouponUpdateCouponParams(TypedDict, total=False): name: str """Name of the coupon""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/credit_get_auto_recharge_params.py b/src/stigg/types/v1/credit_get_auto_recharge_params.py index 2ba3152f..fba64571 100644 --- a/src/stigg/types/v1/credit_get_auto_recharge_params.py +++ b/src/stigg/types/v1/credit_get_auto_recharge_params.py @@ -15,3 +15,7 @@ class CreditGetAutoRechargeParams(TypedDict, total=False): customer_id: Required[Annotated[str, PropertyInfo(alias="customerId")]] """Filter by customer ID (required)""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/credit_get_usage_params.py b/src/stigg/types/v1/credit_get_usage_params.py index 0b37495e..ac7c9df7 100644 --- a/src/stigg/types/v1/credit_get_usage_params.py +++ b/src/stigg/types/v1/credit_get_usage_params.py @@ -53,3 +53,7 @@ class CreditGetUsageParams(TypedDict, total=False): Defaults to LAST_MONTH """ + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/credit_list_ledger_params.py b/src/stigg/types/v1/credit_list_ledger_params.py index af32741e..4a55b71b 100644 --- a/src/stigg/types/v1/credit_list_ledger_params.py +++ b/src/stigg/types/v1/credit_list_ledger_params.py @@ -27,3 +27,7 @@ class CreditListLedgerParams(TypedDict, total=False): resource_id: Annotated[str, PropertyInfo(alias="resourceId")] """Filter by resource ID""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/credits/custom_currency_create_params.py b/src/stigg/types/v1/credits/custom_currency_create_params.py index a918c946..b26c7cf1 100644 --- a/src/stigg/types/v1/credits/custom_currency_create_params.py +++ b/src/stigg/types/v1/credits/custom_currency_create_params.py @@ -32,6 +32,10 @@ class CustomCurrencyCreateParams(TypedDict, total=False): Both fields are required when supplied. """ + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Units(TypedDict, total=False): """Singular and plural unit labels for a custom currency. diff --git a/src/stigg/types/v1/credits/custom_currency_list_params.py b/src/stigg/types/v1/credits/custom_currency_list_params.py index d74ef6d9..e5931045 100644 --- a/src/stigg/types/v1/credits/custom_currency_list_params.py +++ b/src/stigg/types/v1/credits/custom_currency_list_params.py @@ -3,7 +3,9 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["CustomCurrencyListParams"] @@ -23,3 +25,7 @@ class CustomCurrencyListParams(TypedDict, total=False): Supports comma-separated values (e.g., `ACTIVE,ARCHIVED`). Defaults to `ACTIVE`. """ + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/credits/custom_currency_update_params.py b/src/stigg/types/v1/credits/custom_currency_update_params.py index 039690d5..189c2515 100644 --- a/src/stigg/types/v1/credits/custom_currency_update_params.py +++ b/src/stigg/types/v1/credits/custom_currency_update_params.py @@ -35,6 +35,10 @@ class CustomCurrencyUpdateParams(TypedDict, total=False): Both fields are required when supplied. """ + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Units(TypedDict, total=False): """Singular and plural unit labels for a custom currency. diff --git a/src/stigg/types/v1/credits/grant_create_params.py b/src/stigg/types/v1/credits/grant_create_params.py index eeefc488..d429d446 100644 --- a/src/stigg/types/v1/credits/grant_create_params.py +++ b/src/stigg/types/v1/credits/grant_create_params.py @@ -59,6 +59,10 @@ class GrantCreateParams(TypedDict, total=False): resource_id: Annotated[str, PropertyInfo(alias="resourceId")] """The resource ID to scope the grant to""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class BillingInformationBillingAddress(TypedDict, total=False): """The billing address""" diff --git a/src/stigg/types/v1/credits/grant_list_params.py b/src/stigg/types/v1/credits/grant_list_params.py index c275bfaf..36c43565 100644 --- a/src/stigg/types/v1/credits/grant_list_params.py +++ b/src/stigg/types/v1/credits/grant_list_params.py @@ -36,6 +36,10 @@ class GrantListParams(TypedDict, total=False): When omitted, only grants without a resource are returned """ + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/customer_check_entitlement_params.py b/src/stigg/types/v1/customer_check_entitlement_params.py index b3910ca0..039d133e 100644 --- a/src/stigg/types/v1/customer_check_entitlement_params.py +++ b/src/stigg/types/v1/customer_check_entitlement_params.py @@ -31,3 +31,7 @@ class CustomerCheckEntitlementParams(TypedDict, total=False): resource_id: Annotated[str, PropertyInfo(alias="resourceId")] """Resource ID to scope the entitlement check to a specific resource""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/customer_import_params.py b/src/stigg/types/v1/customer_import_params.py index 6c8edf80..135461e5 100644 --- a/src/stigg/types/v1/customer_import_params.py +++ b/src/stigg/types/v1/customer_import_params.py @@ -18,6 +18,10 @@ class CustomerImportParams(TypedDict, total=False): integration_id: Annotated[str, PropertyInfo(alias="integrationId")] """Integration details""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Customer(TypedDict, total=False): id: Required[str] diff --git a/src/stigg/types/v1/customer_list_params.py b/src/stigg/types/v1/customer_list_params.py index 4faadd1f..09e99b66 100644 --- a/src/stigg/types/v1/customer_list_params.py +++ b/src/stigg/types/v1/customer_list_params.py @@ -30,6 +30,10 @@ class CustomerListParams(TypedDict, total=False): name: str """Filter by exact customer name""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/customer_list_resources_params.py b/src/stigg/types/v1/customer_list_resources_params.py index bba1d72b..52df800e 100644 --- a/src/stigg/types/v1/customer_list_resources_params.py +++ b/src/stigg/types/v1/customer_list_resources_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["CustomerListResourcesParams"] @@ -16,3 +18,7 @@ class CustomerListResourcesParams(TypedDict, total=False): limit: int """Maximum number of items to return""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/customer_provision_params.py b/src/stigg/types/v1/customer_provision_params.py index 85d76845..be4b415f 100644 --- a/src/stigg/types/v1/customer_provision_params.py +++ b/src/stigg/types/v1/customer_provision_params.py @@ -180,6 +180,10 @@ class CustomerProvisionParams(TypedDict, total=False): timezone: Optional[str] """Timezone to use for this customer""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class DefaultPaymentMethod(TypedDict, total=False): """The default payment method details""" diff --git a/src/stigg/types/v1/customer_retrieve_entitlements_params.py b/src/stigg/types/v1/customer_retrieve_entitlements_params.py index 60c3a190..0fb968d0 100644 --- a/src/stigg/types/v1/customer_retrieve_entitlements_params.py +++ b/src/stigg/types/v1/customer_retrieve_entitlements_params.py @@ -12,3 +12,7 @@ class CustomerRetrieveEntitlementsParams(TypedDict, total=False): resource_id: Annotated[str, PropertyInfo(alias="resourceId")] """Resource ID to scope entitlements to a specific resource""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/customer_update_params.py b/src/stigg/types/v1/customer_update_params.py index dd1125c3..f7659444 100644 --- a/src/stigg/types/v1/customer_update_params.py +++ b/src/stigg/types/v1/customer_update_params.py @@ -173,6 +173,10 @@ class CustomerUpdateParams(TypedDict, total=False): timezone: Optional[str] """Timezone to use for this customer""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Integration(TypedDict, total=False): """External billing or CRM integration link""" diff --git a/src/stigg/types/v1/customers/integration_link_params.py b/src/stigg/types/v1/customers/integration_link_params.py index d4b3b00d..020a2171 100644 --- a/src/stigg/types/v1/customers/integration_link_params.py +++ b/src/stigg/types/v1/customers/integration_link_params.py @@ -36,3 +36,7 @@ class IntegrationLinkParams(TypedDict, total=False): ] ] """The vendor identifier of integration""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/customers/integration_list_params.py b/src/stigg/types/v1/customers/integration_list_params.py index 626a98dc..42aea0f2 100644 --- a/src/stigg/types/v1/customers/integration_list_params.py +++ b/src/stigg/types/v1/customers/integration_list_params.py @@ -43,3 +43,7 @@ class IntegrationListParams(TypedDict, total=False): Supports comma-separated values for multiple vendors (e.g., STRIPE,HUBSPOT) """ + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/customers/integration_update_params.py b/src/stigg/types/v1/customers/integration_update_params.py index 60ab63ec..969f0298 100644 --- a/src/stigg/types/v1/customers/integration_update_params.py +++ b/src/stigg/types/v1/customers/integration_update_params.py @@ -15,3 +15,7 @@ class IntegrationUpdateParams(TypedDict, total=False): synced_entity_id: Required[Annotated[Optional[str], PropertyInfo(alias="syncedEntityId")]] """Synced entity id""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/customers/payment_method_attach_params.py b/src/stigg/types/v1/customers/payment_method_attach_params.py index b60b200f..8a75a204 100644 --- a/src/stigg/types/v1/customers/payment_method_attach_params.py +++ b/src/stigg/types/v1/customers/payment_method_attach_params.py @@ -162,3 +162,7 @@ class PaymentMethodAttachParams(TypedDict, total=False): PropertyInfo(alias="billingCurrency"), ] """Customers selected currency""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/customers/promotional_entitlement_create_params.py b/src/stigg/types/v1/customers/promotional_entitlement_create_params.py index afc47beb..ab41e977 100644 --- a/src/stigg/types/v1/customers/promotional_entitlement_create_params.py +++ b/src/stigg/types/v1/customers/promotional_entitlement_create_params.py @@ -24,6 +24,10 @@ class PromotionalEntitlementCreateParams(TypedDict, total=False): ] """Promotional entitlements to grant""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class PromotionalEntitlementMonthlyResetPeriodConfiguration(TypedDict, total=False): """ diff --git a/src/stigg/types/v1/customers/promotional_entitlement_list_params.py b/src/stigg/types/v1/customers/promotional_entitlement_list_params.py index 8c414353..e5148d8c 100644 --- a/src/stigg/types/v1/customers/promotional_entitlement_list_params.py +++ b/src/stigg/types/v1/customers/promotional_entitlement_list_params.py @@ -30,6 +30,10 @@ class PromotionalEntitlementListParams(TypedDict, total=False): Supports comma-separated values for multiple statuses """ + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/event_report_params.py b/src/stigg/types/v1/event_report_params.py index 1b6ce638..6f0dace6 100644 --- a/src/stigg/types/v1/event_report_params.py +++ b/src/stigg/types/v1/event_report_params.py @@ -15,6 +15,10 @@ class EventReportParams(TypedDict, total=False): events: Required[Iterable[Event]] """A list of usage events to report""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Event(TypedDict, total=False): """Raw usage event""" diff --git a/src/stigg/types/v1/events/beta/customers/assignment_list_params.py b/src/stigg/types/v1/events/beta/customers/assignment_list_params.py index 936f5bbd..1632b11b 100644 --- a/src/stigg/types/v1/events/beta/customers/assignment_list_params.py +++ b/src/stigg/types/v1/events/beta/customers/assignment_list_params.py @@ -24,3 +24,7 @@ class AssignmentListParams(TypedDict, total=False): limit: int """Maximum number of items to return""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/events/beta/customers/assignment_upsert_params.py b/src/stigg/types/v1/events/beta/customers/assignment_upsert_params.py index 6598aa78..37fe302b 100644 --- a/src/stigg/types/v1/events/beta/customers/assignment_upsert_params.py +++ b/src/stigg/types/v1/events/beta/customers/assignment_upsert_params.py @@ -14,6 +14,10 @@ class AssignmentUpsertParams(TypedDict, total=False): assignments: Required[Iterable[Assignment]] """Assignments to upsert (1–100 per request)""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Assignment(TypedDict, total=False): """A single assignment to create or update. diff --git a/src/stigg/types/v1/events/beta/customers/entitlement_check_params.py b/src/stigg/types/v1/events/beta/customers/entitlement_check_params.py index 97e28170..58b19afa 100644 --- a/src/stigg/types/v1/events/beta/customers/entitlement_check_params.py +++ b/src/stigg/types/v1/events/beta/customers/entitlement_check_params.py @@ -39,3 +39,7 @@ class EntitlementCheckParams(TypedDict, total=False): resource_id: Annotated[str, PropertyInfo(alias="resourceId")] """Resource ID to scope the entitlement check to a specific resource""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/events/beta/customers/entity_archive_params.py b/src/stigg/types/v1/events/beta/customers/entity_archive_params.py index e9965836..eb3c2711 100644 --- a/src/stigg/types/v1/events/beta/customers/entity_archive_params.py +++ b/src/stigg/types/v1/events/beta/customers/entity_archive_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ......_types import SequenceNotStr +from ......_utils import PropertyInfo __all__ = ["EntityArchiveParams"] @@ -12,3 +13,7 @@ class EntityArchiveParams(TypedDict, total=False): ids: Required[SequenceNotStr[str]] """Entity identifiers to act on""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/events/beta/customers/entity_list_params.py b/src/stigg/types/v1/events/beta/customers/entity_list_params.py index bec6ba0a..e47f81af 100644 --- a/src/stigg/types/v1/events/beta/customers/entity_list_params.py +++ b/src/stigg/types/v1/events/beta/customers/entity_list_params.py @@ -24,3 +24,7 @@ class EntityListParams(TypedDict, total=False): type_ref_id: Annotated[str, PropertyInfo(alias="typeRefId")] """Filter results to entities of a specific entity type, by the type's refId""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/events/beta/customers/entity_unarchive_params.py b/src/stigg/types/v1/events/beta/customers/entity_unarchive_params.py index 5eba243f..2cd9eaf9 100644 --- a/src/stigg/types/v1/events/beta/customers/entity_unarchive_params.py +++ b/src/stigg/types/v1/events/beta/customers/entity_unarchive_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ......_types import SequenceNotStr +from ......_utils import PropertyInfo __all__ = ["EntityUnarchiveParams"] @@ -12,3 +13,7 @@ class EntityUnarchiveParams(TypedDict, total=False): ids: Required[SequenceNotStr[str]] """Entity identifiers to act on""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/events/beta/customers/entity_upsert_params.py b/src/stigg/types/v1/events/beta/customers/entity_upsert_params.py index 65e412fc..638d19d3 100644 --- a/src/stigg/types/v1/events/beta/customers/entity_upsert_params.py +++ b/src/stigg/types/v1/events/beta/customers/entity_upsert_params.py @@ -14,6 +14,10 @@ class EntityUpsertParams(TypedDict, total=False): entities: Required[Iterable[Entity]] """List of entities to create or update (1-100 entries)""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Entity(TypedDict, total=False): """A single entity to create or update.""" diff --git a/src/stigg/types/v1/events/beta/entity_type_list_params.py b/src/stigg/types/v1/events/beta/entity_type_list_params.py index f8a5fe19..74062038 100644 --- a/src/stigg/types/v1/events/beta/entity_type_list_params.py +++ b/src/stigg/types/v1/events/beta/entity_type_list_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from ....._utils import PropertyInfo __all__ = ["EntityTypeListParams"] @@ -16,3 +18,7 @@ class EntityTypeListParams(TypedDict, total=False): limit: int """Maximum number of items to return""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/events/beta/entity_type_upsert_params.py b/src/stigg/types/v1/events/beta/entity_type_upsert_params.py index e6e66ee7..33019ea3 100644 --- a/src/stigg/types/v1/events/beta/entity_type_upsert_params.py +++ b/src/stigg/types/v1/events/beta/entity_type_upsert_params.py @@ -15,6 +15,10 @@ class EntityTypeUpsertParams(TypedDict, total=False): types: Required[Iterable[Type]] """Entity types to upsert (1–100 per request)""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Type(TypedDict, total=False): """A single entity type definition.""" diff --git a/src/stigg/types/v1/feature_create_feature_params.py b/src/stigg/types/v1/feature_create_feature_params.py index 8cdaf295..bc6e4d5d 100644 --- a/src/stigg/types/v1/feature_create_feature_params.py +++ b/src/stigg/types/v1/feature_create_feature_params.py @@ -44,6 +44,10 @@ class FeatureCreateFeatureParams(TypedDict, total=False): unit_transformation: Annotated[Optional[UnitTransformation], PropertyInfo(alias="unitTransformation")] """Unit transformation to be applied to the reported usage""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class EnumConfiguration(TypedDict, total=False): display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] diff --git a/src/stigg/types/v1/feature_list_features_params.py b/src/stigg/types/v1/feature_list_features_params.py index a414297c..caafb37e 100644 --- a/src/stigg/types/v1/feature_list_features_params.py +++ b/src/stigg/types/v1/feature_list_features_params.py @@ -36,6 +36,10 @@ class FeatureListFeaturesParams(TypedDict, total=False): status: List[Literal["NEW", "SUSPENDED", "ACTIVE"]] """Filter by feature status. Supports comma-separated values for multiple statuses""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/feature_update_feature_params.py b/src/stigg/types/v1/feature_update_feature_params.py index 7322548a..c431fcca 100644 --- a/src/stigg/types/v1/feature_update_feature_params.py +++ b/src/stigg/types/v1/feature_update_feature_params.py @@ -43,6 +43,10 @@ class FeatureUpdateFeatureParams(TypedDict, total=False): unit_transformation: Annotated[Optional[UnitTransformation], PropertyInfo(alias="unitTransformation")] """Unit transformation to be applied to the reported usage""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class EnumConfiguration(TypedDict, total=False): display_name: Required[Annotated[str, PropertyInfo(alias="displayName")]] diff --git a/src/stigg/types/v1/plan_create_params.py b/src/stigg/types/v1/plan_create_params.py index b90a6645..4c64f55f 100644 --- a/src/stigg/types/v1/plan_create_params.py +++ b/src/stigg/types/v1/plan_create_params.py @@ -41,6 +41,10 @@ class PlanCreateParams(TypedDict, total=False): status: Literal["DRAFT", "PUBLISHED", "ARCHIVED"] """The status of the package""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class DefaultTrialConfigBudget(TypedDict, total=False): """Budget configuration for the trial""" diff --git a/src/stigg/types/v1/plan_list_charges_params.py b/src/stigg/types/v1/plan_list_charges_params.py index 83f70efc..f4efe4d6 100644 --- a/src/stigg/types/v1/plan_list_charges_params.py +++ b/src/stigg/types/v1/plan_list_charges_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["PlanListChargesParams"] @@ -16,3 +18,7 @@ class PlanListChargesParams(TypedDict, total=False): limit: int """Maximum number of items to return""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/plan_list_overage_charges_params.py b/src/stigg/types/v1/plan_list_overage_charges_params.py index 60708a18..ab8454e5 100644 --- a/src/stigg/types/v1/plan_list_overage_charges_params.py +++ b/src/stigg/types/v1/plan_list_overage_charges_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["PlanListOverageChargesParams"] @@ -16,3 +18,7 @@ class PlanListOverageChargesParams(TypedDict, total=False): limit: int """Maximum number of items to return""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/plan_list_params.py b/src/stigg/types/v1/plan_list_params.py index 6aaf45b3..3629df61 100644 --- a/src/stigg/types/v1/plan_list_params.py +++ b/src/stigg/types/v1/plan_list_params.py @@ -30,6 +30,10 @@ class PlanListParams(TypedDict, total=False): status: List[Literal["DRAFT", "PUBLISHED", "ARCHIVED"]] """Filter by status. Supports comma-separated values for multiple statuses""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/plan_publish_params.py b/src/stigg/types/v1/plan_publish_params.py index 7b46da36..8f6506ed 100644 --- a/src/stigg/types/v1/plan_publish_params.py +++ b/src/stigg/types/v1/plan_publish_params.py @@ -12,3 +12,7 @@ class PlanPublishParams(TypedDict, total=False): migration_type: Required[Annotated[Literal["NEW_CUSTOMERS", "ALL_CUSTOMERS"], PropertyInfo(alias="migrationType")]] """The migration type of the package""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/plan_update_params.py b/src/stigg/types/v1/plan_update_params.py index 6c80da9c..c63a03ea 100644 --- a/src/stigg/types/v1/plan_update_params.py +++ b/src/stigg/types/v1/plan_update_params.py @@ -63,6 +63,10 @@ class PlanUpdateParams(TypedDict, total=False): parent_plan_id: Annotated[Optional[str], PropertyInfo(alias="parentPlanId")] """The ID of the parent plan, if applicable""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class ChargesMinimumSpendMinimum(TypedDict, total=False): """The minimum spend amount""" diff --git a/src/stigg/types/v1/plans/entitlement_create_params.py b/src/stigg/types/v1/plans/entitlement_create_params.py index a0990370..5d7c436f 100644 --- a/src/stigg/types/v1/plans/entitlement_create_params.py +++ b/src/stigg/types/v1/plans/entitlement_create_params.py @@ -23,6 +23,10 @@ class EntitlementCreateParams(TypedDict, total=False): entitlements: Required[Iterable[Entitlement]] """Entitlements to create""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class EntitlementFeatureMonthlyResetPeriodConfiguration(TypedDict, total=False): """Configuration for monthly reset period""" diff --git a/src/stigg/types/v1/plans/entitlement_update_params.py b/src/stigg/types/v1/plans/entitlement_update_params.py index e2a5e27a..60d3426a 100644 --- a/src/stigg/types/v1/plans/entitlement_update_params.py +++ b/src/stigg/types/v1/plans/entitlement_update_params.py @@ -80,6 +80,10 @@ class UpdateFeatureEntitlementRequest(TypedDict, total=False): ] """Configuration for yearly reset period""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class UpdateFeatureEntitlementRequestMonthlyResetPeriodConfiguration(TypedDict, total=False): """Configuration for monthly reset period""" @@ -160,5 +164,9 @@ class UpdateCreditEntitlementRequest(TypedDict, total=False): order: float """Display order of the entitlement""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + EntitlementUpdateParams: TypeAlias = Union[UpdateFeatureEntitlementRequest, UpdateCreditEntitlementRequest] diff --git a/src/stigg/types/v1/product_create_product_params.py b/src/stigg/types/v1/product_create_product_params.py index 6bb3291a..ea7246a4 100644 --- a/src/stigg/types/v1/product_create_product_params.py +++ b/src/stigg/types/v1/product_create_product_params.py @@ -25,3 +25,7 @@ class ProductCreateProductParams(TypedDict, total=False): multiple_subscriptions: Annotated[bool, PropertyInfo(alias="multipleSubscriptions")] """Indicates if multiple subscriptions to this product are allowed""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/product_duplicate_product_params.py b/src/stigg/types/v1/product_duplicate_product_params.py index 73879129..007e7517 100644 --- a/src/stigg/types/v1/product_duplicate_product_params.py +++ b/src/stigg/types/v1/product_duplicate_product_params.py @@ -19,3 +19,7 @@ class ProductDuplicateProductParams(TypedDict, total=False): display_name: Annotated[str, PropertyInfo(alias="displayName")] """Display name of the product""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/product_list_products_params.py b/src/stigg/types/v1/product_list_products_params.py index 4ef32b31..33408641 100644 --- a/src/stigg/types/v1/product_list_products_params.py +++ b/src/stigg/types/v1/product_list_products_params.py @@ -30,6 +30,10 @@ class ProductListProductsParams(TypedDict, total=False): status: List[Literal["PUBLISHED", "ARCHIVED"]] """Filter by product status. Supports comma-separated values for multiple statuses""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/product_update_product_params.py b/src/stigg/types/v1/product_update_product_params.py index 4319e22e..fa7c2dc5 100644 --- a/src/stigg/types/v1/product_update_product_params.py +++ b/src/stigg/types/v1/product_update_product_params.py @@ -28,6 +28,10 @@ class ProductUpdateProductParams(TypedDict, total=False): usage_reset_cutoff_rule: Annotated[UsageResetCutoffRule, PropertyInfo(alias="usageResetCutoffRule")] """Rule defining when usage resets upon subscription update.""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class ProductSettings(TypedDict, total=False): subscription_cancellation_time: Required[ diff --git a/src/stigg/types/v1/subscription_cancel_params.py b/src/stigg/types/v1/subscription_cancel_params.py index 5503761a..62f5af4a 100644 --- a/src/stigg/types/v1/subscription_cancel_params.py +++ b/src/stigg/types/v1/subscription_cancel_params.py @@ -25,3 +25,7 @@ class SubscriptionCancelParams(TypedDict, total=False): prorate: bool """If set, enables or disables prorating of credits on subscription cancellation.""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/subscription_delegate_params.py b/src/stigg/types/v1/subscription_delegate_params.py index e8aca37c..79d088d2 100644 --- a/src/stigg/types/v1/subscription_delegate_params.py +++ b/src/stigg/types/v1/subscription_delegate_params.py @@ -16,3 +16,7 @@ class SubscriptionDelegateParams(TypedDict, total=False): this subscription. This customer must already exist in your Stigg account and have a valid payment method if the subscription requires payment. """ + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/subscription_import_params.py b/src/stigg/types/v1/subscription_import_params.py index bd423fe4..edcbf9d6 100644 --- a/src/stigg/types/v1/subscription_import_params.py +++ b/src/stigg/types/v1/subscription_import_params.py @@ -18,6 +18,10 @@ class SubscriptionImportParams(TypedDict, total=False): integration_id: Annotated[Optional[str], PropertyInfo(alias="integrationId")] """Integration ID to use for importing subscriptions""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class SubscriptionAddon(TypedDict, total=False): """Addon configuration""" diff --git a/src/stigg/types/v1/subscription_list_params.py b/src/stigg/types/v1/subscription_list_params.py index ba9f97ec..4935a93c 100644 --- a/src/stigg/types/v1/subscription_list_params.py +++ b/src/stigg/types/v1/subscription_list_params.py @@ -42,6 +42,10 @@ class SubscriptionListParams(TypedDict, total=False): Supports comma-separated values for multiple statuses """ + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class CreatedAt(TypedDict, total=False): """Filter by creation date using range operators: gt, gte, lt, lte""" diff --git a/src/stigg/types/v1/subscription_migrate_params.py b/src/stigg/types/v1/subscription_migrate_params.py index 9119d352..4b80d320 100644 --- a/src/stigg/types/v1/subscription_migrate_params.py +++ b/src/stigg/types/v1/subscription_migrate_params.py @@ -14,3 +14,7 @@ class SubscriptionMigrateParams(TypedDict, total=False): Literal["END_OF_BILLING_PERIOD", "IMMEDIATE"], PropertyInfo(alias="subscriptionMigrationTime") ] """When to migrate (immediate or period end)""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/subscription_preview_params.py b/src/stigg/types/v1/subscription_preview_params.py index 5ffaa436..f9152f22 100644 --- a/src/stigg/types/v1/subscription_preview_params.py +++ b/src/stigg/types/v1/subscription_preview_params.py @@ -78,6 +78,10 @@ class SubscriptionPreviewParams(TypedDict, total=False): unit_quantity: Annotated[int, PropertyInfo(alias="unitQuantity")] """Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Addon(TypedDict, total=False): """Addon configuration""" diff --git a/src/stigg/types/v1/subscription_provision_params.py b/src/stigg/types/v1/subscription_provision_params.py index 182eaaa6..517c09e1 100644 --- a/src/stigg/types/v1/subscription_provision_params.py +++ b/src/stigg/types/v1/subscription_provision_params.py @@ -120,6 +120,10 @@ class SubscriptionProvisionParams(TypedDict, total=False): unit_quantity: Annotated[int, PropertyInfo(alias="unitQuantity")] """Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Addon(TypedDict, total=False): """Addon configuration""" diff --git a/src/stigg/types/v1/subscription_transfer_params.py b/src/stigg/types/v1/subscription_transfer_params.py index ed6fd275..66c9f991 100644 --- a/src/stigg/types/v1/subscription_transfer_params.py +++ b/src/stigg/types/v1/subscription_transfer_params.py @@ -12,3 +12,7 @@ class SubscriptionTransferParams(TypedDict, total=False): destination_resource_id: Required[Annotated[str, PropertyInfo(alias="destinationResourceId")]] """Resource ID to transfer the subscription to""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/subscription_update_params.py b/src/stigg/types/v1/subscription_update_params.py index 14a099f2..488bd6af 100644 --- a/src/stigg/types/v1/subscription_update_params.py +++ b/src/stigg/types/v1/subscription_update_params.py @@ -73,6 +73,10 @@ class SubscriptionUpdateParams(TypedDict, total=False): trial_end_date: Annotated[Union[str, datetime], PropertyInfo(alias="trialEndDate", format="iso8601")] """Subscription trial end date""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Addon(TypedDict, total=False): """Addon configuration""" diff --git a/src/stigg/types/v1/subscriptions/usage_charge_usage_params.py b/src/stigg/types/v1/subscriptions/usage_charge_usage_params.py index d5243476..11283503 100644 --- a/src/stigg/types/v1/subscriptions/usage_charge_usage_params.py +++ b/src/stigg/types/v1/subscriptions/usage_charge_usage_params.py @@ -14,3 +14,7 @@ class UsageChargeUsageParams(TypedDict, total=False): until_date: Annotated[Union[str, datetime], PropertyInfo(alias="untilDate", format="iso8601")] """Cutoff date for usage calculation. If not provided, the current time is used.""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/usage_history_params.py b/src/stigg/types/v1/usage_history_params.py index d3f890ec..3eba130e 100644 --- a/src/stigg/types/v1/usage_history_params.py +++ b/src/stigg/types/v1/usage_history_params.py @@ -25,3 +25,7 @@ class UsageHistoryParams(TypedDict, total=False): resource_id: Annotated[Optional[str], PropertyInfo(alias="resourceId")] """Resource id""" + + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] diff --git a/src/stigg/types/v1/usage_report_params.py b/src/stigg/types/v1/usage_report_params.py index fecbc68d..8c9cc446 100644 --- a/src/stigg/types/v1/usage_report_params.py +++ b/src/stigg/types/v1/usage_report_params.py @@ -15,6 +15,10 @@ class UsageReportParams(TypedDict, total=False): usages: Required[Iterable[Usage]] """A list of usage reports to be submitted in bulk""" + x_account_id: Annotated[str, PropertyInfo(alias="X-ACCOUNT-ID")] + + x_environment_id: Annotated[str, PropertyInfo(alias="X-ENVIRONMENT-ID")] + class Usage(TypedDict, total=False): """Single usage measurement""" diff --git a/tests/api_resources/v1/addons/test_entitlements.py b/tests/api_resources/v1/addons/test_entitlements.py index 5ae82e36..54dddf81 100644 --- a/tests/api_resources/v1/addons/test_entitlements.py +++ b/tests/api_resources/v1/addons/test_entitlements.py @@ -35,6 +35,37 @@ def test_method_create(self, client: Stigg) -> None: ) assert_matches_type(EntitlementCreateResponse, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Stigg) -> None: + entitlement = client.v1.addons.entitlements.create( + addon_id="addonId", + entitlements=[ + { + "id": "id", + "type": "FEATURE", + "behavior": "Increment", + "description": "description", + "display_name_override": "displayNameOverride", + "enum_values": ["string"], + "has_soft_limit": True, + "has_unlimited_usage": True, + "hidden_from_widgets": ["PAYWALL"], + "is_custom": True, + "is_granted": True, + "monthly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "order": 0, + "reset_period": "YEAR", + "usage_limit": 0, + "weekly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "yearly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntitlementCreateResponse, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Stigg) -> None: @@ -119,6 +150,8 @@ def test_method_update_with_all_params_overload_1(self, client: Stigg) -> None: usage_limit=0, weekly_reset_period_configuration={"according_to": "SubscriptionStart"}, yearly_reset_period_configuration={"according_to": "SubscriptionStart"}, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AddonPackageEntitlement, entitlement, path=["response"]) @@ -196,6 +229,8 @@ def test_method_update_with_all_params_overload_2(self, client: Stigg) -> None: is_custom=True, is_granted=True, order=0, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AddonPackageEntitlement, entitlement, path=["response"]) @@ -250,7 +285,17 @@ def test_path_params_update_overload_2(self, client: Stigg) -> None: @parametrize def test_method_list(self, client: Stigg) -> None: entitlement = client.v1.addons.entitlements.list( - "addonId", + addon_id="addonId", + ) + assert_matches_type(EntitlementListResponse, entitlement, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Stigg) -> None: + entitlement = client.v1.addons.entitlements.list( + addon_id="addonId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(EntitlementListResponse, entitlement, path=["response"]) @@ -258,7 +303,7 @@ def test_method_list(self, client: Stigg) -> None: @parametrize def test_raw_response_list(self, client: Stigg) -> None: response = client.v1.addons.entitlements.with_raw_response.list( - "addonId", + addon_id="addonId", ) assert response.is_closed is True @@ -270,7 +315,7 @@ def test_raw_response_list(self, client: Stigg) -> None: @parametrize def test_streaming_response_list(self, client: Stigg) -> None: with client.v1.addons.entitlements.with_streaming_response.list( - "addonId", + addon_id="addonId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -285,7 +330,7 @@ def test_streaming_response_list(self, client: Stigg) -> None: def test_path_params_list(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `addon_id` but received ''"): client.v1.addons.entitlements.with_raw_response.list( - "", + addon_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -297,6 +342,17 @@ def test_method_delete(self, client: Stigg) -> None: ) assert_matches_type(AddonPackageEntitlement, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Stigg) -> None: + entitlement = client.v1.addons.entitlements.delete( + id="id", + addon_id="addonId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(AddonPackageEntitlement, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Stigg) -> None: @@ -360,6 +416,37 @@ async def test_method_create(self, async_client: AsyncStigg) -> None: ) assert_matches_type(EntitlementCreateResponse, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncStigg) -> None: + entitlement = await async_client.v1.addons.entitlements.create( + addon_id="addonId", + entitlements=[ + { + "id": "id", + "type": "FEATURE", + "behavior": "Increment", + "description": "description", + "display_name_override": "displayNameOverride", + "enum_values": ["string"], + "has_soft_limit": True, + "has_unlimited_usage": True, + "hidden_from_widgets": ["PAYWALL"], + "is_custom": True, + "is_granted": True, + "monthly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "order": 0, + "reset_period": "YEAR", + "usage_limit": 0, + "weekly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "yearly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntitlementCreateResponse, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStigg) -> None: @@ -444,6 +531,8 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn usage_limit=0, weekly_reset_period_configuration={"according_to": "SubscriptionStart"}, yearly_reset_period_configuration={"according_to": "SubscriptionStart"}, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AddonPackageEntitlement, entitlement, path=["response"]) @@ -521,6 +610,8 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn is_custom=True, is_granted=True, order=0, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AddonPackageEntitlement, entitlement, path=["response"]) @@ -575,7 +666,17 @@ async def test_path_params_update_overload_2(self, async_client: AsyncStigg) -> @parametrize async def test_method_list(self, async_client: AsyncStigg) -> None: entitlement = await async_client.v1.addons.entitlements.list( - "addonId", + addon_id="addonId", + ) + assert_matches_type(EntitlementListResponse, entitlement, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> None: + entitlement = await async_client.v1.addons.entitlements.list( + addon_id="addonId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(EntitlementListResponse, entitlement, path=["response"]) @@ -583,7 +684,7 @@ async def test_method_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncStigg) -> None: response = await async_client.v1.addons.entitlements.with_raw_response.list( - "addonId", + addon_id="addonId", ) assert response.is_closed is True @@ -595,7 +696,7 @@ async def test_raw_response_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: async with async_client.v1.addons.entitlements.with_streaming_response.list( - "addonId", + addon_id="addonId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -610,7 +711,7 @@ async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: async def test_path_params_list(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `addon_id` but received ''"): await async_client.v1.addons.entitlements.with_raw_response.list( - "", + addon_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -622,6 +723,17 @@ async def test_method_delete(self, async_client: AsyncStigg) -> None: ) assert_matches_type(AddonPackageEntitlement, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncStigg) -> None: + entitlement = await async_client.v1.addons.entitlements.delete( + id="id", + addon_id="addonId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(AddonPackageEntitlement, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/credits/test_custom_currencies.py b/tests/api_resources/v1/credits/test_custom_currencies.py index f442a6c0..bc9d2bd8 100644 --- a/tests/api_resources/v1/credits/test_custom_currencies.py +++ b/tests/api_resources/v1/credits/test_custom_currencies.py @@ -44,6 +44,8 @@ def test_method_create_with_all_params(self, client: Stigg) -> None: "plural": "plural", "singular": "singular", }, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) @@ -96,6 +98,8 @@ def test_method_update_with_all_params(self, client: Stigg) -> None: "plural": "plural", "singular": "singular", }, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) @@ -147,6 +151,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, status=["ACTIVE"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[CustomCurrencyListResponse], custom_currency, path=["response"]) @@ -176,7 +182,17 @@ def test_streaming_response_list(self, client: Stigg) -> None: @parametrize def test_method_archive(self, client: Stigg) -> None: custom_currency = client.v1.credits.custom_currencies.archive( - "currencyId", + currency_id="currencyId", + ) + assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_archive_with_all_params(self, client: Stigg) -> None: + custom_currency = client.v1.credits.custom_currencies.archive( + currency_id="currencyId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) @@ -184,7 +200,7 @@ def test_method_archive(self, client: Stigg) -> None: @parametrize def test_raw_response_archive(self, client: Stigg) -> None: response = client.v1.credits.custom_currencies.with_raw_response.archive( - "currencyId", + currency_id="currencyId", ) assert response.is_closed is True @@ -196,7 +212,7 @@ def test_raw_response_archive(self, client: Stigg) -> None: @parametrize def test_streaming_response_archive(self, client: Stigg) -> None: with client.v1.credits.custom_currencies.with_streaming_response.archive( - "currencyId", + currency_id="currencyId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -211,14 +227,24 @@ def test_streaming_response_archive(self, client: Stigg) -> None: def test_path_params_archive(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `currency_id` but received ''"): client.v1.credits.custom_currencies.with_raw_response.archive( - "", + currency_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_associated_entities(self, client: Stigg) -> None: custom_currency = client.v1.credits.custom_currencies.list_associated_entities( - "currencyId", + currency_id="currencyId", + ) + assert_matches_type(CustomCurrencyListAssociatedEntitiesResponse, custom_currency, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_associated_entities_with_all_params(self, client: Stigg) -> None: + custom_currency = client.v1.credits.custom_currencies.list_associated_entities( + currency_id="currencyId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyListAssociatedEntitiesResponse, custom_currency, path=["response"]) @@ -226,7 +252,7 @@ def test_method_list_associated_entities(self, client: Stigg) -> None: @parametrize def test_raw_response_list_associated_entities(self, client: Stigg) -> None: response = client.v1.credits.custom_currencies.with_raw_response.list_associated_entities( - "currencyId", + currency_id="currencyId", ) assert response.is_closed is True @@ -238,7 +264,7 @@ def test_raw_response_list_associated_entities(self, client: Stigg) -> None: @parametrize def test_streaming_response_list_associated_entities(self, client: Stigg) -> None: with client.v1.credits.custom_currencies.with_streaming_response.list_associated_entities( - "currencyId", + currency_id="currencyId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -253,14 +279,24 @@ def test_streaming_response_list_associated_entities(self, client: Stigg) -> Non def test_path_params_list_associated_entities(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `currency_id` but received ''"): client.v1.credits.custom_currencies.with_raw_response.list_associated_entities( - "", + currency_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_unarchive(self, client: Stigg) -> None: custom_currency = client.v1.credits.custom_currencies.unarchive( - "currencyId", + currency_id="currencyId", + ) + assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_unarchive_with_all_params(self, client: Stigg) -> None: + custom_currency = client.v1.credits.custom_currencies.unarchive( + currency_id="currencyId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) @@ -268,7 +304,7 @@ def test_method_unarchive(self, client: Stigg) -> None: @parametrize def test_raw_response_unarchive(self, client: Stigg) -> None: response = client.v1.credits.custom_currencies.with_raw_response.unarchive( - "currencyId", + currency_id="currencyId", ) assert response.is_closed is True @@ -280,7 +316,7 @@ def test_raw_response_unarchive(self, client: Stigg) -> None: @parametrize def test_streaming_response_unarchive(self, client: Stigg) -> None: with client.v1.credits.custom_currencies.with_streaming_response.unarchive( - "currencyId", + currency_id="currencyId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -295,7 +331,7 @@ def test_streaming_response_unarchive(self, client: Stigg) -> None: def test_path_params_unarchive(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `currency_id` but received ''"): client.v1.credits.custom_currencies.with_raw_response.unarchive( - "", + currency_id="", ) @@ -326,6 +362,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncStigg) -> "plural": "plural", "singular": "singular", }, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) @@ -378,6 +416,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncStigg) -> "plural": "plural", "singular": "singular", }, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) @@ -429,6 +469,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, status=["ACTIVE"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[CustomCurrencyListResponse], custom_currency, path=["response"]) @@ -458,7 +500,17 @@ async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_archive(self, async_client: AsyncStigg) -> None: custom_currency = await async_client.v1.credits.custom_currencies.archive( - "currencyId", + currency_id="currencyId", + ) + assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_archive_with_all_params(self, async_client: AsyncStigg) -> None: + custom_currency = await async_client.v1.credits.custom_currencies.archive( + currency_id="currencyId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) @@ -466,7 +518,7 @@ async def test_method_archive(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: response = await async_client.v1.credits.custom_currencies.with_raw_response.archive( - "currencyId", + currency_id="currencyId", ) assert response.is_closed is True @@ -478,7 +530,7 @@ async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_archive(self, async_client: AsyncStigg) -> None: async with async_client.v1.credits.custom_currencies.with_streaming_response.archive( - "currencyId", + currency_id="currencyId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -493,14 +545,24 @@ async def test_streaming_response_archive(self, async_client: AsyncStigg) -> Non async def test_path_params_archive(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `currency_id` but received ''"): await async_client.v1.credits.custom_currencies.with_raw_response.archive( - "", + currency_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_associated_entities(self, async_client: AsyncStigg) -> None: custom_currency = await async_client.v1.credits.custom_currencies.list_associated_entities( - "currencyId", + currency_id="currencyId", + ) + assert_matches_type(CustomCurrencyListAssociatedEntitiesResponse, custom_currency, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_associated_entities_with_all_params(self, async_client: AsyncStigg) -> None: + custom_currency = await async_client.v1.credits.custom_currencies.list_associated_entities( + currency_id="currencyId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyListAssociatedEntitiesResponse, custom_currency, path=["response"]) @@ -508,7 +570,7 @@ async def test_method_list_associated_entities(self, async_client: AsyncStigg) - @parametrize async def test_raw_response_list_associated_entities(self, async_client: AsyncStigg) -> None: response = await async_client.v1.credits.custom_currencies.with_raw_response.list_associated_entities( - "currencyId", + currency_id="currencyId", ) assert response.is_closed is True @@ -520,7 +582,7 @@ async def test_raw_response_list_associated_entities(self, async_client: AsyncSt @parametrize async def test_streaming_response_list_associated_entities(self, async_client: AsyncStigg) -> None: async with async_client.v1.credits.custom_currencies.with_streaming_response.list_associated_entities( - "currencyId", + currency_id="currencyId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -535,14 +597,24 @@ async def test_streaming_response_list_associated_entities(self, async_client: A async def test_path_params_list_associated_entities(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `currency_id` but received ''"): await async_client.v1.credits.custom_currencies.with_raw_response.list_associated_entities( - "", + currency_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_unarchive(self, async_client: AsyncStigg) -> None: custom_currency = await async_client.v1.credits.custom_currencies.unarchive( - "currencyId", + currency_id="currencyId", + ) + assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_unarchive_with_all_params(self, async_client: AsyncStigg) -> None: + custom_currency = await async_client.v1.credits.custom_currencies.unarchive( + currency_id="currencyId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomCurrencyResponse, custom_currency, path=["response"]) @@ -550,7 +622,7 @@ async def test_method_unarchive(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_unarchive(self, async_client: AsyncStigg) -> None: response = await async_client.v1.credits.custom_currencies.with_raw_response.unarchive( - "currencyId", + currency_id="currencyId", ) assert response.is_closed is True @@ -562,7 +634,7 @@ async def test_raw_response_unarchive(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_unarchive(self, async_client: AsyncStigg) -> None: async with async_client.v1.credits.custom_currencies.with_streaming_response.unarchive( - "currencyId", + currency_id="currencyId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -577,5 +649,5 @@ async def test_streaming_response_unarchive(self, async_client: AsyncStigg) -> N async def test_path_params_unarchive(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `currency_id` but received ''"): await async_client.v1.credits.custom_currencies.with_raw_response.unarchive( - "", + currency_id="", ) diff --git a/tests/api_resources/v1/credits/test_grants.py b/tests/api_resources/v1/credits/test_grants.py index 9926fffd..02b6ad90 100644 --- a/tests/api_resources/v1/credits/test_grants.py +++ b/tests/api_resources/v1/credits/test_grants.py @@ -64,6 +64,8 @@ def test_method_create_with_all_params(self, client: Stigg) -> None: payment_collection_method="CHARGE", priority=0, resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CreditGrantResponse, grant, path=["response"]) @@ -125,6 +127,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: currency_id="currencyId", limit=1, resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[GrantListResponse], grant, path=["response"]) @@ -158,7 +162,17 @@ def test_streaming_response_list(self, client: Stigg) -> None: @parametrize def test_method_void(self, client: Stigg) -> None: grant = client.v1.credits.grants.void( - "x", + id="x", + ) + assert_matches_type(CreditGrantResponse, grant, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_void_with_all_params(self, client: Stigg) -> None: + grant = client.v1.credits.grants.void( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CreditGrantResponse, grant, path=["response"]) @@ -166,7 +180,7 @@ def test_method_void(self, client: Stigg) -> None: @parametrize def test_raw_response_void(self, client: Stigg) -> None: response = client.v1.credits.grants.with_raw_response.void( - "x", + id="x", ) assert response.is_closed is True @@ -178,7 +192,7 @@ def test_raw_response_void(self, client: Stigg) -> None: @parametrize def test_streaming_response_void(self, client: Stigg) -> None: with client.v1.credits.grants.with_streaming_response.void( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -193,7 +207,7 @@ def test_streaming_response_void(self, client: Stigg) -> None: def test_path_params_void(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.credits.grants.with_raw_response.void( - "", + id="", ) @@ -247,6 +261,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncStigg) -> payment_collection_method="CHARGE", priority=0, resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CreditGrantResponse, grant, path=["response"]) @@ -308,6 +324,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No currency_id="currencyId", limit=1, resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[GrantListResponse], grant, path=["response"]) @@ -341,7 +359,17 @@ async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_void(self, async_client: AsyncStigg) -> None: grant = await async_client.v1.credits.grants.void( - "x", + id="x", + ) + assert_matches_type(CreditGrantResponse, grant, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_void_with_all_params(self, async_client: AsyncStigg) -> None: + grant = await async_client.v1.credits.grants.void( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CreditGrantResponse, grant, path=["response"]) @@ -349,7 +377,7 @@ async def test_method_void(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_void(self, async_client: AsyncStigg) -> None: response = await async_client.v1.credits.grants.with_raw_response.void( - "x", + id="x", ) assert response.is_closed is True @@ -361,7 +389,7 @@ async def test_raw_response_void(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_void(self, async_client: AsyncStigg) -> None: async with async_client.v1.credits.grants.with_streaming_response.void( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -376,5 +404,5 @@ async def test_streaming_response_void(self, async_client: AsyncStigg) -> None: async def test_path_params_void(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.credits.grants.with_raw_response.void( - "", + id="", ) diff --git a/tests/api_resources/v1/customers/test_integrations.py b/tests/api_resources/v1/customers/test_integrations.py index 2fb3d57c..2c2a294f 100644 --- a/tests/api_resources/v1/customers/test_integrations.py +++ b/tests/api_resources/v1/customers/test_integrations.py @@ -30,6 +30,17 @@ def test_method_retrieve(self, client: Stigg) -> None: ) assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Stigg) -> None: + integration = client.v1.customers.integrations.retrieve( + integration_id="integrationId", + id="id", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Stigg) -> None: @@ -83,6 +94,18 @@ def test_method_update(self, client: Stigg) -> None: ) assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Stigg) -> None: + integration = client.v1.customers.integrations.update( + integration_id="integrationId", + id="id", + synced_entity_id="syncedEntityId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Stigg) -> None: @@ -147,6 +170,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, vendor_identifier=["AUTH0"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[IntegrationListResponse], integration, path=["response"]) @@ -195,6 +220,19 @@ def test_method_link(self, client: Stigg) -> None: ) assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_link_with_all_params(self, client: Stigg) -> None: + integration = client.v1.customers.integrations.link( + path_id="x", + body_id="id", + synced_entity_id="syncedEntityId", + vendor_identifier="AUTH0", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_link(self, client: Stigg) -> None: @@ -247,6 +285,17 @@ def test_method_unlink(self, client: Stigg) -> None: ) assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_unlink_with_all_params(self, client: Stigg) -> None: + integration = client.v1.customers.integrations.unlink( + integration_id="integrationId", + id="id", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_unlink(self, client: Stigg) -> None: @@ -305,6 +354,17 @@ async def test_method_retrieve(self, async_client: AsyncStigg) -> None: ) assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncStigg) -> None: + integration = await async_client.v1.customers.integrations.retrieve( + integration_id="integrationId", + id="id", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: @@ -358,6 +418,18 @@ async def test_method_update(self, async_client: AsyncStigg) -> None: ) assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncStigg) -> None: + integration = await async_client.v1.customers.integrations.update( + integration_id="integrationId", + id="id", + synced_entity_id="syncedEntityId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncStigg) -> None: @@ -422,6 +494,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, vendor_identifier=["AUTH0"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[IntegrationListResponse], integration, path=["response"]) @@ -470,6 +544,19 @@ async def test_method_link(self, async_client: AsyncStigg) -> None: ) assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_link_with_all_params(self, async_client: AsyncStigg) -> None: + integration = await async_client.v1.customers.integrations.link( + path_id="x", + body_id="id", + synced_entity_id="syncedEntityId", + vendor_identifier="AUTH0", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_link(self, async_client: AsyncStigg) -> None: @@ -522,6 +609,17 @@ async def test_method_unlink(self, async_client: AsyncStigg) -> None: ) assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_unlink_with_all_params(self, async_client: AsyncStigg) -> None: + integration = await async_client.v1.customers.integrations.unlink( + integration_id="integrationId", + id="id", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CustomerIntegrationResponse, integration, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_unlink(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/customers/test_payment_method.py b/tests/api_resources/v1/customers/test_payment_method.py index b93b9cb7..d697f68e 100644 --- a/tests/api_resources/v1/customers/test_payment_method.py +++ b/tests/api_resources/v1/customers/test_payment_method.py @@ -37,6 +37,8 @@ def test_method_attach_with_all_params(self, client: Stigg) -> None: payment_method_id="paymentMethodId", vendor_identifier="AUTH0", billing_currency="usd", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, payment_method, path=["response"]) @@ -87,7 +89,17 @@ def test_path_params_attach(self, client: Stigg) -> None: @parametrize def test_method_detach(self, client: Stigg) -> None: payment_method = client.v1.customers.payment_method.detach( - "x", + id="x", + ) + assert_matches_type(CustomerResponse, payment_method, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_detach_with_all_params(self, client: Stigg) -> None: + payment_method = client.v1.customers.payment_method.detach( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, payment_method, path=["response"]) @@ -95,7 +107,7 @@ def test_method_detach(self, client: Stigg) -> None: @parametrize def test_raw_response_detach(self, client: Stigg) -> None: response = client.v1.customers.payment_method.with_raw_response.detach( - "x", + id="x", ) assert response.is_closed is True @@ -107,7 +119,7 @@ def test_raw_response_detach(self, client: Stigg) -> None: @parametrize def test_streaming_response_detach(self, client: Stigg) -> None: with client.v1.customers.payment_method.with_streaming_response.detach( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,7 +134,7 @@ def test_streaming_response_detach(self, client: Stigg) -> None: def test_path_params_detach(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.customers.payment_method.with_raw_response.detach( - "", + id="", ) @@ -151,6 +163,8 @@ async def test_method_attach_with_all_params(self, async_client: AsyncStigg) -> payment_method_id="paymentMethodId", vendor_identifier="AUTH0", billing_currency="usd", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, payment_method, path=["response"]) @@ -201,7 +215,17 @@ async def test_path_params_attach(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_detach(self, async_client: AsyncStigg) -> None: payment_method = await async_client.v1.customers.payment_method.detach( - "x", + id="x", + ) + assert_matches_type(CustomerResponse, payment_method, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_detach_with_all_params(self, async_client: AsyncStigg) -> None: + payment_method = await async_client.v1.customers.payment_method.detach( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, payment_method, path=["response"]) @@ -209,7 +233,7 @@ async def test_method_detach(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_detach(self, async_client: AsyncStigg) -> None: response = await async_client.v1.customers.payment_method.with_raw_response.detach( - "x", + id="x", ) assert response.is_closed is True @@ -221,7 +245,7 @@ async def test_raw_response_detach(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_detach(self, async_client: AsyncStigg) -> None: async with async_client.v1.customers.payment_method.with_streaming_response.detach( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -236,5 +260,5 @@ async def test_streaming_response_detach(self, async_client: AsyncStigg) -> None async def test_path_params_detach(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.customers.payment_method.with_raw_response.detach( - "", + id="", ) diff --git a/tests/api_resources/v1/customers/test_promotional_entitlements.py b/tests/api_resources/v1/customers/test_promotional_entitlements.py index 73656226..1554df97 100644 --- a/tests/api_resources/v1/customers/test_promotional_entitlements.py +++ b/tests/api_resources/v1/customers/test_promotional_entitlements.py @@ -47,6 +47,32 @@ def test_method_create(self, client: Stigg) -> None: ) assert_matches_type(PromotionalEntitlementCreateResponse, promotional_entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Stigg) -> None: + promotional_entitlement = client.v1.customers.promotional_entitlements.create( + id="x", + promotional_entitlements=[ + { + "custom_end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "enum_values": ["string"], + "feature_id": "featureId", + "has_soft_limit": True, + "has_unlimited_usage": True, + "is_visible": True, + "monthly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "period": "1 week", + "reset_period": "YEAR", + "usage_limit": -9007199254740991, + "weekly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "yearly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(PromotionalEntitlementCreateResponse, promotional_entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Stigg) -> None: @@ -154,6 +180,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: }, limit=1, status=["Active"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type( SyncMyCursorIDPage[PromotionalEntitlementListResponse], promotional_entitlement, path=["response"] @@ -206,6 +234,17 @@ def test_method_revoke(self, client: Stigg) -> None: ) assert_matches_type(PromotionalEntitlementRevokeResponse, promotional_entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_revoke_with_all_params(self, client: Stigg) -> None: + promotional_entitlement = client.v1.customers.promotional_entitlements.revoke( + feature_id="featureId", + id="id", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(PromotionalEntitlementRevokeResponse, promotional_entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_revoke(self, client: Stigg) -> None: @@ -279,6 +318,32 @@ async def test_method_create(self, async_client: AsyncStigg) -> None: ) assert_matches_type(PromotionalEntitlementCreateResponse, promotional_entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncStigg) -> None: + promotional_entitlement = await async_client.v1.customers.promotional_entitlements.create( + id="x", + promotional_entitlements=[ + { + "custom_end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "enum_values": ["string"], + "feature_id": "featureId", + "has_soft_limit": True, + "has_unlimited_usage": True, + "is_visible": True, + "monthly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "period": "1 week", + "reset_period": "YEAR", + "usage_limit": -9007199254740991, + "weekly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "yearly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(PromotionalEntitlementCreateResponse, promotional_entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStigg) -> None: @@ -386,6 +451,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No }, limit=1, status=["Active"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type( AsyncMyCursorIDPage[PromotionalEntitlementListResponse], promotional_entitlement, path=["response"] @@ -438,6 +505,17 @@ async def test_method_revoke(self, async_client: AsyncStigg) -> None: ) assert_matches_type(PromotionalEntitlementRevokeResponse, promotional_entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_revoke_with_all_params(self, async_client: AsyncStigg) -> None: + promotional_entitlement = await async_client.v1.customers.promotional_entitlements.revoke( + feature_id="featureId", + id="id", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(PromotionalEntitlementRevokeResponse, promotional_entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_revoke(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/events/beta/customers/test_assignments.py b/tests/api_resources/v1/events/beta/customers/test_assignments.py index 4a78fde5..15b2696c 100644 --- a/tests/api_resources/v1/events/beta/customers/test_assignments.py +++ b/tests/api_resources/v1/events/beta/customers/test_assignments.py @@ -39,6 +39,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: capability_id="capabilityId", entity_id="entityId", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[AssignmentListResponse], assignment, path=["response"]) @@ -94,6 +96,30 @@ def test_method_upsert(self, client: Stigg) -> None: ) assert_matches_type(AssignmentUpsertResponse, assignment, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_upsert_with_all_params(self, client: Stigg) -> None: + assignment = client.v1.events.beta.customers.assignments.upsert( + id="id", + assignments=[ + { + "capability_id": "compute-minutes", + "entity_id": "workspace-001", + "cadence": "MONTH", + "usage_limit": 1000, + }, + { + "capability_id": "compute-minutes", + "entity_id": "workspace-002", + "cadence": "MONTH", + "usage_limit": 2000, + }, + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(AssignmentUpsertResponse, assignment, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_upsert(self, client: Stigg) -> None: @@ -182,6 +208,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No capability_id="capabilityId", entity_id="entityId", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[AssignmentListResponse], assignment, path=["response"]) @@ -237,6 +265,30 @@ async def test_method_upsert(self, async_client: AsyncStigg) -> None: ) assert_matches_type(AssignmentUpsertResponse, assignment, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_upsert_with_all_params(self, async_client: AsyncStigg) -> None: + assignment = await async_client.v1.events.beta.customers.assignments.upsert( + id="id", + assignments=[ + { + "capability_id": "compute-minutes", + "entity_id": "workspace-001", + "cadence": "MONTH", + "usage_limit": 1000, + }, + { + "capability_id": "compute-minutes", + "entity_id": "workspace-002", + "cadence": "MONTH", + "usage_limit": 2000, + }, + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(AssignmentUpsertResponse, assignment, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_upsert(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/events/beta/customers/test_entities.py b/tests/api_resources/v1/events/beta/customers/test_entities.py index f7868333..c576d09e 100644 --- a/tests/api_resources/v1/events/beta/customers/test_entities.py +++ b/tests/api_resources/v1/events/beta/customers/test_entities.py @@ -33,6 +33,17 @@ def test_method_retrieve(self, client: Stigg) -> None: ) assert_matches_type(EntityRetrieveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Stigg) -> None: + entity = client.v1.events.beta.customers.entities.retrieve( + entity_id="x", + id="id", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityRetrieveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Stigg) -> None: @@ -94,6 +105,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: include_archived="true", limit=1, type_ref_id="typeRefId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[EntityListResponse], entity, path=["response"]) @@ -140,6 +153,17 @@ def test_method_archive(self, client: Stigg) -> None: ) assert_matches_type(EntityArchiveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_archive_with_all_params(self, client: Stigg) -> None: + entity = client.v1.events.beta.customers.entities.archive( + id="id", + ids=["user-7f3a0c1d", "user-c4d1b2e9"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityArchiveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_archive(self, client: Stigg) -> None: @@ -186,6 +210,17 @@ def test_method_unarchive(self, client: Stigg) -> None: ) assert_matches_type(EntityUnarchiveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_unarchive_with_all_params(self, client: Stigg) -> None: + entity = client.v1.events.beta.customers.entities.unarchive( + id="id", + ids=["user-7f3a0c1d", "user-c4d1b2e9"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityUnarchiveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_unarchive(self, client: Stigg) -> None: @@ -232,6 +267,31 @@ def test_method_upsert(self, client: Stigg) -> None: ) assert_matches_type(EntityUpsertResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_upsert_with_all_params(self, client: Stigg) -> None: + entity = client.v1.events.beta.customers.entities.upsert( + id="id", + entities=[ + { + "id": "user-7f3a0c1d", + "metadata": { + "email": "jane@acme.com", + "role": "admin", + }, + "type_ref_id": "user", + }, + { + "id": "user-c4d1b2e9", + "metadata": {"email": "john@acme.com"}, + "type_ref_id": "user", + }, + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityUpsertResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_upsert(self, client: Stigg) -> None: @@ -284,6 +344,17 @@ async def test_method_retrieve(self, async_client: AsyncStigg) -> None: ) assert_matches_type(EntityRetrieveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncStigg) -> None: + entity = await async_client.v1.events.beta.customers.entities.retrieve( + entity_id="x", + id="id", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityRetrieveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: @@ -345,6 +416,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No include_archived="true", limit=1, type_ref_id="typeRefId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[EntityListResponse], entity, path=["response"]) @@ -391,6 +464,17 @@ async def test_method_archive(self, async_client: AsyncStigg) -> None: ) assert_matches_type(EntityArchiveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_archive_with_all_params(self, async_client: AsyncStigg) -> None: + entity = await async_client.v1.events.beta.customers.entities.archive( + id="id", + ids=["user-7f3a0c1d", "user-c4d1b2e9"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityArchiveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: @@ -437,6 +521,17 @@ async def test_method_unarchive(self, async_client: AsyncStigg) -> None: ) assert_matches_type(EntityUnarchiveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_unarchive_with_all_params(self, async_client: AsyncStigg) -> None: + entity = await async_client.v1.events.beta.customers.entities.unarchive( + id="id", + ids=["user-7f3a0c1d", "user-c4d1b2e9"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityUnarchiveResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_unarchive(self, async_client: AsyncStigg) -> None: @@ -483,6 +578,31 @@ async def test_method_upsert(self, async_client: AsyncStigg) -> None: ) assert_matches_type(EntityUpsertResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_upsert_with_all_params(self, async_client: AsyncStigg) -> None: + entity = await async_client.v1.events.beta.customers.entities.upsert( + id="id", + entities=[ + { + "id": "user-7f3a0c1d", + "metadata": { + "email": "jane@acme.com", + "role": "admin", + }, + "type_ref_id": "user", + }, + { + "id": "user-c4d1b2e9", + "metadata": {"email": "john@acme.com"}, + "type_ref_id": "user", + }, + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityUpsertResponse, entity, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_upsert(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/events/beta/customers/test_entitlements.py b/tests/api_resources/v1/events/beta/customers/test_entitlements.py index 11aab721..687a8de4 100644 --- a/tests/api_resources/v1/events/beta/customers/test_entitlements.py +++ b/tests/api_resources/v1/events/beta/customers/test_entitlements.py @@ -36,6 +36,8 @@ def test_method_check_with_all_params(self, client: Stigg) -> None: requested_usage=0, requested_values=["string"], resource_id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(EntitlementCheckResponse, entitlement, path=["response"]) @@ -98,6 +100,8 @@ async def test_method_check_with_all_params(self, async_client: AsyncStigg) -> N requested_usage=0, requested_values=["string"], resource_id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(EntitlementCheckResponse, entitlement, path=["response"]) diff --git a/tests/api_resources/v1/events/beta/test_entity_types.py b/tests/api_resources/v1/events/beta/test_entity_types.py index a81c17db..af7bad06 100644 --- a/tests/api_resources/v1/events/beta/test_entity_types.py +++ b/tests/api_resources/v1/events/beta/test_entity_types.py @@ -34,6 +34,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[EntityTypeListResponse], entity_type, path=["response"]) @@ -78,6 +80,27 @@ def test_method_upsert(self, client: Stigg) -> None: ) assert_matches_type(EntityTypeUpsertResponse, entity_type, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_upsert_with_all_params(self, client: Stigg) -> None: + entity_type = client.v1.events.beta.entity_types.upsert( + types=[ + { + "id": "org", + "attribution_keys": ["organizationId"], + "display_name": "Organization", + }, + { + "id": "team", + "attribution_keys": ["teamId"], + "display_name": "Team", + }, + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityTypeUpsertResponse, entity_type, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_upsert(self, client: Stigg) -> None: @@ -145,6 +168,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[EntityTypeListResponse], entity_type, path=["response"]) @@ -189,6 +214,27 @@ async def test_method_upsert(self, async_client: AsyncStigg) -> None: ) assert_matches_type(EntityTypeUpsertResponse, entity_type, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_upsert_with_all_params(self, async_client: AsyncStigg) -> None: + entity_type = await async_client.v1.events.beta.entity_types.upsert( + types=[ + { + "id": "org", + "attribution_keys": ["organizationId"], + "display_name": "Organization", + }, + { + "id": "team", + "attribution_keys": ["teamId"], + "display_name": "Team", + }, + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntityTypeUpsertResponse, entity_type, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_upsert(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/plans/test_entitlements.py b/tests/api_resources/v1/plans/test_entitlements.py index b88acac2..ba95b043 100644 --- a/tests/api_resources/v1/plans/test_entitlements.py +++ b/tests/api_resources/v1/plans/test_entitlements.py @@ -35,6 +35,37 @@ def test_method_create(self, client: Stigg) -> None: ) assert_matches_type(EntitlementCreateResponse, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Stigg) -> None: + entitlement = client.v1.plans.entitlements.create( + plan_id="planId", + entitlements=[ + { + "id": "id", + "type": "FEATURE", + "behavior": "Increment", + "description": "description", + "display_name_override": "displayNameOverride", + "enum_values": ["string"], + "has_soft_limit": True, + "has_unlimited_usage": True, + "hidden_from_widgets": ["PAYWALL"], + "is_custom": True, + "is_granted": True, + "monthly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "order": 0, + "reset_period": "YEAR", + "usage_limit": 0, + "weekly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "yearly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntitlementCreateResponse, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Stigg) -> None: @@ -119,6 +150,8 @@ def test_method_update_with_all_params_overload_1(self, client: Stigg) -> None: usage_limit=0, weekly_reset_period_configuration={"according_to": "SubscriptionStart"}, yearly_reset_period_configuration={"according_to": "SubscriptionStart"}, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(PlanEntitlement, entitlement, path=["response"]) @@ -196,6 +229,8 @@ def test_method_update_with_all_params_overload_2(self, client: Stigg) -> None: is_custom=True, is_granted=True, order=0, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(PlanEntitlement, entitlement, path=["response"]) @@ -250,7 +285,17 @@ def test_path_params_update_overload_2(self, client: Stigg) -> None: @parametrize def test_method_list(self, client: Stigg) -> None: entitlement = client.v1.plans.entitlements.list( - "planId", + plan_id="planId", + ) + assert_matches_type(EntitlementListResponse, entitlement, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Stigg) -> None: + entitlement = client.v1.plans.entitlements.list( + plan_id="planId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(EntitlementListResponse, entitlement, path=["response"]) @@ -258,7 +303,7 @@ def test_method_list(self, client: Stigg) -> None: @parametrize def test_raw_response_list(self, client: Stigg) -> None: response = client.v1.plans.entitlements.with_raw_response.list( - "planId", + plan_id="planId", ) assert response.is_closed is True @@ -270,7 +315,7 @@ def test_raw_response_list(self, client: Stigg) -> None: @parametrize def test_streaming_response_list(self, client: Stigg) -> None: with client.v1.plans.entitlements.with_streaming_response.list( - "planId", + plan_id="planId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -285,7 +330,7 @@ def test_streaming_response_list(self, client: Stigg) -> None: def test_path_params_list(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"): client.v1.plans.entitlements.with_raw_response.list( - "", + plan_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -297,6 +342,17 @@ def test_method_delete(self, client: Stigg) -> None: ) assert_matches_type(PlanEntitlement, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Stigg) -> None: + entitlement = client.v1.plans.entitlements.delete( + id="id", + plan_id="planId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(PlanEntitlement, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Stigg) -> None: @@ -360,6 +416,37 @@ async def test_method_create(self, async_client: AsyncStigg) -> None: ) assert_matches_type(EntitlementCreateResponse, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncStigg) -> None: + entitlement = await async_client.v1.plans.entitlements.create( + plan_id="planId", + entitlements=[ + { + "id": "id", + "type": "FEATURE", + "behavior": "Increment", + "description": "description", + "display_name_override": "displayNameOverride", + "enum_values": ["string"], + "has_soft_limit": True, + "has_unlimited_usage": True, + "hidden_from_widgets": ["PAYWALL"], + "is_custom": True, + "is_granted": True, + "monthly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "order": 0, + "reset_period": "YEAR", + "usage_limit": 0, + "weekly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + "yearly_reset_period_configuration": {"according_to": "SubscriptionStart"}, + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EntitlementCreateResponse, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStigg) -> None: @@ -444,6 +531,8 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn usage_limit=0, weekly_reset_period_configuration={"according_to": "SubscriptionStart"}, yearly_reset_period_configuration={"according_to": "SubscriptionStart"}, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(PlanEntitlement, entitlement, path=["response"]) @@ -521,6 +610,8 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn is_custom=True, is_granted=True, order=0, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(PlanEntitlement, entitlement, path=["response"]) @@ -575,7 +666,17 @@ async def test_path_params_update_overload_2(self, async_client: AsyncStigg) -> @parametrize async def test_method_list(self, async_client: AsyncStigg) -> None: entitlement = await async_client.v1.plans.entitlements.list( - "planId", + plan_id="planId", + ) + assert_matches_type(EntitlementListResponse, entitlement, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> None: + entitlement = await async_client.v1.plans.entitlements.list( + plan_id="planId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(EntitlementListResponse, entitlement, path=["response"]) @@ -583,7 +684,7 @@ async def test_method_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncStigg) -> None: response = await async_client.v1.plans.entitlements.with_raw_response.list( - "planId", + plan_id="planId", ) assert response.is_closed is True @@ -595,7 +696,7 @@ async def test_raw_response_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: async with async_client.v1.plans.entitlements.with_streaming_response.list( - "planId", + plan_id="planId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -610,7 +711,7 @@ async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: async def test_path_params_list(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"): await async_client.v1.plans.entitlements.with_raw_response.list( - "", + plan_id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -622,6 +723,17 @@ async def test_method_delete(self, async_client: AsyncStigg) -> None: ) assert_matches_type(PlanEntitlement, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncStigg) -> None: + entitlement = await async_client.v1.plans.entitlements.delete( + id="id", + plan_id="planId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(PlanEntitlement, entitlement, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/subscriptions/test_future_update.py b/tests/api_resources/v1/subscriptions/test_future_update.py index d6f0f3b5..20c24e3b 100644 --- a/tests/api_resources/v1/subscriptions/test_future_update.py +++ b/tests/api_resources/v1/subscriptions/test_future_update.py @@ -21,7 +21,17 @@ class TestFutureUpdate: @parametrize def test_method_cancel_pending_payment(self, client: Stigg) -> None: future_update = client.v1.subscriptions.future_update.cancel_pending_payment( - "x", + id="x", + ) + assert_matches_type(CancelSubscription, future_update, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_cancel_pending_payment_with_all_params(self, client: Stigg) -> None: + future_update = client.v1.subscriptions.future_update.cancel_pending_payment( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CancelSubscription, future_update, path=["response"]) @@ -29,7 +39,7 @@ def test_method_cancel_pending_payment(self, client: Stigg) -> None: @parametrize def test_raw_response_cancel_pending_payment(self, client: Stigg) -> None: response = client.v1.subscriptions.future_update.with_raw_response.cancel_pending_payment( - "x", + id="x", ) assert response.is_closed is True @@ -41,7 +51,7 @@ def test_raw_response_cancel_pending_payment(self, client: Stigg) -> None: @parametrize def test_streaming_response_cancel_pending_payment(self, client: Stigg) -> None: with client.v1.subscriptions.future_update.with_streaming_response.cancel_pending_payment( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -56,14 +66,24 @@ def test_streaming_response_cancel_pending_payment(self, client: Stigg) -> None: def test_path_params_cancel_pending_payment(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.subscriptions.future_update.with_raw_response.cancel_pending_payment( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel_schedule(self, client: Stigg) -> None: future_update = client.v1.subscriptions.future_update.cancel_schedule( - "x", + id="x", + ) + assert_matches_type(CancelSubscription, future_update, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_cancel_schedule_with_all_params(self, client: Stigg) -> None: + future_update = client.v1.subscriptions.future_update.cancel_schedule( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CancelSubscription, future_update, path=["response"]) @@ -71,7 +91,7 @@ def test_method_cancel_schedule(self, client: Stigg) -> None: @parametrize def test_raw_response_cancel_schedule(self, client: Stigg) -> None: response = client.v1.subscriptions.future_update.with_raw_response.cancel_schedule( - "x", + id="x", ) assert response.is_closed is True @@ -83,7 +103,7 @@ def test_raw_response_cancel_schedule(self, client: Stigg) -> None: @parametrize def test_streaming_response_cancel_schedule(self, client: Stigg) -> None: with client.v1.subscriptions.future_update.with_streaming_response.cancel_schedule( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,7 +118,7 @@ def test_streaming_response_cancel_schedule(self, client: Stigg) -> None: def test_path_params_cancel_schedule(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.subscriptions.future_update.with_raw_response.cancel_schedule( - "", + id="", ) @@ -111,7 +131,17 @@ class TestAsyncFutureUpdate: @parametrize async def test_method_cancel_pending_payment(self, async_client: AsyncStigg) -> None: future_update = await async_client.v1.subscriptions.future_update.cancel_pending_payment( - "x", + id="x", + ) + assert_matches_type(CancelSubscription, future_update, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_cancel_pending_payment_with_all_params(self, async_client: AsyncStigg) -> None: + future_update = await async_client.v1.subscriptions.future_update.cancel_pending_payment( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CancelSubscription, future_update, path=["response"]) @@ -119,7 +149,7 @@ async def test_method_cancel_pending_payment(self, async_client: AsyncStigg) -> @parametrize async def test_raw_response_cancel_pending_payment(self, async_client: AsyncStigg) -> None: response = await async_client.v1.subscriptions.future_update.with_raw_response.cancel_pending_payment( - "x", + id="x", ) assert response.is_closed is True @@ -131,7 +161,7 @@ async def test_raw_response_cancel_pending_payment(self, async_client: AsyncStig @parametrize async def test_streaming_response_cancel_pending_payment(self, async_client: AsyncStigg) -> None: async with async_client.v1.subscriptions.future_update.with_streaming_response.cancel_pending_payment( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,14 +176,24 @@ async def test_streaming_response_cancel_pending_payment(self, async_client: Asy async def test_path_params_cancel_pending_payment(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.subscriptions.future_update.with_raw_response.cancel_pending_payment( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel_schedule(self, async_client: AsyncStigg) -> None: future_update = await async_client.v1.subscriptions.future_update.cancel_schedule( - "x", + id="x", + ) + assert_matches_type(CancelSubscription, future_update, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_cancel_schedule_with_all_params(self, async_client: AsyncStigg) -> None: + future_update = await async_client.v1.subscriptions.future_update.cancel_schedule( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CancelSubscription, future_update, path=["response"]) @@ -161,7 +201,7 @@ async def test_method_cancel_schedule(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_cancel_schedule(self, async_client: AsyncStigg) -> None: response = await async_client.v1.subscriptions.future_update.with_raw_response.cancel_schedule( - "x", + id="x", ) assert response.is_closed is True @@ -173,7 +213,7 @@ async def test_raw_response_cancel_schedule(self, async_client: AsyncStigg) -> N @parametrize async def test_streaming_response_cancel_schedule(self, async_client: AsyncStigg) -> None: async with async_client.v1.subscriptions.future_update.with_streaming_response.cancel_schedule( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -188,5 +228,5 @@ async def test_streaming_response_cancel_schedule(self, async_client: AsyncStigg async def test_path_params_cancel_schedule(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.subscriptions.future_update.with_raw_response.cancel_schedule( - "", + id="", ) diff --git a/tests/api_resources/v1/subscriptions/test_invoice.py b/tests/api_resources/v1/subscriptions/test_invoice.py index 8fcdd09b..37085616 100644 --- a/tests/api_resources/v1/subscriptions/test_invoice.py +++ b/tests/api_resources/v1/subscriptions/test_invoice.py @@ -21,7 +21,17 @@ class TestInvoice: @parametrize def test_method_mark_as_paid(self, client: Stigg) -> None: invoice = client.v1.subscriptions.invoice.mark_as_paid( - "x", + id="x", + ) + assert_matches_type(InvoiceMarkAsPaidResponse, invoice, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_mark_as_paid_with_all_params(self, client: Stigg) -> None: + invoice = client.v1.subscriptions.invoice.mark_as_paid( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(InvoiceMarkAsPaidResponse, invoice, path=["response"]) @@ -29,7 +39,7 @@ def test_method_mark_as_paid(self, client: Stigg) -> None: @parametrize def test_raw_response_mark_as_paid(self, client: Stigg) -> None: response = client.v1.subscriptions.invoice.with_raw_response.mark_as_paid( - "x", + id="x", ) assert response.is_closed is True @@ -41,7 +51,7 @@ def test_raw_response_mark_as_paid(self, client: Stigg) -> None: @parametrize def test_streaming_response_mark_as_paid(self, client: Stigg) -> None: with client.v1.subscriptions.invoice.with_streaming_response.mark_as_paid( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -56,7 +66,7 @@ def test_streaming_response_mark_as_paid(self, client: Stigg) -> None: def test_path_params_mark_as_paid(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.subscriptions.invoice.with_raw_response.mark_as_paid( - "", + id="", ) @@ -69,7 +79,17 @@ class TestAsyncInvoice: @parametrize async def test_method_mark_as_paid(self, async_client: AsyncStigg) -> None: invoice = await async_client.v1.subscriptions.invoice.mark_as_paid( - "x", + id="x", + ) + assert_matches_type(InvoiceMarkAsPaidResponse, invoice, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_mark_as_paid_with_all_params(self, async_client: AsyncStigg) -> None: + invoice = await async_client.v1.subscriptions.invoice.mark_as_paid( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(InvoiceMarkAsPaidResponse, invoice, path=["response"]) @@ -77,7 +97,7 @@ async def test_method_mark_as_paid(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_mark_as_paid(self, async_client: AsyncStigg) -> None: response = await async_client.v1.subscriptions.invoice.with_raw_response.mark_as_paid( - "x", + id="x", ) assert response.is_closed is True @@ -89,7 +109,7 @@ async def test_raw_response_mark_as_paid(self, async_client: AsyncStigg) -> None @parametrize async def test_streaming_response_mark_as_paid(self, async_client: AsyncStigg) -> None: async with async_client.v1.subscriptions.invoice.with_streaming_response.mark_as_paid( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -104,5 +124,5 @@ async def test_streaming_response_mark_as_paid(self, async_client: AsyncStigg) - async def test_path_params_mark_as_paid(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.subscriptions.invoice.with_raw_response.mark_as_paid( - "", + id="", ) diff --git a/tests/api_resources/v1/subscriptions/test_usage.py b/tests/api_resources/v1/subscriptions/test_usage.py index 6358443e..7b3b11da 100644 --- a/tests/api_resources/v1/subscriptions/test_usage.py +++ b/tests/api_resources/v1/subscriptions/test_usage.py @@ -32,6 +32,8 @@ def test_method_charge_usage_with_all_params(self, client: Stigg) -> None: usage = client.v1.subscriptions.usage.charge_usage( id="x", until_date=parse_datetime("2019-12-27T18:11:19.117Z"), + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(UsageChargeUsageResponse, usage, path=["response"]) @@ -73,7 +75,17 @@ def test_path_params_charge_usage(self, client: Stigg) -> None: @parametrize def test_method_sync(self, client: Stigg) -> None: usage = client.v1.subscriptions.usage.sync( - "x", + id="x", + ) + assert_matches_type(UsageSyncResponse, usage, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_sync_with_all_params(self, client: Stigg) -> None: + usage = client.v1.subscriptions.usage.sync( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(UsageSyncResponse, usage, path=["response"]) @@ -81,7 +93,7 @@ def test_method_sync(self, client: Stigg) -> None: @parametrize def test_raw_response_sync(self, client: Stigg) -> None: response = client.v1.subscriptions.usage.with_raw_response.sync( - "x", + id="x", ) assert response.is_closed is True @@ -93,7 +105,7 @@ def test_raw_response_sync(self, client: Stigg) -> None: @parametrize def test_streaming_response_sync(self, client: Stigg) -> None: with client.v1.subscriptions.usage.with_streaming_response.sync( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -108,7 +120,7 @@ def test_streaming_response_sync(self, client: Stigg) -> None: def test_path_params_sync(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.subscriptions.usage.with_raw_response.sync( - "", + id="", ) @@ -131,6 +143,8 @@ async def test_method_charge_usage_with_all_params(self, async_client: AsyncStig usage = await async_client.v1.subscriptions.usage.charge_usage( id="x", until_date=parse_datetime("2019-12-27T18:11:19.117Z"), + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(UsageChargeUsageResponse, usage, path=["response"]) @@ -172,7 +186,17 @@ async def test_path_params_charge_usage(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_sync(self, async_client: AsyncStigg) -> None: usage = await async_client.v1.subscriptions.usage.sync( - "x", + id="x", + ) + assert_matches_type(UsageSyncResponse, usage, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_sync_with_all_params(self, async_client: AsyncStigg) -> None: + usage = await async_client.v1.subscriptions.usage.sync( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(UsageSyncResponse, usage, path=["response"]) @@ -180,7 +204,7 @@ async def test_method_sync(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_sync(self, async_client: AsyncStigg) -> None: response = await async_client.v1.subscriptions.usage.with_raw_response.sync( - "x", + id="x", ) assert response.is_closed is True @@ -192,7 +216,7 @@ async def test_raw_response_sync(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_sync(self, async_client: AsyncStigg) -> None: async with async_client.v1.subscriptions.usage.with_streaming_response.sync( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -207,5 +231,5 @@ async def test_streaming_response_sync(self, async_client: AsyncStigg) -> None: async def test_path_params_sync(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.subscriptions.usage.with_raw_response.sync( - "", + id="", ) diff --git a/tests/api_resources/v1/test_addons.py b/tests/api_resources/v1/test_addons.py index ff1e4780..87309513 100644 --- a/tests/api_resources/v1/test_addons.py +++ b/tests/api_resources/v1/test_addons.py @@ -48,6 +48,8 @@ def test_method_create_with_all_params(self, client: Stigg) -> None: metadata={"foo": "string"}, pricing_type="FREE", status="DRAFT", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -85,7 +87,17 @@ def test_streaming_response_create(self, client: Stigg) -> None: @parametrize def test_method_retrieve(self, client: Stigg) -> None: addon = client.v1.addons.retrieve( - "x", + id="x", + ) + assert_matches_type(Addon, addon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Stigg) -> None: + addon = client.v1.addons.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -93,7 +105,7 @@ def test_method_retrieve(self, client: Stigg) -> None: @parametrize def test_raw_response_retrieve(self, client: Stigg) -> None: response = client.v1.addons.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -105,7 +117,7 @@ def test_raw_response_retrieve(self, client: Stigg) -> None: @parametrize def test_streaming_response_retrieve(self, client: Stigg) -> None: with client.v1.addons.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -120,7 +132,7 @@ def test_streaming_response_retrieve(self, client: Stigg) -> None: def test_path_params_retrieve(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.addons.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -250,6 +262,8 @@ def test_method_update_with_all_params(self, client: Stigg) -> None: max_quantity=0, metadata={"foo": "string"}, status="DRAFT", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -308,6 +322,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: limit=1, product_id="productId", status=["DRAFT"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[AddonListResponse], addon, path=["response"]) @@ -337,7 +353,17 @@ def test_streaming_response_list(self, client: Stigg) -> None: @parametrize def test_method_archive(self, client: Stigg) -> None: addon = client.v1.addons.archive( - "x", + id="x", + ) + assert_matches_type(Addon, addon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_archive_with_all_params(self, client: Stigg) -> None: + addon = client.v1.addons.archive( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -345,7 +371,7 @@ def test_method_archive(self, client: Stigg) -> None: @parametrize def test_raw_response_archive(self, client: Stigg) -> None: response = client.v1.addons.with_raw_response.archive( - "x", + id="x", ) assert response.is_closed is True @@ -357,7 +383,7 @@ def test_raw_response_archive(self, client: Stigg) -> None: @parametrize def test_streaming_response_archive(self, client: Stigg) -> None: with client.v1.addons.with_streaming_response.archive( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -372,14 +398,24 @@ def test_streaming_response_archive(self, client: Stigg) -> None: def test_path_params_archive(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.addons.with_raw_response.archive( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_draft(self, client: Stigg) -> None: addon = client.v1.addons.create_draft( - "x", + id="x", + ) + assert_matches_type(Addon, addon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_draft_with_all_params(self, client: Stigg) -> None: + addon = client.v1.addons.create_draft( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -387,7 +423,7 @@ def test_method_create_draft(self, client: Stigg) -> None: @parametrize def test_raw_response_create_draft(self, client: Stigg) -> None: response = client.v1.addons.with_raw_response.create_draft( - "x", + id="x", ) assert response.is_closed is True @@ -399,7 +435,7 @@ def test_raw_response_create_draft(self, client: Stigg) -> None: @parametrize def test_streaming_response_create_draft(self, client: Stigg) -> None: with client.v1.addons.with_streaming_response.create_draft( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -414,7 +450,7 @@ def test_streaming_response_create_draft(self, client: Stigg) -> None: def test_path_params_create_draft(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.addons.with_raw_response.create_draft( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -433,6 +469,8 @@ def test_method_list_charges_with_all_params(self, client: Stigg) -> None: after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[AddonListChargesResponse], addon, path=["response"]) @@ -479,6 +517,17 @@ def test_method_publish(self, client: Stigg) -> None: ) assert_matches_type(AddonPublishResponse, addon, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_publish_with_all_params(self, client: Stigg) -> None: + addon = client.v1.addons.publish( + id="x", + migration_type="NEW_CUSTOMERS", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(AddonPublishResponse, addon, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_publish(self, client: Stigg) -> None: @@ -520,7 +569,17 @@ def test_path_params_publish(self, client: Stigg) -> None: @parametrize def test_method_remove_draft(self, client: Stigg) -> None: addon = client.v1.addons.remove_draft( - "x", + id="x", + ) + assert_matches_type(AddonRemoveDraftResponse, addon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_remove_draft_with_all_params(self, client: Stigg) -> None: + addon = client.v1.addons.remove_draft( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AddonRemoveDraftResponse, addon, path=["response"]) @@ -528,7 +587,7 @@ def test_method_remove_draft(self, client: Stigg) -> None: @parametrize def test_raw_response_remove_draft(self, client: Stigg) -> None: response = client.v1.addons.with_raw_response.remove_draft( - "x", + id="x", ) assert response.is_closed is True @@ -540,7 +599,7 @@ def test_raw_response_remove_draft(self, client: Stigg) -> None: @parametrize def test_streaming_response_remove_draft(self, client: Stigg) -> None: with client.v1.addons.with_streaming_response.remove_draft( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -555,7 +614,7 @@ def test_streaming_response_remove_draft(self, client: Stigg) -> None: def test_path_params_remove_draft(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.addons.with_raw_response.remove_draft( - "", + id="", ) @@ -587,6 +646,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncStigg) -> metadata={"foo": "string"}, pricing_type="FREE", status="DRAFT", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -624,7 +685,17 @@ async def test_streaming_response_create(self, async_client: AsyncStigg) -> None @parametrize async def test_method_retrieve(self, async_client: AsyncStigg) -> None: addon = await async_client.v1.addons.retrieve( - "x", + id="x", + ) + assert_matches_type(Addon, addon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncStigg) -> None: + addon = await async_client.v1.addons.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -632,7 +703,7 @@ async def test_method_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: response = await async_client.v1.addons.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -644,7 +715,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> None: async with async_client.v1.addons.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -659,7 +730,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> No async def test_path_params_retrieve(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.addons.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -789,6 +860,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncStigg) -> max_quantity=0, metadata={"foo": "string"}, status="DRAFT", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -847,6 +920,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No limit=1, product_id="productId", status=["DRAFT"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[AddonListResponse], addon, path=["response"]) @@ -876,7 +951,17 @@ async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_archive(self, async_client: AsyncStigg) -> None: addon = await async_client.v1.addons.archive( - "x", + id="x", + ) + assert_matches_type(Addon, addon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_archive_with_all_params(self, async_client: AsyncStigg) -> None: + addon = await async_client.v1.addons.archive( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -884,7 +969,7 @@ async def test_method_archive(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: response = await async_client.v1.addons.with_raw_response.archive( - "x", + id="x", ) assert response.is_closed is True @@ -896,7 +981,7 @@ async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_archive(self, async_client: AsyncStigg) -> None: async with async_client.v1.addons.with_streaming_response.archive( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -911,14 +996,24 @@ async def test_streaming_response_archive(self, async_client: AsyncStigg) -> Non async def test_path_params_archive(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.addons.with_raw_response.archive( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_draft(self, async_client: AsyncStigg) -> None: addon = await async_client.v1.addons.create_draft( - "x", + id="x", + ) + assert_matches_type(Addon, addon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_draft_with_all_params(self, async_client: AsyncStigg) -> None: + addon = await async_client.v1.addons.create_draft( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Addon, addon, path=["response"]) @@ -926,7 +1021,7 @@ async def test_method_create_draft(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_create_draft(self, async_client: AsyncStigg) -> None: response = await async_client.v1.addons.with_raw_response.create_draft( - "x", + id="x", ) assert response.is_closed is True @@ -938,7 +1033,7 @@ async def test_raw_response_create_draft(self, async_client: AsyncStigg) -> None @parametrize async def test_streaming_response_create_draft(self, async_client: AsyncStigg) -> None: async with async_client.v1.addons.with_streaming_response.create_draft( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -953,7 +1048,7 @@ async def test_streaming_response_create_draft(self, async_client: AsyncStigg) - async def test_path_params_create_draft(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.addons.with_raw_response.create_draft( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -972,6 +1067,8 @@ async def test_method_list_charges_with_all_params(self, async_client: AsyncStig after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[AddonListChargesResponse], addon, path=["response"]) @@ -1018,6 +1115,17 @@ async def test_method_publish(self, async_client: AsyncStigg) -> None: ) assert_matches_type(AddonPublishResponse, addon, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_publish_with_all_params(self, async_client: AsyncStigg) -> None: + addon = await async_client.v1.addons.publish( + id="x", + migration_type="NEW_CUSTOMERS", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(AddonPublishResponse, addon, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_publish(self, async_client: AsyncStigg) -> None: @@ -1059,7 +1167,17 @@ async def test_path_params_publish(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_remove_draft(self, async_client: AsyncStigg) -> None: addon = await async_client.v1.addons.remove_draft( - "x", + id="x", + ) + assert_matches_type(AddonRemoveDraftResponse, addon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_remove_draft_with_all_params(self, async_client: AsyncStigg) -> None: + addon = await async_client.v1.addons.remove_draft( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AddonRemoveDraftResponse, addon, path=["response"]) @@ -1067,7 +1185,7 @@ async def test_method_remove_draft(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_remove_draft(self, async_client: AsyncStigg) -> None: response = await async_client.v1.addons.with_raw_response.remove_draft( - "x", + id="x", ) assert response.is_closed is True @@ -1079,7 +1197,7 @@ async def test_raw_response_remove_draft(self, async_client: AsyncStigg) -> None @parametrize async def test_streaming_response_remove_draft(self, async_client: AsyncStigg) -> None: async with async_client.v1.addons.with_streaming_response.remove_draft( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1094,5 +1212,5 @@ async def test_streaming_response_remove_draft(self, async_client: AsyncStigg) - async def test_path_params_remove_draft(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.addons.with_raw_response.remove_draft( - "", + id="", ) diff --git a/tests/api_resources/v1/test_coupons.py b/tests/api_resources/v1/test_coupons.py index b3a0a27c..1247b904 100644 --- a/tests/api_resources/v1/test_coupons.py +++ b/tests/api_resources/v1/test_coupons.py @@ -41,6 +41,27 @@ def test_method_create(self, client: Stigg) -> None: ) assert_matches_type(Coupon, coupon, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Stigg) -> None: + coupon = client.v1.coupons.create( + id="id", + amounts_off=[ + { + "amount": 0, + "currency": "usd", + } + ], + description="description", + duration_in_months=1, + metadata={"foo": "string"}, + name="name", + percent_off=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(Coupon, coupon, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Stigg) -> None: @@ -93,7 +114,17 @@ def test_streaming_response_create(self, client: Stigg) -> None: @parametrize def test_method_retrieve(self, client: Stigg) -> None: coupon = client.v1.coupons.retrieve( - "x", + id="x", + ) + assert_matches_type(Coupon, coupon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Stigg) -> None: + coupon = client.v1.coupons.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Coupon, coupon, path=["response"]) @@ -101,7 +132,7 @@ def test_method_retrieve(self, client: Stigg) -> None: @parametrize def test_raw_response_retrieve(self, client: Stigg) -> None: response = client.v1.coupons.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -113,7 +144,7 @@ def test_raw_response_retrieve(self, client: Stigg) -> None: @parametrize def test_streaming_response_retrieve(self, client: Stigg) -> None: with client.v1.coupons.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -128,7 +159,7 @@ def test_streaming_response_retrieve(self, client: Stigg) -> None: def test_path_params_retrieve(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.coupons.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -153,6 +184,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: limit=1, status=["ACTIVE"], type="FIXED", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[CouponListResponse], coupon, path=["response"]) @@ -182,7 +215,17 @@ def test_streaming_response_list(self, client: Stigg) -> None: @parametrize def test_method_archive_coupon(self, client: Stigg) -> None: coupon = client.v1.coupons.archive_coupon( - "x", + id="x", + ) + assert_matches_type(Coupon, coupon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_archive_coupon_with_all_params(self, client: Stigg) -> None: + coupon = client.v1.coupons.archive_coupon( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Coupon, coupon, path=["response"]) @@ -190,7 +233,7 @@ def test_method_archive_coupon(self, client: Stigg) -> None: @parametrize def test_raw_response_archive_coupon(self, client: Stigg) -> None: response = client.v1.coupons.with_raw_response.archive_coupon( - "x", + id="x", ) assert response.is_closed is True @@ -202,7 +245,7 @@ def test_raw_response_archive_coupon(self, client: Stigg) -> None: @parametrize def test_streaming_response_archive_coupon(self, client: Stigg) -> None: with client.v1.coupons.with_streaming_response.archive_coupon( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -217,7 +260,7 @@ def test_streaming_response_archive_coupon(self, client: Stigg) -> None: def test_path_params_archive_coupon(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.coupons.with_raw_response.archive_coupon( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -236,6 +279,8 @@ def test_method_update_coupon_with_all_params(self, client: Stigg) -> None: description="description", metadata={"foo": "string"}, name="name", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Coupon, coupon, path=["response"]) @@ -298,6 +343,27 @@ async def test_method_create(self, async_client: AsyncStigg) -> None: ) assert_matches_type(Coupon, coupon, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncStigg) -> None: + coupon = await async_client.v1.coupons.create( + id="id", + amounts_off=[ + { + "amount": 0, + "currency": "usd", + } + ], + description="description", + duration_in_months=1, + metadata={"foo": "string"}, + name="name", + percent_off=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(Coupon, coupon, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncStigg) -> None: @@ -350,7 +416,17 @@ async def test_streaming_response_create(self, async_client: AsyncStigg) -> None @parametrize async def test_method_retrieve(self, async_client: AsyncStigg) -> None: coupon = await async_client.v1.coupons.retrieve( - "x", + id="x", + ) + assert_matches_type(Coupon, coupon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncStigg) -> None: + coupon = await async_client.v1.coupons.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Coupon, coupon, path=["response"]) @@ -358,7 +434,7 @@ async def test_method_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: response = await async_client.v1.coupons.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -370,7 +446,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> None: async with async_client.v1.coupons.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -385,7 +461,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> No async def test_path_params_retrieve(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.coupons.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -410,6 +486,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No limit=1, status=["ACTIVE"], type="FIXED", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[CouponListResponse], coupon, path=["response"]) @@ -439,7 +517,17 @@ async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_archive_coupon(self, async_client: AsyncStigg) -> None: coupon = await async_client.v1.coupons.archive_coupon( - "x", + id="x", + ) + assert_matches_type(Coupon, coupon, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_archive_coupon_with_all_params(self, async_client: AsyncStigg) -> None: + coupon = await async_client.v1.coupons.archive_coupon( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Coupon, coupon, path=["response"]) @@ -447,7 +535,7 @@ async def test_method_archive_coupon(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_archive_coupon(self, async_client: AsyncStigg) -> None: response = await async_client.v1.coupons.with_raw_response.archive_coupon( - "x", + id="x", ) assert response.is_closed is True @@ -459,7 +547,7 @@ async def test_raw_response_archive_coupon(self, async_client: AsyncStigg) -> No @parametrize async def test_streaming_response_archive_coupon(self, async_client: AsyncStigg) -> None: async with async_client.v1.coupons.with_streaming_response.archive_coupon( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -474,7 +562,7 @@ async def test_streaming_response_archive_coupon(self, async_client: AsyncStigg) async def test_path_params_archive_coupon(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.coupons.with_raw_response.archive_coupon( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -493,6 +581,8 @@ async def test_method_update_coupon_with_all_params(self, async_client: AsyncSti description="description", metadata={"foo": "string"}, name="name", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Coupon, coupon, path=["response"]) diff --git a/tests/api_resources/v1/test_credits.py b/tests/api_resources/v1/test_credits.py index 3d12a48e..6a2f1408 100644 --- a/tests/api_resources/v1/test_credits.py +++ b/tests/api_resources/v1/test_credits.py @@ -32,6 +32,17 @@ def test_method_get_auto_recharge(self, client: Stigg) -> None: ) assert_matches_type(CreditGetAutoRechargeResponse, credit, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_get_auto_recharge_with_all_params(self, client: Stigg) -> None: + credit = client.v1.credits.get_auto_recharge( + currency_id="currencyId", + customer_id="customerId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CreditGetAutoRechargeResponse, credit, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_auto_recharge(self, client: Stigg) -> None: @@ -82,6 +93,8 @@ def test_method_get_usage_with_all_params(self, client: Stigg) -> None: resource_id="resourceId", start_date=parse_datetime("2019-12-27T18:11:19.117Z"), time_range="LAST_DAY", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CreditGetUsageResponse, credit, path=["response"]) @@ -129,6 +142,8 @@ def test_method_list_ledger_with_all_params(self, client: Stigg) -> None: currency_id="currencyId", limit=1, resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[CreditListLedgerResponse], credit, path=["response"]) @@ -173,6 +188,17 @@ async def test_method_get_auto_recharge(self, async_client: AsyncStigg) -> None: ) assert_matches_type(CreditGetAutoRechargeResponse, credit, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_get_auto_recharge_with_all_params(self, async_client: AsyncStigg) -> None: + credit = await async_client.v1.credits.get_auto_recharge( + currency_id="currencyId", + customer_id="customerId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(CreditGetAutoRechargeResponse, credit, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_auto_recharge(self, async_client: AsyncStigg) -> None: @@ -223,6 +249,8 @@ async def test_method_get_usage_with_all_params(self, async_client: AsyncStigg) resource_id="resourceId", start_date=parse_datetime("2019-12-27T18:11:19.117Z"), time_range="LAST_DAY", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CreditGetUsageResponse, credit, path=["response"]) @@ -270,6 +298,8 @@ async def test_method_list_ledger_with_all_params(self, async_client: AsyncStigg currency_id="currencyId", limit=1, resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[CreditListLedgerResponse], credit, path=["response"]) diff --git a/tests/api_resources/v1/test_customers.py b/tests/api_resources/v1/test_customers.py index a75f654b..25db9c7f 100644 --- a/tests/api_resources/v1/test_customers.py +++ b/tests/api_resources/v1/test_customers.py @@ -30,7 +30,17 @@ class TestCustomers: @parametrize def test_method_retrieve(self, client: Stigg) -> None: customer = client.v1.customers.retrieve( - "x", + id="x", + ) + assert_matches_type(CustomerResponse, customer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Stigg) -> None: + customer = client.v1.customers.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -38,7 +48,7 @@ def test_method_retrieve(self, client: Stigg) -> None: @parametrize def test_raw_response_retrieve(self, client: Stigg) -> None: response = client.v1.customers.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -50,7 +60,7 @@ def test_raw_response_retrieve(self, client: Stigg) -> None: @parametrize def test_streaming_response_retrieve(self, client: Stigg) -> None: with client.v1.customers.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -65,7 +75,7 @@ def test_streaming_response_retrieve(self, client: Stigg) -> None: def test_path_params_retrieve(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.customers.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -139,6 +149,8 @@ def test_method_update_with_all_params(self, client: Stigg) -> None: }, }, timezone="timezone", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -197,6 +209,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: email="email", limit=1, name="name", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[CustomerListResponse], customer, path=["response"]) @@ -226,7 +240,17 @@ def test_streaming_response_list(self, client: Stigg) -> None: @parametrize def test_method_archive(self, client: Stigg) -> None: customer = client.v1.customers.archive( - "x", + id="x", + ) + assert_matches_type(CustomerResponse, customer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_archive_with_all_params(self, client: Stigg) -> None: + customer = client.v1.customers.archive( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -234,7 +258,7 @@ def test_method_archive(self, client: Stigg) -> None: @parametrize def test_raw_response_archive(self, client: Stigg) -> None: response = client.v1.customers.with_raw_response.archive( - "x", + id="x", ) assert response.is_closed is True @@ -246,7 +270,7 @@ def test_raw_response_archive(self, client: Stigg) -> None: @parametrize def test_streaming_response_archive(self, client: Stigg) -> None: with client.v1.customers.with_streaming_response.archive( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -261,7 +285,7 @@ def test_streaming_response_archive(self, client: Stigg) -> None: def test_path_params_archive(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.customers.with_raw_response.archive( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -282,6 +306,8 @@ def test_method_check_entitlement_with_all_params(self, client: Stigg) -> None: requested_usage=0, requested_values=["string"], resource_id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerCheckEntitlementResponse, customer, path=["response"]) @@ -350,6 +376,8 @@ def test_method_import_with_all_params(self, client: Stigg) -> None: } ], integration_id="integrationId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerImportResponse, customer, path=["response"]) @@ -407,6 +435,8 @@ def test_method_list_resources_with_all_params(self, client: Stigg) -> None: after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[CustomerListResourcesResponse], customer, path=["response"]) @@ -522,6 +552,8 @@ def test_method_provision_with_all_params(self, client: Stigg) -> None: }, }, timezone="timezone", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -565,6 +597,8 @@ def test_method_retrieve_entitlements_with_all_params(self, client: Stigg) -> No customer = client.v1.customers.retrieve_entitlements( id="x", resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerRetrieveEntitlementsResponse, customer, path=["response"]) @@ -606,7 +640,17 @@ def test_path_params_retrieve_entitlements(self, client: Stigg) -> None: @parametrize def test_method_unarchive(self, client: Stigg) -> None: customer = client.v1.customers.unarchive( - "x", + id="x", + ) + assert_matches_type(CustomerResponse, customer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_unarchive_with_all_params(self, client: Stigg) -> None: + customer = client.v1.customers.unarchive( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -614,7 +658,7 @@ def test_method_unarchive(self, client: Stigg) -> None: @parametrize def test_raw_response_unarchive(self, client: Stigg) -> None: response = client.v1.customers.with_raw_response.unarchive( - "x", + id="x", ) assert response.is_closed is True @@ -626,7 +670,7 @@ def test_raw_response_unarchive(self, client: Stigg) -> None: @parametrize def test_streaming_response_unarchive(self, client: Stigg) -> None: with client.v1.customers.with_streaming_response.unarchive( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -641,7 +685,7 @@ def test_streaming_response_unarchive(self, client: Stigg) -> None: def test_path_params_unarchive(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.customers.with_raw_response.unarchive( - "", + id="", ) @@ -654,7 +698,17 @@ class TestAsyncCustomers: @parametrize async def test_method_retrieve(self, async_client: AsyncStigg) -> None: customer = await async_client.v1.customers.retrieve( - "x", + id="x", + ) + assert_matches_type(CustomerResponse, customer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncStigg) -> None: + customer = await async_client.v1.customers.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -662,7 +716,7 @@ async def test_method_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: response = await async_client.v1.customers.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -674,7 +728,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> None: async with async_client.v1.customers.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -689,7 +743,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> No async def test_path_params_retrieve(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.customers.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -763,6 +817,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncStigg) -> }, }, timezone="timezone", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -821,6 +877,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No email="email", limit=1, name="name", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[CustomerListResponse], customer, path=["response"]) @@ -850,7 +908,17 @@ async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_archive(self, async_client: AsyncStigg) -> None: customer = await async_client.v1.customers.archive( - "x", + id="x", + ) + assert_matches_type(CustomerResponse, customer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_archive_with_all_params(self, async_client: AsyncStigg) -> None: + customer = await async_client.v1.customers.archive( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -858,7 +926,7 @@ async def test_method_archive(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: response = await async_client.v1.customers.with_raw_response.archive( - "x", + id="x", ) assert response.is_closed is True @@ -870,7 +938,7 @@ async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_archive(self, async_client: AsyncStigg) -> None: async with async_client.v1.customers.with_streaming_response.archive( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -885,7 +953,7 @@ async def test_streaming_response_archive(self, async_client: AsyncStigg) -> Non async def test_path_params_archive(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.customers.with_raw_response.archive( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -906,6 +974,8 @@ async def test_method_check_entitlement_with_all_params(self, async_client: Asyn requested_usage=0, requested_values=["string"], resource_id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerCheckEntitlementResponse, customer, path=["response"]) @@ -974,6 +1044,8 @@ async def test_method_import_with_all_params(self, async_client: AsyncStigg) -> } ], integration_id="integrationId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerImportResponse, customer, path=["response"]) @@ -1031,6 +1103,8 @@ async def test_method_list_resources_with_all_params(self, async_client: AsyncSt after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[CustomerListResourcesResponse], customer, path=["response"]) @@ -1146,6 +1220,8 @@ async def test_method_provision_with_all_params(self, async_client: AsyncStigg) }, }, timezone="timezone", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -1189,6 +1265,8 @@ async def test_method_retrieve_entitlements_with_all_params(self, async_client: customer = await async_client.v1.customers.retrieve_entitlements( id="x", resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerRetrieveEntitlementsResponse, customer, path=["response"]) @@ -1230,7 +1308,17 @@ async def test_path_params_retrieve_entitlements(self, async_client: AsyncStigg) @parametrize async def test_method_unarchive(self, async_client: AsyncStigg) -> None: customer = await async_client.v1.customers.unarchive( - "x", + id="x", + ) + assert_matches_type(CustomerResponse, customer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_unarchive_with_all_params(self, async_client: AsyncStigg) -> None: + customer = await async_client.v1.customers.unarchive( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(CustomerResponse, customer, path=["response"]) @@ -1238,7 +1326,7 @@ async def test_method_unarchive(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_unarchive(self, async_client: AsyncStigg) -> None: response = await async_client.v1.customers.with_raw_response.unarchive( - "x", + id="x", ) assert response.is_closed is True @@ -1250,7 +1338,7 @@ async def test_raw_response_unarchive(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_unarchive(self, async_client: AsyncStigg) -> None: async with async_client.v1.customers.with_streaming_response.unarchive( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1265,5 +1353,5 @@ async def test_streaming_response_unarchive(self, async_client: AsyncStigg) -> N async def test_path_params_unarchive(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.customers.with_raw_response.unarchive( - "", + id="", ) diff --git a/tests/api_resources/v1/test_events.py b/tests/api_resources/v1/test_events.py index ee9da8e2..c847e9fa 100644 --- a/tests/api_resources/v1/test_events.py +++ b/tests/api_resources/v1/test_events.py @@ -9,6 +9,7 @@ from stigg import Stigg, AsyncStigg from tests.utils import assert_matches_type +from stigg._utils import parse_datetime from stigg.types.v1 import EventReportResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -31,6 +32,25 @@ def test_method_report(self, client: Stigg) -> None: ) assert_matches_type(EventReportResponse, event, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_report_with_all_params(self, client: Stigg) -> None: + event = client.v1.events.report( + events=[ + { + "customer_id": "customerId", + "event_name": "x", + "idempotency_key": "x", + "dimensions": {"foo": "string"}, + "resource_id": "resourceId", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EventReportResponse, event, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_report(self, client: Stigg) -> None: @@ -89,6 +109,25 @@ async def test_method_report(self, async_client: AsyncStigg) -> None: ) assert_matches_type(EventReportResponse, event, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_report_with_all_params(self, async_client: AsyncStigg) -> None: + event = await async_client.v1.events.report( + events=[ + { + "customer_id": "customerId", + "event_name": "x", + "idempotency_key": "x", + "dimensions": {"foo": "string"}, + "resource_id": "resourceId", + "timestamp": parse_datetime("2019-12-27T18:11:19.117Z"), + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(EventReportResponse, event, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_report(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/test_features.py b/tests/api_resources/v1/test_features.py index c9ea9928..2f1b6f2b 100644 --- a/tests/api_resources/v1/test_features.py +++ b/tests/api_resources/v1/test_features.py @@ -26,7 +26,17 @@ class TestFeatures: @parametrize def test_method_archive_feature(self, client: Stigg) -> None: feature = client.v1.features.archive_feature( - "x", + id="x", + ) + assert_matches_type(Feature, feature, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_archive_feature_with_all_params(self, client: Stigg) -> None: + feature = client.v1.features.archive_feature( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -34,7 +44,7 @@ def test_method_archive_feature(self, client: Stigg) -> None: @parametrize def test_raw_response_archive_feature(self, client: Stigg) -> None: response = client.v1.features.with_raw_response.archive_feature( - "x", + id="x", ) assert response.is_closed is True @@ -46,7 +56,7 @@ def test_raw_response_archive_feature(self, client: Stigg) -> None: @parametrize def test_streaming_response_archive_feature(self, client: Stigg) -> None: with client.v1.features.with_streaming_response.archive_feature( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -61,7 +71,7 @@ def test_streaming_response_archive_feature(self, client: Stigg) -> None: def test_path_params_archive_feature(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.features.with_raw_response.archive_feature( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -99,6 +109,8 @@ def test_method_create_feature_with_all_params(self, client: Stigg) -> None: "feature_units_plural": "featureUnitsPlural", "round": "UP", }, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -155,6 +167,8 @@ def test_method_list_features_with_all_params(self, client: Stigg) -> None: limit=1, meter_type=["None"], status=["NEW"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[FeatureListFeaturesResponse], feature, path=["response"]) @@ -184,7 +198,17 @@ def test_streaming_response_list_features(self, client: Stigg) -> None: @parametrize def test_method_retrieve_feature(self, client: Stigg) -> None: feature = client.v1.features.retrieve_feature( - "x", + id="x", + ) + assert_matches_type(Feature, feature, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_feature_with_all_params(self, client: Stigg) -> None: + feature = client.v1.features.retrieve_feature( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -192,7 +216,7 @@ def test_method_retrieve_feature(self, client: Stigg) -> None: @parametrize def test_raw_response_retrieve_feature(self, client: Stigg) -> None: response = client.v1.features.with_raw_response.retrieve_feature( - "x", + id="x", ) assert response.is_closed is True @@ -204,7 +228,7 @@ def test_raw_response_retrieve_feature(self, client: Stigg) -> None: @parametrize def test_streaming_response_retrieve_feature(self, client: Stigg) -> None: with client.v1.features.with_streaming_response.retrieve_feature( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -219,14 +243,24 @@ def test_streaming_response_retrieve_feature(self, client: Stigg) -> None: def test_path_params_retrieve_feature(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.features.with_raw_response.retrieve_feature( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_unarchive_feature(self, client: Stigg) -> None: feature = client.v1.features.unarchive_feature( - "x", + id="x", + ) + assert_matches_type(Feature, feature, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_unarchive_feature_with_all_params(self, client: Stigg) -> None: + feature = client.v1.features.unarchive_feature( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -234,7 +268,7 @@ def test_method_unarchive_feature(self, client: Stigg) -> None: @parametrize def test_raw_response_unarchive_feature(self, client: Stigg) -> None: response = client.v1.features.with_raw_response.unarchive_feature( - "x", + id="x", ) assert response.is_closed is True @@ -246,7 +280,7 @@ def test_raw_response_unarchive_feature(self, client: Stigg) -> None: @parametrize def test_streaming_response_unarchive_feature(self, client: Stigg) -> None: with client.v1.features.with_streaming_response.unarchive_feature( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -261,7 +295,7 @@ def test_streaming_response_unarchive_feature(self, client: Stigg) -> None: def test_path_params_unarchive_feature(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.features.with_raw_response.unarchive_feature( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -312,6 +346,8 @@ def test_method_update_feature_with_all_params(self, client: Stigg) -> None: "feature_units_plural": "featureUnitsPlural", "round": "UP", }, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -359,7 +395,17 @@ class TestAsyncFeatures: @parametrize async def test_method_archive_feature(self, async_client: AsyncStigg) -> None: feature = await async_client.v1.features.archive_feature( - "x", + id="x", + ) + assert_matches_type(Feature, feature, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_archive_feature_with_all_params(self, async_client: AsyncStigg) -> None: + feature = await async_client.v1.features.archive_feature( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -367,7 +413,7 @@ async def test_method_archive_feature(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_archive_feature(self, async_client: AsyncStigg) -> None: response = await async_client.v1.features.with_raw_response.archive_feature( - "x", + id="x", ) assert response.is_closed is True @@ -379,7 +425,7 @@ async def test_raw_response_archive_feature(self, async_client: AsyncStigg) -> N @parametrize async def test_streaming_response_archive_feature(self, async_client: AsyncStigg) -> None: async with async_client.v1.features.with_streaming_response.archive_feature( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -394,7 +440,7 @@ async def test_streaming_response_archive_feature(self, async_client: AsyncStigg async def test_path_params_archive_feature(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.features.with_raw_response.archive_feature( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -432,6 +478,8 @@ async def test_method_create_feature_with_all_params(self, async_client: AsyncSt "feature_units_plural": "featureUnitsPlural", "round": "UP", }, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -488,6 +536,8 @@ async def test_method_list_features_with_all_params(self, async_client: AsyncSti limit=1, meter_type=["None"], status=["NEW"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[FeatureListFeaturesResponse], feature, path=["response"]) @@ -517,7 +567,17 @@ async def test_streaming_response_list_features(self, async_client: AsyncStigg) @parametrize async def test_method_retrieve_feature(self, async_client: AsyncStigg) -> None: feature = await async_client.v1.features.retrieve_feature( - "x", + id="x", + ) + assert_matches_type(Feature, feature, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_feature_with_all_params(self, async_client: AsyncStigg) -> None: + feature = await async_client.v1.features.retrieve_feature( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -525,7 +585,7 @@ async def test_method_retrieve_feature(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_retrieve_feature(self, async_client: AsyncStigg) -> None: response = await async_client.v1.features.with_raw_response.retrieve_feature( - "x", + id="x", ) assert response.is_closed is True @@ -537,7 +597,7 @@ async def test_raw_response_retrieve_feature(self, async_client: AsyncStigg) -> @parametrize async def test_streaming_response_retrieve_feature(self, async_client: AsyncStigg) -> None: async with async_client.v1.features.with_streaming_response.retrieve_feature( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -552,14 +612,24 @@ async def test_streaming_response_retrieve_feature(self, async_client: AsyncStig async def test_path_params_retrieve_feature(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.features.with_raw_response.retrieve_feature( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_unarchive_feature(self, async_client: AsyncStigg) -> None: feature = await async_client.v1.features.unarchive_feature( - "x", + id="x", + ) + assert_matches_type(Feature, feature, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_unarchive_feature_with_all_params(self, async_client: AsyncStigg) -> None: + feature = await async_client.v1.features.unarchive_feature( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) @@ -567,7 +637,7 @@ async def test_method_unarchive_feature(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_unarchive_feature(self, async_client: AsyncStigg) -> None: response = await async_client.v1.features.with_raw_response.unarchive_feature( - "x", + id="x", ) assert response.is_closed is True @@ -579,7 +649,7 @@ async def test_raw_response_unarchive_feature(self, async_client: AsyncStigg) -> @parametrize async def test_streaming_response_unarchive_feature(self, async_client: AsyncStigg) -> None: async with async_client.v1.features.with_streaming_response.unarchive_feature( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -594,7 +664,7 @@ async def test_streaming_response_unarchive_feature(self, async_client: AsyncSti async def test_path_params_unarchive_feature(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.features.with_raw_response.unarchive_feature( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -645,6 +715,8 @@ async def test_method_update_feature_with_all_params(self, async_client: AsyncSt "feature_units_plural": "featureUnitsPlural", "round": "UP", }, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Feature, feature, path=["response"]) diff --git a/tests/api_resources/v1/test_plans.py b/tests/api_resources/v1/test_plans.py index 64b93e92..b6f479dc 100644 --- a/tests/api_resources/v1/test_plans.py +++ b/tests/api_resources/v1/test_plans.py @@ -58,6 +58,8 @@ def test_method_create_with_all_params(self, client: Stigg) -> None: parent_plan_id="parentPlanId", pricing_type="FREE", status="DRAFT", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -95,7 +97,17 @@ def test_streaming_response_create(self, client: Stigg) -> None: @parametrize def test_method_retrieve(self, client: Stigg) -> None: plan = client.v1.plans.retrieve( - "x", + id="x", + ) + assert_matches_type(Plan, plan, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Stigg) -> None: + plan = client.v1.plans.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -103,7 +115,7 @@ def test_method_retrieve(self, client: Stigg) -> None: @parametrize def test_raw_response_retrieve(self, client: Stigg) -> None: response = client.v1.plans.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -115,7 +127,7 @@ def test_raw_response_retrieve(self, client: Stigg) -> None: @parametrize def test_streaming_response_retrieve(self, client: Stigg) -> None: with client.v1.plans.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -130,7 +142,7 @@ def test_streaming_response_retrieve(self, client: Stigg) -> None: def test_path_params_retrieve(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.plans.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -268,6 +280,8 @@ def test_method_update_with_all_params(self, client: Stigg) -> None: display_name="displayName", metadata={"foo": "string"}, parent_plan_id="parentPlanId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -326,6 +340,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: limit=1, product_id="productId", status=["DRAFT"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[PlanListResponse], plan, path=["response"]) @@ -355,7 +371,17 @@ def test_streaming_response_list(self, client: Stigg) -> None: @parametrize def test_method_archive(self, client: Stigg) -> None: plan = client.v1.plans.archive( - "x", + id="x", + ) + assert_matches_type(Plan, plan, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_archive_with_all_params(self, client: Stigg) -> None: + plan = client.v1.plans.archive( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -363,7 +389,7 @@ def test_method_archive(self, client: Stigg) -> None: @parametrize def test_raw_response_archive(self, client: Stigg) -> None: response = client.v1.plans.with_raw_response.archive( - "x", + id="x", ) assert response.is_closed is True @@ -375,7 +401,7 @@ def test_raw_response_archive(self, client: Stigg) -> None: @parametrize def test_streaming_response_archive(self, client: Stigg) -> None: with client.v1.plans.with_streaming_response.archive( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -390,14 +416,24 @@ def test_streaming_response_archive(self, client: Stigg) -> None: def test_path_params_archive(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.plans.with_raw_response.archive( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_draft(self, client: Stigg) -> None: plan = client.v1.plans.create_draft( - "x", + id="x", + ) + assert_matches_type(Plan, plan, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_draft_with_all_params(self, client: Stigg) -> None: + plan = client.v1.plans.create_draft( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -405,7 +441,7 @@ def test_method_create_draft(self, client: Stigg) -> None: @parametrize def test_raw_response_create_draft(self, client: Stigg) -> None: response = client.v1.plans.with_raw_response.create_draft( - "x", + id="x", ) assert response.is_closed is True @@ -417,7 +453,7 @@ def test_raw_response_create_draft(self, client: Stigg) -> None: @parametrize def test_streaming_response_create_draft(self, client: Stigg) -> None: with client.v1.plans.with_streaming_response.create_draft( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -432,7 +468,7 @@ def test_streaming_response_create_draft(self, client: Stigg) -> None: def test_path_params_create_draft(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.plans.with_raw_response.create_draft( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -451,6 +487,8 @@ def test_method_list_charges_with_all_params(self, client: Stigg) -> None: after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[PlanListChargesResponse], plan, path=["response"]) @@ -504,6 +542,8 @@ def test_method_list_overage_charges_with_all_params(self, client: Stigg) -> Non after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[PlanListOverageChargesResponse], plan, path=["response"]) @@ -550,6 +590,17 @@ def test_method_publish(self, client: Stigg) -> None: ) assert_matches_type(PlanPublishResponse, plan, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_publish_with_all_params(self, client: Stigg) -> None: + plan = client.v1.plans.publish( + id="x", + migration_type="NEW_CUSTOMERS", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(PlanPublishResponse, plan, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_publish(self, client: Stigg) -> None: @@ -591,7 +642,17 @@ def test_path_params_publish(self, client: Stigg) -> None: @parametrize def test_method_remove_draft(self, client: Stigg) -> None: plan = client.v1.plans.remove_draft( - "x", + id="x", + ) + assert_matches_type(PlanRemoveDraftResponse, plan, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_remove_draft_with_all_params(self, client: Stigg) -> None: + plan = client.v1.plans.remove_draft( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(PlanRemoveDraftResponse, plan, path=["response"]) @@ -599,7 +660,7 @@ def test_method_remove_draft(self, client: Stigg) -> None: @parametrize def test_raw_response_remove_draft(self, client: Stigg) -> None: response = client.v1.plans.with_raw_response.remove_draft( - "x", + id="x", ) assert response.is_closed is True @@ -611,7 +672,7 @@ def test_raw_response_remove_draft(self, client: Stigg) -> None: @parametrize def test_streaming_response_remove_draft(self, client: Stigg) -> None: with client.v1.plans.with_streaming_response.remove_draft( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -626,7 +687,7 @@ def test_streaming_response_remove_draft(self, client: Stigg) -> None: def test_path_params_remove_draft(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.plans.with_raw_response.remove_draft( - "", + id="", ) @@ -667,6 +728,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncStigg) -> parent_plan_id="parentPlanId", pricing_type="FREE", status="DRAFT", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -704,7 +767,17 @@ async def test_streaming_response_create(self, async_client: AsyncStigg) -> None @parametrize async def test_method_retrieve(self, async_client: AsyncStigg) -> None: plan = await async_client.v1.plans.retrieve( - "x", + id="x", + ) + assert_matches_type(Plan, plan, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncStigg) -> None: + plan = await async_client.v1.plans.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -712,7 +785,7 @@ async def test_method_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: response = await async_client.v1.plans.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -724,7 +797,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> None: async with async_client.v1.plans.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -739,7 +812,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> No async def test_path_params_retrieve(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.plans.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -877,6 +950,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncStigg) -> display_name="displayName", metadata={"foo": "string"}, parent_plan_id="parentPlanId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -935,6 +1010,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No limit=1, product_id="productId", status=["DRAFT"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[PlanListResponse], plan, path=["response"]) @@ -964,7 +1041,17 @@ async def test_streaming_response_list(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_archive(self, async_client: AsyncStigg) -> None: plan = await async_client.v1.plans.archive( - "x", + id="x", + ) + assert_matches_type(Plan, plan, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_archive_with_all_params(self, async_client: AsyncStigg) -> None: + plan = await async_client.v1.plans.archive( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -972,7 +1059,7 @@ async def test_method_archive(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: response = await async_client.v1.plans.with_raw_response.archive( - "x", + id="x", ) assert response.is_closed is True @@ -984,7 +1071,7 @@ async def test_raw_response_archive(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_archive(self, async_client: AsyncStigg) -> None: async with async_client.v1.plans.with_streaming_response.archive( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -999,14 +1086,24 @@ async def test_streaming_response_archive(self, async_client: AsyncStigg) -> Non async def test_path_params_archive(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.plans.with_raw_response.archive( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_draft(self, async_client: AsyncStigg) -> None: plan = await async_client.v1.plans.create_draft( - "x", + id="x", + ) + assert_matches_type(Plan, plan, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_draft_with_all_params(self, async_client: AsyncStigg) -> None: + plan = await async_client.v1.plans.create_draft( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Plan, plan, path=["response"]) @@ -1014,7 +1111,7 @@ async def test_method_create_draft(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_create_draft(self, async_client: AsyncStigg) -> None: response = await async_client.v1.plans.with_raw_response.create_draft( - "x", + id="x", ) assert response.is_closed is True @@ -1026,7 +1123,7 @@ async def test_raw_response_create_draft(self, async_client: AsyncStigg) -> None @parametrize async def test_streaming_response_create_draft(self, async_client: AsyncStigg) -> None: async with async_client.v1.plans.with_streaming_response.create_draft( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1041,7 +1138,7 @@ async def test_streaming_response_create_draft(self, async_client: AsyncStigg) - async def test_path_params_create_draft(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.plans.with_raw_response.create_draft( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -1060,6 +1157,8 @@ async def test_method_list_charges_with_all_params(self, async_client: AsyncStig after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[PlanListChargesResponse], plan, path=["response"]) @@ -1113,6 +1212,8 @@ async def test_method_list_overage_charges_with_all_params(self, async_client: A after="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=1, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[PlanListOverageChargesResponse], plan, path=["response"]) @@ -1159,6 +1260,17 @@ async def test_method_publish(self, async_client: AsyncStigg) -> None: ) assert_matches_type(PlanPublishResponse, plan, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_publish_with_all_params(self, async_client: AsyncStigg) -> None: + plan = await async_client.v1.plans.publish( + id="x", + migration_type="NEW_CUSTOMERS", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(PlanPublishResponse, plan, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_publish(self, async_client: AsyncStigg) -> None: @@ -1200,7 +1312,17 @@ async def test_path_params_publish(self, async_client: AsyncStigg) -> None: @parametrize async def test_method_remove_draft(self, async_client: AsyncStigg) -> None: plan = await async_client.v1.plans.remove_draft( - "x", + id="x", + ) + assert_matches_type(PlanRemoveDraftResponse, plan, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_remove_draft_with_all_params(self, async_client: AsyncStigg) -> None: + plan = await async_client.v1.plans.remove_draft( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(PlanRemoveDraftResponse, plan, path=["response"]) @@ -1208,7 +1330,7 @@ async def test_method_remove_draft(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_remove_draft(self, async_client: AsyncStigg) -> None: response = await async_client.v1.plans.with_raw_response.remove_draft( - "x", + id="x", ) assert response.is_closed is True @@ -1220,7 +1342,7 @@ async def test_raw_response_remove_draft(self, async_client: AsyncStigg) -> None @parametrize async def test_streaming_response_remove_draft(self, async_client: AsyncStigg) -> None: async with async_client.v1.plans.with_streaming_response.remove_draft( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1235,5 +1357,5 @@ async def test_streaming_response_remove_draft(self, async_client: AsyncStigg) - async def test_path_params_remove_draft(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.plans.with_raw_response.remove_draft( - "", + id="", ) diff --git a/tests/api_resources/v1/test_products.py b/tests/api_resources/v1/test_products.py index 2e93d74b..5fb9fe92 100644 --- a/tests/api_resources/v1/test_products.py +++ b/tests/api_resources/v1/test_products.py @@ -26,7 +26,17 @@ class TestProducts: @parametrize def test_method_archive_product(self, client: Stigg) -> None: product = client.v1.products.archive_product( - "x", + id="x", + ) + assert_matches_type(Product, product, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_archive_product_with_all_params(self, client: Stigg) -> None: + product = client.v1.products.archive_product( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -34,7 +44,7 @@ def test_method_archive_product(self, client: Stigg) -> None: @parametrize def test_raw_response_archive_product(self, client: Stigg) -> None: response = client.v1.products.with_raw_response.archive_product( - "x", + id="x", ) assert response.is_closed is True @@ -46,7 +56,7 @@ def test_raw_response_archive_product(self, client: Stigg) -> None: @parametrize def test_streaming_response_archive_product(self, client: Stigg) -> None: with client.v1.products.with_streaming_response.archive_product( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -61,7 +71,7 @@ def test_streaming_response_archive_product(self, client: Stigg) -> None: def test_path_params_archive_product(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.products.with_raw_response.archive_product( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -82,6 +92,8 @@ def test_method_create_product_with_all_params(self, client: Stigg) -> None: description="description", metadata={"foo": "string"}, multiple_subscriptions=True, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -130,6 +142,8 @@ def test_method_duplicate_product_with_all_params(self, client: Stigg) -> None: target_id="targetId", description="description", display_name="displayName", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -191,6 +205,8 @@ def test_method_list_products_with_all_params(self, client: Stigg) -> None: }, limit=1, status=["PUBLISHED"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[ProductListProductsResponse], product, path=["response"]) @@ -220,7 +236,17 @@ def test_streaming_response_list_products(self, client: Stigg) -> None: @parametrize def test_method_unarchive_product(self, client: Stigg) -> None: product = client.v1.products.unarchive_product( - "x", + id="x", + ) + assert_matches_type(Product, product, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_unarchive_product_with_all_params(self, client: Stigg) -> None: + product = client.v1.products.unarchive_product( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -228,7 +254,7 @@ def test_method_unarchive_product(self, client: Stigg) -> None: @parametrize def test_raw_response_unarchive_product(self, client: Stigg) -> None: response = client.v1.products.with_raw_response.unarchive_product( - "x", + id="x", ) assert response.is_closed is True @@ -240,7 +266,7 @@ def test_raw_response_unarchive_product(self, client: Stigg) -> None: @parametrize def test_streaming_response_unarchive_product(self, client: Stigg) -> None: with client.v1.products.with_streaming_response.unarchive_product( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -255,7 +281,7 @@ def test_streaming_response_unarchive_product(self, client: Stigg) -> None: def test_path_params_unarchive_product(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.products.with_raw_response.unarchive_product( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -284,6 +310,8 @@ def test_method_update_product_with_all_params(self, client: Stigg) -> None: "subscription_start_plan_id": "subscriptionStartPlanId", }, usage_reset_cutoff_rule={"behavior": "NEVER_RESET"}, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -331,7 +359,17 @@ class TestAsyncProducts: @parametrize async def test_method_archive_product(self, async_client: AsyncStigg) -> None: product = await async_client.v1.products.archive_product( - "x", + id="x", + ) + assert_matches_type(Product, product, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_archive_product_with_all_params(self, async_client: AsyncStigg) -> None: + product = await async_client.v1.products.archive_product( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -339,7 +377,7 @@ async def test_method_archive_product(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_archive_product(self, async_client: AsyncStigg) -> None: response = await async_client.v1.products.with_raw_response.archive_product( - "x", + id="x", ) assert response.is_closed is True @@ -351,7 +389,7 @@ async def test_raw_response_archive_product(self, async_client: AsyncStigg) -> N @parametrize async def test_streaming_response_archive_product(self, async_client: AsyncStigg) -> None: async with async_client.v1.products.with_streaming_response.archive_product( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -366,7 +404,7 @@ async def test_streaming_response_archive_product(self, async_client: AsyncStigg async def test_path_params_archive_product(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.products.with_raw_response.archive_product( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -387,6 +425,8 @@ async def test_method_create_product_with_all_params(self, async_client: AsyncSt description="description", metadata={"foo": "string"}, multiple_subscriptions=True, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -435,6 +475,8 @@ async def test_method_duplicate_product_with_all_params(self, async_client: Asyn target_id="targetId", description="description", display_name="displayName", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -496,6 +538,8 @@ async def test_method_list_products_with_all_params(self, async_client: AsyncSti }, limit=1, status=["PUBLISHED"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[ProductListProductsResponse], product, path=["response"]) @@ -525,7 +569,17 @@ async def test_streaming_response_list_products(self, async_client: AsyncStigg) @parametrize async def test_method_unarchive_product(self, async_client: AsyncStigg) -> None: product = await async_client.v1.products.unarchive_product( - "x", + id="x", + ) + assert_matches_type(Product, product, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_unarchive_product_with_all_params(self, async_client: AsyncStigg) -> None: + product = await async_client.v1.products.unarchive_product( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) @@ -533,7 +587,7 @@ async def test_method_unarchive_product(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_unarchive_product(self, async_client: AsyncStigg) -> None: response = await async_client.v1.products.with_raw_response.unarchive_product( - "x", + id="x", ) assert response.is_closed is True @@ -545,7 +599,7 @@ async def test_raw_response_unarchive_product(self, async_client: AsyncStigg) -> @parametrize async def test_streaming_response_unarchive_product(self, async_client: AsyncStigg) -> None: async with async_client.v1.products.with_streaming_response.unarchive_product( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -560,7 +614,7 @@ async def test_streaming_response_unarchive_product(self, async_client: AsyncSti async def test_path_params_unarchive_product(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.products.with_raw_response.unarchive_product( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -589,6 +643,8 @@ async def test_method_update_product_with_all_params(self, async_client: AsyncSt "subscription_start_plan_id": "subscriptionStartPlanId", }, usage_reset_cutoff_rule={"behavior": "NEVER_RESET"}, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Product, product, path=["response"]) diff --git a/tests/api_resources/v1/test_subscriptions.py b/tests/api_resources/v1/test_subscriptions.py index ae7e82b8..73db6b8b 100644 --- a/tests/api_resources/v1/test_subscriptions.py +++ b/tests/api_resources/v1/test_subscriptions.py @@ -29,7 +29,17 @@ class TestSubscriptions: @parametrize def test_method_retrieve(self, client: Stigg) -> None: subscription = client.v1.subscriptions.retrieve( - "x", + id="x", + ) + assert_matches_type(Subscription, subscription, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Stigg) -> None: + subscription = client.v1.subscriptions.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Subscription, subscription, path=["response"]) @@ -37,7 +47,7 @@ def test_method_retrieve(self, client: Stigg) -> None: @parametrize def test_raw_response_retrieve(self, client: Stigg) -> None: response = client.v1.subscriptions.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -49,7 +59,7 @@ def test_raw_response_retrieve(self, client: Stigg) -> None: @parametrize def test_streaming_response_retrieve(self, client: Stigg) -> None: with client.v1.subscriptions.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -64,7 +74,7 @@ def test_streaming_response_retrieve(self, client: Stigg) -> None: def test_path_params_retrieve(self, client: Stigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.v1.subscriptions.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -176,6 +186,8 @@ def test_method_update_with_all_params(self, client: Stigg) -> None: promotion_code="promotionCode", schedule_strategy="END_OF_BILLING_PERIOD", trial_end_date=parse_datetime("2019-12-27T18:11:19.117Z"), + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Subscription, subscription, path=["response"]) @@ -237,6 +249,8 @@ def test_method_list_with_all_params(self, client: Stigg) -> None: pricing_type=["FREE"], resource_id="resourceId", status=["PAYMENT_PENDING"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SyncMyCursorIDPage[SubscriptionListResponse], subscription, path=["response"]) @@ -279,6 +293,8 @@ def test_method_cancel_with_all_params(self, client: Stigg) -> None: cancellation_time="END_OF_BILLING_PERIOD", end_date=parse_datetime("2019-12-27T18:11:19.117Z"), prorate=True, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Subscription, subscription, path=["response"]) @@ -325,6 +341,17 @@ def test_method_delegate(self, client: Stigg) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_delegate_with_all_params(self, client: Stigg) -> None: + subscription = client.v1.subscriptions.delegate( + id="x", + target_customer_id="targetCustomerId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(Subscription, subscription, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delegate(self, client: Stigg) -> None: @@ -407,6 +434,8 @@ def test_method_import_with_all_params(self, client: Stigg) -> None: } ], integration_id="integrationId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SubscriptionImportResponse, subscription, path=["response"]) @@ -462,6 +491,8 @@ def test_method_migrate_with_all_params(self, client: Stigg) -> None: subscription = client.v1.subscriptions.migrate( id="x", subscription_migration_time="END_OF_BILLING_PERIOD", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Subscription, subscription, path=["response"]) @@ -589,6 +620,8 @@ def test_method_preview_with_all_params(self, client: Stigg) -> None: "trial_end_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, unit_quantity=0, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SubscriptionPreviewResponse, subscription, path=["response"]) @@ -771,6 +804,8 @@ def test_method_provision_with_all_params(self, client: Stigg) -> None: "trial_end_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, unit_quantity=0, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SubscriptionProvisionResponse, subscription, path=["response"]) @@ -811,6 +846,17 @@ def test_method_transfer(self, client: Stigg) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_transfer_with_all_params(self, client: Stigg) -> None: + subscription = client.v1.subscriptions.transfer( + id="x", + destination_resource_id="destinationResourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(Subscription, subscription, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_transfer(self, client: Stigg) -> None: @@ -858,7 +904,17 @@ class TestAsyncSubscriptions: @parametrize async def test_method_retrieve(self, async_client: AsyncStigg) -> None: subscription = await async_client.v1.subscriptions.retrieve( - "x", + id="x", + ) + assert_matches_type(Subscription, subscription, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncStigg) -> None: + subscription = await async_client.v1.subscriptions.retrieve( + id="x", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Subscription, subscription, path=["response"]) @@ -866,7 +922,7 @@ async def test_method_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: response = await async_client.v1.subscriptions.with_raw_response.retrieve( - "x", + id="x", ) assert response.is_closed is True @@ -878,7 +934,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncStigg) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> None: async with async_client.v1.subscriptions.with_streaming_response.retrieve( - "x", + id="x", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -893,7 +949,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncStigg) -> No async def test_path_params_retrieve(self, async_client: AsyncStigg) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.v1.subscriptions.with_raw_response.retrieve( - "", + id="", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -1005,6 +1061,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncStigg) -> promotion_code="promotionCode", schedule_strategy="END_OF_BILLING_PERIOD", trial_end_date=parse_datetime("2019-12-27T18:11:19.117Z"), + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Subscription, subscription, path=["response"]) @@ -1066,6 +1124,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncStigg) -> No pricing_type=["FREE"], resource_id="resourceId", status=["PAYMENT_PENDING"], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(AsyncMyCursorIDPage[SubscriptionListResponse], subscription, path=["response"]) @@ -1108,6 +1168,8 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncStigg) -> cancellation_time="END_OF_BILLING_PERIOD", end_date=parse_datetime("2019-12-27T18:11:19.117Z"), prorate=True, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Subscription, subscription, path=["response"]) @@ -1154,6 +1216,17 @@ async def test_method_delegate(self, async_client: AsyncStigg) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_delegate_with_all_params(self, async_client: AsyncStigg) -> None: + subscription = await async_client.v1.subscriptions.delegate( + id="x", + target_customer_id="targetCustomerId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(Subscription, subscription, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delegate(self, async_client: AsyncStigg) -> None: @@ -1236,6 +1309,8 @@ async def test_method_import_with_all_params(self, async_client: AsyncStigg) -> } ], integration_id="integrationId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SubscriptionImportResponse, subscription, path=["response"]) @@ -1291,6 +1366,8 @@ async def test_method_migrate_with_all_params(self, async_client: AsyncStigg) -> subscription = await async_client.v1.subscriptions.migrate( id="x", subscription_migration_time="END_OF_BILLING_PERIOD", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(Subscription, subscription, path=["response"]) @@ -1418,6 +1495,8 @@ async def test_method_preview_with_all_params(self, async_client: AsyncStigg) -> "trial_end_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, unit_quantity=0, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SubscriptionPreviewResponse, subscription, path=["response"]) @@ -1600,6 +1679,8 @@ async def test_method_provision_with_all_params(self, async_client: AsyncStigg) "trial_end_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, unit_quantity=0, + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(SubscriptionProvisionResponse, subscription, path=["response"]) @@ -1640,6 +1721,17 @@ async def test_method_transfer(self, async_client: AsyncStigg) -> None: ) assert_matches_type(Subscription, subscription, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_transfer_with_all_params(self, async_client: AsyncStigg) -> None: + subscription = await async_client.v1.subscriptions.transfer( + id="x", + destination_resource_id="destinationResourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(Subscription, subscription, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_transfer(self, async_client: AsyncStigg) -> None: diff --git a/tests/api_resources/v1/test_usage.py b/tests/api_resources/v1/test_usage.py index f3c6fe12..777a028f 100644 --- a/tests/api_resources/v1/test_usage.py +++ b/tests/api_resources/v1/test_usage.py @@ -38,6 +38,8 @@ def test_method_history_with_all_params(self, client: Stigg) -> None: end_date=parse_datetime("2019-12-27T18:11:19.117Z"), group_by="groupBy", resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(UsageHistoryResponse, usage, path=["response"]) @@ -102,6 +104,26 @@ def test_method_report(self, client: Stigg) -> None: ) assert_matches_type(UsageReportResponse, usage, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_report_with_all_params(self, client: Stigg) -> None: + usage = client.v1.usage.report( + usages=[ + { + "customer_id": "customerId", + "feature_id": "featureId", + "value": -9007199254740991, + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "dimensions": {"foo": "string"}, + "resource_id": "resourceId", + "update_behavior": "DELTA", + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(UsageReportResponse, usage, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_report(self, client: Stigg) -> None: @@ -166,6 +188,8 @@ async def test_method_history_with_all_params(self, async_client: AsyncStigg) -> end_date=parse_datetime("2019-12-27T18:11:19.117Z"), group_by="groupBy", resource_id="resourceId", + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", ) assert_matches_type(UsageHistoryResponse, usage, path=["response"]) @@ -230,6 +254,26 @@ async def test_method_report(self, async_client: AsyncStigg) -> None: ) assert_matches_type(UsageReportResponse, usage, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_report_with_all_params(self, async_client: AsyncStigg) -> None: + usage = await async_client.v1.usage.report( + usages=[ + { + "customer_id": "customerId", + "feature_id": "featureId", + "value": -9007199254740991, + "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "dimensions": {"foo": "string"}, + "resource_id": "resourceId", + "update_behavior": "DELTA", + } + ], + x_account_id="X-ACCOUNT-ID", + x_environment_id="X-ENVIRONMENT-ID", + ) + assert_matches_type(UsageReportResponse, usage, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_report(self, async_client: AsyncStigg) -> None: diff --git a/tests/test_client.py b/tests/test_client.py index 7241c709..57e534e2 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -876,7 +876,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien respx_mock.get("/api/v1/customers/x").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - client.v1.customers.with_streaming_response.retrieve("x").__enter__() + client.v1.customers.with_streaming_response.retrieve(id="x").__enter__() assert _get_open_connections(client) == 0 @@ -886,7 +886,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client respx_mock.get("/api/v1/customers/x").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - client.v1.customers.with_streaming_response.retrieve("x").__enter__() + client.v1.customers.with_streaming_response.retrieve(id="x").__enter__() assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -915,7 +915,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/v1/customers/x").mock(side_effect=retry_handler) - response = client.v1.customers.with_raw_response.retrieve("x") + response = client.v1.customers.with_raw_response.retrieve(id="x") assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -938,7 +938,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/v1/customers/x").mock(side_effect=retry_handler) response = client.v1.customers.with_raw_response.retrieve( - "x", extra_headers={"x-stainless-retry-count": Omit()} + id="x", extra_headers={"x-stainless-retry-count": Omit()} ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -962,7 +962,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/v1/customers/x").mock(side_effect=retry_handler) - response = client.v1.customers.with_raw_response.retrieve("x", extra_headers={"x-stainless-retry-count": "42"}) + response = client.v1.customers.with_raw_response.retrieve( + id="x", extra_headers={"x-stainless-retry-count": "42"} + ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" @@ -1804,7 +1806,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, respx_mock.get("/api/v1/customers/x").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - await async_client.v1.customers.with_streaming_response.retrieve("x").__aenter__() + await async_client.v1.customers.with_streaming_response.retrieve(id="x").__aenter__() assert _get_open_connections(async_client) == 0 @@ -1814,7 +1816,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, respx_mock.get("/api/v1/customers/x").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - await async_client.v1.customers.with_streaming_response.retrieve("x").__aenter__() + await async_client.v1.customers.with_streaming_response.retrieve(id="x").__aenter__() assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -1843,7 +1845,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/v1/customers/x").mock(side_effect=retry_handler) - response = await client.v1.customers.with_raw_response.retrieve("x") + response = await client.v1.customers.with_raw_response.retrieve(id="x") assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1868,7 +1870,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/v1/customers/x").mock(side_effect=retry_handler) response = await client.v1.customers.with_raw_response.retrieve( - "x", extra_headers={"x-stainless-retry-count": Omit()} + id="x", extra_headers={"x-stainless-retry-count": Omit()} ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -1893,7 +1895,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.get("/api/v1/customers/x").mock(side_effect=retry_handler) response = await client.v1.customers.with_raw_response.retrieve( - "x", extra_headers={"x-stainless-retry-count": "42"} + id="x", extra_headers={"x-stainless-retry-count": "42"} ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" From af3a30e4b6d324299e56a4befea66a51c9728ec5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 19:11:27 +0000 Subject: [PATCH 2/2] release: 0.1.0-beta.18 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/stigg/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 379dddd8..159bd13c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-beta.17" + ".": "0.1.0-beta.18" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 958329dc..04acc7dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-beta.18 (2026-06-08) + +Full Changelog: [v0.1.0-beta.17...v0.1.0-beta.18](https://github.com/stiggio/stigg-python/compare/v0.1.0-beta.17...v0.1.0-beta.18) + +### Features + +* **api:** add x_account_id/x_environment_id header parameters across resources ([fb71370](https://github.com/stiggio/stigg-python/commit/fb7137024b31e2182b378c826a6725507dc93a85)) + ## 0.1.0-beta.17 (2026-06-08) Full Changelog: [v0.1.0-beta.16...v0.1.0-beta.17](https://github.com/stiggio/stigg-python/compare/v0.1.0-beta.16...v0.1.0-beta.17) diff --git a/pyproject.toml b/pyproject.toml index e0719992..226ae12d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "stigg" -version = "0.1.0-beta.17" +version = "0.1.0-beta.18" description = "The official Python library for the stigg API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/stigg/_version.py b/src/stigg/_version.py index 90832302..c75cdf1a 100644 --- a/src/stigg/_version.py +++ b/src/stigg/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "stigg" -__version__ = "0.1.0-beta.17" # x-release-please-version +__version__ = "0.1.0-beta.18" # x-release-please-version