diff --git a/.fern/metadata.json b/.fern/metadata.json
index b564d36..9046ea2 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -23,10 +23,10 @@
}
]
},
- "originGitCommit": "8cfe954dda14329fc30a4f80b915db0acf608382",
+ "originGitCommit": "1ab5d36abb4de887dde605f8b82a71dce464a26b",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
- "requestedVersion": "1.3.3",
+ "requestedVersion": "1.3.4",
"ciProvider": "github",
- "sdkVersion": "1.3.3"
+ "sdkVersion": "1.3.4"
}
\ No newline at end of file
diff --git a/.fern/replay.lock b/.fern/replay.lock
index ba9adcc..9f1bc96 100644
--- a/.fern/replay.lock
+++ b/.fern/replay.lock
@@ -36,5 +36,11 @@ generations:
cli_version: unknown
generator_versions:
fernapi/fern-python-sdk: 5.14.20
-current_generation: 3bcc19082dd0caee045848158261be377bf337d5
+ - commit_sha: 8aa4bf79b129c7358ec7ed929cd639ac19bd98aa
+ tree_hash: 60db7260844b61bfbf5d41fa4b3dfc135ab29a9f
+ timestamp: 2026-08-17T10:10:48.019Z
+ cli_version: unknown
+ generator_versions:
+ fernapi/fern-python-sdk: 5.14.20
+current_generation: 8aa4bf79b129c7358ec7ed929cd639ac19bd98aa
patches: []
diff --git a/poetry.lock b/poetry.lock
index c1f782d..d08e241 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1316,14 +1316,14 @@ files = [
[[package]]
name = "typing-inspection"
-version = "0.4.3"
+version = "0.4.4"
description = "Runtime typing introspection tools"
optional = false
python-versions = ">=3.10"
groups = ["main"]
files = [
- {file = "typing_inspection-0.4.3-py3-none-any.whl", hash = "sha256:5f42b23858a91e0b4ef521f5418f03a0da3c9216fd2995ef5e73463100e676cd"},
- {file = "typing_inspection-0.4.3.tar.gz", hash = "sha256:c5f9ec1530b5c1e2c9bc34a84d9a3466ed1b2f3f2fa9f901368d9c5596210e4d"},
+ {file = "typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147"},
+ {file = "typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47"},
]
[package.dependencies]
diff --git a/pyproject.toml b/pyproject.toml
index 1102244..ab92619 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ dynamic = ["version"]
[tool.poetry]
name = "schematichq"
-version = "1.3.3"
+version = "1.3.4"
description = ""
readme = "README.md"
authors = []
diff --git a/reference.md b/reference.md
index 375ec45..8865d05 100644
--- a/reference.md
+++ b/reference.md
@@ -1389,6 +1389,136 @@ client.accounts.delete_environment(
+
+
+
+
+client.accounts.get_onboarding_state() -> GetOnboardingStateResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from schematic import Schematic
+from schematic.environment import SchematicEnvironment
+
+client = Schematic(
+ api_key="",
+ environment=SchematicEnvironment.DEFAULT,
+)
+
+client.accounts.get_onboarding_state()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounts.update_onboarding_state(...) -> UpdateOnboardingStateResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from schematic import Schematic
+from schematic.environment import SchematicEnvironment
+
+client = Schematic(
+ api_key="",
+ environment=SchematicEnvironment.DEFAULT,
+)
+
+client.accounts.update_onboarding_state()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**path:** `typing.Optional[OnboardingPath]`
+
+
+
+
+
+-
+
+**pricing_page_url:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**track:** `typing.Optional[OnboardingTrack]`
+
+
+
+
+
+-
+
+**website_url:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
@@ -5138,6 +5268,14 @@ client.credits.create_credit_bundle(
-
+**compatible_plan_ids:** `typing.Optional[typing.List[str]]` — Plans whose companies may purchase this bundle. Omitted or empty means the bundle is purchasable on every plan.
+
+
+
+
+
+-
+
**currency_prices:** `typing.Optional[typing.List[CreditBundleCurrencyPriceRequestBody]]`
@@ -5330,6 +5468,14 @@ client.credits.update_credit_bundle_details(
-
+**compatible_plan_ids:** `typing.Optional[typing.List[str]]` — Plans whose companies may purchase this bundle. Omitted leaves compatibility unchanged; empty resets the bundle to purchasable on every plan.
+
+
+
+
+
+-
+
**currency_prices:** `typing.Optional[typing.List[CreditBundleCurrencyPriceRequestBody]]`
@@ -10984,6 +11130,124 @@ client.companies.update_entity_trait_definition(
+
+
+
+
+client.companies.delete_entity_trait_definition(...) -> DeleteEntityTraitDefinitionResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from schematic import Schematic
+from schematic.environment import SchematicEnvironment
+
+client = Schematic(
+ api_key="",
+ environment=SchematicEnvironment.DEFAULT,
+)
+
+client.companies.delete_entity_trait_definition(
+ entity_trait_definition_id="entity_trait_definition_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_trait_definition_id:** `str` — entity_trait_definition_id
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.companies.get_entity_trait_definition_usage(...) -> GetEntityTraitDefinitionUsageResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from schematic import Schematic
+from schematic.environment import SchematicEnvironment
+
+client = Schematic(
+ api_key="",
+ environment=SchematicEnvironment.DEFAULT,
+)
+
+client.companies.get_entity_trait_definition_usage(
+ entity_trait_definition_id="entity_trait_definition_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_trait_definition_id:** `str` — entity_trait_definition_id
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
@@ -11187,6 +11451,92 @@ client.companies.get_entity_trait_values(
+
+
+
+
+client.companies.count_entity_traits(...) -> CountEntityTraitsResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from schematic import Schematic
+from schematic.environment import SchematicEnvironment
+
+client = Schematic(
+ api_key="",
+ environment=SchematicEnvironment.DEFAULT,
+)
+
+client.companies.count_entity_traits(
+ definition_id="definition_id",
+ entity_type="company",
+ limit=1000000,
+ offset=1000000,
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**definition_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**entity_type:** `typing.Optional[EntityType]`
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Page limit (default 100)
+
+
+
+
+
+-
+
+**offset:** `typing.Optional[int]` — Page offset (default 0)
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
@@ -11219,9 +11569,6 @@ client.companies.list_plan_changes(
company_ids=[
"company_ids"
],
- plan_ids=[
- "plan_ids"
- ],
limit=1000000,
offset=1000000,
)
@@ -11272,14 +11619,6 @@ client.companies.list_plan_changes(
-
-**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
-
-
-
-
-
--
-
**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -15480,7 +15819,7 @@ client = Schematic(
)
client.plans.update_company_plans(
- company_plan_id="company_plan_id",
+ company_id="company_id",
add_on_ids=[
"add_on_ids"
],
@@ -15500,7 +15839,7 @@ client.plans.update_company_plans(
-
-**company_plan_id:** `str` — company_plan_id
+**company_id:** `str` — company_id
@@ -15560,6 +15899,7 @@ client = Schematic(
client.plans.list_custom_plan_billings(
company_id="company_id",
plan_id="plan_id",
+ plan_billing_source="custom_plan",
status="active",
statuses=[
"active"
@@ -15598,6 +15938,14 @@ client.plans.list_custom_plan_billings(
-
+**plan_billing_source:** `typing.Optional[PlanBillingSource]` — Filter by the flow that created the billing record. Defaults to custom_plan.
+
+
+
+
+
+-
+
**status:** `typing.Optional[CustomPlanBillingStatus]` — Filter by billing status
@@ -17005,7 +17353,7 @@ client = Schematic(
)
client.plans.delete_plan_version(
- plan_id="plan_id",
+ plan_version_id="plan_version_id",
promote_archived_version=True,
)
@@ -17023,7 +17371,7 @@ client.plans.delete_plan_version(
-
-**plan_id:** `str` — plan_id
+**plan_version_id:** `str` — plan_version_id
@@ -17073,7 +17421,7 @@ client = Schematic(
)
client.plans.publish_plan_version(
- plan_id="plan_id",
+ plan_version_id="plan_version_id",
excluded_company_ids=[
"excluded_company_ids"
],
@@ -17094,7 +17442,7 @@ client.plans.publish_plan_version(
-
-**plan_id:** `str` — plan_id
+**plan_version_id:** `str` — plan_version_id
@@ -17174,6 +17522,14 @@ client.plans.publish_plan_version(
-
+**proration_behavior:** `typing.Optional[MigrationProrationBehavior]`
+
+
+
+
+
+-
+
**send_invoice:** `typing.Optional[bool]` — Whether Stripe emails the invoice when it is finalized. Defaults to true.
@@ -17974,7 +18330,7 @@ client = Schematic(
)
client.planbundle.update_plan_bundle(
- plan_bundle_id="plan_bundle_id",
+ plan_id="plan_id",
entitlements=[
PlanBundleEntitlementRequestBody(
action="create",
@@ -17996,7 +18352,7 @@ client.planbundle.update_plan_bundle(
-
-**plan_bundle_id:** `str` — plan_bundle_id
+**plan_id:** `str` — plan_id
@@ -21717,9 +22073,11 @@ client.plangroups.create_plan_group(
add_on_ids=[
"add_on_ids"
],
+ checkout_bundle_purchase_behavior="individual",
checkout_collect_address=True,
checkout_collect_email=True,
checkout_collect_phone=True,
+ checkout_collect_tax_id=True,
enable_tax_collection=True,
opt_in_enabled=True,
ordered_add_ons=[
@@ -21771,6 +22129,14 @@ client.plangroups.create_plan_group(
-
+**checkout_bundle_purchase_behavior:** `CheckoutBundlePurchaseBehavior`
+
+
+
+
+
+-
+
**checkout_collect_address:** `bool`
@@ -21795,6 +22161,14 @@ client.plangroups.create_plan_group(
-
+**checkout_collect_tax_id:** `bool`
+
+
+
+
+
+-
+
**enable_tax_collection:** `bool`
@@ -22089,9 +22463,11 @@ client.plangroups.update_plan_group(
add_on_ids=[
"add_on_ids"
],
+ checkout_bundle_purchase_behavior="individual",
checkout_collect_address=True,
checkout_collect_email=True,
checkout_collect_phone=True,
+ checkout_collect_tax_id=True,
enable_tax_collection=True,
opt_in_enabled=True,
ordered_add_ons=[
@@ -22151,6 +22527,14 @@ client.plangroups.update_plan_group(
-
+**checkout_bundle_purchase_behavior:** `CheckoutBundlePurchaseBehavior`
+
+
+
+
+
+-
+
**checkout_collect_address:** `bool`
@@ -22175,6 +22559,14 @@ client.plangroups.update_plan_group(
-
+**checkout_collect_tax_id:** `bool`
+
+
+
+
+
+-
+
**enable_tax_collection:** `bool`
@@ -22801,17 +23193,8 @@ client = Schematic(
)
client.planmigrations.create_migration(
- company_ids=[
- "company_ids"
- ],
- excluded_company_ids=[
- "excluded_company_ids"
- ],
plan_id="plan_id",
plan_version_id_to="plan_version_id_to",
- plan_version_ids_from=[
- "plan_version_ids_from"
- ],
strategy="immediate",
target_plan_type="plan",
)
@@ -22830,7 +23213,7 @@ client.planmigrations.create_migration(
-
-**company_ids:** `typing.List[str]`
+**plan_id:** `str`
@@ -22838,7 +23221,7 @@ client.planmigrations.create_migration(
-
-**excluded_company_ids:** `typing.List[str]`
+**plan_version_id_to:** `str`
@@ -22846,7 +23229,7 @@ client.planmigrations.create_migration(
-
-**plan_id:** `str`
+**strategy:** `PlanVersionMigrationStrategy`
@@ -22854,7 +23237,7 @@ client.planmigrations.create_migration(
-
-**plan_version_id_to:** `str`
+**target_plan_type:** `PlanType`
@@ -22862,7 +23245,7 @@ client.planmigrations.create_migration(
-
-**plan_version_ids_from:** `typing.List[str]`
+**company_ids:** `typing.Optional[typing.List[str]]`
@@ -22870,7 +23253,7 @@ client.planmigrations.create_migration(
-
-**strategy:** `PlanVersionMigrationStrategy`
+**excluded_company_ids:** `typing.Optional[typing.List[str]]`
@@ -22878,7 +23261,15 @@ client.planmigrations.create_migration(
-
-**target_plan_type:** `PlanType`
+**plan_version_ids_from:** `typing.Optional[typing.List[str]]`
+
+
+
+
+
+-
+
+**proration_behavior:** `typing.Optional[MigrationProrationBehavior]`
@@ -23135,9 +23526,6 @@ client = Schematic(
)
client.planmigrations.preview_migration(
- company_ids=[
- "company_ids"
- ],
plan_id="plan_id",
plan_version_id_to="plan_version_id_to",
target_plan_type="plan",
@@ -23157,7 +23545,7 @@ client.planmigrations.preview_migration(
-
-**company_ids:** `typing.List[str]`
+**plan_id:** `str`
@@ -23165,7 +23553,7 @@ client.planmigrations.preview_migration(
-
-**plan_id:** `str`
+**plan_version_id_to:** `str`
@@ -23173,7 +23561,7 @@ client.planmigrations.preview_migration(
-
-**plan_version_id_to:** `str`
+**target_plan_type:** `PlanType`
@@ -23181,7 +23569,15 @@ client.planmigrations.preview_migration(
-
-**target_plan_type:** `PlanType`
+**company_ids:** `typing.Optional[typing.List[str]]`
+
+
+
+
+
+-
+
+**plan_version_ids_from:** `typing.Optional[typing.List[str]]`
diff --git a/src/schematic/__init__.py b/src/schematic/__init__.py
index a5c459d..4d37d9d 100644
--- a/src/schematic/__init__.py
+++ b/src/schematic/__init__.py
@@ -21,6 +21,7 @@
AuditLogExportMetadata,
AuditLogListResponseData,
AuditLogResponseData,
+ BillingCollectionMethod,
BillingCouponResponseData,
BillingCreditAutoTopupAvailability,
BillingCreditBundleResponseData,
@@ -89,6 +90,7 @@
CheckFlagResponseData,
CheckFlagsBulkResponseData,
CheckFlagsResponseData,
+ CheckoutBundlePurchaseBehavior,
CheckoutDataResponseData,
CheckoutFieldInput,
CheckoutFieldResponseData,
@@ -216,6 +218,7 @@
EntityKeyDetailResponseData,
EntityKeyResponseData,
EntityTraitDefinitionResponseData,
+ EntityTraitDefinitionUsage,
EntityTraitDetailResponseData,
EntityTraitResponseData,
EntityTraitValue,
@@ -259,6 +262,7 @@
FlagType,
FlagView,
GenericPreviewObject,
+ GetOnboardingStateResp,
InsightsSummaryResponseData,
InstallIntegrationRequestBody,
IntegrationCapabilities,
@@ -293,11 +297,20 @@
MetricPeriodMonthReset,
MetronomeIntegrationConfig,
MigrationErrorCode,
+ MigrationProrationBehavior,
MrrResponseData,
+ OnboardingMilestone,
+ OnboardingMilestoneView,
+ OnboardingPath,
+ OnboardingRequirement,
+ OnboardingRequirementStatus,
+ OnboardingRequirementView,
+ OnboardingTrack,
OrbIntegrationConfig,
OrderedPlansInGroup,
PaymentMethodRequestBody,
PaymentMethodResponseData,
+ PlanBillingSource,
PlanBundleAction,
PlanBundleCreditGrantRequestBody,
PlanBundleEntitlementRequestBody,
@@ -490,6 +503,7 @@
GetApiKeyResponse,
GetAuditLogResponse,
GetEnvironmentResponse,
+ GetOnboardingStateResponse,
GetWhoAmIResponse,
ListAccountMembersParams,
ListAccountMembersResponse,
@@ -502,6 +516,7 @@
QuickstartResponse,
UpdateApiKeyResponse,
UpdateEnvironmentResponse,
+ UpdateOnboardingStateResponse,
)
from .billing import (
CountBillingProductsParams,
@@ -573,6 +588,8 @@
CountEntityKeysResponse,
CountEntityTraitDefinitionsParams,
CountEntityTraitDefinitionsResponse,
+ CountEntityTraitsParams,
+ CountEntityTraitsResponse,
CountPlanTraitsParams,
CountPlanTraitsResponse,
CountUsersParams,
@@ -584,6 +601,7 @@
DeleteCompanyParams,
DeleteCompanyResponse,
DeleteEntityKeyDefinitionResponse,
+ DeleteEntityTraitDefinitionResponse,
DeleteUserByKeysResponse,
DeleteUserResponse,
GetActiveCompanySubscriptionParams,
@@ -594,6 +612,7 @@
GetCompanyBillingEntityResponse,
GetCompanyResponse,
GetEntityTraitDefinitionResponse,
+ GetEntityTraitDefinitionUsageResponse,
GetEntityTraitValuesParams,
GetEntityTraitValuesResponse,
GetOrCreateCompanyMembershipResponse,
@@ -887,6 +906,7 @@
"AuditLogListResponseData": ".types",
"AuditLogResponseData": ".types",
"BadRequestError": ".errors",
+ "BillingCollectionMethod": ".types",
"BillingCouponResponseData": ".types",
"BillingCreditAutoTopupAvailability": ".types",
"BillingCreditBundleResponseData": ".types",
@@ -960,6 +980,7 @@
"CheckFlagsBulkResponseData": ".types",
"CheckFlagsResponse": ".features",
"CheckFlagsResponseData": ".types",
+ "CheckoutBundlePurchaseBehavior": ".types",
"CheckoutDataResponseData": ".types",
"CheckoutFieldInput": ".types",
"CheckoutFieldResponseData": ".types",
@@ -1052,6 +1073,8 @@
"CountEntityKeysResponse": ".companies",
"CountEntityTraitDefinitionsParams": ".companies",
"CountEntityTraitDefinitionsResponse": ".companies",
+ "CountEntityTraitsParams": ".companies",
+ "CountEntityTraitsResponse": ".companies",
"CountFeatureCompaniesParams": ".entitlements",
"CountFeatureCompaniesResponse": ".entitlements",
"CountFeatureUsageParams": ".entitlements",
@@ -1182,6 +1205,7 @@
"DeleteComponentResponse": ".components",
"DeleteCreditBundleResponse": ".credits",
"DeleteEntityKeyDefinitionResponse": ".companies",
+ "DeleteEntityTraitDefinitionResponse": ".companies",
"DeleteEnvironmentResponse": ".accounts",
"DeleteFeatureResponse": ".features",
"DeleteFlagResponse": ".features",
@@ -1207,6 +1231,7 @@
"EntityKeyDetailResponseData": ".types",
"EntityKeyResponseData": ".types",
"EntityTraitDefinitionResponseData": ".types",
+ "EntityTraitDefinitionUsage": ".types",
"EntityTraitDetailResponseData": ".types",
"EntityTraitResponseData": ".types",
"EntityTraitValue": ".types",
@@ -1275,6 +1300,7 @@
"GetDataExportResponse": ".dataexports",
"GetDerivedFeaturesResponse": ".catalogs",
"GetEntityTraitDefinitionResponse": ".companies",
+ "GetEntityTraitDefinitionUsageResponse": ".companies",
"GetEntityTraitValuesParams": ".companies",
"GetEntityTraitValuesResponse": ".companies",
"GetEnvironmentFeatureUsageTimeSeriesParams": ".insights",
@@ -1293,6 +1319,8 @@
"GetFlagResponse": ".features",
"GetIntegrationWebhookUrlResponse": ".integrationsapi",
"GetMigrationResponse": ".planmigrations",
+ "GetOnboardingStateResp": ".types",
+ "GetOnboardingStateResponse": ".accounts",
"GetOrCreateCompanyMembershipResponse": ".companies",
"GetOrCreateEntityTraitDefinitionResponse": ".companies",
"GetPlanChangeResponse": ".companies",
@@ -1465,12 +1493,21 @@
"MetricPeriodMonthReset": ".types",
"MetronomeIntegrationConfig": ".types",
"MigrationErrorCode": ".types",
+ "MigrationProrationBehavior": ".types",
"MrrResponseData": ".types",
"NotFoundError": ".errors",
+ "OnboardingMilestone": ".types",
+ "OnboardingMilestoneView": ".types",
+ "OnboardingPath": ".types",
+ "OnboardingRequirement": ".types",
+ "OnboardingRequirementStatus": ".types",
+ "OnboardingRequirementView": ".types",
+ "OnboardingTrack": ".types",
"OrbIntegrationConfig": ".types",
"OrderedPlansInGroup": ".types",
"PaymentMethodRequestBody": ".types",
"PaymentMethodResponseData": ".types",
+ "PlanBillingSource": ".types",
"PlanBundleAction": ".types",
"PlanBundleCreditGrantRequestBody": ".types",
"PlanBundleEntitlementRequestBody": ".types",
@@ -1622,6 +1659,7 @@
"UpdateFeatureResponse": ".features",
"UpdateFlagResponse": ".features",
"UpdateFlagRulesResponse": ".features",
+ "UpdateOnboardingStateResponse": ".accounts",
"UpdatePayInAdvanceRequestBody": ".types",
"UpdatePlanBundleResponse": ".planbundle",
"UpdatePlanEntitlementResponse": ".entitlements",
@@ -1747,6 +1785,7 @@ def __dir__():
"AuditLogListResponseData",
"AuditLogResponseData",
"BadRequestError",
+ "BillingCollectionMethod",
"BillingCouponResponseData",
"BillingCreditAutoTopupAvailability",
"BillingCreditBundleResponseData",
@@ -1820,6 +1859,7 @@ def __dir__():
"CheckFlagsBulkResponseData",
"CheckFlagsResponse",
"CheckFlagsResponseData",
+ "CheckoutBundlePurchaseBehavior",
"CheckoutDataResponseData",
"CheckoutFieldInput",
"CheckoutFieldResponseData",
@@ -1912,6 +1952,8 @@ def __dir__():
"CountEntityKeysResponse",
"CountEntityTraitDefinitionsParams",
"CountEntityTraitDefinitionsResponse",
+ "CountEntityTraitsParams",
+ "CountEntityTraitsResponse",
"CountFeatureCompaniesParams",
"CountFeatureCompaniesResponse",
"CountFeatureUsageParams",
@@ -2042,6 +2084,7 @@ def __dir__():
"DeleteComponentResponse",
"DeleteCreditBundleResponse",
"DeleteEntityKeyDefinitionResponse",
+ "DeleteEntityTraitDefinitionResponse",
"DeleteEnvironmentResponse",
"DeleteFeatureResponse",
"DeleteFlagResponse",
@@ -2067,6 +2110,7 @@ def __dir__():
"EntityKeyDetailResponseData",
"EntityKeyResponseData",
"EntityTraitDefinitionResponseData",
+ "EntityTraitDefinitionUsage",
"EntityTraitDetailResponseData",
"EntityTraitResponseData",
"EntityTraitValue",
@@ -2135,6 +2179,7 @@ def __dir__():
"GetDataExportResponse",
"GetDerivedFeaturesResponse",
"GetEntityTraitDefinitionResponse",
+ "GetEntityTraitDefinitionUsageResponse",
"GetEntityTraitValuesParams",
"GetEntityTraitValuesResponse",
"GetEnvironmentFeatureUsageTimeSeriesParams",
@@ -2153,6 +2198,8 @@ def __dir__():
"GetFlagResponse",
"GetIntegrationWebhookUrlResponse",
"GetMigrationResponse",
+ "GetOnboardingStateResp",
+ "GetOnboardingStateResponse",
"GetOrCreateCompanyMembershipResponse",
"GetOrCreateEntityTraitDefinitionResponse",
"GetPlanChangeResponse",
@@ -2325,12 +2372,21 @@ def __dir__():
"MetricPeriodMonthReset",
"MetronomeIntegrationConfig",
"MigrationErrorCode",
+ "MigrationProrationBehavior",
"MrrResponseData",
"NotFoundError",
+ "OnboardingMilestone",
+ "OnboardingMilestoneView",
+ "OnboardingPath",
+ "OnboardingRequirement",
+ "OnboardingRequirementStatus",
+ "OnboardingRequirementView",
+ "OnboardingTrack",
"OrbIntegrationConfig",
"OrderedPlansInGroup",
"PaymentMethodRequestBody",
"PaymentMethodResponseData",
+ "PlanBillingSource",
"PlanBundleAction",
"PlanBundleCreditGrantRequestBody",
"PlanBundleEntitlementRequestBody",
@@ -2482,6 +2538,7 @@ def __dir__():
"UpdateFeatureResponse",
"UpdateFlagResponse",
"UpdateFlagRulesResponse",
+ "UpdateOnboardingStateResponse",
"UpdatePayInAdvanceRequestBody",
"UpdatePlanBundleResponse",
"UpdatePlanEntitlementResponse",
diff --git a/src/schematic/accounts/__init__.py b/src/schematic/accounts/__init__.py
index 28b75c7..7e1d405 100644
--- a/src/schematic/accounts/__init__.py
+++ b/src/schematic/accounts/__init__.py
@@ -21,6 +21,7 @@
GetApiKeyResponse,
GetAuditLogResponse,
GetEnvironmentResponse,
+ GetOnboardingStateResponse,
GetWhoAmIResponse,
ListAccountMembersParams,
ListAccountMembersResponse,
@@ -33,6 +34,7 @@
QuickstartResponse,
UpdateApiKeyResponse,
UpdateEnvironmentResponse,
+ UpdateOnboardingStateResponse,
)
_dynamic_imports: typing.Dict[str, str] = {
"CountAccountMembersParams": ".types",
@@ -49,6 +51,7 @@
"GetApiKeyResponse": ".types",
"GetAuditLogResponse": ".types",
"GetEnvironmentResponse": ".types",
+ "GetOnboardingStateResponse": ".types",
"GetWhoAmIResponse": ".types",
"ListAccountMembersParams": ".types",
"ListAccountMembersResponse": ".types",
@@ -61,6 +64,7 @@
"QuickstartResponse": ".types",
"UpdateApiKeyResponse": ".types",
"UpdateEnvironmentResponse": ".types",
+ "UpdateOnboardingStateResponse": ".types",
}
@@ -100,6 +104,7 @@ def __dir__():
"GetApiKeyResponse",
"GetAuditLogResponse",
"GetEnvironmentResponse",
+ "GetOnboardingStateResponse",
"GetWhoAmIResponse",
"ListAccountMembersParams",
"ListAccountMembersResponse",
@@ -112,4 +117,5 @@ def __dir__():
"QuickstartResponse",
"UpdateApiKeyResponse",
"UpdateEnvironmentResponse",
+ "UpdateOnboardingStateResponse",
]
diff --git a/src/schematic/accounts/client.py b/src/schematic/accounts/client.py
index e5dd1ed..760fd4c 100644
--- a/src/schematic/accounts/client.py
+++ b/src/schematic/accounts/client.py
@@ -8,6 +8,8 @@
from ..types.account_member_role import AccountMemberRole
from ..types.actor_type import ActorType
from ..types.environment_type import EnvironmentType
+from ..types.onboarding_path import OnboardingPath
+from ..types.onboarding_track import OnboardingTrack
from .raw_client import AsyncRawAccountsClient, RawAccountsClient
from .types.count_account_members_response import CountAccountMembersResponse
from .types.count_api_keys_response import CountApiKeysResponse
@@ -20,6 +22,7 @@
from .types.get_api_key_response import GetApiKeyResponse
from .types.get_audit_log_response import GetAuditLogResponse
from .types.get_environment_response import GetEnvironmentResponse
+from .types.get_onboarding_state_response import GetOnboardingStateResponse
from .types.get_who_am_i_response import GetWhoAmIResponse
from .types.list_account_members_response import ListAccountMembersResponse
from .types.list_api_keys_response import ListApiKeysResponse
@@ -28,6 +31,7 @@
from .types.quickstart_response import QuickstartResponse
from .types.update_api_key_response import UpdateApiKeyResponse
from .types.update_environment_response import UpdateEnvironmentResponse
+from .types.update_onboarding_state_response import UpdateOnboardingStateResponse
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
@@ -821,6 +825,78 @@ def delete_environment(
_response = self._raw_client.delete_environment(environment_id, request_options=request_options)
return _response.data
+ def get_onboarding_state(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> GetOnboardingStateResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetOnboardingStateResponse
+ OK
+
+ Examples
+ --------
+ from schematic import Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.get_onboarding_state()
+ """
+ _response = self._raw_client.get_onboarding_state(request_options=request_options)
+ return _response.data
+
+ def update_onboarding_state(
+ self,
+ *,
+ path: typing.Optional[OnboardingPath] = OMIT,
+ pricing_page_url: typing.Optional[str] = OMIT,
+ track: typing.Optional[OnboardingTrack] = OMIT,
+ website_url: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> UpdateOnboardingStateResponse:
+ """
+ Parameters
+ ----------
+ path : typing.Optional[OnboardingPath]
+
+ pricing_page_url : typing.Optional[str]
+
+ track : typing.Optional[OnboardingTrack]
+
+ website_url : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UpdateOnboardingStateResponse
+ OK
+
+ Examples
+ --------
+ from schematic import Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.accounts.update_onboarding_state()
+ """
+ _response = self._raw_client.update_onboarding_state(
+ path=path,
+ pricing_page_url=pricing_page_url,
+ track=track,
+ website_url=website_url,
+ request_options=request_options,
+ )
+ return _response.data
+
def quickstart(self, *, request_options: typing.Optional[RequestOptions] = None) -> QuickstartResponse:
"""
Parameters
@@ -1792,6 +1868,94 @@ async def main() -> None:
_response = await self._raw_client.delete_environment(environment_id, request_options=request_options)
return _response.data
+ async def get_onboarding_state(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> GetOnboardingStateResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetOnboardingStateResponse
+ OK
+
+ Examples
+ --------
+ import asyncio
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.accounts.get_onboarding_state()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.get_onboarding_state(request_options=request_options)
+ return _response.data
+
+ async def update_onboarding_state(
+ self,
+ *,
+ path: typing.Optional[OnboardingPath] = OMIT,
+ pricing_page_url: typing.Optional[str] = OMIT,
+ track: typing.Optional[OnboardingTrack] = OMIT,
+ website_url: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> UpdateOnboardingStateResponse:
+ """
+ Parameters
+ ----------
+ path : typing.Optional[OnboardingPath]
+
+ pricing_page_url : typing.Optional[str]
+
+ track : typing.Optional[OnboardingTrack]
+
+ website_url : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UpdateOnboardingStateResponse
+ OK
+
+ Examples
+ --------
+ import asyncio
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.accounts.update_onboarding_state()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.update_onboarding_state(
+ path=path,
+ pricing_page_url=pricing_page_url,
+ track=track,
+ website_url=website_url,
+ request_options=request_options,
+ )
+ return _response.data
+
async def quickstart(self, *, request_options: typing.Optional[RequestOptions] = None) -> QuickstartResponse:
"""
Parameters
diff --git a/src/schematic/accounts/raw_client.py b/src/schematic/accounts/raw_client.py
index 1ee1ed7..d5c0121 100644
--- a/src/schematic/accounts/raw_client.py
+++ b/src/schematic/accounts/raw_client.py
@@ -21,6 +21,8 @@
from ..types.actor_type import ActorType
from ..types.api_error import ApiError as types_api_error_ApiError
from ..types.environment_type import EnvironmentType
+from ..types.onboarding_path import OnboardingPath
+from ..types.onboarding_track import OnboardingTrack
from .types.count_account_members_response import CountAccountMembersResponse
from .types.count_api_keys_response import CountApiKeysResponse
from .types.count_audit_logs_response import CountAuditLogsResponse
@@ -32,6 +34,7 @@
from .types.get_api_key_response import GetApiKeyResponse
from .types.get_audit_log_response import GetAuditLogResponse
from .types.get_environment_response import GetEnvironmentResponse
+from .types.get_onboarding_state_response import GetOnboardingStateResponse
from .types.get_who_am_i_response import GetWhoAmIResponse
from .types.list_account_members_response import ListAccountMembersResponse
from .types.list_api_keys_response import ListApiKeysResponse
@@ -40,6 +43,7 @@
from .types.quickstart_response import QuickstartResponse
from .types.update_api_key_response import UpdateApiKeyResponse
from .types.update_environment_response import UpdateEnvironmentResponse
+from .types.update_onboarding_state_response import UpdateOnboardingStateResponse
from pydantic import ValidationError
# this is used as the default value for optional parameters
@@ -1943,6 +1947,213 @@ def delete_environment(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
+ def get_onboarding_state(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[GetOnboardingStateResponse]:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[GetOnboardingStateResponse]
+ OK
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "onboarding-state",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ GetOnboardingStateResponse,
+ parse_obj_as(
+ type_=GetOnboardingStateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ def update_onboarding_state(
+ self,
+ *,
+ path: typing.Optional[OnboardingPath] = OMIT,
+ pricing_page_url: typing.Optional[str] = OMIT,
+ track: typing.Optional[OnboardingTrack] = OMIT,
+ website_url: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[UpdateOnboardingStateResponse]:
+ """
+ Parameters
+ ----------
+ path : typing.Optional[OnboardingPath]
+
+ pricing_page_url : typing.Optional[str]
+
+ track : typing.Optional[OnboardingTrack]
+
+ website_url : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[UpdateOnboardingStateResponse]
+ OK
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "onboarding-state",
+ method="POST",
+ json={
+ "path": path,
+ "pricing_page_url": pricing_page_url,
+ "track": track,
+ "website_url": website_url,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ UpdateOnboardingStateResponse,
+ parse_obj_as(
+ type_=UpdateOnboardingStateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
def quickstart(
self, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[QuickstartResponse]:
@@ -4024,6 +4235,213 @@ async def delete_environment(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
+ async def get_onboarding_state(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[GetOnboardingStateResponse]:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[GetOnboardingStateResponse]
+ OK
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "onboarding-state",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ GetOnboardingStateResponse,
+ parse_obj_as(
+ type_=GetOnboardingStateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ async def update_onboarding_state(
+ self,
+ *,
+ path: typing.Optional[OnboardingPath] = OMIT,
+ pricing_page_url: typing.Optional[str] = OMIT,
+ track: typing.Optional[OnboardingTrack] = OMIT,
+ website_url: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[UpdateOnboardingStateResponse]:
+ """
+ Parameters
+ ----------
+ path : typing.Optional[OnboardingPath]
+
+ pricing_page_url : typing.Optional[str]
+
+ track : typing.Optional[OnboardingTrack]
+
+ website_url : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[UpdateOnboardingStateResponse]
+ OK
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "onboarding-state",
+ method="POST",
+ json={
+ "path": path,
+ "pricing_page_url": pricing_page_url,
+ "track": track,
+ "website_url": website_url,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ UpdateOnboardingStateResponse,
+ parse_obj_as(
+ type_=UpdateOnboardingStateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
async def quickstart(
self, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[QuickstartResponse]:
diff --git a/src/schematic/accounts/types/__init__.py b/src/schematic/accounts/types/__init__.py
index 69f8120..9216ff8 100644
--- a/src/schematic/accounts/types/__init__.py
+++ b/src/schematic/accounts/types/__init__.py
@@ -20,6 +20,7 @@
from .get_api_key_response import GetApiKeyResponse
from .get_audit_log_response import GetAuditLogResponse
from .get_environment_response import GetEnvironmentResponse
+ from .get_onboarding_state_response import GetOnboardingStateResponse
from .get_who_am_i_response import GetWhoAmIResponse
from .list_account_members_params import ListAccountMembersParams
from .list_account_members_response import ListAccountMembersResponse
@@ -32,6 +33,7 @@
from .quickstart_response import QuickstartResponse
from .update_api_key_response import UpdateApiKeyResponse
from .update_environment_response import UpdateEnvironmentResponse
+ from .update_onboarding_state_response import UpdateOnboardingStateResponse
_dynamic_imports: typing.Dict[str, str] = {
"CountAccountMembersParams": ".count_account_members_params",
"CountAccountMembersResponse": ".count_account_members_response",
@@ -47,6 +49,7 @@
"GetApiKeyResponse": ".get_api_key_response",
"GetAuditLogResponse": ".get_audit_log_response",
"GetEnvironmentResponse": ".get_environment_response",
+ "GetOnboardingStateResponse": ".get_onboarding_state_response",
"GetWhoAmIResponse": ".get_who_am_i_response",
"ListAccountMembersParams": ".list_account_members_params",
"ListAccountMembersResponse": ".list_account_members_response",
@@ -59,6 +62,7 @@
"QuickstartResponse": ".quickstart_response",
"UpdateApiKeyResponse": ".update_api_key_response",
"UpdateEnvironmentResponse": ".update_environment_response",
+ "UpdateOnboardingStateResponse": ".update_onboarding_state_response",
}
@@ -98,6 +102,7 @@ def __dir__():
"GetApiKeyResponse",
"GetAuditLogResponse",
"GetEnvironmentResponse",
+ "GetOnboardingStateResponse",
"GetWhoAmIResponse",
"ListAccountMembersParams",
"ListAccountMembersResponse",
@@ -110,4 +115,5 @@ def __dir__():
"QuickstartResponse",
"UpdateApiKeyResponse",
"UpdateEnvironmentResponse",
+ "UpdateOnboardingStateResponse",
]
diff --git a/src/schematic/accounts/types/get_onboarding_state_response.py b/src/schematic/accounts/types/get_onboarding_state_response.py
new file mode 100644
index 0000000..65850d4
--- /dev/null
+++ b/src/schematic/accounts/types/get_onboarding_state_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ...types.get_onboarding_state_resp import GetOnboardingStateResp
+
+
+class GetOnboardingStateResponse(UniversalBaseModel):
+ data: GetOnboardingStateResp
+ params: typing.Dict[str, typing.Any] = pydantic.Field()
+ """
+ Input parameters
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/accounts/types/update_onboarding_state_response.py b/src/schematic/accounts/types/update_onboarding_state_response.py
new file mode 100644
index 0000000..83cfe44
--- /dev/null
+++ b/src/schematic/accounts/types/update_onboarding_state_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ...types.get_onboarding_state_resp import GetOnboardingStateResp
+
+
+class UpdateOnboardingStateResponse(UniversalBaseModel):
+ data: GetOnboardingStateResp
+ params: typing.Dict[str, typing.Any] = pydantic.Field()
+ """
+ Input parameters
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/checkout/client.py b/src/schematic/checkout/client.py
index f2b591a..f66a17c 100644
--- a/src/schematic/checkout/client.py
+++ b/src/schematic/checkout/client.py
@@ -5,6 +5,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
+from ..types.billing_collection_method import BillingCollectionMethod
from ..types.checkout_field_value import CheckoutFieldValue
from ..types.customer_billing_address import CustomerBillingAddress
from ..types.plan_selection import PlanSelection
@@ -440,15 +441,22 @@ def manage_plan(
credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody],
custom_field_values: typing.Sequence[CheckoutFieldValue],
pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody],
+ activate_on_payment: typing.Optional[bool] = OMIT,
base_plan_id: typing.Optional[str] = OMIT,
base_plan_price_id: typing.Optional[str] = OMIT,
base_plan_version_id: typing.Optional[str] = OMIT,
+ billing_cycle_anchor: typing.Optional[dt.datetime] = OMIT,
+ billing_email: typing.Optional[str] = OMIT,
billing_entity_id: typing.Optional[str] = OMIT,
cancel_immediately: typing.Optional[bool] = OMIT,
+ collection_method: typing.Optional[BillingCollectionMethod] = OMIT,
coupon_external_id: typing.Optional[str] = OMIT,
+ days_until_due: typing.Optional[int] = OMIT,
payment_method_external_id: typing.Optional[str] = OMIT,
promo_code: typing.Optional[str] = OMIT,
prorate: typing.Optional[bool] = OMIT,
+ prorate_first_period: typing.Optional[bool] = OMIT,
+ send_invoice: typing.Optional[bool] = OMIT,
trial_end: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> ManagePlanResponse:
@@ -465,20 +473,35 @@ def manage_plan(
pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody]
+ activate_on_payment : typing.Optional[bool]
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+
base_plan_id : typing.Optional[str]
base_plan_price_id : typing.Optional[str]
base_plan_version_id : typing.Optional[str]
+ billing_cycle_anchor : typing.Optional[dt.datetime]
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+
+ billing_email : typing.Optional[str]
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+
billing_entity_id : typing.Optional[str]
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
cancel_immediately : typing.Optional[bool]
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
+ collection_method : typing.Optional[BillingCollectionMethod]
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+
coupon_external_id : typing.Optional[str]
+ days_until_due : typing.Optional[int]
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+
payment_method_external_id : typing.Optional[str]
promo_code : typing.Optional[str]
@@ -486,6 +509,12 @@ def manage_plan(
prorate : typing.Optional[bool]
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
+ prorate_first_period : typing.Optional[bool]
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+
+ send_invoice : typing.Optional[bool]
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+
trial_end : typing.Optional[dt.datetime]
request_options : typing.Optional[RequestOptions]
@@ -542,15 +571,22 @@ def manage_plan(
credit_bundles=credit_bundles,
custom_field_values=custom_field_values,
pay_in_advance_entitlements=pay_in_advance_entitlements,
+ activate_on_payment=activate_on_payment,
base_plan_id=base_plan_id,
base_plan_price_id=base_plan_price_id,
base_plan_version_id=base_plan_version_id,
+ billing_cycle_anchor=billing_cycle_anchor,
+ billing_email=billing_email,
billing_entity_id=billing_entity_id,
cancel_immediately=cancel_immediately,
+ collection_method=collection_method,
coupon_external_id=coupon_external_id,
+ days_until_due=days_until_due,
payment_method_external_id=payment_method_external_id,
promo_code=promo_code,
prorate=prorate,
+ prorate_first_period=prorate_first_period,
+ send_invoice=send_invoice,
trial_end=trial_end,
request_options=request_options,
)
@@ -564,15 +600,22 @@ def preview_manage_plan(
credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody],
custom_field_values: typing.Sequence[CheckoutFieldValue],
pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody],
+ activate_on_payment: typing.Optional[bool] = OMIT,
base_plan_id: typing.Optional[str] = OMIT,
base_plan_price_id: typing.Optional[str] = OMIT,
base_plan_version_id: typing.Optional[str] = OMIT,
+ billing_cycle_anchor: typing.Optional[dt.datetime] = OMIT,
+ billing_email: typing.Optional[str] = OMIT,
billing_entity_id: typing.Optional[str] = OMIT,
cancel_immediately: typing.Optional[bool] = OMIT,
+ collection_method: typing.Optional[BillingCollectionMethod] = OMIT,
coupon_external_id: typing.Optional[str] = OMIT,
+ days_until_due: typing.Optional[int] = OMIT,
payment_method_external_id: typing.Optional[str] = OMIT,
promo_code: typing.Optional[str] = OMIT,
prorate: typing.Optional[bool] = OMIT,
+ prorate_first_period: typing.Optional[bool] = OMIT,
+ send_invoice: typing.Optional[bool] = OMIT,
trial_end: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> PreviewManagePlanResponse:
@@ -589,20 +632,35 @@ def preview_manage_plan(
pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody]
+ activate_on_payment : typing.Optional[bool]
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+
base_plan_id : typing.Optional[str]
base_plan_price_id : typing.Optional[str]
base_plan_version_id : typing.Optional[str]
+ billing_cycle_anchor : typing.Optional[dt.datetime]
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+
+ billing_email : typing.Optional[str]
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+
billing_entity_id : typing.Optional[str]
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
cancel_immediately : typing.Optional[bool]
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
+ collection_method : typing.Optional[BillingCollectionMethod]
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+
coupon_external_id : typing.Optional[str]
+ days_until_due : typing.Optional[int]
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+
payment_method_external_id : typing.Optional[str]
promo_code : typing.Optional[str]
@@ -610,6 +668,12 @@ def preview_manage_plan(
prorate : typing.Optional[bool]
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
+ prorate_first_period : typing.Optional[bool]
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+
+ send_invoice : typing.Optional[bool]
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+
trial_end : typing.Optional[dt.datetime]
request_options : typing.Optional[RequestOptions]
@@ -666,15 +730,22 @@ def preview_manage_plan(
credit_bundles=credit_bundles,
custom_field_values=custom_field_values,
pay_in_advance_entitlements=pay_in_advance_entitlements,
+ activate_on_payment=activate_on_payment,
base_plan_id=base_plan_id,
base_plan_price_id=base_plan_price_id,
base_plan_version_id=base_plan_version_id,
+ billing_cycle_anchor=billing_cycle_anchor,
+ billing_email=billing_email,
billing_entity_id=billing_entity_id,
cancel_immediately=cancel_immediately,
+ collection_method=collection_method,
coupon_external_id=coupon_external_id,
+ days_until_due=days_until_due,
payment_method_external_id=payment_method_external_id,
promo_code=promo_code,
prorate=prorate,
+ prorate_first_period=prorate_first_period,
+ send_invoice=send_invoice,
trial_end=trial_end,
request_options=request_options,
)
@@ -1218,15 +1289,22 @@ async def manage_plan(
credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody],
custom_field_values: typing.Sequence[CheckoutFieldValue],
pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody],
+ activate_on_payment: typing.Optional[bool] = OMIT,
base_plan_id: typing.Optional[str] = OMIT,
base_plan_price_id: typing.Optional[str] = OMIT,
base_plan_version_id: typing.Optional[str] = OMIT,
+ billing_cycle_anchor: typing.Optional[dt.datetime] = OMIT,
+ billing_email: typing.Optional[str] = OMIT,
billing_entity_id: typing.Optional[str] = OMIT,
cancel_immediately: typing.Optional[bool] = OMIT,
+ collection_method: typing.Optional[BillingCollectionMethod] = OMIT,
coupon_external_id: typing.Optional[str] = OMIT,
+ days_until_due: typing.Optional[int] = OMIT,
payment_method_external_id: typing.Optional[str] = OMIT,
promo_code: typing.Optional[str] = OMIT,
prorate: typing.Optional[bool] = OMIT,
+ prorate_first_period: typing.Optional[bool] = OMIT,
+ send_invoice: typing.Optional[bool] = OMIT,
trial_end: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> ManagePlanResponse:
@@ -1243,20 +1321,35 @@ async def manage_plan(
pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody]
+ activate_on_payment : typing.Optional[bool]
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+
base_plan_id : typing.Optional[str]
base_plan_price_id : typing.Optional[str]
base_plan_version_id : typing.Optional[str]
+ billing_cycle_anchor : typing.Optional[dt.datetime]
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+
+ billing_email : typing.Optional[str]
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+
billing_entity_id : typing.Optional[str]
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
cancel_immediately : typing.Optional[bool]
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
+ collection_method : typing.Optional[BillingCollectionMethod]
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+
coupon_external_id : typing.Optional[str]
+ days_until_due : typing.Optional[int]
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+
payment_method_external_id : typing.Optional[str]
promo_code : typing.Optional[str]
@@ -1264,6 +1357,12 @@ async def manage_plan(
prorate : typing.Optional[bool]
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
+ prorate_first_period : typing.Optional[bool]
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+
+ send_invoice : typing.Optional[bool]
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+
trial_end : typing.Optional[dt.datetime]
request_options : typing.Optional[RequestOptions]
@@ -1328,15 +1427,22 @@ async def main() -> None:
credit_bundles=credit_bundles,
custom_field_values=custom_field_values,
pay_in_advance_entitlements=pay_in_advance_entitlements,
+ activate_on_payment=activate_on_payment,
base_plan_id=base_plan_id,
base_plan_price_id=base_plan_price_id,
base_plan_version_id=base_plan_version_id,
+ billing_cycle_anchor=billing_cycle_anchor,
+ billing_email=billing_email,
billing_entity_id=billing_entity_id,
cancel_immediately=cancel_immediately,
+ collection_method=collection_method,
coupon_external_id=coupon_external_id,
+ days_until_due=days_until_due,
payment_method_external_id=payment_method_external_id,
promo_code=promo_code,
prorate=prorate,
+ prorate_first_period=prorate_first_period,
+ send_invoice=send_invoice,
trial_end=trial_end,
request_options=request_options,
)
@@ -1350,15 +1456,22 @@ async def preview_manage_plan(
credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody],
custom_field_values: typing.Sequence[CheckoutFieldValue],
pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody],
+ activate_on_payment: typing.Optional[bool] = OMIT,
base_plan_id: typing.Optional[str] = OMIT,
base_plan_price_id: typing.Optional[str] = OMIT,
base_plan_version_id: typing.Optional[str] = OMIT,
+ billing_cycle_anchor: typing.Optional[dt.datetime] = OMIT,
+ billing_email: typing.Optional[str] = OMIT,
billing_entity_id: typing.Optional[str] = OMIT,
cancel_immediately: typing.Optional[bool] = OMIT,
+ collection_method: typing.Optional[BillingCollectionMethod] = OMIT,
coupon_external_id: typing.Optional[str] = OMIT,
+ days_until_due: typing.Optional[int] = OMIT,
payment_method_external_id: typing.Optional[str] = OMIT,
promo_code: typing.Optional[str] = OMIT,
prorate: typing.Optional[bool] = OMIT,
+ prorate_first_period: typing.Optional[bool] = OMIT,
+ send_invoice: typing.Optional[bool] = OMIT,
trial_end: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> PreviewManagePlanResponse:
@@ -1375,20 +1488,35 @@ async def preview_manage_plan(
pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody]
+ activate_on_payment : typing.Optional[bool]
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+
base_plan_id : typing.Optional[str]
base_plan_price_id : typing.Optional[str]
base_plan_version_id : typing.Optional[str]
+ billing_cycle_anchor : typing.Optional[dt.datetime]
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+
+ billing_email : typing.Optional[str]
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+
billing_entity_id : typing.Optional[str]
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
cancel_immediately : typing.Optional[bool]
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
+ collection_method : typing.Optional[BillingCollectionMethod]
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+
coupon_external_id : typing.Optional[str]
+ days_until_due : typing.Optional[int]
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+
payment_method_external_id : typing.Optional[str]
promo_code : typing.Optional[str]
@@ -1396,6 +1524,12 @@ async def preview_manage_plan(
prorate : typing.Optional[bool]
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
+ prorate_first_period : typing.Optional[bool]
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+
+ send_invoice : typing.Optional[bool]
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+
trial_end : typing.Optional[dt.datetime]
request_options : typing.Optional[RequestOptions]
@@ -1460,15 +1594,22 @@ async def main() -> None:
credit_bundles=credit_bundles,
custom_field_values=custom_field_values,
pay_in_advance_entitlements=pay_in_advance_entitlements,
+ activate_on_payment=activate_on_payment,
base_plan_id=base_plan_id,
base_plan_price_id=base_plan_price_id,
base_plan_version_id=base_plan_version_id,
+ billing_cycle_anchor=billing_cycle_anchor,
+ billing_email=billing_email,
billing_entity_id=billing_entity_id,
cancel_immediately=cancel_immediately,
+ collection_method=collection_method,
coupon_external_id=coupon_external_id,
+ days_until_due=days_until_due,
payment_method_external_id=payment_method_external_id,
promo_code=promo_code,
prorate=prorate,
+ prorate_first_period=prorate_first_period,
+ send_invoice=send_invoice,
trial_end=trial_end,
request_options=request_options,
)
diff --git a/src/schematic/checkout/raw_client.py b/src/schematic/checkout/raw_client.py
index 35f5b82..0a5d81a 100644
--- a/src/schematic/checkout/raw_client.py
+++ b/src/schematic/checkout/raw_client.py
@@ -18,6 +18,7 @@
from ..errors.not_found_error import NotFoundError
from ..errors.unauthorized_error import UnauthorizedError
from ..types.api_error import ApiError as types_api_error_ApiError
+from ..types.billing_collection_method import BillingCollectionMethod
from ..types.checkout_field_value import CheckoutFieldValue
from ..types.customer_billing_address import CustomerBillingAddress
from ..types.plan_selection import PlanSelection
@@ -740,15 +741,22 @@ def manage_plan(
credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody],
custom_field_values: typing.Sequence[CheckoutFieldValue],
pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody],
+ activate_on_payment: typing.Optional[bool] = OMIT,
base_plan_id: typing.Optional[str] = OMIT,
base_plan_price_id: typing.Optional[str] = OMIT,
base_plan_version_id: typing.Optional[str] = OMIT,
+ billing_cycle_anchor: typing.Optional[dt.datetime] = OMIT,
+ billing_email: typing.Optional[str] = OMIT,
billing_entity_id: typing.Optional[str] = OMIT,
cancel_immediately: typing.Optional[bool] = OMIT,
+ collection_method: typing.Optional[BillingCollectionMethod] = OMIT,
coupon_external_id: typing.Optional[str] = OMIT,
+ days_until_due: typing.Optional[int] = OMIT,
payment_method_external_id: typing.Optional[str] = OMIT,
promo_code: typing.Optional[str] = OMIT,
prorate: typing.Optional[bool] = OMIT,
+ prorate_first_period: typing.Optional[bool] = OMIT,
+ send_invoice: typing.Optional[bool] = OMIT,
trial_end: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[ManagePlanResponse]:
@@ -765,20 +773,35 @@ def manage_plan(
pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody]
+ activate_on_payment : typing.Optional[bool]
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+
base_plan_id : typing.Optional[str]
base_plan_price_id : typing.Optional[str]
base_plan_version_id : typing.Optional[str]
+ billing_cycle_anchor : typing.Optional[dt.datetime]
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+
+ billing_email : typing.Optional[str]
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+
billing_entity_id : typing.Optional[str]
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
cancel_immediately : typing.Optional[bool]
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
+ collection_method : typing.Optional[BillingCollectionMethod]
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+
coupon_external_id : typing.Optional[str]
+ days_until_due : typing.Optional[int]
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+
payment_method_external_id : typing.Optional[str]
promo_code : typing.Optional[str]
@@ -786,6 +809,12 @@ def manage_plan(
prorate : typing.Optional[bool]
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
+ prorate_first_period : typing.Optional[bool]
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+
+ send_invoice : typing.Optional[bool]
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+
trial_end : typing.Optional[dt.datetime]
request_options : typing.Optional[RequestOptions]
@@ -800,14 +829,18 @@ def manage_plan(
"manage-plan",
method="POST",
json={
+ "activate_on_payment": activate_on_payment,
"add_on_selections": convert_and_respect_annotation_metadata(
object_=add_on_selections, annotation=typing.Sequence[PlanSelection], direction="write"
),
"base_plan_id": base_plan_id,
"base_plan_price_id": base_plan_price_id,
"base_plan_version_id": base_plan_version_id,
+ "billing_cycle_anchor": billing_cycle_anchor,
+ "billing_email": billing_email,
"billing_entity_id": billing_entity_id,
"cancel_immediately": cancel_immediately,
+ "collection_method": collection_method,
"company_id": company_id,
"coupon_external_id": coupon_external_id,
"credit_bundles": convert_and_respect_annotation_metadata(
@@ -816,6 +849,7 @@ def manage_plan(
"custom_field_values": convert_and_respect_annotation_metadata(
object_=custom_field_values, annotation=typing.Sequence[CheckoutFieldValue], direction="write"
),
+ "days_until_due": days_until_due,
"pay_in_advance_entitlements": convert_and_respect_annotation_metadata(
object_=pay_in_advance_entitlements,
annotation=typing.Sequence[UpdatePayInAdvanceRequestBody],
@@ -824,6 +858,8 @@ def manage_plan(
"payment_method_external_id": payment_method_external_id,
"promo_code": promo_code,
"prorate": prorate,
+ "prorate_first_period": prorate_first_period,
+ "send_invoice": send_invoice,
"trial_end": trial_end,
},
headers={
@@ -918,15 +954,22 @@ def preview_manage_plan(
credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody],
custom_field_values: typing.Sequence[CheckoutFieldValue],
pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody],
+ activate_on_payment: typing.Optional[bool] = OMIT,
base_plan_id: typing.Optional[str] = OMIT,
base_plan_price_id: typing.Optional[str] = OMIT,
base_plan_version_id: typing.Optional[str] = OMIT,
+ billing_cycle_anchor: typing.Optional[dt.datetime] = OMIT,
+ billing_email: typing.Optional[str] = OMIT,
billing_entity_id: typing.Optional[str] = OMIT,
cancel_immediately: typing.Optional[bool] = OMIT,
+ collection_method: typing.Optional[BillingCollectionMethod] = OMIT,
coupon_external_id: typing.Optional[str] = OMIT,
+ days_until_due: typing.Optional[int] = OMIT,
payment_method_external_id: typing.Optional[str] = OMIT,
promo_code: typing.Optional[str] = OMIT,
prorate: typing.Optional[bool] = OMIT,
+ prorate_first_period: typing.Optional[bool] = OMIT,
+ send_invoice: typing.Optional[bool] = OMIT,
trial_end: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[PreviewManagePlanResponse]:
@@ -943,20 +986,35 @@ def preview_manage_plan(
pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody]
+ activate_on_payment : typing.Optional[bool]
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+
base_plan_id : typing.Optional[str]
base_plan_price_id : typing.Optional[str]
base_plan_version_id : typing.Optional[str]
+ billing_cycle_anchor : typing.Optional[dt.datetime]
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+
+ billing_email : typing.Optional[str]
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+
billing_entity_id : typing.Optional[str]
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
cancel_immediately : typing.Optional[bool]
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
+ collection_method : typing.Optional[BillingCollectionMethod]
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+
coupon_external_id : typing.Optional[str]
+ days_until_due : typing.Optional[int]
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+
payment_method_external_id : typing.Optional[str]
promo_code : typing.Optional[str]
@@ -964,6 +1022,12 @@ def preview_manage_plan(
prorate : typing.Optional[bool]
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
+ prorate_first_period : typing.Optional[bool]
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+
+ send_invoice : typing.Optional[bool]
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+
trial_end : typing.Optional[dt.datetime]
request_options : typing.Optional[RequestOptions]
@@ -978,14 +1042,18 @@ def preview_manage_plan(
"manage-plan/preview",
method="POST",
json={
+ "activate_on_payment": activate_on_payment,
"add_on_selections": convert_and_respect_annotation_metadata(
object_=add_on_selections, annotation=typing.Sequence[PlanSelection], direction="write"
),
"base_plan_id": base_plan_id,
"base_plan_price_id": base_plan_price_id,
"base_plan_version_id": base_plan_version_id,
+ "billing_cycle_anchor": billing_cycle_anchor,
+ "billing_email": billing_email,
"billing_entity_id": billing_entity_id,
"cancel_immediately": cancel_immediately,
+ "collection_method": collection_method,
"company_id": company_id,
"coupon_external_id": coupon_external_id,
"credit_bundles": convert_and_respect_annotation_metadata(
@@ -994,6 +1062,7 @@ def preview_manage_plan(
"custom_field_values": convert_and_respect_annotation_metadata(
object_=custom_field_values, annotation=typing.Sequence[CheckoutFieldValue], direction="write"
),
+ "days_until_due": days_until_due,
"pay_in_advance_entitlements": convert_and_respect_annotation_metadata(
object_=pay_in_advance_entitlements,
annotation=typing.Sequence[UpdatePayInAdvanceRequestBody],
@@ -1002,6 +1071,8 @@ def preview_manage_plan(
"payment_method_external_id": payment_method_external_id,
"promo_code": promo_code,
"prorate": prorate,
+ "prorate_first_period": prorate_first_period,
+ "send_invoice": send_invoice,
"trial_end": trial_end,
},
headers={
@@ -2020,15 +2091,22 @@ async def manage_plan(
credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody],
custom_field_values: typing.Sequence[CheckoutFieldValue],
pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody],
+ activate_on_payment: typing.Optional[bool] = OMIT,
base_plan_id: typing.Optional[str] = OMIT,
base_plan_price_id: typing.Optional[str] = OMIT,
base_plan_version_id: typing.Optional[str] = OMIT,
+ billing_cycle_anchor: typing.Optional[dt.datetime] = OMIT,
+ billing_email: typing.Optional[str] = OMIT,
billing_entity_id: typing.Optional[str] = OMIT,
cancel_immediately: typing.Optional[bool] = OMIT,
+ collection_method: typing.Optional[BillingCollectionMethod] = OMIT,
coupon_external_id: typing.Optional[str] = OMIT,
+ days_until_due: typing.Optional[int] = OMIT,
payment_method_external_id: typing.Optional[str] = OMIT,
promo_code: typing.Optional[str] = OMIT,
prorate: typing.Optional[bool] = OMIT,
+ prorate_first_period: typing.Optional[bool] = OMIT,
+ send_invoice: typing.Optional[bool] = OMIT,
trial_end: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[ManagePlanResponse]:
@@ -2045,20 +2123,35 @@ async def manage_plan(
pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody]
+ activate_on_payment : typing.Optional[bool]
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+
base_plan_id : typing.Optional[str]
base_plan_price_id : typing.Optional[str]
base_plan_version_id : typing.Optional[str]
+ billing_cycle_anchor : typing.Optional[dt.datetime]
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+
+ billing_email : typing.Optional[str]
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+
billing_entity_id : typing.Optional[str]
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
cancel_immediately : typing.Optional[bool]
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
+ collection_method : typing.Optional[BillingCollectionMethod]
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+
coupon_external_id : typing.Optional[str]
+ days_until_due : typing.Optional[int]
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+
payment_method_external_id : typing.Optional[str]
promo_code : typing.Optional[str]
@@ -2066,6 +2159,12 @@ async def manage_plan(
prorate : typing.Optional[bool]
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
+ prorate_first_period : typing.Optional[bool]
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+
+ send_invoice : typing.Optional[bool]
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+
trial_end : typing.Optional[dt.datetime]
request_options : typing.Optional[RequestOptions]
@@ -2080,14 +2179,18 @@ async def manage_plan(
"manage-plan",
method="POST",
json={
+ "activate_on_payment": activate_on_payment,
"add_on_selections": convert_and_respect_annotation_metadata(
object_=add_on_selections, annotation=typing.Sequence[PlanSelection], direction="write"
),
"base_plan_id": base_plan_id,
"base_plan_price_id": base_plan_price_id,
"base_plan_version_id": base_plan_version_id,
+ "billing_cycle_anchor": billing_cycle_anchor,
+ "billing_email": billing_email,
"billing_entity_id": billing_entity_id,
"cancel_immediately": cancel_immediately,
+ "collection_method": collection_method,
"company_id": company_id,
"coupon_external_id": coupon_external_id,
"credit_bundles": convert_and_respect_annotation_metadata(
@@ -2096,6 +2199,7 @@ async def manage_plan(
"custom_field_values": convert_and_respect_annotation_metadata(
object_=custom_field_values, annotation=typing.Sequence[CheckoutFieldValue], direction="write"
),
+ "days_until_due": days_until_due,
"pay_in_advance_entitlements": convert_and_respect_annotation_metadata(
object_=pay_in_advance_entitlements,
annotation=typing.Sequence[UpdatePayInAdvanceRequestBody],
@@ -2104,6 +2208,8 @@ async def manage_plan(
"payment_method_external_id": payment_method_external_id,
"promo_code": promo_code,
"prorate": prorate,
+ "prorate_first_period": prorate_first_period,
+ "send_invoice": send_invoice,
"trial_end": trial_end,
},
headers={
@@ -2198,15 +2304,22 @@ async def preview_manage_plan(
credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody],
custom_field_values: typing.Sequence[CheckoutFieldValue],
pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody],
+ activate_on_payment: typing.Optional[bool] = OMIT,
base_plan_id: typing.Optional[str] = OMIT,
base_plan_price_id: typing.Optional[str] = OMIT,
base_plan_version_id: typing.Optional[str] = OMIT,
+ billing_cycle_anchor: typing.Optional[dt.datetime] = OMIT,
+ billing_email: typing.Optional[str] = OMIT,
billing_entity_id: typing.Optional[str] = OMIT,
cancel_immediately: typing.Optional[bool] = OMIT,
+ collection_method: typing.Optional[BillingCollectionMethod] = OMIT,
coupon_external_id: typing.Optional[str] = OMIT,
+ days_until_due: typing.Optional[int] = OMIT,
payment_method_external_id: typing.Optional[str] = OMIT,
promo_code: typing.Optional[str] = OMIT,
prorate: typing.Optional[bool] = OMIT,
+ prorate_first_period: typing.Optional[bool] = OMIT,
+ send_invoice: typing.Optional[bool] = OMIT,
trial_end: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[PreviewManagePlanResponse]:
@@ -2223,20 +2336,35 @@ async def preview_manage_plan(
pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody]
+ activate_on_payment : typing.Optional[bool]
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+
base_plan_id : typing.Optional[str]
base_plan_price_id : typing.Optional[str]
base_plan_version_id : typing.Optional[str]
+ billing_cycle_anchor : typing.Optional[dt.datetime]
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+
+ billing_email : typing.Optional[str]
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+
billing_entity_id : typing.Optional[str]
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
cancel_immediately : typing.Optional[bool]
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
+ collection_method : typing.Optional[BillingCollectionMethod]
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+
coupon_external_id : typing.Optional[str]
+ days_until_due : typing.Optional[int]
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+
payment_method_external_id : typing.Optional[str]
promo_code : typing.Optional[str]
@@ -2244,6 +2372,12 @@ async def preview_manage_plan(
prorate : typing.Optional[bool]
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
+ prorate_first_period : typing.Optional[bool]
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+
+ send_invoice : typing.Optional[bool]
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+
trial_end : typing.Optional[dt.datetime]
request_options : typing.Optional[RequestOptions]
@@ -2258,14 +2392,18 @@ async def preview_manage_plan(
"manage-plan/preview",
method="POST",
json={
+ "activate_on_payment": activate_on_payment,
"add_on_selections": convert_and_respect_annotation_metadata(
object_=add_on_selections, annotation=typing.Sequence[PlanSelection], direction="write"
),
"base_plan_id": base_plan_id,
"base_plan_price_id": base_plan_price_id,
"base_plan_version_id": base_plan_version_id,
+ "billing_cycle_anchor": billing_cycle_anchor,
+ "billing_email": billing_email,
"billing_entity_id": billing_entity_id,
"cancel_immediately": cancel_immediately,
+ "collection_method": collection_method,
"company_id": company_id,
"coupon_external_id": coupon_external_id,
"credit_bundles": convert_and_respect_annotation_metadata(
@@ -2274,6 +2412,7 @@ async def preview_manage_plan(
"custom_field_values": convert_and_respect_annotation_metadata(
object_=custom_field_values, annotation=typing.Sequence[CheckoutFieldValue], direction="write"
),
+ "days_until_due": days_until_due,
"pay_in_advance_entitlements": convert_and_respect_annotation_metadata(
object_=pay_in_advance_entitlements,
annotation=typing.Sequence[UpdatePayInAdvanceRequestBody],
@@ -2282,6 +2421,8 @@ async def preview_manage_plan(
"payment_method_external_id": payment_method_external_id,
"promo_code": promo_code,
"prorate": prorate,
+ "prorate_first_period": prorate_first_period,
+ "send_invoice": send_invoice,
"trial_end": trial_end,
},
headers={
diff --git a/src/schematic/companies/__init__.py b/src/schematic/companies/__init__.py
index 0160d0a..80d297b 100644
--- a/src/schematic/companies/__init__.py
+++ b/src/schematic/companies/__init__.py
@@ -15,6 +15,8 @@
CountEntityKeysResponse,
CountEntityTraitDefinitionsParams,
CountEntityTraitDefinitionsResponse,
+ CountEntityTraitsParams,
+ CountEntityTraitsResponse,
CountPlanTraitsParams,
CountPlanTraitsResponse,
CountUsersParams,
@@ -26,6 +28,7 @@
DeleteCompanyParams,
DeleteCompanyResponse,
DeleteEntityKeyDefinitionResponse,
+ DeleteEntityTraitDefinitionResponse,
DeleteUserByKeysResponse,
DeleteUserResponse,
GetActiveCompanySubscriptionParams,
@@ -36,6 +39,7 @@
GetCompanyBillingEntityResponse,
GetCompanyResponse,
GetEntityTraitDefinitionResponse,
+ GetEntityTraitDefinitionUsageResponse,
GetEntityTraitValuesParams,
GetEntityTraitValuesResponse,
GetOrCreateCompanyMembershipResponse,
@@ -77,6 +81,8 @@
"CountEntityKeysResponse": ".types",
"CountEntityTraitDefinitionsParams": ".types",
"CountEntityTraitDefinitionsResponse": ".types",
+ "CountEntityTraitsParams": ".types",
+ "CountEntityTraitsResponse": ".types",
"CountPlanTraitsParams": ".types",
"CountPlanTraitsResponse": ".types",
"CountUsersParams": ".types",
@@ -88,6 +94,7 @@
"DeleteCompanyParams": ".types",
"DeleteCompanyResponse": ".types",
"DeleteEntityKeyDefinitionResponse": ".types",
+ "DeleteEntityTraitDefinitionResponse": ".types",
"DeleteUserByKeysResponse": ".types",
"DeleteUserResponse": ".types",
"GetActiveCompanySubscriptionParams": ".types",
@@ -98,6 +105,7 @@
"GetCompanyBillingEntityResponse": ".types",
"GetCompanyResponse": ".types",
"GetEntityTraitDefinitionResponse": ".types",
+ "GetEntityTraitDefinitionUsageResponse": ".types",
"GetEntityTraitValuesParams": ".types",
"GetEntityTraitValuesResponse": ".types",
"GetOrCreateCompanyMembershipResponse": ".types",
@@ -162,6 +170,8 @@ def __dir__():
"CountEntityKeysResponse",
"CountEntityTraitDefinitionsParams",
"CountEntityTraitDefinitionsResponse",
+ "CountEntityTraitsParams",
+ "CountEntityTraitsResponse",
"CountPlanTraitsParams",
"CountPlanTraitsResponse",
"CountUsersParams",
@@ -173,6 +183,7 @@ def __dir__():
"DeleteCompanyParams",
"DeleteCompanyResponse",
"DeleteEntityKeyDefinitionResponse",
+ "DeleteEntityTraitDefinitionResponse",
"DeleteUserByKeysResponse",
"DeleteUserResponse",
"GetActiveCompanySubscriptionParams",
@@ -183,6 +194,7 @@ def __dir__():
"GetCompanyBillingEntityResponse",
"GetCompanyResponse",
"GetEntityTraitDefinitionResponse",
+ "GetEntityTraitDefinitionUsageResponse",
"GetEntityTraitValuesParams",
"GetEntityTraitValuesResponse",
"GetOrCreateCompanyMembershipResponse",
diff --git a/src/schematic/companies/client.py b/src/schematic/companies/client.py
index d772c11..fc7a05f 100644
--- a/src/schematic/companies/client.py
+++ b/src/schematic/companies/client.py
@@ -18,6 +18,7 @@
from .types.count_entity_key_definitions_response import CountEntityKeyDefinitionsResponse
from .types.count_entity_keys_response import CountEntityKeysResponse
from .types.count_entity_trait_definitions_response import CountEntityTraitDefinitionsResponse
+from .types.count_entity_traits_response import CountEntityTraitsResponse
from .types.count_plan_traits_response import CountPlanTraitsResponse
from .types.count_users_response import CountUsersResponse
from .types.create_company_response import CreateCompanyResponse
@@ -26,6 +27,7 @@
from .types.delete_company_membership_response import DeleteCompanyMembershipResponse
from .types.delete_company_response import DeleteCompanyResponse
from .types.delete_entity_key_definition_response import DeleteEntityKeyDefinitionResponse
+from .types.delete_entity_trait_definition_response import DeleteEntityTraitDefinitionResponse
from .types.delete_user_by_keys_response import DeleteUserByKeysResponse
from .types.delete_user_response import DeleteUserResponse
from .types.get_active_company_subscription_response import GetActiveCompanySubscriptionResponse
@@ -33,6 +35,7 @@
from .types.get_company_billing_entity_response import GetCompanyBillingEntityResponse
from .types.get_company_response import GetCompanyResponse
from .types.get_entity_trait_definition_response import GetEntityTraitDefinitionResponse
+from .types.get_entity_trait_definition_usage_response import GetEntityTraitDefinitionUsageResponse
from .types.get_entity_trait_values_response import GetEntityTraitValuesResponse
from .types.get_or_create_company_membership_response import GetOrCreateCompanyMembershipResponse
from .types.get_or_create_entity_trait_definition_response import GetOrCreateEntityTraitDefinitionResponse
@@ -237,6 +240,7 @@ def upsert_company(
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
prevent_key_remap: typing.Optional[bool] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -262,6 +266,9 @@ def upsert_company(
prevent_key_remap : typing.Optional[bool]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -294,6 +301,7 @@ def upsert_company(
last_seen_at=last_seen_at,
name=name,
prevent_key_remap=prevent_key_remap,
+ remove_keys=remove_keys,
traits=traits,
update_only=update_only,
request_options=request_options,
@@ -538,6 +546,7 @@ def create_company(
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
prevent_key_remap: typing.Optional[bool] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -563,6 +572,9 @@ def create_company(
prevent_key_remap : typing.Optional[bool]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -595,6 +607,7 @@ def create_company(
last_seen_at=last_seen_at,
name=name,
prevent_key_remap=prevent_key_remap,
+ remove_keys=remove_keys,
traits=traits,
update_only=update_only,
request_options=request_options,
@@ -1336,6 +1349,72 @@ def update_entity_trait_definition(
)
return _response.data
+ def delete_entity_trait_definition(
+ self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> DeleteEntityTraitDefinitionResponse:
+ """
+ Parameters
+ ----------
+ entity_trait_definition_id : str
+ entity_trait_definition_id
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DeleteEntityTraitDefinitionResponse
+ OK
+
+ Examples
+ --------
+ from schematic import Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.delete_entity_trait_definition(
+ entity_trait_definition_id="entity_trait_definition_id",
+ )
+ """
+ _response = self._raw_client.delete_entity_trait_definition(
+ entity_trait_definition_id, request_options=request_options
+ )
+ return _response.data
+
+ def get_entity_trait_definition_usage(
+ self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> GetEntityTraitDefinitionUsageResponse:
+ """
+ Parameters
+ ----------
+ entity_trait_definition_id : str
+ entity_trait_definition_id
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetEntityTraitDefinitionUsageResponse
+ OK
+
+ Examples
+ --------
+ from schematic import Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.get_entity_trait_definition_usage(
+ entity_trait_definition_id="entity_trait_definition_id",
+ )
+ """
+ _response = self._raw_client.get_entity_trait_definition_usage(
+ entity_trait_definition_id, request_options=request_options
+ )
+ return _response.data
+
def count_entity_trait_definitions(
self,
*,
@@ -1453,6 +1532,59 @@ def get_entity_trait_values(
)
return _response.data
+ def count_entity_traits(
+ self,
+ *,
+ definition_id: typing.Optional[str] = None,
+ entity_type: typing.Optional[EntityType] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CountEntityTraitsResponse:
+ """
+ Parameters
+ ----------
+ definition_id : typing.Optional[str]
+
+ entity_type : typing.Optional[EntityType]
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CountEntityTraitsResponse
+ OK
+
+ Examples
+ --------
+ from schematic import Schematic
+
+ client = Schematic(
+ api_key="YOUR_API_KEY",
+ )
+ client.companies.count_entity_traits(
+ definition_id="definition_id",
+ entity_type="company",
+ limit=1000000,
+ offset=1000000,
+ )
+ """
+ _response = self._raw_client.count_entity_traits(
+ definition_id=definition_id,
+ entity_type=entity_type,
+ limit=limit,
+ offset=offset,
+ request_options=request_options,
+ )
+ return _response.data
+
def list_plan_changes(
self,
*,
@@ -1460,7 +1592,6 @@ def list_plan_changes(
base_plan_action: typing.Optional[PlanChangeBasePlanAction] = None,
company_id: typing.Optional[str] = None,
company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
@@ -1476,8 +1607,6 @@ def list_plan_changes(
company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
- plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
-
limit : typing.Optional[int]
Page limit (default 100)
@@ -1504,7 +1633,6 @@ def list_plan_changes(
base_plan_action="fallback",
company_id="company_id",
company_ids=["company_ids"],
- plan_ids=["plan_ids"],
limit=1000000,
offset=1000000,
)
@@ -1514,7 +1642,6 @@ def list_plan_changes(
base_plan_action=base_plan_action,
company_id=company_id,
company_ids=company_ids,
- plan_ids=plan_ids,
limit=limit,
offset=offset,
request_options=request_options,
@@ -1891,6 +2018,7 @@ def upsert_user(
id: typing.Optional[str] = OMIT,
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -1920,6 +2048,9 @@ def upsert_user(
name : typing.Optional[str]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -1953,6 +2084,7 @@ def upsert_user(
id=id,
last_seen_at=last_seen_at,
name=name,
+ remove_keys=remove_keys,
traits=traits,
update_only=update_only,
request_options=request_options,
@@ -2097,6 +2229,7 @@ def create_user(
id: typing.Optional[str] = OMIT,
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -2126,6 +2259,9 @@ def create_user(
name : typing.Optional[str]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -2159,6 +2295,7 @@ def create_user(
id=id,
last_seen_at=last_seen_at,
name=name,
+ remove_keys=remove_keys,
traits=traits,
update_only=update_only,
request_options=request_options,
@@ -2413,6 +2550,7 @@ async def upsert_company(
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
prevent_key_remap: typing.Optional[bool] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -2438,6 +2576,9 @@ async def upsert_company(
prevent_key_remap : typing.Optional[bool]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -2478,6 +2619,7 @@ async def main() -> None:
last_seen_at=last_seen_at,
name=name,
prevent_key_remap=prevent_key_remap,
+ remove_keys=remove_keys,
traits=traits,
update_only=update_only,
request_options=request_options,
@@ -2746,6 +2888,7 @@ async def create_company(
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
prevent_key_remap: typing.Optional[bool] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -2771,6 +2914,9 @@ async def create_company(
prevent_key_remap : typing.Optional[bool]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -2811,6 +2957,7 @@ async def main() -> None:
last_seen_at=last_seen_at,
name=name,
prevent_key_remap=prevent_key_remap,
+ remove_keys=remove_keys,
traits=traits,
update_only=update_only,
request_options=request_options,
@@ -3692,6 +3839,88 @@ async def main() -> None:
)
return _response.data
+ async def delete_entity_trait_definition(
+ self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> DeleteEntityTraitDefinitionResponse:
+ """
+ Parameters
+ ----------
+ entity_trait_definition_id : str
+ entity_trait_definition_id
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DeleteEntityTraitDefinitionResponse
+ OK
+
+ Examples
+ --------
+ import asyncio
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.companies.delete_entity_trait_definition(
+ entity_trait_definition_id="entity_trait_definition_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.delete_entity_trait_definition(
+ entity_trait_definition_id, request_options=request_options
+ )
+ return _response.data
+
+ async def get_entity_trait_definition_usage(
+ self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> GetEntityTraitDefinitionUsageResponse:
+ """
+ Parameters
+ ----------
+ entity_trait_definition_id : str
+ entity_trait_definition_id
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetEntityTraitDefinitionUsageResponse
+ OK
+
+ Examples
+ --------
+ import asyncio
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.companies.get_entity_trait_definition_usage(
+ entity_trait_definition_id="entity_trait_definition_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.get_entity_trait_definition_usage(
+ entity_trait_definition_id, request_options=request_options
+ )
+ return _response.data
+
async def count_entity_trait_definitions(
self,
*,
@@ -3825,6 +4054,67 @@ async def main() -> None:
)
return _response.data
+ async def count_entity_traits(
+ self,
+ *,
+ definition_id: typing.Optional[str] = None,
+ entity_type: typing.Optional[EntityType] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CountEntityTraitsResponse:
+ """
+ Parameters
+ ----------
+ definition_id : typing.Optional[str]
+
+ entity_type : typing.Optional[EntityType]
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CountEntityTraitsResponse
+ OK
+
+ Examples
+ --------
+ import asyncio
+
+ from schematic import AsyncSchematic
+
+ client = AsyncSchematic(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.companies.count_entity_traits(
+ definition_id="definition_id",
+ entity_type="company",
+ limit=1000000,
+ offset=1000000,
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.count_entity_traits(
+ definition_id=definition_id,
+ entity_type=entity_type,
+ limit=limit,
+ offset=offset,
+ request_options=request_options,
+ )
+ return _response.data
+
async def list_plan_changes(
self,
*,
@@ -3832,7 +4122,6 @@ async def list_plan_changes(
base_plan_action: typing.Optional[PlanChangeBasePlanAction] = None,
company_id: typing.Optional[str] = None,
company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
@@ -3848,8 +4137,6 @@ async def list_plan_changes(
company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
- plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
-
limit : typing.Optional[int]
Page limit (default 100)
@@ -3881,7 +4168,6 @@ async def main() -> None:
base_plan_action="fallback",
company_id="company_id",
company_ids=["company_ids"],
- plan_ids=["plan_ids"],
limit=1000000,
offset=1000000,
)
@@ -3894,7 +4180,6 @@ async def main() -> None:
base_plan_action=base_plan_action,
company_id=company_id,
company_ids=company_ids,
- plan_ids=plan_ids,
limit=limit,
offset=offset,
request_options=request_options,
@@ -4327,6 +4612,7 @@ async def upsert_user(
id: typing.Optional[str] = OMIT,
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -4356,6 +4642,9 @@ async def upsert_user(
name : typing.Optional[str]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -4397,6 +4686,7 @@ async def main() -> None:
id=id,
last_seen_at=last_seen_at,
name=name,
+ remove_keys=remove_keys,
traits=traits,
update_only=update_only,
request_options=request_options,
@@ -4567,6 +4857,7 @@ async def create_user(
id: typing.Optional[str] = OMIT,
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -4596,6 +4887,9 @@ async def create_user(
name : typing.Optional[str]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -4637,6 +4931,7 @@ async def main() -> None:
id=id,
last_seen_at=last_seen_at,
name=name,
+ remove_keys=remove_keys,
traits=traits,
update_only=update_only,
request_options=request_options,
diff --git a/src/schematic/companies/raw_client.py b/src/schematic/companies/raw_client.py
index 9acaae2..4590413 100644
--- a/src/schematic/companies/raw_client.py
+++ b/src/schematic/companies/raw_client.py
@@ -30,6 +30,7 @@
from .types.count_entity_key_definitions_response import CountEntityKeyDefinitionsResponse
from .types.count_entity_keys_response import CountEntityKeysResponse
from .types.count_entity_trait_definitions_response import CountEntityTraitDefinitionsResponse
+from .types.count_entity_traits_response import CountEntityTraitsResponse
from .types.count_plan_traits_response import CountPlanTraitsResponse
from .types.count_users_response import CountUsersResponse
from .types.create_company_response import CreateCompanyResponse
@@ -38,6 +39,7 @@
from .types.delete_company_membership_response import DeleteCompanyMembershipResponse
from .types.delete_company_response import DeleteCompanyResponse
from .types.delete_entity_key_definition_response import DeleteEntityKeyDefinitionResponse
+from .types.delete_entity_trait_definition_response import DeleteEntityTraitDefinitionResponse
from .types.delete_user_by_keys_response import DeleteUserByKeysResponse
from .types.delete_user_response import DeleteUserResponse
from .types.get_active_company_subscription_response import GetActiveCompanySubscriptionResponse
@@ -45,6 +47,7 @@
from .types.get_company_billing_entity_response import GetCompanyBillingEntityResponse
from .types.get_company_response import GetCompanyResponse
from .types.get_entity_trait_definition_response import GetEntityTraitDefinitionResponse
+from .types.get_entity_trait_definition_usage_response import GetEntityTraitDefinitionUsageResponse
from .types.get_entity_trait_values_response import GetEntityTraitValuesResponse
from .types.get_or_create_company_membership_response import GetOrCreateCompanyMembershipResponse
from .types.get_or_create_entity_trait_definition_response import GetOrCreateEntityTraitDefinitionResponse
@@ -289,6 +292,7 @@ def upsert_company(
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
prevent_key_remap: typing.Optional[bool] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -314,6 +318,9 @@ def upsert_company(
prevent_key_remap : typing.Optional[bool]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -338,6 +345,7 @@ def upsert_company(
"last_seen_at": last_seen_at,
"name": name,
"prevent_key_remap": prevent_key_remap,
+ "remove_keys": remove_keys,
"traits": traits,
"update_only": update_only,
},
@@ -840,6 +848,7 @@ def create_company(
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
prevent_key_remap: typing.Optional[bool] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -865,6 +874,9 @@ def create_company(
prevent_key_remap : typing.Optional[bool]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -889,6 +901,7 @@ def create_company(
"last_seen_at": last_seen_at,
"name": name,
"prevent_key_remap": prevent_key_remap,
+ "remove_keys": remove_keys,
"traits": traits,
"update_only": update_only,
},
@@ -2884,65 +2897,34 @@ def update_entity_trait_definition(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def count_entity_trait_definitions(
- self,
- *,
- entity_type: typing.Optional[EntityType] = None,
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- q: typing.Optional[str] = None,
- trait_type: typing.Optional[TraitType] = None,
- trait_types: typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]] = None,
- limit: typing.Optional[int] = None,
- offset: typing.Optional[int] = None,
- request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[CountEntityTraitDefinitionsResponse]:
+ def delete_entity_trait_definition(
+ self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[DeleteEntityTraitDefinitionResponse]:
"""
Parameters
----------
- entity_type : typing.Optional[EntityType]
-
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
-
- q : typing.Optional[str]
-
- trait_type : typing.Optional[TraitType]
-
- trait_types : typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]]
-
- limit : typing.Optional[int]
- Page limit (default 100)
-
- offset : typing.Optional[int]
- Page offset (default 0)
+ entity_trait_definition_id : str
+ entity_trait_definition_id
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[CountEntityTraitDefinitionsResponse]
+ HttpResponse[DeleteEntityTraitDefinitionResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "entity-trait-definitions/count",
- method="GET",
- params={
- "entity_type": entity_type,
- "ids": ids,
- "q": q,
- "trait_type": trait_type,
- "trait_types": trait_types,
- "limit": limit,
- "offset": offset,
- },
+ f"entity-trait-definitions/{encode_path_param(entity_trait_definition_id)}",
+ method="DELETE",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- CountEntityTraitDefinitionsResponse,
+ DeleteEntityTraitDefinitionResponse,
parse_obj_as(
- type_=CountEntityTraitDefinitionsResponse, # type: ignore
+ type_=DeleteEntityTraitDefinitionResponse, # type: ignore
object_=_response.json(),
),
)
@@ -3015,68 +2997,38 @@ def count_entity_trait_definitions(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def get_entity_trait_values(
- self,
- *,
- definition_id: str,
- q: typing.Optional[str] = None,
- limit: typing.Optional[int] = None,
- offset: typing.Optional[int] = None,
- request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[GetEntityTraitValuesResponse]:
+ def get_entity_trait_definition_usage(
+ self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[GetEntityTraitDefinitionUsageResponse]:
"""
Parameters
----------
- definition_id : str
-
- q : typing.Optional[str]
-
- limit : typing.Optional[int]
- Page limit (default 100)
-
- offset : typing.Optional[int]
- Page offset (default 0)
+ entity_trait_definition_id : str
+ entity_trait_definition_id
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[GetEntityTraitValuesResponse]
+ HttpResponse[GetEntityTraitDefinitionUsageResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "entity-trait-values",
+ f"entity-trait-definitions/{encode_path_param(entity_trait_definition_id)}/usage",
method="GET",
- params={
- "definition_id": definition_id,
- "q": q,
- "limit": limit,
- "offset": offset,
- },
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetEntityTraitValuesResponse,
+ GetEntityTraitDefinitionUsageResponse,
parse_obj_as(
- type_=GetEntityTraitValuesResponse, # type: ignore
+ type_=GetEntityTraitDefinitionUsageResponse, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
- if _response.status_code == 400:
- raise BadRequestError(
- headers=dict(_response.headers),
- body=typing.cast(
- types_api_error_ApiError,
- parse_obj_as(
- type_=types_api_error_ApiError, # type: ignore
- object_=_response.json(),
- ),
- ),
- )
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -3134,30 +3086,30 @@ def get_entity_trait_values(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def list_plan_changes(
+ def count_entity_trait_definitions(
self,
*,
- action: typing.Optional[PlanChangeAction] = None,
- base_plan_action: typing.Optional[PlanChangeBasePlanAction] = None,
- company_id: typing.Optional[str] = None,
- company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ entity_type: typing.Optional[EntityType] = None,
+ ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ q: typing.Optional[str] = None,
+ trait_type: typing.Optional[TraitType] = None,
+ trait_types: typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[ListPlanChangesResponse]:
+ ) -> HttpResponse[CountEntityTraitDefinitionsResponse]:
"""
Parameters
----------
- action : typing.Optional[PlanChangeAction]
+ entity_type : typing.Optional[EntityType]
- base_plan_action : typing.Optional[PlanChangeBasePlanAction]
+ ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
- company_id : typing.Optional[str]
+ q : typing.Optional[str]
- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ trait_type : typing.Optional[TraitType]
- plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ trait_types : typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]]
limit : typing.Optional[int]
Page limit (default 100)
@@ -3170,18 +3122,18 @@ def list_plan_changes(
Returns
-------
- HttpResponse[ListPlanChangesResponse]
+ HttpResponse[CountEntityTraitDefinitionsResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "plan-changes",
+ "entity-trait-definitions/count",
method="GET",
params={
- "action": action,
- "base_plan_action": base_plan_action,
- "company_id": company_id,
- "company_ids": company_ids,
- "plan_ids": plan_ids,
+ "entity_type": entity_type,
+ "ids": ids,
+ "q": q,
+ "trait_type": trait_type,
+ "trait_types": trait_types,
"limit": limit,
"offset": offset,
},
@@ -3190,9 +3142,9 @@ def list_plan_changes(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- ListPlanChangesResponse,
+ CountEntityTraitDefinitionsResponse,
parse_obj_as(
- type_=ListPlanChangesResponse, # type: ignore
+ type_=CountEntityTraitDefinitionsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -3265,38 +3217,68 @@ def list_plan_changes(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def get_plan_change(
- self, plan_change_id: str, *, request_options: typing.Optional[RequestOptions] = None
- ) -> HttpResponse[GetPlanChangeResponse]:
+ def get_entity_trait_values(
+ self,
+ *,
+ definition_id: str,
+ q: typing.Optional[str] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[GetEntityTraitValuesResponse]:
"""
Parameters
----------
- plan_change_id : str
- plan_change_id
+ definition_id : str
+
+ q : typing.Optional[str]
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[GetPlanChangeResponse]
+ HttpResponse[GetEntityTraitValuesResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- f"plan-changes/{encode_path_param(plan_change_id)}",
+ "entity-trait-values",
method="GET",
+ params={
+ "definition_id": definition_id,
+ "q": q,
+ "limit": limit,
+ "offset": offset,
+ },
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetPlanChangeResponse,
+ GetEntityTraitValuesResponse,
parse_obj_as(
- type_=GetPlanChangeResponse, # type: ignore
+ type_=GetEntityTraitValuesResponse, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -3354,27 +3336,21 @@ def get_plan_change(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def list_plan_traits(
+ def count_entity_traits(
self,
*,
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- plan_id: typing.Optional[str] = None,
- trait_id: typing.Optional[str] = None,
- trait_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ definition_id: typing.Optional[str] = None,
+ entity_type: typing.Optional[EntityType] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[ListPlanTraitsResponse]:
+ ) -> HttpResponse[CountEntityTraitsResponse]:
"""
Parameters
----------
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
-
- plan_id : typing.Optional[str]
-
- trait_id : typing.Optional[str]
+ definition_id : typing.Optional[str]
- trait_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ entity_type : typing.Optional[EntityType]
limit : typing.Optional[int]
Page limit (default 100)
@@ -3387,17 +3363,15 @@ def list_plan_traits(
Returns
-------
- HttpResponse[ListPlanTraitsResponse]
+ HttpResponse[CountEntityTraitsResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "plan-traits",
+ "entity-traits/count",
method="GET",
params={
- "ids": ids,
- "plan_id": plan_id,
- "trait_id": trait_id,
- "trait_ids": trait_ids,
+ "definition_id": definition_id,
+ "entity_type": entity_type,
"limit": limit,
"offset": offset,
},
@@ -3406,9 +3380,9 @@ def list_plan_traits(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- ListPlanTraitsResponse,
+ CountEntityTraitsResponse,
parse_obj_as(
- type_=ListPlanTraitsResponse, # type: ignore
+ type_=CountEntityTraitsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -3481,40 +3455,67 @@ def list_plan_traits(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def get_plan_trait(
- self, plan_trait_id: str, *, request_options: typing.Optional[RequestOptions] = None
- ) -> HttpResponse[GetPlanTraitResponse]:
+ def list_plan_changes(
+ self,
+ *,
+ action: typing.Optional[PlanChangeAction] = None,
+ base_plan_action: typing.Optional[PlanChangeBasePlanAction] = None,
+ company_id: typing.Optional[str] = None,
+ company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[ListPlanChangesResponse]:
"""
Parameters
----------
- plan_trait_id : str
- plan_trait_id
+ action : typing.Optional[PlanChangeAction]
+
+ base_plan_action : typing.Optional[PlanChangeBasePlanAction]
+
+ company_id : typing.Optional[str]
+
+ company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[GetPlanTraitResponse]
+ HttpResponse[ListPlanChangesResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- f"plan-traits/{encode_path_param(plan_trait_id)}",
+ "plan-changes",
method="GET",
+ params={
+ "action": action,
+ "base_plan_action": base_plan_action,
+ "company_id": company_id,
+ "company_ids": company_ids,
+ "limit": limit,
+ "offset": offset,
+ },
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetPlanTraitResponse,
+ ListPlanChangesResponse,
parse_obj_as(
- type_=GetPlanTraitResponse, # type: ignore
+ type_=ListPlanChangesResponse, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
- if _response.status_code == 401:
- raise UnauthorizedError(
+ if _response.status_code == 400:
+ raise BadRequestError(
headers=dict(_response.headers),
body=typing.cast(
types_api_error_ApiError,
@@ -3524,7 +3525,18 @@ def get_plan_trait(
),
),
)
- if _response.status_code == 403:
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
raise ForbiddenError(
headers=dict(_response.headers),
body=typing.cast(
@@ -3570,68 +3582,38 @@ def get_plan_trait(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def update_plan_traits_bulk(
- self,
- *,
- apply_to_existing_companies: bool,
- plan_id: str,
- traits: typing.Sequence[UpdatePlanTraitTraitRequestBody],
- request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[UpdatePlanTraitsBulkResponse]:
+ def get_plan_change(
+ self, plan_change_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[GetPlanChangeResponse]:
"""
Parameters
----------
- apply_to_existing_companies : bool
-
- plan_id : str
-
- traits : typing.Sequence[UpdatePlanTraitTraitRequestBody]
+ plan_change_id : str
+ plan_change_id
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[UpdatePlanTraitsBulkResponse]
+ HttpResponse[GetPlanChangeResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "plan-traits/bulk",
- method="POST",
- json={
- "apply_to_existing_companies": apply_to_existing_companies,
- "plan_id": plan_id,
- "traits": convert_and_respect_annotation_metadata(
- object_=traits, annotation=typing.Sequence[UpdatePlanTraitTraitRequestBody], direction="write"
- ),
- },
- headers={
- "content-type": "application/json",
- },
+ f"plan-changes/{encode_path_param(plan_change_id)}",
+ method="GET",
request_options=request_options,
- omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- UpdatePlanTraitsBulkResponse,
+ GetPlanChangeResponse,
parse_obj_as(
- type_=UpdatePlanTraitsBulkResponse, # type: ignore
+ type_=GetPlanChangeResponse, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
- if _response.status_code == 400:
- raise BadRequestError(
- headers=dict(_response.headers),
- body=typing.cast(
- types_api_error_ApiError,
- parse_obj_as(
- type_=types_api_error_ApiError, # type: ignore
- object_=_response.json(),
- ),
- ),
- )
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -3689,7 +3671,7 @@ def update_plan_traits_bulk(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def count_plan_traits(
+ def list_plan_traits(
self,
*,
ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
@@ -3699,7 +3681,7 @@ def count_plan_traits(
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[CountPlanTraitsResponse]:
+ ) -> HttpResponse[ListPlanTraitsResponse]:
"""
Parameters
----------
@@ -3722,11 +3704,11 @@ def count_plan_traits(
Returns
-------
- HttpResponse[CountPlanTraitsResponse]
+ HttpResponse[ListPlanTraitsResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "plan-traits/count",
+ "plan-traits",
method="GET",
params={
"ids": ids,
@@ -3741,9 +3723,9 @@ def count_plan_traits(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- CountPlanTraitsResponse,
+ ListPlanTraitsResponse,
parse_obj_as(
- type_=CountPlanTraitsResponse, # type: ignore
+ type_=ListPlanTraitsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -3816,51 +3798,129 @@ def count_plan_traits(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def upsert_user_trait(
+ def get_plan_trait(
+ self, plan_trait_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[GetPlanTraitResponse]:
+ """
+ Parameters
+ ----------
+ plan_trait_id : str
+ plan_trait_id
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[GetPlanTraitResponse]
+ OK
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"plan-traits/{encode_path_param(plan_trait_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ GetPlanTraitResponse,
+ parse_obj_as(
+ type_=GetPlanTraitResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ def update_plan_traits_bulk(
self,
*,
- keys: typing.Dict[str, str],
- trait: str,
- incr: typing.Optional[int] = OMIT,
- set_: typing.Optional[str] = OMIT,
- update_only: typing.Optional[bool] = OMIT,
+ apply_to_existing_companies: bool,
+ plan_id: str,
+ traits: typing.Sequence[UpdatePlanTraitTraitRequestBody],
request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[UpsertUserTraitResponse]:
+ ) -> HttpResponse[UpdatePlanTraitsBulkResponse]:
"""
Parameters
----------
- keys : typing.Dict[str, str]
- Key/value pairs to identify a company or user
-
- trait : str
- Name of the trait to update
-
- incr : typing.Optional[int]
- Amount to increment the trait by (positive or negative)
+ apply_to_existing_companies : bool
- set_ : typing.Optional[str]
- Value to set the trait to
+ plan_id : str
- update_only : typing.Optional[bool]
- Unless this is set, the company or user will be created if it does not already exist
+ traits : typing.Sequence[UpdatePlanTraitTraitRequestBody]
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[UpsertUserTraitResponse]
+ HttpResponse[UpdatePlanTraitsBulkResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "user-traits",
+ "plan-traits/bulk",
method="POST",
json={
- "incr": incr,
- "keys": keys,
- "set": set_,
- "trait": trait,
- "update_only": update_only,
+ "apply_to_existing_companies": apply_to_existing_companies,
+ "plan_id": plan_id,
+ "traits": convert_and_respect_annotation_metadata(
+ object_=traits, annotation=typing.Sequence[UpdatePlanTraitTraitRequestBody], direction="write"
+ ),
},
headers={
"content-type": "application/json",
@@ -3871,9 +3931,9 @@ def upsert_user_trait(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- UpsertUserTraitResponse,
+ UpdatePlanTraitsBulkResponse,
parse_obj_as(
- type_=UpsertUserTraitResponse, # type: ignore
+ type_=UpdatePlanTraitsBulkResponse, # type: ignore
object_=_response.json(),
),
)
@@ -3946,31 +4006,27 @@ def upsert_user_trait(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def list_users(
+ def count_plan_traits(
self,
*,
- company_id: typing.Optional[str] = None,
ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
plan_id: typing.Optional[str] = None,
- q: typing.Optional[str] = None,
+ trait_id: typing.Optional[str] = None,
+ trait_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[ListUsersResponse]:
+ ) -> HttpResponse[CountPlanTraitsResponse]:
"""
Parameters
----------
- company_id : typing.Optional[str]
- Filter users by company ID (starts with comp_)
-
ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
- Filter users by multiple user IDs (starts with user_)
plan_id : typing.Optional[str]
- Filter users by plan ID (starts with plan_)
- q : typing.Optional[str]
- Search for users by name, keys or string traits
+ trait_id : typing.Optional[str]
+
+ trait_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
limit : typing.Optional[int]
Page limit (default 100)
@@ -3983,17 +4039,17 @@ def list_users(
Returns
-------
- HttpResponse[ListUsersResponse]
+ HttpResponse[CountPlanTraitsResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "users",
+ "plan-traits/count",
method="GET",
params={
- "company_id": company_id,
"ids": ids,
"plan_id": plan_id,
- "q": q,
+ "trait_id": trait_id,
+ "trait_ids": trait_ids,
"limit": limit,
"offset": offset,
},
@@ -4002,9 +4058,9 @@ def list_users(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- ListUsersResponse,
+ CountPlanTraitsResponse,
parse_obj_as(
- type_=ListUsersResponse, # type: ignore
+ type_=CountPlanTraitsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -4077,72 +4133,50 @@ def list_users(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def upsert_user(
+ def upsert_user_trait(
self,
*,
keys: typing.Dict[str, str],
- companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
- company: typing.Optional[typing.Dict[str, str]] = OMIT,
- company_id: typing.Optional[str] = OMIT,
- company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
- id: typing.Optional[str] = OMIT,
- last_seen_at: typing.Optional[dt.datetime] = OMIT,
- name: typing.Optional[str] = OMIT,
- traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
+ trait: str,
+ incr: typing.Optional[int] = OMIT,
+ set_: typing.Optional[str] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[UpsertUserResponse]:
+ ) -> HttpResponse[UpsertUserTraitResponse]:
"""
Parameters
----------
keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+ Key/value pairs to identify a company or user
- companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
- Optionally specify companies using array of key/value pairs
-
- company : typing.Optional[typing.Dict[str, str]]
- Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
-
- company_id : typing.Optional[str]
- Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
-
- company_ids : typing.Optional[typing.Sequence[str]]
- Optionally specify companies using Schematic company ID
-
- id : typing.Optional[str]
- If you know the Schematic ID, you can use that here instead of keys
-
- last_seen_at : typing.Optional[dt.datetime]
+ trait : str
+ Name of the trait to update
- name : typing.Optional[str]
+ incr : typing.Optional[int]
+ Amount to increment the trait by (positive or negative)
- traits : typing.Optional[typing.Dict[str, typing.Any]]
- A map of trait names to trait values
+ set_ : typing.Optional[str]
+ Value to set the trait to
update_only : typing.Optional[bool]
+ Unless this is set, the company or user will be created if it does not already exist
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[UpsertUserResponse]
+ HttpResponse[UpsertUserTraitResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "users",
+ "user-traits",
method="POST",
json={
- "companies": companies,
- "company": company,
- "company_id": company_id,
- "company_ids": company_ids,
- "id": id,
+ "incr": incr,
"keys": keys,
- "last_seen_at": last_seen_at,
- "name": name,
- "traits": traits,
+ "set": set_,
+ "trait": trait,
"update_only": update_only,
},
headers={
@@ -4154,9 +4188,9 @@ def upsert_user(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- UpsertUserResponse,
+ UpsertUserTraitResponse,
parse_obj_as(
- type_=UpsertUserResponse, # type: ignore
+ type_=UpsertUserTraitResponse, # type: ignore
object_=_response.json(),
),
)
@@ -4229,38 +4263,80 @@ def upsert_user(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def get_user(
- self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
- ) -> HttpResponse[GetUserResponse]:
+ def list_users(
+ self,
+ *,
+ company_id: typing.Optional[str] = None,
+ ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ plan_id: typing.Optional[str] = None,
+ q: typing.Optional[str] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[ListUsersResponse]:
"""
Parameters
----------
- user_id : str
- user_id
+ company_id : typing.Optional[str]
+ Filter users by company ID (starts with comp_)
+
+ ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Filter users by multiple user IDs (starts with user_)
+
+ plan_id : typing.Optional[str]
+ Filter users by plan ID (starts with plan_)
+
+ q : typing.Optional[str]
+ Search for users by name, keys or string traits
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[GetUserResponse]
+ HttpResponse[ListUsersResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- f"users/{encode_path_param(user_id)}",
+ "users",
method="GET",
+ params={
+ "company_id": company_id,
+ "ids": ids,
+ "plan_id": plan_id,
+ "q": q,
+ "limit": limit,
+ "offset": offset,
+ },
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetUserResponse,
+ ListUsersResponse,
parse_obj_as(
- type_=GetUserResponse, # type: ignore
+ type_=ListUsersResponse, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -4318,34 +4394,91 @@ def get_user(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def delete_user(
- self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
- ) -> HttpResponse[DeleteUserResponse]:
+ def upsert_user(
+ self,
+ *,
+ keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
+ company_id: typing.Optional[str] = OMIT,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ id: typing.Optional[str] = OMIT,
+ last_seen_at: typing.Optional[dt.datetime] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
+ traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
+ update_only: typing.Optional[bool] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[UpsertUserResponse]:
"""
Parameters
----------
- user_id : str
- user_id
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
+ Optionally specify companies using array of key/value pairs
+
+ company : typing.Optional[typing.Dict[str, str]]
+ Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
+
+ company_id : typing.Optional[str]
+ Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids
+
+ company_ids : typing.Optional[typing.Sequence[str]]
+ Optionally specify companies using Schematic company ID
+
+ id : typing.Optional[str]
+ If you know the Schematic ID, you can use that here instead of keys
+
+ last_seen_at : typing.Optional[dt.datetime]
+
+ name : typing.Optional[str]
+
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+
+ traits : typing.Optional[typing.Dict[str, typing.Any]]
+ A map of trait names to trait values
+
+ update_only : typing.Optional[bool]
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[DeleteUserResponse]
+ HttpResponse[UpsertUserResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- f"users/{encode_path_param(user_id)}",
- method="DELETE",
+ "users",
+ method="POST",
+ json={
+ "companies": companies,
+ "company": company,
+ "company_id": company_id,
+ "company_ids": company_ids,
+ "id": id,
+ "keys": keys,
+ "last_seen_at": last_seen_at,
+ "name": name,
+ "remove_keys": remove_keys,
+ "traits": traits,
+ "update_only": update_only,
+ },
+ headers={
+ "content-type": "application/json",
+ },
request_options=request_options,
+ omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- DeleteUserResponse,
+ UpsertUserResponse,
parse_obj_as(
- type_=DeleteUserResponse, # type: ignore
+ type_=UpsertUserResponse, # type: ignore
object_=_response.json(),
),
)
@@ -4418,80 +4551,38 @@ def delete_user(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def count_users(
- self,
- *,
- company_id: typing.Optional[str] = None,
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- plan_id: typing.Optional[str] = None,
- q: typing.Optional[str] = None,
- limit: typing.Optional[int] = None,
- offset: typing.Optional[int] = None,
- request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[CountUsersResponse]:
+ def get_user(
+ self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[GetUserResponse]:
"""
Parameters
----------
- company_id : typing.Optional[str]
- Filter users by company ID (starts with comp_)
-
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
- Filter users by multiple user IDs (starts with user_)
-
- plan_id : typing.Optional[str]
- Filter users by plan ID (starts with plan_)
-
- q : typing.Optional[str]
- Search for users by name, keys or string traits
-
- limit : typing.Optional[int]
- Page limit (default 100)
-
- offset : typing.Optional[int]
- Page offset (default 0)
+ user_id : str
+ user_id
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- HttpResponse[CountUsersResponse]
+ HttpResponse[GetUserResponse]
OK
"""
_response = self._client_wrapper.httpx_client.request(
- "users/count",
+ f"users/{encode_path_param(user_id)}",
method="GET",
- params={
- "company_id": company_id,
- "ids": ids,
- "plan_id": plan_id,
- "q": q,
- "limit": limit,
- "offset": offset,
- },
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- CountUsersResponse,
+ GetUserResponse,
parse_obj_as(
- type_=CountUsersResponse, # type: ignore
+ type_=GetUserResponse, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
- if _response.status_code == 400:
- raise BadRequestError(
- headers=dict(_response.headers),
- body=typing.cast(
- types_api_error_ApiError,
- parse_obj_as(
- type_=types_api_error_ApiError, # type: ignore
- object_=_response.json(),
- ),
- ),
- )
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -4549,25 +4640,257 @@ def count_users(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- def create_user(
- self,
- *,
- keys: typing.Dict[str, str],
- companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
- company: typing.Optional[typing.Dict[str, str]] = OMIT,
- company_id: typing.Optional[str] = OMIT,
- company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
- id: typing.Optional[str] = OMIT,
- last_seen_at: typing.Optional[dt.datetime] = OMIT,
- name: typing.Optional[str] = OMIT,
- traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
- update_only: typing.Optional[bool] = OMIT,
- request_options: typing.Optional[RequestOptions] = None,
- ) -> HttpResponse[CreateUserResponse]:
+ def delete_user(
+ self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[DeleteUserResponse]:
"""
Parameters
----------
- keys : typing.Dict[str, str]
+ user_id : str
+ user_id
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[DeleteUserResponse]
+ OK
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"users/{encode_path_param(user_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ DeleteUserResponse,
+ parse_obj_as(
+ type_=DeleteUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ def count_users(
+ self,
+ *,
+ company_id: typing.Optional[str] = None,
+ ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ plan_id: typing.Optional[str] = None,
+ q: typing.Optional[str] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[CountUsersResponse]:
+ """
+ Parameters
+ ----------
+ company_id : typing.Optional[str]
+ Filter users by company ID (starts with comp_)
+
+ ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Filter users by multiple user IDs (starts with user_)
+
+ plan_id : typing.Optional[str]
+ Filter users by plan ID (starts with plan_)
+
+ q : typing.Optional[str]
+ Search for users by name, keys or string traits
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[CountUsersResponse]
+ OK
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "users/count",
+ method="GET",
+ params={
+ "company_id": company_id,
+ "ids": ids,
+ "plan_id": plan_id,
+ "q": q,
+ "limit": limit,
+ "offset": offset,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ CountUsersResponse,
+ parse_obj_as(
+ type_=CountUsersResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ def create_user(
+ self,
+ *,
+ keys: typing.Dict[str, str],
+ companies: typing.Optional[typing.Sequence[typing.Dict[str, str]]] = OMIT,
+ company: typing.Optional[typing.Dict[str, str]] = OMIT,
+ company_id: typing.Optional[str] = OMIT,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ id: typing.Optional[str] = OMIT,
+ last_seen_at: typing.Optional[dt.datetime] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
+ traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
+ update_only: typing.Optional[bool] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[CreateUserResponse]:
+ """
+ Parameters
+ ----------
+ keys : typing.Dict[str, str]
See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
companies : typing.Optional[typing.Sequence[typing.Dict[str, str]]]
@@ -4589,6 +4912,9 @@ def create_user(
name : typing.Optional[str]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -4614,6 +4940,7 @@ def create_user(
"keys": keys,
"last_seen_at": last_seen_at,
"name": name,
+ "remove_keys": remove_keys,
"traits": traits,
"update_only": update_only,
},
@@ -5117,6 +5444,7 @@ async def upsert_company(
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
prevent_key_remap: typing.Optional[bool] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -5142,6 +5470,9 @@ async def upsert_company(
prevent_key_remap : typing.Optional[bool]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -5166,6 +5497,7 @@ async def upsert_company(
"last_seen_at": last_seen_at,
"name": name,
"prevent_key_remap": prevent_key_remap,
+ "remove_keys": remove_keys,
"traits": traits,
"update_only": update_only,
},
@@ -5668,6 +6000,7 @@ async def create_company(
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
prevent_key_remap: typing.Optional[bool] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -5675,63 +6008,373 @@ async def create_company(
"""
Parameters
----------
- keys : typing.Dict[str, str]
- See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
-
- base_plan_id : typing.Optional[str]
- Assign this base plan when creating the company (starts with plan_). Takes precedence over the environment's initial plan and must be provisionable without a payment method.
-
- base_plan_price_id : typing.Optional[str]
- The Schematic price to provision for base_plan_id (starts with bilpp_). Required and must be $0 for a billing-linked plan; omit for a plan that is not billing-linked.
-
- id : typing.Optional[str]
- If you know the Schematic ID, you can use that here instead of keys
-
- last_seen_at : typing.Optional[dt.datetime]
-
- name : typing.Optional[str]
-
- prevent_key_remap : typing.Optional[bool]
-
- traits : typing.Optional[typing.Dict[str, typing.Any]]
- A map of trait names to trait values
-
- update_only : typing.Optional[bool]
+ keys : typing.Dict[str, str]
+ See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information
+
+ base_plan_id : typing.Optional[str]
+ Assign this base plan when creating the company (starts with plan_). Takes precedence over the environment's initial plan and must be provisionable without a payment method.
+
+ base_plan_price_id : typing.Optional[str]
+ The Schematic price to provision for base_plan_id (starts with bilpp_). Required and must be $0 for a billing-linked plan; omit for a plan that is not billing-linked.
+
+ id : typing.Optional[str]
+ If you know the Schematic ID, you can use that here instead of keys
+
+ last_seen_at : typing.Optional[dt.datetime]
+
+ name : typing.Optional[str]
+
+ prevent_key_remap : typing.Optional[bool]
+
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+
+ traits : typing.Optional[typing.Dict[str, typing.Any]]
+ A map of trait names to trait values
+
+ update_only : typing.Optional[bool]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[CreateCompanyResponse]
+ Created
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "companies/create",
+ method="POST",
+ json={
+ "base_plan_id": base_plan_id,
+ "base_plan_price_id": base_plan_price_id,
+ "id": id,
+ "keys": keys,
+ "last_seen_at": last_seen_at,
+ "name": name,
+ "prevent_key_remap": prevent_key_remap,
+ "remove_keys": remove_keys,
+ "traits": traits,
+ "update_only": update_only,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ CreateCompanyResponse,
+ parse_obj_as(
+ type_=CreateCompanyResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ async def delete_company_by_keys(
+ self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[DeleteCompanyByKeysResponse]:
+ """
+ Parameters
+ ----------
+ keys : typing.Dict[str, str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[DeleteCompanyByKeysResponse]
+ OK
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "companies/delete",
+ method="POST",
+ json={
+ "keys": keys,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ DeleteCompanyByKeysResponse,
+ parse_obj_as(
+ type_=DeleteCompanyByKeysResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ async def lookup_company(
+ self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[LookupCompanyResponse]:
+ """
+ Company lookup is determined to resolve a company from its keys, similar to how many of our other apis work.
+ The following approaches will all work to resolve a company and any of them are appropriate:
+ 1. `/companies/lookup?keys={"foo": "bar", "fizz": "buzz"}`
+ 2. `/companies/lookup?keys[foo]=bar&keys[fizz]=buzz`
+ 2. `/companies/lookup?foo=bar&fizz=buzz`
+
+ Parameters
+ ----------
+ keys : typing.Dict[str, str]
+ Key/value pairs
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[LookupCompanyResponse]
+ OK
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "companies/lookup",
+ method="GET",
+ params={
+ "keys": keys,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ LookupCompanyResponse,
+ parse_obj_as(
+ type_=LookupCompanyResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
+ )
+ except ValidationError as e:
+ raise ParsingError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
+ )
+ raise core_api_error_ApiError(
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
+ )
+
+ async def get_company_billing_entity(
+ self, *, company_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[GetCompanyBillingEntityResponse]:
+ """
+ Parameters
+ ----------
+ company_id : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[CreateCompanyResponse]
- Created
+ AsyncHttpResponse[GetCompanyBillingEntityResponse]
+ OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "companies/create",
- method="POST",
- json={
- "base_plan_id": base_plan_id,
- "base_plan_price_id": base_plan_price_id,
- "id": id,
- "keys": keys,
- "last_seen_at": last_seen_at,
- "name": name,
- "prevent_key_remap": prevent_key_remap,
- "traits": traits,
- "update_only": update_only,
- },
- headers={
- "content-type": "application/json",
+ "company-billing-entity",
+ method="GET",
+ params={
+ "company_id": company_id,
},
request_options=request_options,
- omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- CreateCompanyResponse,
+ GetCompanyBillingEntityResponse,
parse_obj_as(
- type_=CreateCompanyResponse, # type: ignore
+ type_=GetCompanyBillingEntityResponse, # type: ignore
object_=_response.json(),
),
)
@@ -5804,40 +6447,36 @@ async def create_company(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def delete_company_by_keys(
- self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[DeleteCompanyByKeysResponse]:
+ async def get_billing_entity_child_subscriptions(
+ self, *, company_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[GetBillingEntityChildSubscriptionsResponse]:
"""
Parameters
----------
- keys : typing.Dict[str, str]
+ company_id : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[DeleteCompanyByKeysResponse]
+ AsyncHttpResponse[GetBillingEntityChildSubscriptionsResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "companies/delete",
- method="POST",
- json={
- "keys": keys,
- },
- headers={
- "content-type": "application/json",
+ "company-billing-entity-subscriptions",
+ method="GET",
+ params={
+ "company_id": company_id,
},
request_options=request_options,
- omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- DeleteCompanyByKeysResponse,
+ GetBillingEntityChildSubscriptionsResponse,
parse_obj_as(
- type_=DeleteCompanyByKeysResponse, # type: ignore
+ type_=GetBillingEntityChildSubscriptionsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -5910,47 +6549,68 @@ async def delete_company_by_keys(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def lookup_company(
- self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[LookupCompanyResponse]:
+ async def list_company_memberships(
+ self,
+ *,
+ company_id: typing.Optional[str] = None,
+ user_id: typing.Optional[str] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[ListCompanyMembershipsResponse]:
"""
- Company lookup is determined to resolve a company from its keys, similar to how many of our other apis work.
- The following approaches will all work to resolve a company and any of them are appropriate:
- 1. `/companies/lookup?keys={"foo": "bar", "fizz": "buzz"}`
- 2. `/companies/lookup?keys[foo]=bar&keys[fizz]=buzz`
- 2. `/companies/lookup?foo=bar&fizz=buzz`
-
Parameters
----------
- keys : typing.Dict[str, str]
- Key/value pairs
+ company_id : typing.Optional[str]
+
+ user_id : typing.Optional[str]
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[LookupCompanyResponse]
+ AsyncHttpResponse[ListCompanyMembershipsResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "companies/lookup",
+ "company-memberships",
method="GET",
params={
- "keys": keys,
+ "company_id": company_id,
+ "user_id": user_id,
+ "limit": limit,
+ "offset": offset,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- LookupCompanyResponse,
+ ListCompanyMembershipsResponse,
parse_obj_as(
- type_=LookupCompanyResponse, # type: ignore
+ type_=ListCompanyMembershipsResponse, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 400:
+ raise BadRequestError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ types_api_error_ApiError,
+ parse_obj_as(
+ type_=types_api_error_ApiError, # type: ignore
+ object_=_response.json(),
+ ),
+ ),
+ )
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -6008,36 +6668,43 @@ async def lookup_company(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def get_company_billing_entity(
- self, *, company_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[GetCompanyBillingEntityResponse]:
+ async def get_or_create_company_membership(
+ self, *, company_id: str, user_id: str, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[GetOrCreateCompanyMembershipResponse]:
"""
Parameters
----------
- company_id : typing.Optional[str]
+ company_id : str
+
+ user_id : str
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[GetCompanyBillingEntityResponse]
+ AsyncHttpResponse[GetOrCreateCompanyMembershipResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "company-billing-entity",
- method="GET",
- params={
+ "company-memberships",
+ method="POST",
+ json={
"company_id": company_id,
+ "user_id": user_id,
+ },
+ headers={
+ "content-type": "application/json",
},
request_options=request_options,
+ omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetCompanyBillingEntityResponse,
+ GetOrCreateCompanyMembershipResponse,
parse_obj_as(
- type_=GetCompanyBillingEntityResponse, # type: ignore
+ type_=GetOrCreateCompanyMembershipResponse, # type: ignore
object_=_response.json(),
),
)
@@ -6110,36 +6777,34 @@ async def get_company_billing_entity(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def get_billing_entity_child_subscriptions(
- self, *, company_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[GetBillingEntityChildSubscriptionsResponse]:
+ async def delete_company_membership(
+ self, company_membership_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[DeleteCompanyMembershipResponse]:
"""
Parameters
----------
- company_id : typing.Optional[str]
+ company_membership_id : str
+ company_membership_id
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[GetBillingEntityChildSubscriptionsResponse]
+ AsyncHttpResponse[DeleteCompanyMembershipResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "company-billing-entity-subscriptions",
- method="GET",
- params={
- "company_id": company_id,
- },
+ f"company-memberships/{encode_path_param(company_membership_id)}",
+ method="DELETE",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetBillingEntityChildSubscriptionsResponse,
+ DeleteCompanyMembershipResponse,
parse_obj_as(
- type_=GetBillingEntityChildSubscriptionsResponse, # type: ignore
+ type_=DeleteCompanyMembershipResponse, # type: ignore
object_=_response.json(),
),
)
@@ -6212,21 +6877,21 @@ async def get_billing_entity_child_subscriptions(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def list_company_memberships(
+ async def get_active_company_subscription(
self,
*,
company_id: typing.Optional[str] = None,
- user_id: typing.Optional[str] = None,
+ company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[ListCompanyMembershipsResponse]:
+ ) -> AsyncHttpResponse[GetActiveCompanySubscriptionResponse]:
"""
Parameters
----------
company_id : typing.Optional[str]
- user_id : typing.Optional[str]
+ company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
limit : typing.Optional[int]
Page limit (default 100)
@@ -6239,15 +6904,15 @@ async def list_company_memberships(
Returns
-------
- AsyncHttpResponse[ListCompanyMembershipsResponse]
+ AsyncHttpResponse[GetActiveCompanySubscriptionResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "company-memberships",
+ "company-subscriptions",
method="GET",
params={
"company_id": company_id,
- "user_id": user_id,
+ "company_ids": company_ids,
"limit": limit,
"offset": offset,
},
@@ -6256,9 +6921,9 @@ async def list_company_memberships(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- ListCompanyMembershipsResponse,
+ GetActiveCompanySubscriptionResponse,
parse_obj_as(
- type_=ListCompanyMembershipsResponse, # type: ignore
+ type_=GetActiveCompanySubscriptionResponse, # type: ignore
object_=_response.json(),
),
)
@@ -6331,30 +6996,51 @@ async def list_company_memberships(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def get_or_create_company_membership(
- self, *, company_id: str, user_id: str, request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[GetOrCreateCompanyMembershipResponse]:
+ async def upsert_company_trait(
+ self,
+ *,
+ keys: typing.Dict[str, str],
+ trait: str,
+ incr: typing.Optional[int] = OMIT,
+ set_: typing.Optional[str] = OMIT,
+ update_only: typing.Optional[bool] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[UpsertCompanyTraitResponse]:
"""
Parameters
----------
- company_id : str
+ keys : typing.Dict[str, str]
+ Key/value pairs to identify a company or user
- user_id : str
+ trait : str
+ Name of the trait to update
+
+ incr : typing.Optional[int]
+ Amount to increment the trait by (positive or negative)
+
+ set_ : typing.Optional[str]
+ Value to set the trait to
+
+ update_only : typing.Optional[bool]
+ Unless this is set, the company or user will be created if it does not already exist
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[GetOrCreateCompanyMembershipResponse]
+ AsyncHttpResponse[UpsertCompanyTraitResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "company-memberships",
+ "company-traits",
method="POST",
json={
- "company_id": company_id,
- "user_id": user_id,
+ "incr": incr,
+ "keys": keys,
+ "set": set_,
+ "trait": trait,
+ "update_only": update_only,
},
headers={
"content-type": "application/json",
@@ -6365,9 +7051,9 @@ async def get_or_create_company_membership(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetOrCreateCompanyMembershipResponse,
+ UpsertCompanyTraitResponse,
parse_obj_as(
- type_=GetOrCreateCompanyMembershipResponse, # type: ignore
+ type_=UpsertCompanyTraitResponse, # type: ignore
object_=_response.json(),
),
)
@@ -6440,34 +7126,57 @@ async def get_or_create_company_membership(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def delete_company_membership(
- self, company_membership_id: str, *, request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[DeleteCompanyMembershipResponse]:
+ async def list_entity_key_definitions(
+ self,
+ *,
+ entity_type: typing.Optional[EntityType] = None,
+ ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ q: typing.Optional[str] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[ListEntityKeyDefinitionsResponse]:
"""
Parameters
----------
- company_membership_id : str
- company_membership_id
+ entity_type : typing.Optional[EntityType]
+
+ ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ q : typing.Optional[str]
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[DeleteCompanyMembershipResponse]
+ AsyncHttpResponse[ListEntityKeyDefinitionsResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- f"company-memberships/{encode_path_param(company_membership_id)}",
- method="DELETE",
+ "entity-key-definitions",
+ method="GET",
+ params={
+ "entity_type": entity_type,
+ "ids": ids,
+ "q": q,
+ "limit": limit,
+ "offset": offset,
+ },
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- DeleteCompanyMembershipResponse,
+ ListEntityKeyDefinitionsResponse,
parse_obj_as(
- type_=DeleteCompanyMembershipResponse, # type: ignore
+ type_=ListEntityKeyDefinitionsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -6540,53 +7249,34 @@ async def delete_company_membership(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def get_active_company_subscription(
- self,
- *,
- company_id: typing.Optional[str] = None,
- company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- limit: typing.Optional[int] = None,
- offset: typing.Optional[int] = None,
- request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[GetActiveCompanySubscriptionResponse]:
+ async def delete_entity_key_definition(
+ self, entity_key_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[DeleteEntityKeyDefinitionResponse]:
"""
Parameters
----------
- company_id : typing.Optional[str]
-
- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
-
- limit : typing.Optional[int]
- Page limit (default 100)
-
- offset : typing.Optional[int]
- Page offset (default 0)
+ entity_key_definition_id : str
+ entity_key_definition_id
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[GetActiveCompanySubscriptionResponse]
+ AsyncHttpResponse[DeleteEntityKeyDefinitionResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "company-subscriptions",
- method="GET",
- params={
- "company_id": company_id,
- "company_ids": company_ids,
- "limit": limit,
- "offset": offset,
- },
+ f"entity-key-definitions/{encode_path_param(entity_key_definition_id)}",
+ method="DELETE",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetActiveCompanySubscriptionResponse,
+ DeleteEntityKeyDefinitionResponse,
parse_obj_as(
- type_=GetActiveCompanySubscriptionResponse, # type: ignore
+ type_=DeleteEntityKeyDefinitionResponse, # type: ignore
object_=_response.json(),
),
)
@@ -6659,64 +7349,57 @@ async def get_active_company_subscription(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def upsert_company_trait(
+ async def count_entity_key_definitions(
self,
*,
- keys: typing.Dict[str, str],
- trait: str,
- incr: typing.Optional[int] = OMIT,
- set_: typing.Optional[str] = OMIT,
- update_only: typing.Optional[bool] = OMIT,
+ entity_type: typing.Optional[EntityType] = None,
+ ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ q: typing.Optional[str] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[UpsertCompanyTraitResponse]:
+ ) -> AsyncHttpResponse[CountEntityKeyDefinitionsResponse]:
"""
Parameters
----------
- keys : typing.Dict[str, str]
- Key/value pairs to identify a company or user
+ entity_type : typing.Optional[EntityType]
- trait : str
- Name of the trait to update
+ ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
- incr : typing.Optional[int]
- Amount to increment the trait by (positive or negative)
+ q : typing.Optional[str]
- set_ : typing.Optional[str]
- Value to set the trait to
+ limit : typing.Optional[int]
+ Page limit (default 100)
- update_only : typing.Optional[bool]
- Unless this is set, the company or user will be created if it does not already exist
+ offset : typing.Optional[int]
+ Page offset (default 0)
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[UpsertCompanyTraitResponse]
+ AsyncHttpResponse[CountEntityKeyDefinitionsResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "company-traits",
- method="POST",
- json={
- "incr": incr,
- "keys": keys,
- "set": set_,
- "trait": trait,
- "update_only": update_only,
- },
- headers={
- "content-type": "application/json",
+ "entity-key-definitions/count",
+ method="GET",
+ params={
+ "entity_type": entity_type,
+ "ids": ids,
+ "q": q,
+ "limit": limit,
+ "offset": offset,
},
request_options=request_options,
- omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- UpsertCompanyTraitResponse,
+ CountEntityKeyDefinitionsResponse,
parse_obj_as(
- type_=UpsertCompanyTraitResponse, # type: ignore
+ type_=CountEntityKeyDefinitionsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -6789,24 +7472,21 @@ async def upsert_company_trait(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def list_entity_key_definitions(
+ async def count_entity_keys(
self,
*,
+ definition_id: typing.Optional[str] = None,
entity_type: typing.Optional[EntityType] = None,
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- q: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[ListEntityKeyDefinitionsResponse]:
+ ) -> AsyncHttpResponse[CountEntityKeysResponse]:
"""
Parameters
----------
- entity_type : typing.Optional[EntityType]
-
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ definition_id : typing.Optional[str]
- q : typing.Optional[str]
+ entity_type : typing.Optional[EntityType]
limit : typing.Optional[int]
Page limit (default 100)
@@ -6819,16 +7499,15 @@ async def list_entity_key_definitions(
Returns
-------
- AsyncHttpResponse[ListEntityKeyDefinitionsResponse]
+ AsyncHttpResponse[CountEntityKeysResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "entity-key-definitions",
+ "entity-keys/count",
method="GET",
params={
+ "definition_id": definition_id,
"entity_type": entity_type,
- "ids": ids,
- "q": q,
"limit": limit,
"offset": offset,
},
@@ -6837,9 +7516,9 @@ async def list_entity_key_definitions(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- ListEntityKeyDefinitionsResponse,
+ CountEntityKeysResponse,
parse_obj_as(
- type_=ListEntityKeyDefinitionsResponse, # type: ignore
+ type_=CountEntityKeysResponse, # type: ignore
object_=_response.json(),
),
)
@@ -6912,34 +7591,65 @@ async def list_entity_key_definitions(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def delete_entity_key_definition(
- self, entity_key_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[DeleteEntityKeyDefinitionResponse]:
+ async def list_entity_trait_definitions(
+ self,
+ *,
+ entity_type: typing.Optional[EntityType] = None,
+ ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ q: typing.Optional[str] = None,
+ trait_type: typing.Optional[TraitType] = None,
+ trait_types: typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[ListEntityTraitDefinitionsResponse]:
"""
Parameters
----------
- entity_key_definition_id : str
- entity_key_definition_id
+ entity_type : typing.Optional[EntityType]
+
+ ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ q : typing.Optional[str]
+
+ trait_type : typing.Optional[TraitType]
+
+ trait_types : typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]]
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[DeleteEntityKeyDefinitionResponse]
+ AsyncHttpResponse[ListEntityTraitDefinitionsResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- f"entity-key-definitions/{encode_path_param(entity_key_definition_id)}",
- method="DELETE",
+ "entity-trait-definitions",
+ method="GET",
+ params={
+ "entity_type": entity_type,
+ "ids": ids,
+ "q": q,
+ "trait_type": trait_type,
+ "trait_types": trait_types,
+ "limit": limit,
+ "offset": offset,
+ },
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- DeleteEntityKeyDefinitionResponse,
+ ListEntityTraitDefinitionsResponse,
parse_obj_as(
- type_=DeleteEntityKeyDefinitionResponse, # type: ignore
+ type_=ListEntityTraitDefinitionsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -7012,57 +7722,55 @@ async def delete_entity_key_definition(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def count_entity_key_definitions(
+ async def get_or_create_entity_trait_definition(
self,
*,
- entity_type: typing.Optional[EntityType] = None,
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- q: typing.Optional[str] = None,
- limit: typing.Optional[int] = None,
- offset: typing.Optional[int] = None,
+ entity_type: EntityType,
+ hierarchy: typing.Sequence[str],
+ trait_type: TraitType,
+ display_name: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[CountEntityKeyDefinitionsResponse]:
+ ) -> AsyncHttpResponse[GetOrCreateEntityTraitDefinitionResponse]:
"""
Parameters
----------
- entity_type : typing.Optional[EntityType]
-
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ entity_type : EntityType
- q : typing.Optional[str]
+ hierarchy : typing.Sequence[str]
- limit : typing.Optional[int]
- Page limit (default 100)
+ trait_type : TraitType
- offset : typing.Optional[int]
- Page offset (default 0)
+ display_name : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[CountEntityKeyDefinitionsResponse]
+ AsyncHttpResponse[GetOrCreateEntityTraitDefinitionResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "entity-key-definitions/count",
- method="GET",
- params={
+ "entity-trait-definitions",
+ method="POST",
+ json={
+ "display_name": display_name,
"entity_type": entity_type,
- "ids": ids,
- "q": q,
- "limit": limit,
- "offset": offset,
+ "hierarchy": hierarchy,
+ "trait_type": trait_type,
+ },
+ headers={
+ "content-type": "application/json",
},
request_options=request_options,
+ omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- CountEntityKeyDefinitionsResponse,
+ GetOrCreateEntityTraitDefinitionResponse,
parse_obj_as(
- type_=CountEntityKeyDefinitionsResponse, # type: ignore
+ type_=GetOrCreateEntityTraitDefinitionResponse, # type: ignore
object_=_response.json(),
),
)
@@ -7135,68 +7843,38 @@ async def count_entity_key_definitions(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def count_entity_keys(
- self,
- *,
- definition_id: typing.Optional[str] = None,
- entity_type: typing.Optional[EntityType] = None,
- limit: typing.Optional[int] = None,
- offset: typing.Optional[int] = None,
- request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[CountEntityKeysResponse]:
+ async def get_entity_trait_definition(
+ self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[GetEntityTraitDefinitionResponse]:
"""
Parameters
----------
- definition_id : typing.Optional[str]
-
- entity_type : typing.Optional[EntityType]
-
- limit : typing.Optional[int]
- Page limit (default 100)
-
- offset : typing.Optional[int]
- Page offset (default 0)
+ entity_trait_definition_id : str
+ entity_trait_definition_id
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[CountEntityKeysResponse]
+ AsyncHttpResponse[GetEntityTraitDefinitionResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "entity-keys/count",
+ f"entity-trait-definitions/{encode_path_param(entity_trait_definition_id)}",
method="GET",
- params={
- "definition_id": definition_id,
- "entity_type": entity_type,
- "limit": limit,
- "offset": offset,
- },
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- CountEntityKeysResponse,
+ GetEntityTraitDefinitionResponse,
parse_obj_as(
- type_=CountEntityKeysResponse, # type: ignore
+ type_=GetEntityTraitDefinitionResponse, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
- if _response.status_code == 400:
- raise BadRequestError(
- headers=dict(_response.headers),
- body=typing.cast(
- types_api_error_ApiError,
- parse_obj_as(
- type_=types_api_error_ApiError, # type: ignore
- object_=_response.json(),
- ),
- ),
- )
if _response.status_code == 401:
raise UnauthorizedError(
headers=dict(_response.headers),
@@ -7254,65 +7932,51 @@ async def count_entity_keys(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def list_entity_trait_definitions(
+ async def update_entity_trait_definition(
self,
+ entity_trait_definition_id: str,
*,
- entity_type: typing.Optional[EntityType] = None,
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- q: typing.Optional[str] = None,
- trait_type: typing.Optional[TraitType] = None,
- trait_types: typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]] = None,
- limit: typing.Optional[int] = None,
- offset: typing.Optional[int] = None,
+ trait_type: TraitType,
+ display_name: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[ListEntityTraitDefinitionsResponse]:
+ ) -> AsyncHttpResponse[UpdateEntityTraitDefinitionResponse]:
"""
Parameters
----------
- entity_type : typing.Optional[EntityType]
-
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
-
- q : typing.Optional[str]
-
- trait_type : typing.Optional[TraitType]
-
- trait_types : typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]]
+ entity_trait_definition_id : str
+ entity_trait_definition_id
- limit : typing.Optional[int]
- Page limit (default 100)
+ trait_type : TraitType
- offset : typing.Optional[int]
- Page offset (default 0)
+ display_name : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[ListEntityTraitDefinitionsResponse]
+ AsyncHttpResponse[UpdateEntityTraitDefinitionResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "entity-trait-definitions",
- method="GET",
- params={
- "entity_type": entity_type,
- "ids": ids,
- "q": q,
+ f"entity-trait-definitions/{encode_path_param(entity_trait_definition_id)}",
+ method="PUT",
+ json={
+ "display_name": display_name,
"trait_type": trait_type,
- "trait_types": trait_types,
- "limit": limit,
- "offset": offset,
+ },
+ headers={
+ "content-type": "application/json",
},
request_options=request_options,
+ omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- ListEntityTraitDefinitionsResponse,
+ UpdateEntityTraitDefinitionResponse,
parse_obj_as(
- type_=ListEntityTraitDefinitionsResponse, # type: ignore
+ type_=UpdateEntityTraitDefinitionResponse, # type: ignore
object_=_response.json(),
),
)
@@ -7385,55 +8049,34 @@ async def list_entity_trait_definitions(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def get_or_create_entity_trait_definition(
- self,
- *,
- entity_type: EntityType,
- hierarchy: typing.Sequence[str],
- trait_type: TraitType,
- display_name: typing.Optional[str] = OMIT,
- request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[GetOrCreateEntityTraitDefinitionResponse]:
+ async def delete_entity_trait_definition(
+ self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[DeleteEntityTraitDefinitionResponse]:
"""
Parameters
----------
- entity_type : EntityType
-
- hierarchy : typing.Sequence[str]
-
- trait_type : TraitType
-
- display_name : typing.Optional[str]
+ entity_trait_definition_id : str
+ entity_trait_definition_id
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[GetOrCreateEntityTraitDefinitionResponse]
+ AsyncHttpResponse[DeleteEntityTraitDefinitionResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "entity-trait-definitions",
- method="POST",
- json={
- "display_name": display_name,
- "entity_type": entity_type,
- "hierarchy": hierarchy,
- "trait_type": trait_type,
- },
- headers={
- "content-type": "application/json",
- },
+ f"entity-trait-definitions/{encode_path_param(entity_trait_definition_id)}",
+ method="DELETE",
request_options=request_options,
- omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetOrCreateEntityTraitDefinitionResponse,
+ DeleteEntityTraitDefinitionResponse,
parse_obj_as(
- type_=GetOrCreateEntityTraitDefinitionResponse, # type: ignore
+ type_=DeleteEntityTraitDefinitionResponse, # type: ignore
object_=_response.json(),
),
)
@@ -7506,9 +8149,9 @@ async def get_or_create_entity_trait_definition(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def get_entity_trait_definition(
+ async def get_entity_trait_definition_usage(
self, entity_trait_definition_id: str, *, request_options: typing.Optional[RequestOptions] = None
- ) -> AsyncHttpResponse[GetEntityTraitDefinitionResponse]:
+ ) -> AsyncHttpResponse[GetEntityTraitDefinitionUsageResponse]:
"""
Parameters
----------
@@ -7520,20 +8163,20 @@ async def get_entity_trait_definition(
Returns
-------
- AsyncHttpResponse[GetEntityTraitDefinitionResponse]
+ AsyncHttpResponse[GetEntityTraitDefinitionUsageResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- f"entity-trait-definitions/{encode_path_param(entity_trait_definition_id)}",
+ f"entity-trait-definitions/{encode_path_param(entity_trait_definition_id)}/usage",
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetEntityTraitDefinitionResponse,
+ GetEntityTraitDefinitionUsageResponse,
parse_obj_as(
- type_=GetEntityTraitDefinitionResponse, # type: ignore
+ type_=GetEntityTraitDefinitionUsageResponse, # type: ignore
object_=_response.json(),
),
)
@@ -7595,51 +8238,65 @@ async def get_entity_trait_definition(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def update_entity_trait_definition(
+ async def count_entity_trait_definitions(
self,
- entity_trait_definition_id: str,
*,
- trait_type: TraitType,
- display_name: typing.Optional[str] = OMIT,
+ entity_type: typing.Optional[EntityType] = None,
+ ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ q: typing.Optional[str] = None,
+ trait_type: typing.Optional[TraitType] = None,
+ trait_types: typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]] = None,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[UpdateEntityTraitDefinitionResponse]:
+ ) -> AsyncHttpResponse[CountEntityTraitDefinitionsResponse]:
"""
Parameters
----------
- entity_trait_definition_id : str
- entity_trait_definition_id
+ entity_type : typing.Optional[EntityType]
- trait_type : TraitType
+ ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
- display_name : typing.Optional[str]
+ q : typing.Optional[str]
+
+ trait_type : typing.Optional[TraitType]
+
+ trait_types : typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]]
+
+ limit : typing.Optional[int]
+ Page limit (default 100)
+
+ offset : typing.Optional[int]
+ Page offset (default 0)
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
- AsyncHttpResponse[UpdateEntityTraitDefinitionResponse]
+ AsyncHttpResponse[CountEntityTraitDefinitionsResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- f"entity-trait-definitions/{encode_path_param(entity_trait_definition_id)}",
- method="PUT",
- json={
- "display_name": display_name,
+ "entity-trait-definitions/count",
+ method="GET",
+ params={
+ "entity_type": entity_type,
+ "ids": ids,
+ "q": q,
"trait_type": trait_type,
- },
- headers={
- "content-type": "application/json",
+ "trait_types": trait_types,
+ "limit": limit,
+ "offset": offset,
},
request_options=request_options,
- omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- UpdateEntityTraitDefinitionResponse,
+ CountEntityTraitDefinitionsResponse,
parse_obj_as(
- type_=UpdateEntityTraitDefinitionResponse, # type: ignore
+ type_=CountEntityTraitDefinitionsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -7712,31 +8369,22 @@ async def update_entity_trait_definition(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def count_entity_trait_definitions(
+ async def get_entity_trait_values(
self,
*,
- entity_type: typing.Optional[EntityType] = None,
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ definition_id: str,
q: typing.Optional[str] = None,
- trait_type: typing.Optional[TraitType] = None,
- trait_types: typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[CountEntityTraitDefinitionsResponse]:
+ ) -> AsyncHttpResponse[GetEntityTraitValuesResponse]:
"""
Parameters
----------
- entity_type : typing.Optional[EntityType]
-
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ definition_id : str
q : typing.Optional[str]
- trait_type : typing.Optional[TraitType]
-
- trait_types : typing.Optional[typing.Union[TraitType, typing.Sequence[TraitType]]]
-
limit : typing.Optional[int]
Page limit (default 100)
@@ -7748,18 +8396,15 @@ async def count_entity_trait_definitions(
Returns
-------
- AsyncHttpResponse[CountEntityTraitDefinitionsResponse]
+ AsyncHttpResponse[GetEntityTraitValuesResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "entity-trait-definitions/count",
+ "entity-trait-values",
method="GET",
params={
- "entity_type": entity_type,
- "ids": ids,
+ "definition_id": definition_id,
"q": q,
- "trait_type": trait_type,
- "trait_types": trait_types,
"limit": limit,
"offset": offset,
},
@@ -7768,9 +8413,9 @@ async def count_entity_trait_definitions(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- CountEntityTraitDefinitionsResponse,
+ GetEntityTraitValuesResponse,
parse_obj_as(
- type_=CountEntityTraitDefinitionsResponse, # type: ignore
+ type_=GetEntityTraitValuesResponse, # type: ignore
object_=_response.json(),
),
)
@@ -7843,21 +8488,21 @@ async def count_entity_trait_definitions(
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
)
- async def get_entity_trait_values(
+ async def count_entity_traits(
self,
*,
- definition_id: str,
- q: typing.Optional[str] = None,
+ definition_id: typing.Optional[str] = None,
+ entity_type: typing.Optional[EntityType] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
- ) -> AsyncHttpResponse[GetEntityTraitValuesResponse]:
+ ) -> AsyncHttpResponse[CountEntityTraitsResponse]:
"""
Parameters
----------
- definition_id : str
+ definition_id : typing.Optional[str]
- q : typing.Optional[str]
+ entity_type : typing.Optional[EntityType]
limit : typing.Optional[int]
Page limit (default 100)
@@ -7870,15 +8515,15 @@ async def get_entity_trait_values(
Returns
-------
- AsyncHttpResponse[GetEntityTraitValuesResponse]
+ AsyncHttpResponse[CountEntityTraitsResponse]
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- "entity-trait-values",
+ "entity-traits/count",
method="GET",
params={
"definition_id": definition_id,
- "q": q,
+ "entity_type": entity_type,
"limit": limit,
"offset": offset,
},
@@ -7887,9 +8532,9 @@ async def get_entity_trait_values(
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
- GetEntityTraitValuesResponse,
+ CountEntityTraitsResponse,
parse_obj_as(
- type_=GetEntityTraitValuesResponse, # type: ignore
+ type_=CountEntityTraitsResponse, # type: ignore
object_=_response.json(),
),
)
@@ -7969,7 +8614,6 @@ async def list_plan_changes(
base_plan_action: typing.Optional[PlanChangeBasePlanAction] = None,
company_id: typing.Optional[str] = None,
company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
- plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
request_options: typing.Optional[RequestOptions] = None,
@@ -7985,8 +8629,6 @@ async def list_plan_changes(
company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
- plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
-
limit : typing.Optional[int]
Page limit (default 100)
@@ -8009,7 +8651,6 @@ async def list_plan_changes(
"base_plan_action": base_plan_action,
"company_id": company_id,
"company_ids": company_ids,
- "plan_ids": plan_ids,
"limit": limit,
"offset": offset,
},
@@ -8916,6 +9557,7 @@ async def upsert_user(
id: typing.Optional[str] = OMIT,
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -8945,6 +9587,9 @@ async def upsert_user(
name : typing.Optional[str]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -8970,6 +9615,7 @@ async def upsert_user(
"keys": keys,
"last_seen_at": last_seen_at,
"name": name,
+ "remove_keys": remove_keys,
"traits": traits,
"update_only": update_only,
},
@@ -9388,6 +10034,7 @@ async def create_user(
id: typing.Optional[str] = OMIT,
last_seen_at: typing.Optional[dt.datetime] = OMIT,
name: typing.Optional[str] = OMIT,
+ remove_keys: typing.Optional[typing.Sequence[str]] = OMIT,
traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
update_only: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -9417,6 +10064,9 @@ async def create_user(
name : typing.Optional[str]
+ remove_keys : typing.Optional[typing.Sequence[str]]
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+
traits : typing.Optional[typing.Dict[str, typing.Any]]
A map of trait names to trait values
@@ -9442,6 +10092,7 @@ async def create_user(
"keys": keys,
"last_seen_at": last_seen_at,
"name": name,
+ "remove_keys": remove_keys,
"traits": traits,
"update_only": update_only,
},
diff --git a/src/schematic/companies/types/__init__.py b/src/schematic/companies/types/__init__.py
index a5e305f..79a8ca1 100644
--- a/src/schematic/companies/types/__init__.py
+++ b/src/schematic/companies/types/__init__.py
@@ -14,6 +14,8 @@
from .count_entity_keys_response import CountEntityKeysResponse
from .count_entity_trait_definitions_params import CountEntityTraitDefinitionsParams
from .count_entity_trait_definitions_response import CountEntityTraitDefinitionsResponse
+ from .count_entity_traits_params import CountEntityTraitsParams
+ from .count_entity_traits_response import CountEntityTraitsResponse
from .count_plan_traits_params import CountPlanTraitsParams
from .count_plan_traits_response import CountPlanTraitsResponse
from .count_users_params import CountUsersParams
@@ -25,6 +27,7 @@
from .delete_company_params import DeleteCompanyParams
from .delete_company_response import DeleteCompanyResponse
from .delete_entity_key_definition_response import DeleteEntityKeyDefinitionResponse
+ from .delete_entity_trait_definition_response import DeleteEntityTraitDefinitionResponse
from .delete_user_by_keys_response import DeleteUserByKeysResponse
from .delete_user_response import DeleteUserResponse
from .get_active_company_subscription_params import GetActiveCompanySubscriptionParams
@@ -35,6 +38,7 @@
from .get_company_billing_entity_response import GetCompanyBillingEntityResponse
from .get_company_response import GetCompanyResponse
from .get_entity_trait_definition_response import GetEntityTraitDefinitionResponse
+ from .get_entity_trait_definition_usage_response import GetEntityTraitDefinitionUsageResponse
from .get_entity_trait_values_params import GetEntityTraitValuesParams
from .get_entity_trait_values_response import GetEntityTraitValuesResponse
from .get_or_create_company_membership_response import GetOrCreateCompanyMembershipResponse
@@ -75,6 +79,8 @@
"CountEntityKeysResponse": ".count_entity_keys_response",
"CountEntityTraitDefinitionsParams": ".count_entity_trait_definitions_params",
"CountEntityTraitDefinitionsResponse": ".count_entity_trait_definitions_response",
+ "CountEntityTraitsParams": ".count_entity_traits_params",
+ "CountEntityTraitsResponse": ".count_entity_traits_response",
"CountPlanTraitsParams": ".count_plan_traits_params",
"CountPlanTraitsResponse": ".count_plan_traits_response",
"CountUsersParams": ".count_users_params",
@@ -86,6 +92,7 @@
"DeleteCompanyParams": ".delete_company_params",
"DeleteCompanyResponse": ".delete_company_response",
"DeleteEntityKeyDefinitionResponse": ".delete_entity_key_definition_response",
+ "DeleteEntityTraitDefinitionResponse": ".delete_entity_trait_definition_response",
"DeleteUserByKeysResponse": ".delete_user_by_keys_response",
"DeleteUserResponse": ".delete_user_response",
"GetActiveCompanySubscriptionParams": ".get_active_company_subscription_params",
@@ -96,6 +103,7 @@
"GetCompanyBillingEntityResponse": ".get_company_billing_entity_response",
"GetCompanyResponse": ".get_company_response",
"GetEntityTraitDefinitionResponse": ".get_entity_trait_definition_response",
+ "GetEntityTraitDefinitionUsageResponse": ".get_entity_trait_definition_usage_response",
"GetEntityTraitValuesParams": ".get_entity_trait_values_params",
"GetEntityTraitValuesResponse": ".get_entity_trait_values_response",
"GetOrCreateCompanyMembershipResponse": ".get_or_create_company_membership_response",
@@ -160,6 +168,8 @@ def __dir__():
"CountEntityKeysResponse",
"CountEntityTraitDefinitionsParams",
"CountEntityTraitDefinitionsResponse",
+ "CountEntityTraitsParams",
+ "CountEntityTraitsResponse",
"CountPlanTraitsParams",
"CountPlanTraitsResponse",
"CountUsersParams",
@@ -171,6 +181,7 @@ def __dir__():
"DeleteCompanyParams",
"DeleteCompanyResponse",
"DeleteEntityKeyDefinitionResponse",
+ "DeleteEntityTraitDefinitionResponse",
"DeleteUserByKeysResponse",
"DeleteUserResponse",
"GetActiveCompanySubscriptionParams",
@@ -181,6 +192,7 @@ def __dir__():
"GetCompanyBillingEntityResponse",
"GetCompanyResponse",
"GetEntityTraitDefinitionResponse",
+ "GetEntityTraitDefinitionUsageResponse",
"GetEntityTraitValuesParams",
"GetEntityTraitValuesResponse",
"GetOrCreateCompanyMembershipResponse",
diff --git a/src/schematic/companies/types/count_entity_traits_params.py b/src/schematic/companies/types/count_entity_traits_params.py
new file mode 100644
index 0000000..74df89e
--- /dev/null
+++ b/src/schematic/companies/types/count_entity_traits_params.py
@@ -0,0 +1,34 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ...types.entity_type import EntityType
+
+
+class CountEntityTraitsParams(UniversalBaseModel):
+ """
+ Input parameters
+ """
+
+ definition_id: typing.Optional[str] = None
+ entity_type: typing.Optional[EntityType] = None
+ limit: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Page limit (default 100)
+ """
+
+ offset: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Page offset (default 0)
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/companies/types/count_entity_traits_response.py b/src/schematic/companies/types/count_entity_traits_response.py
new file mode 100644
index 0000000..eafe23e
--- /dev/null
+++ b/src/schematic/companies/types/count_entity_traits_response.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ...types.count_response import CountResponse
+from .count_entity_traits_params import CountEntityTraitsParams
+
+
+class CountEntityTraitsResponse(UniversalBaseModel):
+ data: CountResponse
+ params: CountEntityTraitsParams = pydantic.Field()
+ """
+ Input parameters
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/companies/types/delete_entity_trait_definition_response.py b/src/schematic/companies/types/delete_entity_trait_definition_response.py
new file mode 100644
index 0000000..fae6a65
--- /dev/null
+++ b/src/schematic/companies/types/delete_entity_trait_definition_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ...types.delete_response import DeleteResponse
+
+
+class DeleteEntityTraitDefinitionResponse(UniversalBaseModel):
+ data: DeleteResponse
+ params: typing.Dict[str, typing.Any] = pydantic.Field()
+ """
+ Input parameters
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/companies/types/get_entity_trait_definition_usage_response.py b/src/schematic/companies/types/get_entity_trait_definition_usage_response.py
new file mode 100644
index 0000000..fc96066
--- /dev/null
+++ b/src/schematic/companies/types/get_entity_trait_definition_usage_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from ...types.entity_trait_definition_usage import EntityTraitDefinitionUsage
+
+
+class GetEntityTraitDefinitionUsageResponse(UniversalBaseModel):
+ data: EntityTraitDefinitionUsage
+ params: typing.Dict[str, typing.Any] = pydantic.Field()
+ """
+ Input parameters
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/companies/types/list_plan_changes_params.py b/src/schematic/companies/types/list_plan_changes_params.py
index dad497a..04f38e3 100644
--- a/src/schematic/companies/types/list_plan_changes_params.py
+++ b/src/schematic/companies/types/list_plan_changes_params.py
@@ -27,8 +27,6 @@ class ListPlanChangesParams(UniversalBaseModel):
Page offset (default 0)
"""
- plan_ids: typing.Optional[typing.List[str]] = None
-
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
diff --git a/src/schematic/core/client_wrapper.py b/src/schematic/core/client_wrapper.py
index aa41bb8..b51ddc7 100644
--- a/src/schematic/core/client_wrapper.py
+++ b/src/schematic/core/client_wrapper.py
@@ -29,12 +29,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform
headers: typing.Dict[str, str] = {
- "User-Agent": "schematichq/1.3.3",
+ "User-Agent": "schematichq/1.3.4",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "schematichq",
- "X-Fern-SDK-Version": "1.3.3",
+ "X-Fern-SDK-Version": "1.3.4",
**(self.get_custom_headers() or {}),
}
headers["X-Schematic-Api-Key"] = self.api_key
diff --git a/src/schematic/credits/client.py b/src/schematic/credits/client.py
index aff68c4..ea63a22 100644
--- a/src/schematic/credits/client.py
+++ b/src/schematic/credits/client.py
@@ -462,6 +462,7 @@ def create_credit_bundle(
currency: str,
price_per_unit: int,
bundle_type: typing.Optional[BillingCreditBundleType] = OMIT,
+ compatible_plan_ids: typing.Optional[typing.Sequence[str]] = OMIT,
currency_prices: typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -484,6 +485,9 @@ def create_credit_bundle(
bundle_type : typing.Optional[BillingCreditBundleType]
+ compatible_plan_ids : typing.Optional[typing.Sequence[str]]
+ Plans whose companies may purchase this bundle. Omitted or empty means the bundle is purchasable on every plan.
+
currency_prices : typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -526,6 +530,7 @@ def create_credit_bundle(
currency=currency,
price_per_unit=price_per_unit,
bundle_type=bundle_type,
+ compatible_plan_ids=compatible_plan_ids,
currency_prices=currency_prices,
expiry_type=expiry_type,
expiry_unit=expiry_unit,
@@ -574,6 +579,7 @@ def update_credit_bundle_details(
*,
bundle_name: str,
price_per_unit: int,
+ compatible_plan_ids: typing.Optional[typing.Sequence[str]] = OMIT,
currency_prices: typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -593,6 +599,9 @@ def update_credit_bundle_details(
price_per_unit : int
+ compatible_plan_ids : typing.Optional[typing.Sequence[str]]
+ Plans whose companies may purchase this bundle. Omitted leaves compatibility unchanged; empty resets the bundle to purchasable on every plan.
+
currency_prices : typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -632,6 +641,7 @@ def update_credit_bundle_details(
bundle_id,
bundle_name=bundle_name,
price_per_unit=price_per_unit,
+ compatible_plan_ids=compatible_plan_ids,
currency_prices=currency_prices,
expiry_type=expiry_type,
expiry_unit=expiry_unit,
@@ -1333,6 +1343,7 @@ def create_billing_plan_credit_grant(
auto_topup_threshold_credits: typing.Optional[int] = OMIT,
auto_topup_threshold_percent: typing.Optional[int] = OMIT,
can_buy_bundles: typing.Optional[bool] = OMIT,
+ company_credit_amount: typing.Optional[int] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
expiry_unit_count: typing.Optional[int] = OMIT,
@@ -1380,6 +1391,9 @@ def create_billing_plan_credit_grant(
can_buy_bundles : typing.Optional[bool]
+ company_credit_amount : typing.Optional[int]
+ Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0.
+
expiry_type : typing.Optional[BillingCreditExpiryType]
expiry_unit : typing.Optional[BillingCreditExpiryUnit]
@@ -1440,6 +1454,7 @@ def create_billing_plan_credit_grant(
auto_topup_threshold_credits=auto_topup_threshold_credits,
auto_topup_threshold_percent=auto_topup_threshold_percent,
can_buy_bundles=can_buy_bundles,
+ company_credit_amount=company_credit_amount,
expiry_type=expiry_type,
expiry_unit=expiry_unit,
expiry_unit_count=expiry_unit_count,
@@ -1503,6 +1518,7 @@ def update_billing_plan_credit_grant(
auto_topup_threshold_credits: typing.Optional[int] = OMIT,
auto_topup_threshold_percent: typing.Optional[int] = OMIT,
can_buy_bundles: typing.Optional[bool] = OMIT,
+ company_credit_amount: typing.Optional[int] = OMIT,
credit_amount: typing.Optional[int] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -1547,6 +1563,9 @@ def update_billing_plan_credit_grant(
can_buy_bundles : typing.Optional[bool]
+ company_credit_amount : typing.Optional[int]
+ Credits granted once per company on top of the per-license amount. Only valid when the grant scales per license.
+
credit_amount : typing.Optional[int]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -1556,7 +1575,7 @@ def update_billing_plan_credit_grant(
expiry_unit_count : typing.Optional[int]
license_id : typing.Optional[str]
- The license whose quantity scales this grant. Cannot be changed after creation.
+ The license whose quantity scales this grant. Cleared when the grant moves off per-license scaling.
reset_type : typing.Optional[BillingPlanCreditGrantResetType]
@@ -1564,7 +1583,7 @@ def update_billing_plan_credit_grant(
Percentage of unused credits that carry over when this grant resets. Only applies when reset_type is plan_period. Rolled-over credits expire at the next reset and are not rolled again.
scaling : typing.Optional[PlanCreditGrantScaling]
- Whether the grant is a fixed amount per company, or issued once per license the company holds. Cannot be changed after creation.
+ Whether the grant is a fixed amount per company, or issued once per license the company holds. Changing this re-issues the credits companies already hold for this grant.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -1603,6 +1622,7 @@ def update_billing_plan_credit_grant(
auto_topup_threshold_credits=auto_topup_threshold_credits,
auto_topup_threshold_percent=auto_topup_threshold_percent,
can_buy_bundles=can_buy_bundles,
+ company_credit_amount=company_credit_amount,
credit_amount=credit_amount,
expiry_type=expiry_type,
expiry_unit=expiry_unit,
@@ -2332,6 +2352,7 @@ async def create_credit_bundle(
currency: str,
price_per_unit: int,
bundle_type: typing.Optional[BillingCreditBundleType] = OMIT,
+ compatible_plan_ids: typing.Optional[typing.Sequence[str]] = OMIT,
currency_prices: typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -2354,6 +2375,9 @@ async def create_credit_bundle(
bundle_type : typing.Optional[BillingCreditBundleType]
+ compatible_plan_ids : typing.Optional[typing.Sequence[str]]
+ Plans whose companies may purchase this bundle. Omitted or empty means the bundle is purchasable on every plan.
+
currency_prices : typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -2404,6 +2428,7 @@ async def main() -> None:
currency=currency,
price_per_unit=price_per_unit,
bundle_type=bundle_type,
+ compatible_plan_ids=compatible_plan_ids,
currency_prices=currency_prices,
expiry_type=expiry_type,
expiry_unit=expiry_unit,
@@ -2460,6 +2485,7 @@ async def update_credit_bundle_details(
*,
bundle_name: str,
price_per_unit: int,
+ compatible_plan_ids: typing.Optional[typing.Sequence[str]] = OMIT,
currency_prices: typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -2479,6 +2505,9 @@ async def update_credit_bundle_details(
price_per_unit : int
+ compatible_plan_ids : typing.Optional[typing.Sequence[str]]
+ Plans whose companies may purchase this bundle. Omitted leaves compatibility unchanged; empty resets the bundle to purchasable on every plan.
+
currency_prices : typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -2526,6 +2555,7 @@ async def main() -> None:
bundle_id,
bundle_name=bundle_name,
price_per_unit=price_per_unit,
+ compatible_plan_ids=compatible_plan_ids,
currency_prices=currency_prices,
expiry_type=expiry_type,
expiry_unit=expiry_unit,
@@ -3333,6 +3363,7 @@ async def create_billing_plan_credit_grant(
auto_topup_threshold_credits: typing.Optional[int] = OMIT,
auto_topup_threshold_percent: typing.Optional[int] = OMIT,
can_buy_bundles: typing.Optional[bool] = OMIT,
+ company_credit_amount: typing.Optional[int] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
expiry_unit_count: typing.Optional[int] = OMIT,
@@ -3380,6 +3411,9 @@ async def create_billing_plan_credit_grant(
can_buy_bundles : typing.Optional[bool]
+ company_credit_amount : typing.Optional[int]
+ Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0.
+
expiry_type : typing.Optional[BillingCreditExpiryType]
expiry_unit : typing.Optional[BillingCreditExpiryUnit]
@@ -3448,6 +3482,7 @@ async def main() -> None:
auto_topup_threshold_credits=auto_topup_threshold_credits,
auto_topup_threshold_percent=auto_topup_threshold_percent,
can_buy_bundles=can_buy_bundles,
+ company_credit_amount=company_credit_amount,
expiry_type=expiry_type,
expiry_unit=expiry_unit,
expiry_unit_count=expiry_unit_count,
@@ -3519,6 +3554,7 @@ async def update_billing_plan_credit_grant(
auto_topup_threshold_credits: typing.Optional[int] = OMIT,
auto_topup_threshold_percent: typing.Optional[int] = OMIT,
can_buy_bundles: typing.Optional[bool] = OMIT,
+ company_credit_amount: typing.Optional[int] = OMIT,
credit_amount: typing.Optional[int] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -3563,6 +3599,9 @@ async def update_billing_plan_credit_grant(
can_buy_bundles : typing.Optional[bool]
+ company_credit_amount : typing.Optional[int]
+ Credits granted once per company on top of the per-license amount. Only valid when the grant scales per license.
+
credit_amount : typing.Optional[int]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -3572,7 +3611,7 @@ async def update_billing_plan_credit_grant(
expiry_unit_count : typing.Optional[int]
license_id : typing.Optional[str]
- The license whose quantity scales this grant. Cannot be changed after creation.
+ The license whose quantity scales this grant. Cleared when the grant moves off per-license scaling.
reset_type : typing.Optional[BillingPlanCreditGrantResetType]
@@ -3580,7 +3619,7 @@ async def update_billing_plan_credit_grant(
Percentage of unused credits that carry over when this grant resets. Only applies when reset_type is plan_period. Rolled-over credits expire at the next reset and are not rolled again.
scaling : typing.Optional[PlanCreditGrantScaling]
- Whether the grant is a fixed amount per company, or issued once per license the company holds. Cannot be changed after creation.
+ Whether the grant is a fixed amount per company, or issued once per license the company holds. Changing this re-issues the credits companies already hold for this grant.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -3627,6 +3666,7 @@ async def main() -> None:
auto_topup_threshold_credits=auto_topup_threshold_credits,
auto_topup_threshold_percent=auto_topup_threshold_percent,
can_buy_bundles=can_buy_bundles,
+ company_credit_amount=company_credit_amount,
credit_amount=credit_amount,
expiry_type=expiry_type,
expiry_unit=expiry_unit,
diff --git a/src/schematic/credits/raw_client.py b/src/schematic/credits/raw_client.py
index 48745e0..556f1c8 100644
--- a/src/schematic/credits/raw_client.py
+++ b/src/schematic/credits/raw_client.py
@@ -945,6 +945,7 @@ def create_credit_bundle(
currency: str,
price_per_unit: int,
bundle_type: typing.Optional[BillingCreditBundleType] = OMIT,
+ compatible_plan_ids: typing.Optional[typing.Sequence[str]] = OMIT,
currency_prices: typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -967,6 +968,9 @@ def create_credit_bundle(
bundle_type : typing.Optional[BillingCreditBundleType]
+ compatible_plan_ids : typing.Optional[typing.Sequence[str]]
+ Plans whose companies may purchase this bundle. Omitted or empty means the bundle is purchasable on every plan.
+
currency_prices : typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -995,6 +999,7 @@ def create_credit_bundle(
json={
"bundle_name": bundle_name,
"bundle_type": bundle_type,
+ "compatible_plan_ids": compatible_plan_ids,
"credit_id": credit_id,
"currency": currency,
"currency_prices": convert_and_respect_annotation_metadata(
@@ -1189,6 +1194,7 @@ def update_credit_bundle_details(
*,
bundle_name: str,
price_per_unit: int,
+ compatible_plan_ids: typing.Optional[typing.Sequence[str]] = OMIT,
currency_prices: typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -1208,6 +1214,9 @@ def update_credit_bundle_details(
price_per_unit : int
+ compatible_plan_ids : typing.Optional[typing.Sequence[str]]
+ Plans whose companies may purchase this bundle. Omitted leaves compatibility unchanged; empty resets the bundle to purchasable on every plan.
+
currency_prices : typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -1235,6 +1244,7 @@ def update_credit_bundle_details(
method="PUT",
json={
"bundle_name": bundle_name,
+ "compatible_plan_ids": compatible_plan_ids,
"currency_prices": convert_and_respect_annotation_metadata(
object_=currency_prices,
annotation=typing.Sequence[CreditBundleCurrencyPriceRequestBody],
@@ -2932,6 +2942,7 @@ def create_billing_plan_credit_grant(
auto_topup_threshold_credits: typing.Optional[int] = OMIT,
auto_topup_threshold_percent: typing.Optional[int] = OMIT,
can_buy_bundles: typing.Optional[bool] = OMIT,
+ company_credit_amount: typing.Optional[int] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
expiry_unit_count: typing.Optional[int] = OMIT,
@@ -2979,6 +2990,9 @@ def create_billing_plan_credit_grant(
can_buy_bundles : typing.Optional[bool]
+ company_credit_amount : typing.Optional[int]
+ Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0.
+
expiry_type : typing.Optional[BillingCreditExpiryType]
expiry_unit : typing.Optional[BillingCreditExpiryUnit]
@@ -3022,6 +3036,7 @@ def create_billing_plan_credit_grant(
"auto_topup_threshold_credits": auto_topup_threshold_credits,
"auto_topup_threshold_percent": auto_topup_threshold_percent,
"can_buy_bundles": can_buy_bundles,
+ "company_credit_amount": company_credit_amount,
"credit_amount": credit_amount,
"credit_id": credit_id,
"expiry_type": expiry_type,
@@ -3227,6 +3242,7 @@ def update_billing_plan_credit_grant(
auto_topup_threshold_credits: typing.Optional[int] = OMIT,
auto_topup_threshold_percent: typing.Optional[int] = OMIT,
can_buy_bundles: typing.Optional[bool] = OMIT,
+ company_credit_amount: typing.Optional[int] = OMIT,
credit_amount: typing.Optional[int] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -3271,6 +3287,9 @@ def update_billing_plan_credit_grant(
can_buy_bundles : typing.Optional[bool]
+ company_credit_amount : typing.Optional[int]
+ Credits granted once per company on top of the per-license amount. Only valid when the grant scales per license.
+
credit_amount : typing.Optional[int]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -3280,7 +3299,7 @@ def update_billing_plan_credit_grant(
expiry_unit_count : typing.Optional[int]
license_id : typing.Optional[str]
- The license whose quantity scales this grant. Cannot be changed after creation.
+ The license whose quantity scales this grant. Cleared when the grant moves off per-license scaling.
reset_type : typing.Optional[BillingPlanCreditGrantResetType]
@@ -3288,7 +3307,7 @@ def update_billing_plan_credit_grant(
Percentage of unused credits that carry over when this grant resets. Only applies when reset_type is plan_period. Rolled-over credits expire at the next reset and are not rolled again.
scaling : typing.Optional[PlanCreditGrantScaling]
- Whether the grant is a fixed amount per company, or issued once per license the company holds. Cannot be changed after creation.
+ Whether the grant is a fixed amount per company, or issued once per license the company holds. Changing this re-issues the credits companies already hold for this grant.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -3314,6 +3333,7 @@ def update_billing_plan_credit_grant(
"auto_topup_threshold_credits": auto_topup_threshold_credits,
"auto_topup_threshold_percent": auto_topup_threshold_percent,
"can_buy_bundles": can_buy_bundles,
+ "company_credit_amount": company_credit_amount,
"credit_amount": credit_amount,
"expiry_type": expiry_type,
"expiry_unit": expiry_unit,
@@ -4795,6 +4815,7 @@ async def create_credit_bundle(
currency: str,
price_per_unit: int,
bundle_type: typing.Optional[BillingCreditBundleType] = OMIT,
+ compatible_plan_ids: typing.Optional[typing.Sequence[str]] = OMIT,
currency_prices: typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -4817,6 +4838,9 @@ async def create_credit_bundle(
bundle_type : typing.Optional[BillingCreditBundleType]
+ compatible_plan_ids : typing.Optional[typing.Sequence[str]]
+ Plans whose companies may purchase this bundle. Omitted or empty means the bundle is purchasable on every plan.
+
currency_prices : typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -4845,6 +4869,7 @@ async def create_credit_bundle(
json={
"bundle_name": bundle_name,
"bundle_type": bundle_type,
+ "compatible_plan_ids": compatible_plan_ids,
"credit_id": credit_id,
"currency": currency,
"currency_prices": convert_and_respect_annotation_metadata(
@@ -5039,6 +5064,7 @@ async def update_credit_bundle_details(
*,
bundle_name: str,
price_per_unit: int,
+ compatible_plan_ids: typing.Optional[typing.Sequence[str]] = OMIT,
currency_prices: typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -5058,6 +5084,9 @@ async def update_credit_bundle_details(
price_per_unit : int
+ compatible_plan_ids : typing.Optional[typing.Sequence[str]]
+ Plans whose companies may purchase this bundle. Omitted leaves compatibility unchanged; empty resets the bundle to purchasable on every plan.
+
currency_prices : typing.Optional[typing.Sequence[CreditBundleCurrencyPriceRequestBody]]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -5085,6 +5114,7 @@ async def update_credit_bundle_details(
method="PUT",
json={
"bundle_name": bundle_name,
+ "compatible_plan_ids": compatible_plan_ids,
"currency_prices": convert_and_respect_annotation_metadata(
object_=currency_prices,
annotation=typing.Sequence[CreditBundleCurrencyPriceRequestBody],
@@ -6782,6 +6812,7 @@ async def create_billing_plan_credit_grant(
auto_topup_threshold_credits: typing.Optional[int] = OMIT,
auto_topup_threshold_percent: typing.Optional[int] = OMIT,
can_buy_bundles: typing.Optional[bool] = OMIT,
+ company_credit_amount: typing.Optional[int] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
expiry_unit_count: typing.Optional[int] = OMIT,
@@ -6829,6 +6860,9 @@ async def create_billing_plan_credit_grant(
can_buy_bundles : typing.Optional[bool]
+ company_credit_amount : typing.Optional[int]
+ Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0.
+
expiry_type : typing.Optional[BillingCreditExpiryType]
expiry_unit : typing.Optional[BillingCreditExpiryUnit]
@@ -6872,6 +6906,7 @@ async def create_billing_plan_credit_grant(
"auto_topup_threshold_credits": auto_topup_threshold_credits,
"auto_topup_threshold_percent": auto_topup_threshold_percent,
"can_buy_bundles": can_buy_bundles,
+ "company_credit_amount": company_credit_amount,
"credit_amount": credit_amount,
"credit_id": credit_id,
"expiry_type": expiry_type,
@@ -7077,6 +7112,7 @@ async def update_billing_plan_credit_grant(
auto_topup_threshold_credits: typing.Optional[int] = OMIT,
auto_topup_threshold_percent: typing.Optional[int] = OMIT,
can_buy_bundles: typing.Optional[bool] = OMIT,
+ company_credit_amount: typing.Optional[int] = OMIT,
credit_amount: typing.Optional[int] = OMIT,
expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT,
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT,
@@ -7121,6 +7157,9 @@ async def update_billing_plan_credit_grant(
can_buy_bundles : typing.Optional[bool]
+ company_credit_amount : typing.Optional[int]
+ Credits granted once per company on top of the per-license amount. Only valid when the grant scales per license.
+
credit_amount : typing.Optional[int]
expiry_type : typing.Optional[BillingCreditExpiryType]
@@ -7130,7 +7169,7 @@ async def update_billing_plan_credit_grant(
expiry_unit_count : typing.Optional[int]
license_id : typing.Optional[str]
- The license whose quantity scales this grant. Cannot be changed after creation.
+ The license whose quantity scales this grant. Cleared when the grant moves off per-license scaling.
reset_type : typing.Optional[BillingPlanCreditGrantResetType]
@@ -7138,7 +7177,7 @@ async def update_billing_plan_credit_grant(
Percentage of unused credits that carry over when this grant resets. Only applies when reset_type is plan_period. Rolled-over credits expire at the next reset and are not rolled again.
scaling : typing.Optional[PlanCreditGrantScaling]
- Whether the grant is a fixed amount per company, or issued once per license the company holds. Cannot be changed after creation.
+ Whether the grant is a fixed amount per company, or issued once per license the company holds. Changing this re-issues the credits companies already hold for this grant.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -7164,6 +7203,7 @@ async def update_billing_plan_credit_grant(
"auto_topup_threshold_credits": auto_topup_threshold_credits,
"auto_topup_threshold_percent": auto_topup_threshold_percent,
"can_buy_bundles": can_buy_bundles,
+ "company_credit_amount": company_credit_amount,
"credit_amount": credit_amount,
"expiry_type": expiry_type,
"expiry_unit": expiry_unit,
diff --git a/src/schematic/planbundle/client.py b/src/schematic/planbundle/client.py
index 9b5e2fa..b45347b 100644
--- a/src/schematic/planbundle/client.py
+++ b/src/schematic/planbundle/client.py
@@ -140,7 +140,7 @@ def create_plan_bundle(
def update_plan_bundle(
self,
- plan_bundle_id: str,
+ plan_id: str,
*,
entitlements: typing.Sequence[PlanBundleEntitlementRequestBody],
billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT,
@@ -152,8 +152,8 @@ def update_plan_bundle(
"""
Parameters
----------
- plan_bundle_id : str
- plan_bundle_id
+ plan_id : str
+ plan_id
entitlements : typing.Sequence[PlanBundleEntitlementRequestBody]
@@ -181,7 +181,7 @@ def update_plan_bundle(
api_key="YOUR_API_KEY",
)
client.planbundle.update_plan_bundle(
- plan_bundle_id="plan_bundle_id",
+ plan_id="plan_id",
entitlements=[
PlanBundleEntitlementRequestBody(
action="create",
@@ -190,7 +190,7 @@ def update_plan_bundle(
)
"""
_response = self._raw_client.update_plan_bundle(
- plan_bundle_id,
+ plan_id,
entitlements=entitlements,
billing_product=billing_product,
credit_grants=credit_grants,
@@ -338,7 +338,7 @@ async def main() -> None:
async def update_plan_bundle(
self,
- plan_bundle_id: str,
+ plan_id: str,
*,
entitlements: typing.Sequence[PlanBundleEntitlementRequestBody],
billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT,
@@ -350,8 +350,8 @@ async def update_plan_bundle(
"""
Parameters
----------
- plan_bundle_id : str
- plan_bundle_id
+ plan_id : str
+ plan_id
entitlements : typing.Sequence[PlanBundleEntitlementRequestBody]
@@ -384,7 +384,7 @@ async def update_plan_bundle(
async def main() -> None:
await client.planbundle.update_plan_bundle(
- plan_bundle_id="plan_bundle_id",
+ plan_id="plan_id",
entitlements=[
PlanBundleEntitlementRequestBody(
action="create",
@@ -396,7 +396,7 @@ async def main() -> None:
asyncio.run(main())
"""
_response = await self._raw_client.update_plan_bundle(
- plan_bundle_id,
+ plan_id,
entitlements=entitlements,
billing_product=billing_product,
credit_grants=credit_grants,
diff --git a/src/schematic/planbundle/raw_client.py b/src/schematic/planbundle/raw_client.py
index 886efa9..28351f6 100644
--- a/src/schematic/planbundle/raw_client.py
+++ b/src/schematic/planbundle/raw_client.py
@@ -304,7 +304,7 @@ def create_plan_bundle(
def update_plan_bundle(
self,
- plan_bundle_id: str,
+ plan_id: str,
*,
entitlements: typing.Sequence[PlanBundleEntitlementRequestBody],
billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT,
@@ -316,8 +316,8 @@ def update_plan_bundle(
"""
Parameters
----------
- plan_bundle_id : str
- plan_bundle_id
+ plan_id : str
+ plan_id
entitlements : typing.Sequence[PlanBundleEntitlementRequestBody]
@@ -338,7 +338,7 @@ def update_plan_bundle(
OK
"""
_response = self._client_wrapper.httpx_client.request(
- f"plan-bundles/{encode_path_param(plan_bundle_id)}",
+ f"plan-bundles/{encode_path_param(plan_id)}",
method="PUT",
json={
"billing_product": convert_and_respect_annotation_metadata(
@@ -716,7 +716,7 @@ async def create_plan_bundle(
async def update_plan_bundle(
self,
- plan_bundle_id: str,
+ plan_id: str,
*,
entitlements: typing.Sequence[PlanBundleEntitlementRequestBody],
billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT,
@@ -728,8 +728,8 @@ async def update_plan_bundle(
"""
Parameters
----------
- plan_bundle_id : str
- plan_bundle_id
+ plan_id : str
+ plan_id
entitlements : typing.Sequence[PlanBundleEntitlementRequestBody]
@@ -750,7 +750,7 @@ async def update_plan_bundle(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- f"plan-bundles/{encode_path_param(plan_bundle_id)}",
+ f"plan-bundles/{encode_path_param(plan_id)}",
method="PUT",
json={
"billing_product": convert_and_respect_annotation_metadata(
diff --git a/src/schematic/plangroups/client.py b/src/schematic/plangroups/client.py
index db82dcd..57ff747 100644
--- a/src/schematic/plangroups/client.py
+++ b/src/schematic/plangroups/client.py
@@ -4,6 +4,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
+from ..types.checkout_bundle_purchase_behavior import CheckoutBundlePurchaseBehavior
from ..types.checkout_field_input import CheckoutFieldInput
from ..types.compatible_plans import CompatiblePlans
from ..types.custom_plan_config import CustomPlanConfig
@@ -74,9 +75,11 @@ def create_plan_group(
self,
*,
add_on_ids: typing.Sequence[str],
+ checkout_bundle_purchase_behavior: CheckoutBundlePurchaseBehavior,
checkout_collect_address: bool,
checkout_collect_email: bool,
checkout_collect_phone: bool,
+ checkout_collect_tax_id: bool,
enable_tax_collection: bool,
opt_in_enabled: bool,
ordered_add_ons: typing.Sequence[OrderedPlansInGroup],
@@ -117,12 +120,16 @@ def create_plan_group(
add_on_ids : typing.Sequence[str]
Use OrderedAddOns instead
+ checkout_bundle_purchase_behavior : CheckoutBundlePurchaseBehavior
+
checkout_collect_address : bool
checkout_collect_email : bool
checkout_collect_phone : bool
+ checkout_collect_tax_id : bool
+
enable_tax_collection : bool
opt_in_enabled : bool
@@ -204,9 +211,11 @@ def create_plan_group(
)
client.plangroups.create_plan_group(
add_on_ids=["add_on_ids"],
+ checkout_bundle_purchase_behavior="individual",
checkout_collect_address=True,
checkout_collect_email=True,
checkout_collect_phone=True,
+ checkout_collect_tax_id=True,
enable_tax_collection=True,
opt_in_enabled=True,
ordered_add_ons=[
@@ -238,9 +247,11 @@ def create_plan_group(
"""
_response = self._raw_client.create_plan_group(
add_on_ids=add_on_ids,
+ checkout_bundle_purchase_behavior=checkout_bundle_purchase_behavior,
checkout_collect_address=checkout_collect_address,
checkout_collect_email=checkout_collect_email,
checkout_collect_phone=checkout_collect_phone,
+ checkout_collect_tax_id=checkout_collect_tax_id,
enable_tax_collection=enable_tax_collection,
opt_in_enabled=opt_in_enabled,
ordered_add_ons=ordered_add_ons,
@@ -282,9 +293,11 @@ def update_plan_group(
plan_group_id: str,
*,
add_on_ids: typing.Sequence[str],
+ checkout_bundle_purchase_behavior: CheckoutBundlePurchaseBehavior,
checkout_collect_address: bool,
checkout_collect_email: bool,
checkout_collect_phone: bool,
+ checkout_collect_tax_id: bool,
enable_tax_collection: bool,
opt_in_enabled: bool,
ordered_add_ons: typing.Sequence[OrderedPlansInGroup],
@@ -328,12 +341,16 @@ def update_plan_group(
add_on_ids : typing.Sequence[str]
Use OrderedAddOns instead
+ checkout_bundle_purchase_behavior : CheckoutBundlePurchaseBehavior
+
checkout_collect_address : bool
checkout_collect_email : bool
checkout_collect_phone : bool
+ checkout_collect_tax_id : bool
+
enable_tax_collection : bool
opt_in_enabled : bool
@@ -416,9 +433,11 @@ def update_plan_group(
client.plangroups.update_plan_group(
plan_group_id="plan_group_id",
add_on_ids=["add_on_ids"],
+ checkout_bundle_purchase_behavior="individual",
checkout_collect_address=True,
checkout_collect_email=True,
checkout_collect_phone=True,
+ checkout_collect_tax_id=True,
enable_tax_collection=True,
opt_in_enabled=True,
ordered_add_ons=[
@@ -451,9 +470,11 @@ def update_plan_group(
_response = self._raw_client.update_plan_group(
plan_group_id,
add_on_ids=add_on_ids,
+ checkout_bundle_purchase_behavior=checkout_bundle_purchase_behavior,
checkout_collect_address=checkout_collect_address,
checkout_collect_email=checkout_collect_email,
checkout_collect_phone=checkout_collect_phone,
+ checkout_collect_tax_id=checkout_collect_tax_id,
enable_tax_collection=enable_tax_collection,
opt_in_enabled=opt_in_enabled,
ordered_add_ons=ordered_add_ons,
@@ -553,9 +574,11 @@ async def create_plan_group(
self,
*,
add_on_ids: typing.Sequence[str],
+ checkout_bundle_purchase_behavior: CheckoutBundlePurchaseBehavior,
checkout_collect_address: bool,
checkout_collect_email: bool,
checkout_collect_phone: bool,
+ checkout_collect_tax_id: bool,
enable_tax_collection: bool,
opt_in_enabled: bool,
ordered_add_ons: typing.Sequence[OrderedPlansInGroup],
@@ -596,12 +619,16 @@ async def create_plan_group(
add_on_ids : typing.Sequence[str]
Use OrderedAddOns instead
+ checkout_bundle_purchase_behavior : CheckoutBundlePurchaseBehavior
+
checkout_collect_address : bool
checkout_collect_email : bool
checkout_collect_phone : bool
+ checkout_collect_tax_id : bool
+
enable_tax_collection : bool
opt_in_enabled : bool
@@ -688,9 +715,11 @@ async def create_plan_group(
async def main() -> None:
await client.plangroups.create_plan_group(
add_on_ids=["add_on_ids"],
+ checkout_bundle_purchase_behavior="individual",
checkout_collect_address=True,
checkout_collect_email=True,
checkout_collect_phone=True,
+ checkout_collect_tax_id=True,
enable_tax_collection=True,
opt_in_enabled=True,
ordered_add_ons=[
@@ -725,9 +754,11 @@ async def main() -> None:
"""
_response = await self._raw_client.create_plan_group(
add_on_ids=add_on_ids,
+ checkout_bundle_purchase_behavior=checkout_bundle_purchase_behavior,
checkout_collect_address=checkout_collect_address,
checkout_collect_email=checkout_collect_email,
checkout_collect_phone=checkout_collect_phone,
+ checkout_collect_tax_id=checkout_collect_tax_id,
enable_tax_collection=enable_tax_collection,
opt_in_enabled=opt_in_enabled,
ordered_add_ons=ordered_add_ons,
@@ -769,9 +800,11 @@ async def update_plan_group(
plan_group_id: str,
*,
add_on_ids: typing.Sequence[str],
+ checkout_bundle_purchase_behavior: CheckoutBundlePurchaseBehavior,
checkout_collect_address: bool,
checkout_collect_email: bool,
checkout_collect_phone: bool,
+ checkout_collect_tax_id: bool,
enable_tax_collection: bool,
opt_in_enabled: bool,
ordered_add_ons: typing.Sequence[OrderedPlansInGroup],
@@ -815,12 +848,16 @@ async def update_plan_group(
add_on_ids : typing.Sequence[str]
Use OrderedAddOns instead
+ checkout_bundle_purchase_behavior : CheckoutBundlePurchaseBehavior
+
checkout_collect_address : bool
checkout_collect_email : bool
checkout_collect_phone : bool
+ checkout_collect_tax_id : bool
+
enable_tax_collection : bool
opt_in_enabled : bool
@@ -908,9 +945,11 @@ async def main() -> None:
await client.plangroups.update_plan_group(
plan_group_id="plan_group_id",
add_on_ids=["add_on_ids"],
+ checkout_bundle_purchase_behavior="individual",
checkout_collect_address=True,
checkout_collect_email=True,
checkout_collect_phone=True,
+ checkout_collect_tax_id=True,
enable_tax_collection=True,
opt_in_enabled=True,
ordered_add_ons=[
@@ -946,9 +985,11 @@ async def main() -> None:
_response = await self._raw_client.update_plan_group(
plan_group_id,
add_on_ids=add_on_ids,
+ checkout_bundle_purchase_behavior=checkout_bundle_purchase_behavior,
checkout_collect_address=checkout_collect_address,
checkout_collect_email=checkout_collect_email,
checkout_collect_phone=checkout_collect_phone,
+ checkout_collect_tax_id=checkout_collect_tax_id,
enable_tax_collection=enable_tax_collection,
opt_in_enabled=opt_in_enabled,
ordered_add_ons=ordered_add_ons,
diff --git a/src/schematic/plangroups/raw_client.py b/src/schematic/plangroups/raw_client.py
index 543f303..5c4c881 100644
--- a/src/schematic/plangroups/raw_client.py
+++ b/src/schematic/plangroups/raw_client.py
@@ -17,6 +17,7 @@
from ..errors.not_found_error import NotFoundError
from ..errors.unauthorized_error import UnauthorizedError
from ..types.api_error import ApiError as types_api_error_ApiError
+from ..types.checkout_bundle_purchase_behavior import CheckoutBundlePurchaseBehavior
from ..types.checkout_field_input import CheckoutFieldInput
from ..types.compatible_plans import CompatiblePlans
from ..types.custom_plan_config import CustomPlanConfig
@@ -135,9 +136,11 @@ def create_plan_group(
self,
*,
add_on_ids: typing.Sequence[str],
+ checkout_bundle_purchase_behavior: CheckoutBundlePurchaseBehavior,
checkout_collect_address: bool,
checkout_collect_email: bool,
checkout_collect_phone: bool,
+ checkout_collect_tax_id: bool,
enable_tax_collection: bool,
opt_in_enabled: bool,
ordered_add_ons: typing.Sequence[OrderedPlansInGroup],
@@ -178,12 +181,16 @@ def create_plan_group(
add_on_ids : typing.Sequence[str]
Use OrderedAddOns instead
+ checkout_bundle_purchase_behavior : CheckoutBundlePurchaseBehavior
+
checkout_collect_address : bool
checkout_collect_email : bool
checkout_collect_phone : bool
+ checkout_collect_tax_id : bool
+
enable_tax_collection : bool
opt_in_enabled : bool
@@ -264,9 +271,11 @@ def create_plan_group(
object_=add_on_compatibilities, annotation=typing.Sequence[CompatiblePlans], direction="write"
),
"add_on_ids": add_on_ids,
+ "checkout_bundle_purchase_behavior": checkout_bundle_purchase_behavior,
"checkout_collect_address": checkout_collect_address,
"checkout_collect_email": checkout_collect_email,
"checkout_collect_phone": checkout_collect_phone,
+ "checkout_collect_tax_id": checkout_collect_tax_id,
"custom_checkout_fields": convert_and_respect_annotation_metadata(
object_=custom_checkout_fields, annotation=typing.Sequence[CheckoutFieldInput], direction="write"
),
@@ -398,9 +407,11 @@ def update_plan_group(
plan_group_id: str,
*,
add_on_ids: typing.Sequence[str],
+ checkout_bundle_purchase_behavior: CheckoutBundlePurchaseBehavior,
checkout_collect_address: bool,
checkout_collect_email: bool,
checkout_collect_phone: bool,
+ checkout_collect_tax_id: bool,
enable_tax_collection: bool,
opt_in_enabled: bool,
ordered_add_ons: typing.Sequence[OrderedPlansInGroup],
@@ -444,12 +455,16 @@ def update_plan_group(
add_on_ids : typing.Sequence[str]
Use OrderedAddOns instead
+ checkout_bundle_purchase_behavior : CheckoutBundlePurchaseBehavior
+
checkout_collect_address : bool
checkout_collect_email : bool
checkout_collect_phone : bool
+ checkout_collect_tax_id : bool
+
enable_tax_collection : bool
opt_in_enabled : bool
@@ -530,9 +545,11 @@ def update_plan_group(
object_=add_on_compatibilities, annotation=typing.Sequence[CompatiblePlans], direction="write"
),
"add_on_ids": add_on_ids,
+ "checkout_bundle_purchase_behavior": checkout_bundle_purchase_behavior,
"checkout_collect_address": checkout_collect_address,
"checkout_collect_email": checkout_collect_email,
"checkout_collect_phone": checkout_collect_phone,
+ "checkout_collect_tax_id": checkout_collect_tax_id,
"custom_checkout_fields": convert_and_respect_annotation_metadata(
object_=custom_checkout_fields, annotation=typing.Sequence[CheckoutFieldInput], direction="write"
),
@@ -762,9 +779,11 @@ async def create_plan_group(
self,
*,
add_on_ids: typing.Sequence[str],
+ checkout_bundle_purchase_behavior: CheckoutBundlePurchaseBehavior,
checkout_collect_address: bool,
checkout_collect_email: bool,
checkout_collect_phone: bool,
+ checkout_collect_tax_id: bool,
enable_tax_collection: bool,
opt_in_enabled: bool,
ordered_add_ons: typing.Sequence[OrderedPlansInGroup],
@@ -805,12 +824,16 @@ async def create_plan_group(
add_on_ids : typing.Sequence[str]
Use OrderedAddOns instead
+ checkout_bundle_purchase_behavior : CheckoutBundlePurchaseBehavior
+
checkout_collect_address : bool
checkout_collect_email : bool
checkout_collect_phone : bool
+ checkout_collect_tax_id : bool
+
enable_tax_collection : bool
opt_in_enabled : bool
@@ -891,9 +914,11 @@ async def create_plan_group(
object_=add_on_compatibilities, annotation=typing.Sequence[CompatiblePlans], direction="write"
),
"add_on_ids": add_on_ids,
+ "checkout_bundle_purchase_behavior": checkout_bundle_purchase_behavior,
"checkout_collect_address": checkout_collect_address,
"checkout_collect_email": checkout_collect_email,
"checkout_collect_phone": checkout_collect_phone,
+ "checkout_collect_tax_id": checkout_collect_tax_id,
"custom_checkout_fields": convert_and_respect_annotation_metadata(
object_=custom_checkout_fields, annotation=typing.Sequence[CheckoutFieldInput], direction="write"
),
@@ -1025,9 +1050,11 @@ async def update_plan_group(
plan_group_id: str,
*,
add_on_ids: typing.Sequence[str],
+ checkout_bundle_purchase_behavior: CheckoutBundlePurchaseBehavior,
checkout_collect_address: bool,
checkout_collect_email: bool,
checkout_collect_phone: bool,
+ checkout_collect_tax_id: bool,
enable_tax_collection: bool,
opt_in_enabled: bool,
ordered_add_ons: typing.Sequence[OrderedPlansInGroup],
@@ -1071,12 +1098,16 @@ async def update_plan_group(
add_on_ids : typing.Sequence[str]
Use OrderedAddOns instead
+ checkout_bundle_purchase_behavior : CheckoutBundlePurchaseBehavior
+
checkout_collect_address : bool
checkout_collect_email : bool
checkout_collect_phone : bool
+ checkout_collect_tax_id : bool
+
enable_tax_collection : bool
opt_in_enabled : bool
@@ -1157,9 +1188,11 @@ async def update_plan_group(
object_=add_on_compatibilities, annotation=typing.Sequence[CompatiblePlans], direction="write"
),
"add_on_ids": add_on_ids,
+ "checkout_bundle_purchase_behavior": checkout_bundle_purchase_behavior,
"checkout_collect_address": checkout_collect_address,
"checkout_collect_email": checkout_collect_email,
"checkout_collect_phone": checkout_collect_phone,
+ "checkout_collect_tax_id": checkout_collect_tax_id,
"custom_checkout_fields": convert_and_respect_annotation_metadata(
object_=custom_checkout_fields, annotation=typing.Sequence[CheckoutFieldInput], direction="write"
),
diff --git a/src/schematic/planmigrations/client.py b/src/schematic/planmigrations/client.py
index e48f68f..d45fccd 100644
--- a/src/schematic/planmigrations/client.py
+++ b/src/schematic/planmigrations/client.py
@@ -5,6 +5,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.migration_error_code import MigrationErrorCode
+from ..types.migration_proration_behavior import MigrationProrationBehavior
from ..types.plan_type import PlanType
from ..types.plan_version_company_migration_status import PlanVersionCompanyMigrationStatus
from ..types.plan_version_migration_status import PlanVersionMigrationStatus
@@ -230,32 +231,35 @@ def list_migrations(
def create_migration(
self,
*,
- company_ids: typing.Sequence[str],
- excluded_company_ids: typing.Sequence[str],
plan_id: str,
plan_version_id_to: str,
- plan_version_ids_from: typing.Sequence[str],
strategy: PlanVersionMigrationStrategy,
target_plan_type: PlanType,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ excluded_company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ plan_version_ids_from: typing.Optional[typing.Sequence[str]] = OMIT,
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> CreateMigrationResponse:
"""
Parameters
----------
- company_ids : typing.Sequence[str]
-
- excluded_company_ids : typing.Sequence[str]
-
plan_id : str
plan_version_id_to : str
- plan_version_ids_from : typing.Sequence[str]
-
strategy : PlanVersionMigrationStrategy
target_plan_type : PlanType
+ company_ids : typing.Optional[typing.Sequence[str]]
+
+ excluded_company_ids : typing.Optional[typing.Sequence[str]]
+
+ plan_version_ids_from : typing.Optional[typing.Sequence[str]]
+
+ proration_behavior : typing.Optional[MigrationProrationBehavior]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -272,23 +276,21 @@ def create_migration(
api_key="YOUR_API_KEY",
)
client.planmigrations.create_migration(
- company_ids=["company_ids"],
- excluded_company_ids=["excluded_company_ids"],
plan_id="plan_id",
plan_version_id_to="plan_version_id_to",
- plan_version_ids_from=["plan_version_ids_from"],
strategy="immediate",
target_plan_type="plan",
)
"""
_response = self._raw_client.create_migration(
- company_ids=company_ids,
- excluded_company_ids=excluded_company_ids,
plan_id=plan_id,
plan_version_id_to=plan_version_id_to,
- plan_version_ids_from=plan_version_ids_from,
strategy=strategy,
target_plan_type=target_plan_type,
+ company_ids=company_ids,
+ excluded_company_ids=excluded_company_ids,
+ plan_version_ids_from=plan_version_ids_from,
+ proration_behavior=proration_behavior,
request_options=request_options,
)
return _response.data
@@ -416,23 +418,26 @@ def count_migrations(
def preview_migration(
self,
*,
- company_ids: typing.Sequence[str],
plan_id: str,
plan_version_id_to: str,
target_plan_type: PlanType,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ plan_version_ids_from: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> PreviewMigrationResponse:
"""
Parameters
----------
- company_ids : typing.Sequence[str]
-
plan_id : str
plan_version_id_to : str
target_plan_type : PlanType
+ company_ids : typing.Optional[typing.Sequence[str]]
+
+ plan_version_ids_from : typing.Optional[typing.Sequence[str]]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -449,17 +454,17 @@ def preview_migration(
api_key="YOUR_API_KEY",
)
client.planmigrations.preview_migration(
- company_ids=["company_ids"],
plan_id="plan_id",
plan_version_id_to="plan_version_id_to",
target_plan_type="plan",
)
"""
_response = self._raw_client.preview_migration(
- company_ids=company_ids,
plan_id=plan_id,
plan_version_id_to=plan_version_id_to,
target_plan_type=target_plan_type,
+ company_ids=company_ids,
+ plan_version_ids_from=plan_version_ids_from,
request_options=request_options,
)
return _response.data
@@ -703,32 +708,35 @@ async def main() -> None:
async def create_migration(
self,
*,
- company_ids: typing.Sequence[str],
- excluded_company_ids: typing.Sequence[str],
plan_id: str,
plan_version_id_to: str,
- plan_version_ids_from: typing.Sequence[str],
strategy: PlanVersionMigrationStrategy,
target_plan_type: PlanType,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ excluded_company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ plan_version_ids_from: typing.Optional[typing.Sequence[str]] = OMIT,
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> CreateMigrationResponse:
"""
Parameters
----------
- company_ids : typing.Sequence[str]
-
- excluded_company_ids : typing.Sequence[str]
-
plan_id : str
plan_version_id_to : str
- plan_version_ids_from : typing.Sequence[str]
-
strategy : PlanVersionMigrationStrategy
target_plan_type : PlanType
+ company_ids : typing.Optional[typing.Sequence[str]]
+
+ excluded_company_ids : typing.Optional[typing.Sequence[str]]
+
+ plan_version_ids_from : typing.Optional[typing.Sequence[str]]
+
+ proration_behavior : typing.Optional[MigrationProrationBehavior]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -750,11 +758,8 @@ async def create_migration(
async def main() -> None:
await client.planmigrations.create_migration(
- company_ids=["company_ids"],
- excluded_company_ids=["excluded_company_ids"],
plan_id="plan_id",
plan_version_id_to="plan_version_id_to",
- plan_version_ids_from=["plan_version_ids_from"],
strategy="immediate",
target_plan_type="plan",
)
@@ -763,13 +768,14 @@ async def main() -> None:
asyncio.run(main())
"""
_response = await self._raw_client.create_migration(
- company_ids=company_ids,
- excluded_company_ids=excluded_company_ids,
plan_id=plan_id,
plan_version_id_to=plan_version_id_to,
- plan_version_ids_from=plan_version_ids_from,
strategy=strategy,
target_plan_type=target_plan_type,
+ company_ids=company_ids,
+ excluded_company_ids=excluded_company_ids,
+ plan_version_ids_from=plan_version_ids_from,
+ proration_behavior=proration_behavior,
request_options=request_options,
)
return _response.data
@@ -921,23 +927,26 @@ async def main() -> None:
async def preview_migration(
self,
*,
- company_ids: typing.Sequence[str],
plan_id: str,
plan_version_id_to: str,
target_plan_type: PlanType,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ plan_version_ids_from: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> PreviewMigrationResponse:
"""
Parameters
----------
- company_ids : typing.Sequence[str]
-
plan_id : str
plan_version_id_to : str
target_plan_type : PlanType
+ company_ids : typing.Optional[typing.Sequence[str]]
+
+ plan_version_ids_from : typing.Optional[typing.Sequence[str]]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -959,7 +968,6 @@ async def preview_migration(
async def main() -> None:
await client.planmigrations.preview_migration(
- company_ids=["company_ids"],
plan_id="plan_id",
plan_version_id_to="plan_version_id_to",
target_plan_type="plan",
@@ -969,10 +977,11 @@ async def main() -> None:
asyncio.run(main())
"""
_response = await self._raw_client.preview_migration(
- company_ids=company_ids,
plan_id=plan_id,
plan_version_id_to=plan_version_id_to,
target_plan_type=target_plan_type,
+ company_ids=company_ids,
+ plan_version_ids_from=plan_version_ids_from,
request_options=request_options,
)
return _response.data
diff --git a/src/schematic/planmigrations/raw_client.py b/src/schematic/planmigrations/raw_client.py
index 97a1dfa..8d445c6 100644
--- a/src/schematic/planmigrations/raw_client.py
+++ b/src/schematic/planmigrations/raw_client.py
@@ -17,6 +17,7 @@
from ..errors.unauthorized_error import UnauthorizedError
from ..types.api_error import ApiError as types_api_error_ApiError
from ..types.migration_error_code import MigrationErrorCode
+from ..types.migration_proration_behavior import MigrationProrationBehavior
from ..types.plan_type import PlanType
from ..types.plan_version_company_migration_status import PlanVersionCompanyMigrationStatus
from ..types.plan_version_migration_status import PlanVersionMigrationStatus
@@ -508,32 +509,35 @@ def list_migrations(
def create_migration(
self,
*,
- company_ids: typing.Sequence[str],
- excluded_company_ids: typing.Sequence[str],
plan_id: str,
plan_version_id_to: str,
- plan_version_ids_from: typing.Sequence[str],
strategy: PlanVersionMigrationStrategy,
target_plan_type: PlanType,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ excluded_company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ plan_version_ids_from: typing.Optional[typing.Sequence[str]] = OMIT,
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[CreateMigrationResponse]:
"""
Parameters
----------
- company_ids : typing.Sequence[str]
-
- excluded_company_ids : typing.Sequence[str]
-
plan_id : str
plan_version_id_to : str
- plan_version_ids_from : typing.Sequence[str]
-
strategy : PlanVersionMigrationStrategy
target_plan_type : PlanType
+ company_ids : typing.Optional[typing.Sequence[str]]
+
+ excluded_company_ids : typing.Optional[typing.Sequence[str]]
+
+ plan_version_ids_from : typing.Optional[typing.Sequence[str]]
+
+ proration_behavior : typing.Optional[MigrationProrationBehavior]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -551,6 +555,7 @@ def create_migration(
"plan_id": plan_id,
"plan_version_id_to": plan_version_id_to,
"plan_version_ids_from": plan_version_ids_from,
+ "proration_behavior": proration_behavior,
"strategy": strategy,
"target_plan_type": target_plan_type,
},
@@ -962,23 +967,26 @@ def count_migrations(
def preview_migration(
self,
*,
- company_ids: typing.Sequence[str],
plan_id: str,
plan_version_id_to: str,
target_plan_type: PlanType,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ plan_version_ids_from: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[PreviewMigrationResponse]:
"""
Parameters
----------
- company_ids : typing.Sequence[str]
-
plan_id : str
plan_version_id_to : str
target_plan_type : PlanType
+ company_ids : typing.Optional[typing.Sequence[str]]
+
+ plan_version_ids_from : typing.Optional[typing.Sequence[str]]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -994,6 +1002,7 @@ def preview_migration(
"company_ids": company_ids,
"plan_id": plan_id,
"plan_version_id_to": plan_version_id_to,
+ "plan_version_ids_from": plan_version_ids_from,
"target_plan_type": target_plan_type,
},
headers={
@@ -1553,32 +1562,35 @@ async def list_migrations(
async def create_migration(
self,
*,
- company_ids: typing.Sequence[str],
- excluded_company_ids: typing.Sequence[str],
plan_id: str,
plan_version_id_to: str,
- plan_version_ids_from: typing.Sequence[str],
strategy: PlanVersionMigrationStrategy,
target_plan_type: PlanType,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ excluded_company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ plan_version_ids_from: typing.Optional[typing.Sequence[str]] = OMIT,
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[CreateMigrationResponse]:
"""
Parameters
----------
- company_ids : typing.Sequence[str]
-
- excluded_company_ids : typing.Sequence[str]
-
plan_id : str
plan_version_id_to : str
- plan_version_ids_from : typing.Sequence[str]
-
strategy : PlanVersionMigrationStrategy
target_plan_type : PlanType
+ company_ids : typing.Optional[typing.Sequence[str]]
+
+ excluded_company_ids : typing.Optional[typing.Sequence[str]]
+
+ plan_version_ids_from : typing.Optional[typing.Sequence[str]]
+
+ proration_behavior : typing.Optional[MigrationProrationBehavior]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -1596,6 +1608,7 @@ async def create_migration(
"plan_id": plan_id,
"plan_version_id_to": plan_version_id_to,
"plan_version_ids_from": plan_version_ids_from,
+ "proration_behavior": proration_behavior,
"strategy": strategy,
"target_plan_type": target_plan_type,
},
@@ -2007,23 +2020,26 @@ async def count_migrations(
async def preview_migration(
self,
*,
- company_ids: typing.Sequence[str],
plan_id: str,
plan_version_id_to: str,
target_plan_type: PlanType,
+ company_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ plan_version_ids_from: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[PreviewMigrationResponse]:
"""
Parameters
----------
- company_ids : typing.Sequence[str]
-
plan_id : str
plan_version_id_to : str
target_plan_type : PlanType
+ company_ids : typing.Optional[typing.Sequence[str]]
+
+ plan_version_ids_from : typing.Optional[typing.Sequence[str]]
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -2039,6 +2055,7 @@ async def preview_migration(
"company_ids": company_ids,
"plan_id": plan_id,
"plan_version_id_to": plan_version_id_to,
+ "plan_version_ids_from": plan_version_ids_from,
"target_plan_type": target_plan_type,
},
headers={
diff --git a/src/schematic/plans/client.py b/src/schematic/plans/client.py
index 368089f..b5fbc55 100644
--- a/src/schematic/plans/client.py
+++ b/src/schematic/plans/client.py
@@ -12,6 +12,8 @@
from ..types.custom_plan_billing_status import CustomPlanBillingStatus
from ..types.customer_billing_address import CustomerBillingAddress
from ..types.mark_custom_plan_billing_paid_request_body import MarkCustomPlanBillingPaidRequestBody
+from ..types.migration_proration_behavior import MigrationProrationBehavior
+from ..types.plan_billing_source import PlanBillingSource
from ..types.plan_currency_price_request_body import PlanCurrencyPriceRequestBody
from ..types.plan_icon import PlanIcon
from ..types.plan_type import PlanType
@@ -58,7 +60,7 @@ def with_raw_response(self) -> RawPlansClient:
def update_company_plans(
self,
- company_plan_id: str,
+ company_id: str,
*,
add_on_ids: typing.Sequence[str],
base_plan_id: typing.Optional[str] = OMIT,
@@ -67,8 +69,8 @@ def update_company_plans(
"""
Parameters
----------
- company_plan_id : str
- company_plan_id
+ company_id : str
+ company_id
add_on_ids : typing.Sequence[str]
@@ -90,12 +92,12 @@ def update_company_plans(
api_key="YOUR_API_KEY",
)
client.plans.update_company_plans(
- company_plan_id="company_plan_id",
+ company_id="company_id",
add_on_ids=["add_on_ids"],
)
"""
_response = self._raw_client.update_company_plans(
- company_plan_id, add_on_ids=add_on_ids, base_plan_id=base_plan_id, request_options=request_options
+ company_id, add_on_ids=add_on_ids, base_plan_id=base_plan_id, request_options=request_options
)
return _response.data
@@ -104,6 +106,7 @@ def list_custom_plan_billings(
*,
company_id: typing.Optional[str] = None,
plan_id: typing.Optional[str] = None,
+ plan_billing_source: typing.Optional[PlanBillingSource] = None,
status: typing.Optional[CustomPlanBillingStatus] = None,
statuses: typing.Optional[
typing.Union[CustomPlanBillingStatus, typing.Sequence[CustomPlanBillingStatus]]
@@ -121,6 +124,9 @@ def list_custom_plan_billings(
plan_id : typing.Optional[str]
Filter by plan ID
+ plan_billing_source : typing.Optional[PlanBillingSource]
+ Filter by the flow that created the billing record. Defaults to custom_plan.
+
status : typing.Optional[CustomPlanBillingStatus]
Filter by billing status
@@ -151,6 +157,7 @@ def list_custom_plan_billings(
client.plans.list_custom_plan_billings(
company_id="company_id",
plan_id="plan_id",
+ plan_billing_source="custom_plan",
status="active",
statuses=["active"],
limit=1000000,
@@ -160,6 +167,7 @@ def list_custom_plan_billings(
_response = self._raw_client.list_custom_plan_billings(
company_id=company_id,
plan_id=plan_id,
+ plan_billing_source=plan_billing_source,
status=status,
statuses=statuses,
limit=limit,
@@ -1045,7 +1053,7 @@ def list_plan_issues(
def delete_plan_version(
self,
- plan_id: str,
+ plan_version_id: str,
*,
promote_archived_version: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
@@ -1053,8 +1061,8 @@ def delete_plan_version(
"""
Parameters
----------
- plan_id : str
- plan_id
+ plan_version_id : str
+ plan_version_id
promote_archived_version : typing.Optional[bool]
@@ -1074,18 +1082,18 @@ def delete_plan_version(
api_key="YOUR_API_KEY",
)
client.plans.delete_plan_version(
- plan_id="plan_id",
+ plan_version_id="plan_version_id",
promote_archived_version=True,
)
"""
_response = self._raw_client.delete_plan_version(
- plan_id, promote_archived_version=promote_archived_version, request_options=request_options
+ plan_version_id, promote_archived_version=promote_archived_version, request_options=request_options
)
return _response.data
def publish_plan_version(
self,
- plan_id: str,
+ plan_version_id: str,
*,
excluded_company_ids: typing.Sequence[str],
migration_strategy: PlanVersionMigrationStrategy,
@@ -1096,6 +1104,7 @@ def publish_plan_version(
customer_email: typing.Optional[str] = OMIT,
days_until_due: typing.Optional[int] = OMIT,
phone: typing.Optional[str] = OMIT,
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = OMIT,
send_invoice: typing.Optional[bool] = OMIT,
tax_id: typing.Optional[TaxIdInput] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -1103,8 +1112,8 @@ def publish_plan_version(
"""
Parameters
----------
- plan_id : str
- plan_id
+ plan_version_id : str
+ plan_version_id
excluded_company_ids : typing.Sequence[str]
@@ -1124,6 +1133,8 @@ def publish_plan_version(
phone : typing.Optional[str]
+ proration_behavior : typing.Optional[MigrationProrationBehavior]
+
send_invoice : typing.Optional[bool]
Whether Stripe emails the invoice when it is finalized. Defaults to true.
@@ -1145,13 +1156,13 @@ def publish_plan_version(
api_key="YOUR_API_KEY",
)
client.plans.publish_plan_version(
- plan_id="plan_id",
+ plan_version_id="plan_version_id",
excluded_company_ids=["excluded_company_ids"],
migration_strategy="immediate",
)
"""
_response = self._raw_client.publish_plan_version(
- plan_id,
+ plan_version_id,
excluded_company_ids=excluded_company_ids,
migration_strategy=migration_strategy,
activation_strategy=activation_strategy,
@@ -1161,6 +1172,7 @@ def publish_plan_version(
customer_email=customer_email,
days_until_due=days_until_due,
phone=phone,
+ proration_behavior=proration_behavior,
send_invoice=send_invoice,
tax_id=tax_id,
request_options=request_options,
@@ -1185,7 +1197,7 @@ def with_raw_response(self) -> AsyncRawPlansClient:
async def update_company_plans(
self,
- company_plan_id: str,
+ company_id: str,
*,
add_on_ids: typing.Sequence[str],
base_plan_id: typing.Optional[str] = OMIT,
@@ -1194,8 +1206,8 @@ async def update_company_plans(
"""
Parameters
----------
- company_plan_id : str
- company_plan_id
+ company_id : str
+ company_id
add_on_ids : typing.Sequence[str]
@@ -1222,7 +1234,7 @@ async def update_company_plans(
async def main() -> None:
await client.plans.update_company_plans(
- company_plan_id="company_plan_id",
+ company_id="company_id",
add_on_ids=["add_on_ids"],
)
@@ -1230,7 +1242,7 @@ async def main() -> None:
asyncio.run(main())
"""
_response = await self._raw_client.update_company_plans(
- company_plan_id, add_on_ids=add_on_ids, base_plan_id=base_plan_id, request_options=request_options
+ company_id, add_on_ids=add_on_ids, base_plan_id=base_plan_id, request_options=request_options
)
return _response.data
@@ -1239,6 +1251,7 @@ async def list_custom_plan_billings(
*,
company_id: typing.Optional[str] = None,
plan_id: typing.Optional[str] = None,
+ plan_billing_source: typing.Optional[PlanBillingSource] = None,
status: typing.Optional[CustomPlanBillingStatus] = None,
statuses: typing.Optional[
typing.Union[CustomPlanBillingStatus, typing.Sequence[CustomPlanBillingStatus]]
@@ -1256,6 +1269,9 @@ async def list_custom_plan_billings(
plan_id : typing.Optional[str]
Filter by plan ID
+ plan_billing_source : typing.Optional[PlanBillingSource]
+ Filter by the flow that created the billing record. Defaults to custom_plan.
+
status : typing.Optional[CustomPlanBillingStatus]
Filter by billing status
@@ -1291,6 +1307,7 @@ async def main() -> None:
await client.plans.list_custom_plan_billings(
company_id="company_id",
plan_id="plan_id",
+ plan_billing_source="custom_plan",
status="active",
statuses=["active"],
limit=1000000,
@@ -1303,6 +1320,7 @@ async def main() -> None:
_response = await self._raw_client.list_custom_plan_billings(
company_id=company_id,
plan_id=plan_id,
+ plan_billing_source=plan_billing_source,
status=status,
statuses=statuses,
limit=limit,
@@ -2302,7 +2320,7 @@ async def main() -> None:
async def delete_plan_version(
self,
- plan_id: str,
+ plan_version_id: str,
*,
promote_archived_version: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
@@ -2310,8 +2328,8 @@ async def delete_plan_version(
"""
Parameters
----------
- plan_id : str
- plan_id
+ plan_version_id : str
+ plan_version_id
promote_archived_version : typing.Optional[bool]
@@ -2336,7 +2354,7 @@ async def delete_plan_version(
async def main() -> None:
await client.plans.delete_plan_version(
- plan_id="plan_id",
+ plan_version_id="plan_version_id",
promote_archived_version=True,
)
@@ -2344,13 +2362,13 @@ async def main() -> None:
asyncio.run(main())
"""
_response = await self._raw_client.delete_plan_version(
- plan_id, promote_archived_version=promote_archived_version, request_options=request_options
+ plan_version_id, promote_archived_version=promote_archived_version, request_options=request_options
)
return _response.data
async def publish_plan_version(
self,
- plan_id: str,
+ plan_version_id: str,
*,
excluded_company_ids: typing.Sequence[str],
migration_strategy: PlanVersionMigrationStrategy,
@@ -2361,6 +2379,7 @@ async def publish_plan_version(
customer_email: typing.Optional[str] = OMIT,
days_until_due: typing.Optional[int] = OMIT,
phone: typing.Optional[str] = OMIT,
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = OMIT,
send_invoice: typing.Optional[bool] = OMIT,
tax_id: typing.Optional[TaxIdInput] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -2368,8 +2387,8 @@ async def publish_plan_version(
"""
Parameters
----------
- plan_id : str
- plan_id
+ plan_version_id : str
+ plan_version_id
excluded_company_ids : typing.Sequence[str]
@@ -2389,6 +2408,8 @@ async def publish_plan_version(
phone : typing.Optional[str]
+ proration_behavior : typing.Optional[MigrationProrationBehavior]
+
send_invoice : typing.Optional[bool]
Whether Stripe emails the invoice when it is finalized. Defaults to true.
@@ -2415,7 +2436,7 @@ async def publish_plan_version(
async def main() -> None:
await client.plans.publish_plan_version(
- plan_id="plan_id",
+ plan_version_id="plan_version_id",
excluded_company_ids=["excluded_company_ids"],
migration_strategy="immediate",
)
@@ -2424,7 +2445,7 @@ async def main() -> None:
asyncio.run(main())
"""
_response = await self._raw_client.publish_plan_version(
- plan_id,
+ plan_version_id,
excluded_company_ids=excluded_company_ids,
migration_strategy=migration_strategy,
activation_strategy=activation_strategy,
@@ -2434,6 +2455,7 @@ async def main() -> None:
customer_email=customer_email,
days_until_due=days_until_due,
phone=phone,
+ proration_behavior=proration_behavior,
send_invoice=send_invoice,
tax_id=tax_id,
request_options=request_options,
diff --git a/src/schematic/plans/raw_client.py b/src/schematic/plans/raw_client.py
index 8fb2720..2a007b7 100644
--- a/src/schematic/plans/raw_client.py
+++ b/src/schematic/plans/raw_client.py
@@ -25,6 +25,8 @@
from ..types.custom_plan_billing_status import CustomPlanBillingStatus
from ..types.customer_billing_address import CustomerBillingAddress
from ..types.mark_custom_plan_billing_paid_request_body import MarkCustomPlanBillingPaidRequestBody
+from ..types.migration_proration_behavior import MigrationProrationBehavior
+from ..types.plan_billing_source import PlanBillingSource
from ..types.plan_currency_price_request_body import PlanCurrencyPriceRequestBody
from ..types.plan_icon import PlanIcon
from ..types.plan_type import PlanType
@@ -60,7 +62,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
def update_company_plans(
self,
- company_plan_id: str,
+ company_id: str,
*,
add_on_ids: typing.Sequence[str],
base_plan_id: typing.Optional[str] = OMIT,
@@ -69,8 +71,8 @@ def update_company_plans(
"""
Parameters
----------
- company_plan_id : str
- company_plan_id
+ company_id : str
+ company_id
add_on_ids : typing.Sequence[str]
@@ -85,7 +87,7 @@ def update_company_plans(
OK
"""
_response = self._client_wrapper.httpx_client.request(
- f"company-plans/{encode_path_param(company_plan_id)}",
+ f"company-plans/{encode_path_param(company_id)}",
method="PUT",
json={
"add_on_ids": add_on_ids,
@@ -180,6 +182,7 @@ def list_custom_plan_billings(
*,
company_id: typing.Optional[str] = None,
plan_id: typing.Optional[str] = None,
+ plan_billing_source: typing.Optional[PlanBillingSource] = None,
status: typing.Optional[CustomPlanBillingStatus] = None,
statuses: typing.Optional[
typing.Union[CustomPlanBillingStatus, typing.Sequence[CustomPlanBillingStatus]]
@@ -197,6 +200,9 @@ def list_custom_plan_billings(
plan_id : typing.Optional[str]
Filter by plan ID
+ plan_billing_source : typing.Optional[PlanBillingSource]
+ Filter by the flow that created the billing record. Defaults to custom_plan.
+
status : typing.Optional[CustomPlanBillingStatus]
Filter by billing status
@@ -223,6 +229,7 @@ def list_custom_plan_billings(
params={
"company_id": company_id,
"plan_id": plan_id,
+ "plan_billing_source": plan_billing_source,
"status": status,
"statuses": statuses,
"limit": limit,
@@ -2134,7 +2141,7 @@ def list_plan_issues(
def delete_plan_version(
self,
- plan_id: str,
+ plan_version_id: str,
*,
promote_archived_version: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
@@ -2142,8 +2149,8 @@ def delete_plan_version(
"""
Parameters
----------
- plan_id : str
- plan_id
+ plan_version_id : str
+ plan_version_id
promote_archived_version : typing.Optional[bool]
@@ -2156,7 +2163,7 @@ def delete_plan_version(
OK
"""
_response = self._client_wrapper.httpx_client.request(
- f"plans/version/{encode_path_param(plan_id)}",
+ f"plans/version/{encode_path_param(plan_version_id)}",
method="DELETE",
params={
"promote_archived_version": promote_archived_version,
@@ -2243,7 +2250,7 @@ def delete_plan_version(
def publish_plan_version(
self,
- plan_id: str,
+ plan_version_id: str,
*,
excluded_company_ids: typing.Sequence[str],
migration_strategy: PlanVersionMigrationStrategy,
@@ -2254,6 +2261,7 @@ def publish_plan_version(
customer_email: typing.Optional[str] = OMIT,
days_until_due: typing.Optional[int] = OMIT,
phone: typing.Optional[str] = OMIT,
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = OMIT,
send_invoice: typing.Optional[bool] = OMIT,
tax_id: typing.Optional[TaxIdInput] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -2261,8 +2269,8 @@ def publish_plan_version(
"""
Parameters
----------
- plan_id : str
- plan_id
+ plan_version_id : str
+ plan_version_id
excluded_company_ids : typing.Sequence[str]
@@ -2282,6 +2290,8 @@ def publish_plan_version(
phone : typing.Optional[str]
+ proration_behavior : typing.Optional[MigrationProrationBehavior]
+
send_invoice : typing.Optional[bool]
Whether Stripe emails the invoice when it is finalized. Defaults to true.
@@ -2296,7 +2306,7 @@ def publish_plan_version(
OK
"""
_response = self._client_wrapper.httpx_client.request(
- f"plans/version/{encode_path_param(plan_id)}/publish",
+ f"plans/version/{encode_path_param(plan_version_id)}/publish",
method="PUT",
json={
"activation_strategy": activation_strategy,
@@ -2312,6 +2322,7 @@ def publish_plan_version(
"excluded_company_ids": excluded_company_ids,
"migration_strategy": migration_strategy,
"phone": phone,
+ "proration_behavior": proration_behavior,
"send_invoice": send_invoice,
"tax_id": convert_and_respect_annotation_metadata(
object_=tax_id, annotation=TaxIdInput, direction="write"
@@ -2408,7 +2419,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
async def update_company_plans(
self,
- company_plan_id: str,
+ company_id: str,
*,
add_on_ids: typing.Sequence[str],
base_plan_id: typing.Optional[str] = OMIT,
@@ -2417,8 +2428,8 @@ async def update_company_plans(
"""
Parameters
----------
- company_plan_id : str
- company_plan_id
+ company_id : str
+ company_id
add_on_ids : typing.Sequence[str]
@@ -2433,7 +2444,7 @@ async def update_company_plans(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- f"company-plans/{encode_path_param(company_plan_id)}",
+ f"company-plans/{encode_path_param(company_id)}",
method="PUT",
json={
"add_on_ids": add_on_ids,
@@ -2528,6 +2539,7 @@ async def list_custom_plan_billings(
*,
company_id: typing.Optional[str] = None,
plan_id: typing.Optional[str] = None,
+ plan_billing_source: typing.Optional[PlanBillingSource] = None,
status: typing.Optional[CustomPlanBillingStatus] = None,
statuses: typing.Optional[
typing.Union[CustomPlanBillingStatus, typing.Sequence[CustomPlanBillingStatus]]
@@ -2545,6 +2557,9 @@ async def list_custom_plan_billings(
plan_id : typing.Optional[str]
Filter by plan ID
+ plan_billing_source : typing.Optional[PlanBillingSource]
+ Filter by the flow that created the billing record. Defaults to custom_plan.
+
status : typing.Optional[CustomPlanBillingStatus]
Filter by billing status
@@ -2571,6 +2586,7 @@ async def list_custom_plan_billings(
params={
"company_id": company_id,
"plan_id": plan_id,
+ "plan_billing_source": plan_billing_source,
"status": status,
"statuses": statuses,
"limit": limit,
@@ -4482,7 +4498,7 @@ async def list_plan_issues(
async def delete_plan_version(
self,
- plan_id: str,
+ plan_version_id: str,
*,
promote_archived_version: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
@@ -4490,8 +4506,8 @@ async def delete_plan_version(
"""
Parameters
----------
- plan_id : str
- plan_id
+ plan_version_id : str
+ plan_version_id
promote_archived_version : typing.Optional[bool]
@@ -4504,7 +4520,7 @@ async def delete_plan_version(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- f"plans/version/{encode_path_param(plan_id)}",
+ f"plans/version/{encode_path_param(plan_version_id)}",
method="DELETE",
params={
"promote_archived_version": promote_archived_version,
@@ -4591,7 +4607,7 @@ async def delete_plan_version(
async def publish_plan_version(
self,
- plan_id: str,
+ plan_version_id: str,
*,
excluded_company_ids: typing.Sequence[str],
migration_strategy: PlanVersionMigrationStrategy,
@@ -4602,6 +4618,7 @@ async def publish_plan_version(
customer_email: typing.Optional[str] = OMIT,
days_until_due: typing.Optional[int] = OMIT,
phone: typing.Optional[str] = OMIT,
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = OMIT,
send_invoice: typing.Optional[bool] = OMIT,
tax_id: typing.Optional[TaxIdInput] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -4609,8 +4626,8 @@ async def publish_plan_version(
"""
Parameters
----------
- plan_id : str
- plan_id
+ plan_version_id : str
+ plan_version_id
excluded_company_ids : typing.Sequence[str]
@@ -4630,6 +4647,8 @@ async def publish_plan_version(
phone : typing.Optional[str]
+ proration_behavior : typing.Optional[MigrationProrationBehavior]
+
send_invoice : typing.Optional[bool]
Whether Stripe emails the invoice when it is finalized. Defaults to true.
@@ -4644,7 +4663,7 @@ async def publish_plan_version(
OK
"""
_response = await self._client_wrapper.httpx_client.request(
- f"plans/version/{encode_path_param(plan_id)}/publish",
+ f"plans/version/{encode_path_param(plan_version_id)}/publish",
method="PUT",
json={
"activation_strategy": activation_strategy,
@@ -4660,6 +4679,7 @@ async def publish_plan_version(
"excluded_company_ids": excluded_company_ids,
"migration_strategy": migration_strategy,
"phone": phone,
+ "proration_behavior": proration_behavior,
"send_invoice": send_invoice,
"tax_id": convert_and_respect_annotation_metadata(
object_=tax_id, annotation=TaxIdInput, direction="write"
diff --git a/src/schematic/plans/types/list_custom_plan_billings_params.py b/src/schematic/plans/types/list_custom_plan_billings_params.py
index c26c871..4545f0d 100644
--- a/src/schematic/plans/types/list_custom_plan_billings_params.py
+++ b/src/schematic/plans/types/list_custom_plan_billings_params.py
@@ -5,6 +5,7 @@
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...types.custom_plan_billing_status import CustomPlanBillingStatus
+from ...types.plan_billing_source import PlanBillingSource
class ListCustomPlanBillingsParams(UniversalBaseModel):
@@ -27,6 +28,11 @@ class ListCustomPlanBillingsParams(UniversalBaseModel):
Page offset (default 0)
"""
+ plan_billing_source: typing.Optional[PlanBillingSource] = pydantic.Field(default=None)
+ """
+ Filter by the flow that created the billing record. Defaults to custom_plan.
+ """
+
plan_id: typing.Optional[str] = pydantic.Field(default=None)
"""
Filter by plan ID
diff --git a/src/schematic/types/__init__.py b/src/schematic/types/__init__.py
index 5d7e08f..f4dd494 100644
--- a/src/schematic/types/__init__.py
+++ b/src/schematic/types/__init__.py
@@ -20,6 +20,7 @@
from .audit_log_export_metadata import AuditLogExportMetadata
from .audit_log_list_response_data import AuditLogListResponseData
from .audit_log_response_data import AuditLogResponseData
+ from .billing_collection_method import BillingCollectionMethod
from .billing_coupon_response_data import BillingCouponResponseData
from .billing_credit_auto_topup_availability import BillingCreditAutoTopupAvailability
from .billing_credit_bundle_response_data import BillingCreditBundleResponseData
@@ -88,6 +89,7 @@
from .check_flag_response_data import CheckFlagResponseData
from .check_flags_bulk_response_data import CheckFlagsBulkResponseData
from .check_flags_response_data import CheckFlagsResponseData
+ from .checkout_bundle_purchase_behavior import CheckoutBundlePurchaseBehavior
from .checkout_data_response_data import CheckoutDataResponseData
from .checkout_field_input import CheckoutFieldInput
from .checkout_field_response_data import CheckoutFieldResponseData
@@ -221,6 +223,7 @@
from .entity_key_detail_response_data import EntityKeyDetailResponseData
from .entity_key_response_data import EntityKeyResponseData
from .entity_trait_definition_response_data import EntityTraitDefinitionResponseData
+ from .entity_trait_definition_usage import EntityTraitDefinitionUsage
from .entity_trait_detail_response_data import EntityTraitDetailResponseData
from .entity_trait_response_data import EntityTraitResponseData
from .entity_trait_value import EntityTraitValue
@@ -264,6 +267,7 @@
from .flag_type import FlagType
from .flag_view import FlagView
from .generic_preview_object import GenericPreviewObject
+ from .get_onboarding_state_resp import GetOnboardingStateResp
from .insights_summary_response_data import InsightsSummaryResponseData
from .install_integration_request_body import InstallIntegrationRequestBody
from .integration_capabilities import IntegrationCapabilities
@@ -300,11 +304,20 @@
from .metric_period_month_reset import MetricPeriodMonthReset
from .metronome_integration_config import MetronomeIntegrationConfig
from .migration_error_code import MigrationErrorCode
+ from .migration_proration_behavior import MigrationProrationBehavior
from .mrr_response_data import MrrResponseData
+ from .onboarding_milestone import OnboardingMilestone
+ from .onboarding_milestone_view import OnboardingMilestoneView
+ from .onboarding_path import OnboardingPath
+ from .onboarding_requirement import OnboardingRequirement
+ from .onboarding_requirement_status import OnboardingRequirementStatus
+ from .onboarding_requirement_view import OnboardingRequirementView
+ from .onboarding_track import OnboardingTrack
from .orb_integration_config import OrbIntegrationConfig
from .ordered_plans_in_group import OrderedPlansInGroup
from .payment_method_request_body import PaymentMethodRequestBody
from .payment_method_response_data import PaymentMethodResponseData
+ from .plan_billing_source import PlanBillingSource
from .plan_bundle_action import PlanBundleAction
from .plan_bundle_credit_grant_request_body import PlanBundleCreditGrantRequestBody
from .plan_bundle_entitlement_request_body import PlanBundleEntitlementRequestBody
@@ -469,6 +482,7 @@
"AuditLogExportMetadata": ".audit_log_export_metadata",
"AuditLogListResponseData": ".audit_log_list_response_data",
"AuditLogResponseData": ".audit_log_response_data",
+ "BillingCollectionMethod": ".billing_collection_method",
"BillingCouponResponseData": ".billing_coupon_response_data",
"BillingCreditAutoTopupAvailability": ".billing_credit_auto_topup_availability",
"BillingCreditBundleResponseData": ".billing_credit_bundle_response_data",
@@ -537,6 +551,7 @@
"CheckFlagResponseData": ".check_flag_response_data",
"CheckFlagsBulkResponseData": ".check_flags_bulk_response_data",
"CheckFlagsResponseData": ".check_flags_response_data",
+ "CheckoutBundlePurchaseBehavior": ".checkout_bundle_purchase_behavior",
"CheckoutDataResponseData": ".checkout_data_response_data",
"CheckoutFieldInput": ".checkout_field_input",
"CheckoutFieldResponseData": ".checkout_field_response_data",
@@ -664,6 +679,7 @@
"EntityKeyDetailResponseData": ".entity_key_detail_response_data",
"EntityKeyResponseData": ".entity_key_response_data",
"EntityTraitDefinitionResponseData": ".entity_trait_definition_response_data",
+ "EntityTraitDefinitionUsage": ".entity_trait_definition_usage",
"EntityTraitDetailResponseData": ".entity_trait_detail_response_data",
"EntityTraitResponseData": ".entity_trait_response_data",
"EntityTraitValue": ".entity_trait_value",
@@ -707,6 +723,7 @@
"FlagType": ".flag_type",
"FlagView": ".flag_view",
"GenericPreviewObject": ".generic_preview_object",
+ "GetOnboardingStateResp": ".get_onboarding_state_resp",
"InsightsSummaryResponseData": ".insights_summary_response_data",
"InstallIntegrationRequestBody": ".install_integration_request_body",
"IntegrationCapabilities": ".integration_capabilities",
@@ -741,11 +758,20 @@
"MetricPeriodMonthReset": ".metric_period_month_reset",
"MetronomeIntegrationConfig": ".metronome_integration_config",
"MigrationErrorCode": ".migration_error_code",
+ "MigrationProrationBehavior": ".migration_proration_behavior",
"MrrResponseData": ".mrr_response_data",
+ "OnboardingMilestone": ".onboarding_milestone",
+ "OnboardingMilestoneView": ".onboarding_milestone_view",
+ "OnboardingPath": ".onboarding_path",
+ "OnboardingRequirement": ".onboarding_requirement",
+ "OnboardingRequirementStatus": ".onboarding_requirement_status",
+ "OnboardingRequirementView": ".onboarding_requirement_view",
+ "OnboardingTrack": ".onboarding_track",
"OrbIntegrationConfig": ".orb_integration_config",
"OrderedPlansInGroup": ".ordered_plans_in_group",
"PaymentMethodRequestBody": ".payment_method_request_body",
"PaymentMethodResponseData": ".payment_method_response_data",
+ "PlanBillingSource": ".plan_billing_source",
"PlanBundleAction": ".plan_bundle_action",
"PlanBundleCreditGrantRequestBody": ".plan_bundle_credit_grant_request_body",
"PlanBundleEntitlementRequestBody": ".plan_bundle_entitlement_request_body",
@@ -934,6 +960,7 @@ def __dir__():
"AuditLogExportMetadata",
"AuditLogListResponseData",
"AuditLogResponseData",
+ "BillingCollectionMethod",
"BillingCouponResponseData",
"BillingCreditAutoTopupAvailability",
"BillingCreditBundleResponseData",
@@ -1002,6 +1029,7 @@ def __dir__():
"CheckFlagResponseData",
"CheckFlagsBulkResponseData",
"CheckFlagsResponseData",
+ "CheckoutBundlePurchaseBehavior",
"CheckoutDataResponseData",
"CheckoutFieldInput",
"CheckoutFieldResponseData",
@@ -1129,6 +1157,7 @@ def __dir__():
"EntityKeyDetailResponseData",
"EntityKeyResponseData",
"EntityTraitDefinitionResponseData",
+ "EntityTraitDefinitionUsage",
"EntityTraitDetailResponseData",
"EntityTraitResponseData",
"EntityTraitValue",
@@ -1172,6 +1201,7 @@ def __dir__():
"FlagType",
"FlagView",
"GenericPreviewObject",
+ "GetOnboardingStateResp",
"InsightsSummaryResponseData",
"InstallIntegrationRequestBody",
"IntegrationCapabilities",
@@ -1206,11 +1236,20 @@ def __dir__():
"MetricPeriodMonthReset",
"MetronomeIntegrationConfig",
"MigrationErrorCode",
+ "MigrationProrationBehavior",
"MrrResponseData",
+ "OnboardingMilestone",
+ "OnboardingMilestoneView",
+ "OnboardingPath",
+ "OnboardingRequirement",
+ "OnboardingRequirementStatus",
+ "OnboardingRequirementView",
+ "OnboardingTrack",
"OrbIntegrationConfig",
"OrderedPlansInGroup",
"PaymentMethodRequestBody",
"PaymentMethodResponseData",
+ "PlanBillingSource",
"PlanBundleAction",
"PlanBundleCreditGrantRequestBody",
"PlanBundleEntitlementRequestBody",
diff --git a/src/schematic/types/billing_collection_method.py b/src/schematic/types/billing_collection_method.py
new file mode 100644
index 0000000..2711de5
--- /dev/null
+++ b/src/schematic/types/billing_collection_method.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+BillingCollectionMethod = typing.Union[typing.Literal["charge_automatically", "send_invoice"], typing.Any]
diff --git a/src/schematic/types/billing_credit_bundle_response_data.py b/src/schematic/types/billing_credit_bundle_response_data.py
index 6d6e07c..6e6e19f 100644
--- a/src/schematic/types/billing_credit_bundle_response_data.py
+++ b/src/schematic/types/billing_credit_bundle_response_data.py
@@ -16,6 +16,11 @@
class BillingCreditBundleResponseData(UniversalBaseModel):
billing_invoice_id: typing.Optional[str] = None
bundle_type: BillingCreditBundleType = "fixed"
+ compatible_plan_ids: typing.List[str] = pydantic.Field()
+ """
+ Plans whose companies may purchase this bundle. Empty means the bundle is purchasable on every plan.
+ """
+
created_at: dt.datetime
credit_description: typing.Optional[str] = None
credit_icon: typing.Optional[str] = None
diff --git a/src/schematic/types/billing_credit_bundle_view.py b/src/schematic/types/billing_credit_bundle_view.py
index 4554b25..fb6b8c4 100644
--- a/src/schematic/types/billing_credit_bundle_view.py
+++ b/src/schematic/types/billing_credit_bundle_view.py
@@ -15,6 +15,7 @@
class BillingCreditBundleView(UniversalBaseModel):
bundle_type: BillingCreditBundleType = "fixed"
+ compatible_plan_ids: typing.List[str]
created_at: dt.datetime
credit_description: typing.Optional[str] = None
credit_icon: typing.Optional[str] = None
diff --git a/src/schematic/types/billing_credit_grant_response_data.py b/src/schematic/types/billing_credit_grant_response_data.py
index 0042655..a66d918 100644
--- a/src/schematic/types/billing_credit_grant_response_data.py
+++ b/src/schematic/types/billing_credit_grant_response_data.py
@@ -14,6 +14,11 @@
class BillingCreditGrantResponseData(UniversalBaseModel):
company_id: str
+ company_license_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The license instance this grant was issued for. Set only when a per-license plan grant issued it; null on a plan's own grant.
+ """
+
company_name: str
created_at: dt.datetime
credit_icon: typing.Optional[str] = None
@@ -23,6 +28,11 @@ class BillingCreditGrantResponseData(UniversalBaseModel):
expires_at: typing.Optional[dt.datetime] = None
grant_reason: BillingCreditGrantReason
id: str
+ license_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Name of the license this grant was issued for, when it came from a per-license plan grant.
+ """
+
plan_id: typing.Optional[str] = None
plan_name: typing.Optional[str] = None
price: typing.Optional[BillingPriceResponseData] = None
diff --git a/src/schematic/types/billing_plan_credit_grant_response_data.py b/src/schematic/types/billing_plan_credit_grant_response_data.py
index 5493b1c..69d605d 100644
--- a/src/schematic/types/billing_plan_credit_grant_response_data.py
+++ b/src/schematic/types/billing_plan_credit_grant_response_data.py
@@ -40,6 +40,11 @@ class BillingPlanCreditGrantResponseData(UniversalBaseModel):
Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability.
"""
+ company_credit_amount: int = pydantic.Field()
+ """
+ Credits granted once per company on top of the per-license amount. Always 0 when scaling is fixed.
+ """
+
created_at: dt.datetime
credit: typing.Optional[BillingCreditResponseData] = None
credit_amount: int
diff --git a/src/schematic/types/checkout_bundle_purchase_behavior.py b/src/schematic/types/checkout_bundle_purchase_behavior.py
new file mode 100644
index 0000000..22a7775
--- /dev/null
+++ b/src/schematic/types/checkout_bundle_purchase_behavior.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CheckoutBundlePurchaseBehavior = typing.Union[typing.Literal["individual", "quantity"], typing.Any]
diff --git a/src/schematic/types/checkout_settings_response_data.py b/src/schematic/types/checkout_settings_response_data.py
index 83d2af4..0aa5e92 100644
--- a/src/schematic/types/checkout_settings_response_data.py
+++ b/src/schematic/types/checkout_settings_response_data.py
@@ -4,12 +4,15 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .checkout_bundle_purchase_behavior import CheckoutBundlePurchaseBehavior
class CheckoutSettingsResponseData(UniversalBaseModel):
+ bundle_purchase_behavior: CheckoutBundlePurchaseBehavior
collect_address: bool
collect_email: bool
collect_phone: bool
+ collect_tax_id: bool
opt_in_enabled: bool
opt_in_text: typing.Optional[str] = None
opt_in_title: typing.Optional[str] = None
diff --git a/src/schematic/types/company_billing_checkout_settings.py b/src/schematic/types/company_billing_checkout_settings.py
index 9896040..30127ab 100644
--- a/src/schematic/types/company_billing_checkout_settings.py
+++ b/src/schematic/types/company_billing_checkout_settings.py
@@ -10,6 +10,7 @@ class CompanyBillingCheckoutSettings(UniversalBaseModel):
collect_address: bool
collect_email: bool
collect_phone: bool
+ collect_tax_id: bool
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
diff --git a/src/schematic/types/company_feature_usage_export_metadata.py b/src/schematic/types/company_feature_usage_export_metadata.py
index c20498c..5aa9842 100644
--- a/src/schematic/types/company_feature_usage_export_metadata.py
+++ b/src/schematic/types/company_feature_usage_export_metadata.py
@@ -23,6 +23,16 @@ class CompanyFeatureUsageExportMetadata(UniversalBaseModel):
Restrict the export to companies with these billing credit type IDs
"""
+ entity_key_definition_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Company key definition IDs to include as columns, one column per definition, mirroring the companies list
+ """
+
+ entity_trait_definition_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Company trait definition IDs to include as columns, one column per definition, mirroring the companies list
+ """
+
feature_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
"""
Schematic feature IDs (starting with 'feat_') to include as usage columns; empty means no usage columns
diff --git a/src/schematic/types/company_plan_credit_grant_view.py b/src/schematic/types/company_plan_credit_grant_view.py
index 5f92a4b..69e4848 100644
--- a/src/schematic/types/company_plan_credit_grant_view.py
+++ b/src/schematic/types/company_plan_credit_grant_view.py
@@ -31,6 +31,7 @@ class CompanyPlanCreditGrantView(UniversalBaseModel):
company_auto_topup_amount: typing.Optional[int] = None
company_auto_topup_enabled: typing.Optional[bool] = None
company_auto_topup_threshold_credits: typing.Optional[int] = None
+ company_credit_amount: int
created_at: dt.datetime
credit: typing.Optional[BillingCreditView] = None
credit_amount: int
diff --git a/src/schematic/types/component_checkout_settings.py b/src/schematic/types/component_checkout_settings.py
index 5737cdd..0c2bdf3 100644
--- a/src/schematic/types/component_checkout_settings.py
+++ b/src/schematic/types/component_checkout_settings.py
@@ -4,13 +4,16 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .checkout_bundle_purchase_behavior import CheckoutBundlePurchaseBehavior
from .proration_behavior import ProrationBehavior
class ComponentCheckoutSettings(UniversalBaseModel):
+ bundle_purchase_behavior: CheckoutBundlePurchaseBehavior
collect_address: bool
collect_email: bool
collect_phone: bool
+ collect_tax_id: bool
proration_behavior: ProrationBehavior
tax_collection_enabled: bool
diff --git a/src/schematic/types/create_billing_plan_credit_grant_request_body.py b/src/schematic/types/create_billing_plan_credit_grant_request_body.py
index 587b7d8..7f24b1e 100644
--- a/src/schematic/types/create_billing_plan_credit_grant_request_body.py
+++ b/src/schematic/types/create_billing_plan_credit_grant_request_body.py
@@ -27,6 +27,11 @@ class CreateBillingPlanCreditGrantRequestBody(UniversalBaseModel):
auto_topup_threshold_credits: typing.Optional[int] = None
auto_topup_threshold_percent: typing.Optional[int] = None
can_buy_bundles: typing.Optional[bool] = None
+ company_credit_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0.
+ """
+
credit_amount: int
credit_id: str
expiry_type: typing.Optional[BillingCreditExpiryType] = None
diff --git a/src/schematic/types/credit_company_grant_view.py b/src/schematic/types/credit_company_grant_view.py
index 3b4db6e..1a1ea0b 100644
--- a/src/schematic/types/credit_company_grant_view.py
+++ b/src/schematic/types/credit_company_grant_view.py
@@ -18,6 +18,7 @@ class CreditCompanyGrantView(UniversalBaseModel):
billing_credit_bundle_id: typing.Optional[str] = None
billing_credit_id: str
company_id: str
+ company_license_id: typing.Optional[str] = None
company_name: str
created_at: dt.datetime
credit_description: str
@@ -31,6 +32,7 @@ class CreditCompanyGrantView(UniversalBaseModel):
expiry_unit_count: typing.Optional[int] = None
grant_reason: BillingCreditGrantReason
id: str
+ license_name: typing.Optional[str] = None
plan_id: typing.Optional[str] = None
plan_name: typing.Optional[str] = None
plural_name: typing.Optional[str] = None
diff --git a/src/schematic/types/custom_plan_billing_response_data.py b/src/schematic/types/custom_plan_billing_response_data.py
index c4cf816..40e3300 100644
--- a/src/schematic/types/custom_plan_billing_response_data.py
+++ b/src/schematic/types/custom_plan_billing_response_data.py
@@ -7,16 +7,27 @@
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .custom_plan_activation_strategy import CustomPlanActivationStrategy
from .custom_plan_billing_status import CustomPlanBillingStatus
+from .plan_billing_source import PlanBillingSource
class CustomPlanBillingResponseData(UniversalBaseModel):
activation_strategy: CustomPlanActivationStrategy
+ billing_cycle_anchor: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ The billing period renewal date pinned when the subscription started, when one was set. When no invoice exists yet, the first invoice is raised on this date.
+ """
+
company_id: str
created_at: dt.datetime
days_until_due: int
external_invoice_id: typing.Optional[str] = None
id: str
paid_at: typing.Optional[dt.datetime] = None
+ plan_billing_source: PlanBillingSource = pydantic.Field()
+ """
+ The flow that created this billing record: a custom plan, or a standard plan assigned by invoice through Manage Plan.
+ """
+
plan_id: str
published_at: typing.Optional[dt.datetime] = None
send_invoice: bool
diff --git a/src/schematic/types/data_export_metadata.py b/src/schematic/types/data_export_metadata.py
index 1345091..502fd0d 100644
--- a/src/schematic/types/data_export_metadata.py
+++ b/src/schematic/types/data_export_metadata.py
@@ -39,6 +39,8 @@ class DataExportMetadata_CompanyFeatureUsage(UniversalBaseModel):
export_type: typing.Literal["company-feature-usage"] = "company-feature-usage"
company_ids: typing.Optional[typing.List[str]] = None
credit_type_ids: typing.Optional[typing.List[str]] = None
+ entity_key_definition_ids: typing.Optional[typing.List[str]] = None
+ entity_trait_definition_ids: typing.Optional[typing.List[str]] = None
feature_ids: typing.Optional[typing.List[str]] = None
has_scheduled_downgrade: typing.Optional[bool] = None
monetized_subscriptions: typing.Optional[bool] = None
diff --git a/src/schematic/types/entity_trait_definition_usage.py b/src/schematic/types/entity_trait_definition_usage.py
new file mode 100644
index 0000000..9014deb
--- /dev/null
+++ b/src/schematic/types/entity_trait_definition_usage.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+
+
+class EntityTraitDefinitionUsage(UniversalBaseModel):
+ checkout_field_config_count: int
+ company_override_count: int
+ feature_count: int
+ plan_entitlement_count: int
+ plan_trait_count: int
+ rule_condition_count: int
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/types/get_onboarding_state_resp.py b/src/schematic/types/get_onboarding_state_resp.py
new file mode 100644
index 0000000..47d3b11
--- /dev/null
+++ b/src/schematic/types/get_onboarding_state_resp.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .onboarding_milestone_view import OnboardingMilestoneView
+from .onboarding_path import OnboardingPath
+from .onboarding_requirement import OnboardingRequirement
+from .onboarding_requirement_view import OnboardingRequirementView
+from .onboarding_track import OnboardingTrack
+
+
+class GetOnboardingStateResp(UniversalBaseModel):
+ environment_id: typing.Optional[str] = None
+ milestones: typing.List[OnboardingMilestoneView]
+ path: typing.Optional[OnboardingPath] = None
+ requirements: typing.List[OnboardingRequirementView]
+ suggested_next: typing.List[OnboardingRequirement]
+ track: typing.Optional[OnboardingTrack] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/types/manage_plan_request.py b/src/schematic/types/manage_plan_request.py
index 14f7661..c9fb367 100644
--- a/src/schematic/types/manage_plan_request.py
+++ b/src/schematic/types/manage_plan_request.py
@@ -5,6 +5,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .billing_collection_method import BillingCollectionMethod
from .checkout_field_value import CheckoutFieldValue
from .plan_selection import PlanSelection
from .update_credit_bundle_request_body import UpdateCreditBundleRequestBody
@@ -12,10 +13,25 @@
class ManagePlanRequest(UniversalBaseModel):
+ activate_on_payment: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ If true, the company gets the plan only once the first invoice is paid. Only applies to an invoiced subscription. Defaults to false.
+ """
+
add_on_selections: typing.List[PlanSelection]
base_plan_id: typing.Optional[str] = None
base_plan_price_id: typing.Optional[str] = None
base_plan_version_id: typing.Optional[str] = None
+ billing_cycle_anchor: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ The date the subscription's billing period renews on. Only honored when starting a new subscription; changing the anchor on an existing subscription is not supported.
+ """
+
+ billing_email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address the invoice is sent to. Required when collection_method is send_invoice.
+ """
+
billing_entity_id: typing.Optional[str] = pydantic.Field(default=None)
"""
The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.
@@ -26,10 +42,20 @@ class ManagePlanRequest(UniversalBaseModel):
If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.
"""
+ collection_method: typing.Optional[BillingCollectionMethod] = pydantic.Field(default=None)
+ """
+ How the subscription is paid: charged to a payment method on file, or invoiced with payment terms. Invoicing is only available when starting a new subscription. Defaults to charge_automatically.
+ """
+
company_id: str
coupon_external_id: typing.Optional[str] = None
credit_bundles: typing.List[UpdateCreditBundleRequestBody]
custom_field_values: typing.List[CheckoutFieldValue]
+ days_until_due: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Payment terms in days for an invoiced subscription. Defaults to 30.
+ """
+
pay_in_advance_entitlements: typing.List[UpdatePayInAdvanceRequestBody]
payment_method_external_id: typing.Optional[str] = None
promo_code: typing.Optional[str] = None
@@ -38,6 +64,16 @@ class ManagePlanRequest(UniversalBaseModel):
If true and cancel_immediately is true, issue prorated credit. Only applies when removing all plans. Defaults to true.
"""
+ prorate_first_period: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
+ """
+
+ send_invoice: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether Stripe emails the invoice when it is finalized. Only applies to an invoiced subscription. Defaults to true.
+ """
+
trial_end: typing.Optional[dt.datetime] = None
if IS_PYDANTIC_V2:
diff --git a/src/schematic/types/migration_proration_behavior.py b/src/schematic/types/migration_proration_behavior.py
new file mode 100644
index 0000000..8d0d19a
--- /dev/null
+++ b/src/schematic/types/migration_proration_behavior.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+MigrationProrationBehavior = typing.Union[typing.Literal["always_invoice", "create_prorations"], typing.Any]
diff --git a/src/schematic/types/onboarding_milestone.py b/src/schematic/types/onboarding_milestone.py
new file mode 100644
index 0000000..4f817bb
--- /dev/null
+++ b/src/schematic/types/onboarding_milestone.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OnboardingMilestone = typing.Union[typing.Literal["evaluated", "implemented"], typing.Any]
diff --git a/src/schematic/types/onboarding_milestone_view.py b/src/schematic/types/onboarding_milestone_view.py
new file mode 100644
index 0000000..f9ea47b
--- /dev/null
+++ b/src/schematic/types/onboarding_milestone_view.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import datetime as dt
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .onboarding_milestone import OnboardingMilestone
+from .onboarding_requirement import OnboardingRequirement
+
+
+class OnboardingMilestoneView(UniversalBaseModel):
+ id: OnboardingMilestone
+ missing: typing.List[OnboardingRequirement]
+ progress: float
+ reached_at: typing.Optional[dt.datetime] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/types/onboarding_path.py b/src/schematic/types/onboarding_path.py
new file mode 100644
index 0000000..bacb372
--- /dev/null
+++ b/src/schematic/types/onboarding_path.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OnboardingPath = typing.Union[typing.Literal["agent", "app"], typing.Any]
diff --git a/src/schematic/types/onboarding_requirement.py b/src/schematic/types/onboarding_requirement.py
new file mode 100644
index 0000000..cd0ed65
--- /dev/null
+++ b/src/schematic/types/onboarding_requirement.py
@@ -0,0 +1,10 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OnboardingRequirement = typing.Union[
+ typing.Literal[
+ "connect_billing", "create_api_key", "first_flag_check", "import_companies", "model_packaging", "send_events"
+ ],
+ typing.Any,
+]
diff --git a/src/schematic/types/onboarding_requirement_status.py b/src/schematic/types/onboarding_requirement_status.py
new file mode 100644
index 0000000..fbcec58
--- /dev/null
+++ b/src/schematic/types/onboarding_requirement_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OnboardingRequirementStatus = typing.Union[typing.Literal["available", "blocked", "complete"], typing.Any]
diff --git a/src/schematic/types/onboarding_requirement_view.py b/src/schematic/types/onboarding_requirement_view.py
new file mode 100644
index 0000000..13346e0
--- /dev/null
+++ b/src/schematic/types/onboarding_requirement_view.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .onboarding_requirement import OnboardingRequirement
+from .onboarding_requirement_status import OnboardingRequirementStatus
+
+
+class OnboardingRequirementView(UniversalBaseModel):
+ blocked_by: typing.Optional[typing.List[OnboardingRequirement]] = None
+ id: OnboardingRequirement
+ satisfied_by: typing.Optional[str] = None
+ status: OnboardingRequirementStatus
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/schematic/types/onboarding_track.py b/src/schematic/types/onboarding_track.py
new file mode 100644
index 0000000..13a344a
--- /dev/null
+++ b/src/schematic/types/onboarding_track.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OnboardingTrack = typing.Union[typing.Literal["catalog", "single_plan"], typing.Any]
diff --git a/src/schematic/types/plan_billing_source.py b/src/schematic/types/plan_billing_source.py
new file mode 100644
index 0000000..825fd26
--- /dev/null
+++ b/src/schematic/types/plan_billing_source.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PlanBillingSource = typing.Union[typing.Literal["custom_plan", "manage_plan"], typing.Any]
diff --git a/src/schematic/types/plan_bundle_response_data.py b/src/schematic/types/plan_bundle_response_data.py
index 550453e..9f0a6df 100644
--- a/src/schematic/types/plan_bundle_response_data.py
+++ b/src/schematic/types/plan_bundle_response_data.py
@@ -8,6 +8,7 @@
from .billing_product_plan_response_data import BillingProductPlanResponseData
from .plan_entitlement_response_data import PlanEntitlementResponseData
from .plan_response_data import PlanResponseData
+from .plan_version_response_data import PlanVersionResponseData
class PlanBundleResponseData(UniversalBaseModel):
@@ -15,6 +16,7 @@ class PlanBundleResponseData(UniversalBaseModel):
credit_grants: typing.Optional[typing.List[BillingPlanCreditGrantResponseData]] = None
entitlements: typing.Optional[typing.List[PlanEntitlementResponseData]] = None
plan: typing.Optional[PlanResponseData] = None
+ plan_version: typing.Optional[PlanVersionResponseData] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
diff --git a/src/schematic/types/plan_credit_grant_view.py b/src/schematic/types/plan_credit_grant_view.py
index 3514c39..fec3c3d 100644
--- a/src/schematic/types/plan_credit_grant_view.py
+++ b/src/schematic/types/plan_credit_grant_view.py
@@ -28,6 +28,7 @@ class PlanCreditGrantView(UniversalBaseModel):
billing_credit_auto_topup_threshold_credits: typing.Optional[int] = None
billing_credit_auto_topup_threshold_percent: typing.Optional[int] = None
billing_credit_can_buy_bundles: bool
+ company_credit_amount: int
created_at: dt.datetime
credit: typing.Optional[BillingCreditView] = None
credit_amount: int
diff --git a/src/schematic/types/plan_version_migration_preview_response_data.py b/src/schematic/types/plan_version_migration_preview_response_data.py
index 3000d3e..c055805 100644
--- a/src/schematic/types/plan_version_migration_preview_response_data.py
+++ b/src/schematic/types/plan_version_migration_preview_response_data.py
@@ -9,6 +9,7 @@
class PlanVersionMigrationPreviewResponseData(UniversalBaseModel):
companies: typing.List[PlanVersionMigrationPreviewCompanyResponseData]
+ has_billing_changes: bool
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
diff --git a/src/schematic/types/plan_version_migration_response_data.py b/src/schematic/types/plan_version_migration_response_data.py
index e3bfbc6..31a404d 100644
--- a/src/schematic/types/plan_version_migration_response_data.py
+++ b/src/schematic/types/plan_version_migration_response_data.py
@@ -5,6 +5,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
+from .migration_proration_behavior import MigrationProrationBehavior
from .plan_version_migration_status import PlanVersionMigrationStatus
from .plan_version_migration_strategy import PlanVersionMigrationStrategy
@@ -20,6 +21,7 @@ class PlanVersionMigrationResponseData(UniversalBaseModel):
plan_version_id_from: typing.Optional[str] = None
plan_version_id_to: str
plan_version_ids_from: typing.List[str]
+ proration_behavior: typing.Optional[MigrationProrationBehavior] = None
skipped_companies: int
started_at: typing.Optional[dt.datetime] = None
status: PlanVersionMigrationStatus
diff --git a/src/schematic/types/preview_subscription_finance_response_data.py b/src/schematic/types/preview_subscription_finance_response_data.py
index ceaa47d..7ed4044 100644
--- a/src/schematic/types/preview_subscription_finance_response_data.py
+++ b/src/schematic/types/preview_subscription_finance_response_data.py
@@ -11,6 +11,7 @@
class PreviewSubscriptionFinanceResponseData(UniversalBaseModel):
amount_off: int
+ discount_amount: int
discounts: typing.List[PreviewSubscriptionDiscountResponseData]
due_now: int
new_charges: int
diff --git a/src/schematic/types/update_billing_plan_credit_grant_request_body.py b/src/schematic/types/update_billing_plan_credit_grant_request_body.py
index 0c6d2c2..ffcd12a 100644
--- a/src/schematic/types/update_billing_plan_credit_grant_request_body.py
+++ b/src/schematic/types/update_billing_plan_credit_grant_request_body.py
@@ -27,13 +27,18 @@ class UpdateBillingPlanCreditGrantRequestBody(UniversalBaseModel):
auto_topup_threshold_credits: typing.Optional[int] = None
auto_topup_threshold_percent: typing.Optional[int] = None
can_buy_bundles: typing.Optional[bool] = None
+ company_credit_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Credits granted once per company on top of the per-license amount. Only valid when the grant scales per license.
+ """
+
credit_amount: typing.Optional[int] = None
expiry_type: typing.Optional[BillingCreditExpiryType] = None
expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None
expiry_unit_count: typing.Optional[int] = None
license_id: typing.Optional[str] = pydantic.Field(default=None)
"""
- The license whose quantity scales this grant. Cannot be changed after creation.
+ The license whose quantity scales this grant. Cleared when the grant moves off per-license scaling.
"""
reset_cadence: BillingPlanCreditGrantResetCadence
@@ -46,7 +51,7 @@ class UpdateBillingPlanCreditGrantRequestBody(UniversalBaseModel):
scaling: typing.Optional[PlanCreditGrantScaling] = pydantic.Field(default=None)
"""
- Whether the grant is a fixed amount per company, or issued once per license the company holds. Cannot be changed after creation.
+ Whether the grant is a fixed amount per company, or issued once per license the company holds. Changing this re-issues the credits companies already hold for this grant.
"""
if IS_PYDANTIC_V2:
diff --git a/src/schematic/types/upsert_company_request_body.py b/src/schematic/types/upsert_company_request_body.py
index ba8ada6..06def17 100644
--- a/src/schematic/types/upsert_company_request_body.py
+++ b/src/schematic/types/upsert_company_request_body.py
@@ -31,6 +31,11 @@ class UpsertCompanyRequestBody(UniversalBaseModel):
last_seen_at: typing.Optional[dt.datetime] = None
name: typing.Optional[str] = None
prevent_key_remap: typing.Optional[bool] = None
+ remove_keys: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Names of keys to remove from the company. Removing a key the company does not have does nothing, and a company must keep at least one key.
+ """
+
traits: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
A map of trait names to trait values
diff --git a/src/schematic/types/upsert_user_request_body.py b/src/schematic/types/upsert_user_request_body.py
index 7c13a84..edf780f 100644
--- a/src/schematic/types/upsert_user_request_body.py
+++ b/src/schematic/types/upsert_user_request_body.py
@@ -40,6 +40,11 @@ class UpsertUserRequestBody(UniversalBaseModel):
last_seen_at: typing.Optional[dt.datetime] = None
name: typing.Optional[str] = None
+ remove_keys: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+ """
+
traits: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
A map of trait names to trait values
diff --git a/src/schematic/types/upsert_user_sub_request_body.py b/src/schematic/types/upsert_user_sub_request_body.py
index c17913a..11d61ca 100644
--- a/src/schematic/types/upsert_user_sub_request_body.py
+++ b/src/schematic/types/upsert_user_sub_request_body.py
@@ -30,6 +30,11 @@ class UpsertUserSubRequestBody(UniversalBaseModel):
last_seen_at: typing.Optional[dt.datetime] = None
name: typing.Optional[str] = None
+ remove_keys: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Names of keys to remove from the user. Removing a key the user does not have does nothing, and a user must keep at least one key.
+ """
+
traits: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
"""
A map of trait names to trait values
diff --git a/src/schematic/types/who_am_i_response_data.py b/src/schematic/types/who_am_i_response_data.py
index 6fc2a83..2a9b095 100644
--- a/src/schematic/types/who_am_i_response_data.py
+++ b/src/schematic/types/who_am_i_response_data.py
@@ -15,6 +15,7 @@ class WhoAmIResponseData(UniversalBaseModel):
api_key_id: typing.Optional[str] = None
environment_id: typing.Optional[str] = None
environments: typing.List[EnvironmentResponseData]
+ onboarding_complete: bool
stripe_user_id: typing.Optional[str] = None
user_id: typing.Optional[str] = None
user_name: typing.Optional[str] = None