Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
}
]
},
"originGitCommit": "a0658700ca9b3d362ce6594c0740c41d9286e429",
"sdkVersion": "1.2.0"
"originGitCommit": "efe71642022d9d3303fd78c648e5b2539192230e",
"sdkVersion": "1.2.1"
}
79 changes: 9 additions & 70 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/schematic/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "schematichq/1.2.0",
"User-Agent": "schematichq/1.2.1",
"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.2.0",
"X-Fern-SDK-Version": "1.2.1",
**(self.get_custom_headers() or {}),
}
headers["X-Schematic-Api-Key"] = self.api_key
Expand Down
20 changes: 20 additions & 0 deletions src/schematic/events/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ def create_event(
self,
*,
event_type: EventType,
backfill: typing.Optional[bool] = OMIT,
body: typing.Optional[EventBody] = OMIT,
idempotency_key: typing.Optional[str] = OMIT,
sent_at: typing.Optional[dt.datetime] = OMIT,
trusted_client_clock: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> CreateEventResponse:
"""
Expand All @@ -209,6 +211,9 @@ def create_event(
event_type : EventType
Either 'identify' or 'track'

backfill : typing.Optional[bool]
Requires a secret API key, and trusted_client_clock. Import historical data without affecting billing.

body : typing.Optional[EventBody]

idempotency_key : typing.Optional[str]
Expand All @@ -217,6 +222,9 @@ def create_event(
sent_at : typing.Optional[dt.datetime]
Optionally provide a timestamp at which the event was sent to Schematic

trusted_client_clock : typing.Optional[bool]
Requires a secret API key and sent_at. Use sent_at as the effective timestamp.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand All @@ -238,9 +246,11 @@ def create_event(
"""
_response = self._raw_client.create_event(
event_type=event_type,
backfill=backfill,
body=body,
idempotency_key=idempotency_key,
sent_at=sent_at,
trusted_client_clock=trusted_client_clock,
request_options=request_options,
)
return _response.data
Expand Down Expand Up @@ -503,9 +513,11 @@ async def create_event(
self,
*,
event_type: EventType,
backfill: typing.Optional[bool] = OMIT,
body: typing.Optional[EventBody] = OMIT,
idempotency_key: typing.Optional[str] = OMIT,
sent_at: typing.Optional[dt.datetime] = OMIT,
trusted_client_clock: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> CreateEventResponse:
"""
Expand All @@ -514,6 +526,9 @@ async def create_event(
event_type : EventType
Either 'identify' or 'track'

backfill : typing.Optional[bool]
Requires a secret API key, and trusted_client_clock. Import historical data without affecting billing.

body : typing.Optional[EventBody]

idempotency_key : typing.Optional[str]
Expand All @@ -522,6 +537,9 @@ async def create_event(
sent_at : typing.Optional[dt.datetime]
Optionally provide a timestamp at which the event was sent to Schematic

trusted_client_clock : typing.Optional[bool]
Requires a secret API key and sent_at. Use sent_at as the effective timestamp.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -551,9 +569,11 @@ async def main() -> None:
"""
_response = await self._raw_client.create_event(
event_type=event_type,
backfill=backfill,
body=body,
idempotency_key=idempotency_key,
sent_at=sent_at,
trusted_client_clock=trusted_client_clock,
request_options=request_options,
)
return _response.data
Expand Down
20 changes: 20 additions & 0 deletions src/schematic/events/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,11 @@ def create_event(
self,
*,
event_type: EventType,
backfill: typing.Optional[bool] = OMIT,
body: typing.Optional[EventBody] = OMIT,
idempotency_key: typing.Optional[str] = OMIT,
sent_at: typing.Optional[dt.datetime] = OMIT,
trusted_client_clock: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[CreateEventResponse]:
"""
Expand All @@ -417,6 +419,9 @@ def create_event(
event_type : EventType
Either 'identify' or 'track'

backfill : typing.Optional[bool]
Requires a secret API key, and trusted_client_clock. Import historical data without affecting billing.

body : typing.Optional[EventBody]

idempotency_key : typing.Optional[str]
Expand All @@ -425,6 +430,9 @@ def create_event(
sent_at : typing.Optional[dt.datetime]
Optionally provide a timestamp at which the event was sent to Schematic

trusted_client_clock : typing.Optional[bool]
Requires a secret API key and sent_at. Use sent_at as the effective timestamp.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand All @@ -437,10 +445,12 @@ def create_event(
"events",
method="POST",
json={
"backfill": backfill,
"body": convert_and_respect_annotation_metadata(object_=body, annotation=EventBody, direction="write"),
"event_type": event_type,
"idempotency_key": idempotency_key,
"sent_at": sent_at,
"trusted_client_clock": trusted_client_clock,
},
headers={
"content-type": "application/json",
Expand Down Expand Up @@ -1075,9 +1085,11 @@ async def create_event(
self,
*,
event_type: EventType,
backfill: typing.Optional[bool] = OMIT,
body: typing.Optional[EventBody] = OMIT,
idempotency_key: typing.Optional[str] = OMIT,
sent_at: typing.Optional[dt.datetime] = OMIT,
trusted_client_clock: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[CreateEventResponse]:
"""
Expand All @@ -1086,6 +1098,9 @@ async def create_event(
event_type : EventType
Either 'identify' or 'track'

backfill : typing.Optional[bool]
Requires a secret API key, and trusted_client_clock. Import historical data without affecting billing.

body : typing.Optional[EventBody]

idempotency_key : typing.Optional[str]
Expand All @@ -1094,6 +1109,9 @@ async def create_event(
sent_at : typing.Optional[dt.datetime]
Optionally provide a timestamp at which the event was sent to Schematic

trusted_client_clock : typing.Optional[bool]
Requires a secret API key and sent_at. Use sent_at as the effective timestamp.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand All @@ -1106,10 +1124,12 @@ async def create_event(
"events",
method="POST",
json={
"backfill": backfill,
"body": convert_and_respect_annotation_metadata(object_=body, annotation=EventBody, direction="write"),
"event_type": event_type,
"idempotency_key": idempotency_key,
"sent_at": sent_at,
"trusted_client_clock": trusted_client_clock,
},
headers={
"content-type": "application/json",
Expand Down
10 changes: 10 additions & 0 deletions src/schematic/types/create_event_request_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@


class CreateEventRequestBody(UniversalBaseModel):
backfill: typing.Optional[bool] = pydantic.Field(default=None)
"""
Requires a secret API key, and trusted_client_clock. Import historical data without affecting billing.
"""

body: typing.Optional[EventBody] = None
event_type: EventType = pydantic.Field()
"""
Expand All @@ -26,6 +31,11 @@ class CreateEventRequestBody(UniversalBaseModel):
Optionally provide a timestamp at which the event was sent to Schematic
"""

trusted_client_clock: typing.Optional[bool] = pydantic.Field(default=None)
"""
Requires a secret API key and sent_at. Use sent_at as the effective timestamp.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
Expand Down
2 changes: 2 additions & 0 deletions src/schematic/types/data_event_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

class DataEventPayload(UniversalBaseModel):
api_key: str
backfill: typing.Optional[bool] = None
body: typing.Optional[typing.Dict[str, typing.Any]] = None
idempotency_key: typing.Optional[str] = None
sent_at: typing.Optional[dt.datetime] = None
trusted_client_clock: typing.Optional[bool] = None
type: EventType

if IS_PYDANTIC_V2:
Expand Down
Loading