Skip to content

Commit

Permalink
🌿 Fern Regeneration -- June 27, 2024 (#13)
Browse files Browse the repository at this point in the history
* SDK regeneration

* Fix flag check types to reflect API changes

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Ben Papillon <benpapillon@gmail.com>
  • Loading branch information
fern-api[bot] and bpapillon authored Jun 27, 2024
1 parent 0d5bf28 commit 93cf42e
Show file tree
Hide file tree
Showing 83 changed files with 919 additions and 257 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "schematichq"
version = "1.0.3"
version = "1.0.4"
description = ""
readme = "README.md"
authors = []
Expand Down
28 changes: 28 additions & 0 deletions src/schematic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,15 @@
CountCompaniesParams,
CountCompaniesResponse,
CountEntityKeyDefinitionsParams,
CountEntityKeyDefinitionsRequestEntityType,
CountEntityKeyDefinitionsResponse,
CountEntityKeyDefinitionsResponseParamsEntityType,
CountEntityTraitDefinitionsParams,
CountEntityTraitDefinitionsRequestEntityType,
CountEntityTraitDefinitionsRequestTraitType,
CountEntityTraitDefinitionsResponse,
CountEntityTraitDefinitionsResponseParamsEntityType,
CountEntityTraitDefinitionsResponseParamsTraitType,
CountUsersParams,
CountUsersResponse,
CreateCompanyResponse,
Expand Down Expand Up @@ -170,9 +176,15 @@
ListCompanyPlansParams,
ListCompanyPlansResponse,
ListEntityKeyDefinitionsParams,
ListEntityKeyDefinitionsRequestEntityType,
ListEntityKeyDefinitionsResponse,
ListEntityKeyDefinitionsResponseParamsEntityType,
ListEntityTraitDefinitionsParams,
ListEntityTraitDefinitionsRequestEntityType,
ListEntityTraitDefinitionsRequestTraitType,
ListEntityTraitDefinitionsResponse,
ListEntityTraitDefinitionsResponseParamsEntityType,
ListEntityTraitDefinitionsResponseParamsTraitType,
ListUsersParams,
ListUsersResponse,
LookupCompanyParams,
Expand Down Expand Up @@ -303,6 +315,7 @@
CountWebhookEventsResponse,
CountWebhooksParams,
CountWebhooksResponse,
CreateWebhookRequestBodyRequestTypesItem,
CreateWebhookResponse,
DeleteWebhookResponse,
GetWebhookEventResponse,
Expand All @@ -311,6 +324,7 @@
ListWebhookEventsResponse,
ListWebhooksParams,
ListWebhooksResponse,
UpdateWebhookRequestBodyRequestTypesItem,
UpdateWebhookResponse,
)

Expand Down Expand Up @@ -351,9 +365,15 @@
"CountCompanyOverridesParams",
"CountCompanyOverridesResponse",
"CountEntityKeyDefinitionsParams",
"CountEntityKeyDefinitionsRequestEntityType",
"CountEntityKeyDefinitionsResponse",
"CountEntityKeyDefinitionsResponseParamsEntityType",
"CountEntityTraitDefinitionsParams",
"CountEntityTraitDefinitionsRequestEntityType",
"CountEntityTraitDefinitionsRequestTraitType",
"CountEntityTraitDefinitionsResponse",
"CountEntityTraitDefinitionsResponseParamsEntityType",
"CountEntityTraitDefinitionsResponseParamsTraitType",
"CountFeatureCompaniesParams",
"CountFeatureCompaniesResponse",
"CountFeatureUsageParams",
Expand Down Expand Up @@ -411,6 +431,7 @@
"CreateReqCommonMetricPeriod",
"CreateReqCommonValueType",
"CreateUserResponse",
"CreateWebhookRequestBodyRequestTypesItem",
"CreateWebhookResponse",
"CrmDealLineItem",
"CrmDealResponseData",
Expand Down Expand Up @@ -510,9 +531,15 @@
"ListCrmProductsParams",
"ListCrmProductsResponse",
"ListEntityKeyDefinitionsParams",
"ListEntityKeyDefinitionsRequestEntityType",
"ListEntityKeyDefinitionsResponse",
"ListEntityKeyDefinitionsResponseParamsEntityType",
"ListEntityTraitDefinitionsParams",
"ListEntityTraitDefinitionsRequestEntityType",
"ListEntityTraitDefinitionsRequestTraitType",
"ListEntityTraitDefinitionsResponse",
"ListEntityTraitDefinitionsResponseParamsEntityType",
"ListEntityTraitDefinitionsResponseParamsTraitType",
"ListEnvironmentsParams",
"ListEnvironmentsResponse",
"ListEventsParams",
Expand Down Expand Up @@ -594,6 +621,7 @@
"UpdateReqCommonMetricPeriod",
"UpdateReqCommonValueType",
"UpdateRuleRequestBody",
"UpdateWebhookRequestBodyRequestTypesItem",
"UpdateWebhookResponse",
"UpsertBillingProductResponse",
"UpsertBillingSubscriptionResponse",
Expand Down
12 changes: 10 additions & 2 deletions src/schematic/accounts/types/count_api_keys_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ class CountApiKeysParams(pydantic_v1.BaseModel):
"""

environment_id: typing.Optional[str] = None
limit: typing.Optional[int] = None
offset: typing.Optional[int] = None
limit: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page limit (default 100)
"""

offset: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page offset (default 0)
"""

require_environment: typing.Optional[bool] = None

def json(self, **kwargs: typing.Any) -> str:
Expand Down
12 changes: 10 additions & 2 deletions src/schematic/accounts/types/count_api_requests_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ class CountApiRequestsParams(pydantic_v1.BaseModel):
"""

environment_id: typing.Optional[str] = None
limit: typing.Optional[int] = None
offset: typing.Optional[int] = None
limit: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page limit (default 100)
"""

offset: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page offset (default 0)
"""

q: typing.Optional[str] = None
request_type: typing.Optional[str] = None

Expand Down
12 changes: 10 additions & 2 deletions src/schematic/accounts/types/list_api_keys_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ class ListApiKeysParams(pydantic_v1.BaseModel):
"""

environment_id: typing.Optional[str] = None
limit: typing.Optional[int] = None
offset: typing.Optional[int] = None
limit: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page limit (default 100)
"""

offset: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page offset (default 0)
"""

require_environment: typing.Optional[bool] = None

def json(self, **kwargs: typing.Any) -> str:
Expand Down
12 changes: 10 additions & 2 deletions src/schematic/accounts/types/list_api_requests_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ class ListApiRequestsParams(pydantic_v1.BaseModel):
"""

environment_id: typing.Optional[str] = None
limit: typing.Optional[int] = None
offset: typing.Optional[int] = None
limit: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page limit (default 100)
"""

offset: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page offset (default 0)
"""

q: typing.Optional[str] = None
request_type: typing.Optional[str] = None

Expand Down
11 changes: 9 additions & 2 deletions src/schematic/accounts/types/list_environments_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ class ListEnvironmentsParams(pydantic_v1.BaseModel):
"""

ids: typing.Optional[typing.List[str]] = None
limit: typing.Optional[int] = None
offset: typing.Optional[int] = None
limit: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page limit (default 100)
"""

offset: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page offset (default 0)
"""

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
11 changes: 9 additions & 2 deletions src/schematic/billing/types/list_products_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ class ListProductsParams(pydantic_v1.BaseModel):
"""

ids: typing.Optional[typing.List[str]] = None
limit: typing.Optional[int] = None
limit: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page limit (default 100)
"""

name: typing.Optional[str] = None
offset: typing.Optional[int] = None
offset: typing.Optional[int] = pydantic_v1.Field(default=None)
"""
Page offset (default 0)
"""

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
20 changes: 13 additions & 7 deletions src/schematic/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@ def shutdown(self) -> None:
def check_flag(
self,
flag_key: str,
company: Optional[Dict[str, str]] = None,
user: Optional[Dict[str, str]] = None,
company: Optional[Dict[str, Optional[str]]] = None,
user: Optional[Dict[str, Optional[str]]] = None,
) -> bool:
if self.offline:
return self._get_flag_default(flag_key)

try:
cache_key = (
flag_key + ":" + str(company) + ":" + str(user) if (company or user) else flag_key
flag_key + ":" + str(company) + ":" + str(user)
if (company or user)
else flag_key
)

for provider in self.flag_check_cache_providers:
Expand Down Expand Up @@ -161,7 +163,9 @@ class AsyncSchematicConfig:
class AsyncSchematic(AsyncBaseSchematic):
def __init__(self, api_key: str, config: Optional[AsyncSchematicConfig] = None):
config = config or AsyncSchematicConfig()
httpx_client = AsyncOfflineHTTPClient() if config.offline else config.httpx_client
httpx_client = (
AsyncOfflineHTTPClient() if config.offline else config.httpx_client
)

super().__init__(
api_key=api_key,
Expand Down Expand Up @@ -191,15 +195,17 @@ async def initialize(self) -> None:
async def check_flag(
self,
flag_key: str,
company: Optional[Dict[str, str]] = None,
user: Optional[Dict[str, str]] = None,
company: Optional[Dict[str, Optional[str]]] = None,
user: Optional[Dict[str, Optional[str]]] = None,
) -> bool:
if self.offline:
return self._get_flag_default(flag_key)

try:
cache_key = (
flag_key + ":" + str(company) + ":" + str(user) if (company or user) else flag_key
flag_key + ":" + str(company) + ":" + str(user)
if (company or user)
else flag_key
)

for provider in self.flag_check_cache_providers:
Expand Down
24 changes: 24 additions & 0 deletions src/schematic/companies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
CountCompaniesParams,
CountCompaniesResponse,
CountEntityKeyDefinitionsParams,
CountEntityKeyDefinitionsRequestEntityType,
CountEntityKeyDefinitionsResponse,
CountEntityKeyDefinitionsResponseParamsEntityType,
CountEntityTraitDefinitionsParams,
CountEntityTraitDefinitionsRequestEntityType,
CountEntityTraitDefinitionsRequestTraitType,
CountEntityTraitDefinitionsResponse,
CountEntityTraitDefinitionsResponseParamsEntityType,
CountEntityTraitDefinitionsResponseParamsTraitType,
CountUsersParams,
CountUsersResponse,
CreateCompanyResponse,
Expand Down Expand Up @@ -36,9 +42,15 @@
ListCompanyPlansParams,
ListCompanyPlansResponse,
ListEntityKeyDefinitionsParams,
ListEntityKeyDefinitionsRequestEntityType,
ListEntityKeyDefinitionsResponse,
ListEntityKeyDefinitionsResponseParamsEntityType,
ListEntityTraitDefinitionsParams,
ListEntityTraitDefinitionsRequestEntityType,
ListEntityTraitDefinitionsRequestTraitType,
ListEntityTraitDefinitionsResponse,
ListEntityTraitDefinitionsResponseParamsEntityType,
ListEntityTraitDefinitionsResponseParamsTraitType,
ListUsersParams,
ListUsersResponse,
LookupCompanyParams,
Expand All @@ -57,9 +69,15 @@
"CountCompaniesParams",
"CountCompaniesResponse",
"CountEntityKeyDefinitionsParams",
"CountEntityKeyDefinitionsRequestEntityType",
"CountEntityKeyDefinitionsResponse",
"CountEntityKeyDefinitionsResponseParamsEntityType",
"CountEntityTraitDefinitionsParams",
"CountEntityTraitDefinitionsRequestEntityType",
"CountEntityTraitDefinitionsRequestTraitType",
"CountEntityTraitDefinitionsResponse",
"CountEntityTraitDefinitionsResponseParamsEntityType",
"CountEntityTraitDefinitionsResponseParamsTraitType",
"CountUsersParams",
"CountUsersResponse",
"CreateCompanyResponse",
Expand Down Expand Up @@ -89,9 +107,15 @@
"ListCompanyPlansParams",
"ListCompanyPlansResponse",
"ListEntityKeyDefinitionsParams",
"ListEntityKeyDefinitionsRequestEntityType",
"ListEntityKeyDefinitionsResponse",
"ListEntityKeyDefinitionsResponseParamsEntityType",
"ListEntityTraitDefinitionsParams",
"ListEntityTraitDefinitionsRequestEntityType",
"ListEntityTraitDefinitionsRequestTraitType",
"ListEntityTraitDefinitionsResponse",
"ListEntityTraitDefinitionsResponseParamsEntityType",
"ListEntityTraitDefinitionsResponseParamsTraitType",
"ListUsersParams",
"ListUsersResponse",
"LookupCompanyParams",
Expand Down
Loading

0 comments on commit 93cf42e

Please sign in to comment.