Skip to content

Commit 7175089

Browse files
feat(api): api update
1 parent 70a1e18 commit 7175089

6 files changed

Lines changed: 623 additions & 13 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 73
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-mapi-1ec488e7c53d932d47c0a8dad075a2b9b48d76d90c33e879870c2ccf54c2d91c.yml
3-
openapi_spec_hash: 11bc7e330005aa01e98acfb6eaf459c6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-mapi-b08979b014004b02db2381163e28a35d1c1fed6439db8398253ee5d6804ed08b.yml
3+
openapi_spec_hash: b2fa41a39d9f4d96857224c4ceb581eb
44
config_hash: 1543050ac0815a90f8fc8158f853af03

src/knock_mapi/types/message_type_variant.py

Lines changed: 125 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Union
4-
from typing_extensions import TypeAlias
3+
from typing import List, Union, Optional
4+
from typing_extensions import Literal, TypeAlias
55

66
from .._models import BaseModel
77
from .message_type_text_field import MessageTypeTextField
@@ -15,14 +15,136 @@
1515
from .shared.message_type_textarea_field import MessageTypeTextareaField
1616
from .shared.message_type_multi_select_field import MessageTypeMultiSelectField
1717

18-
__all__ = ["MessageTypeVariant", "Field"]
18+
__all__ = [
19+
"MessageTypeVariant",
20+
"Field",
21+
"FieldMessageTypeListField",
22+
"FieldMessageTypeListFieldSettings",
23+
"FieldMessageTypeNumberField",
24+
"FieldMessageTypeNumberFieldSettings",
25+
"FieldMessageTypeColorField",
26+
"FieldMessageTypeColorFieldSettings",
27+
]
28+
29+
30+
class FieldMessageTypeListFieldSettings(BaseModel):
31+
"""Settings for the list field."""
32+
33+
default: Optional[List[object]] = None
34+
"""The default value of the list field."""
35+
36+
description: Optional[str] = None
37+
38+
item_schema: Optional[object] = None
39+
"""A JSON schema used to validate the structure of each item in the list.
40+
41+
Must be a valid JSON schema.
42+
"""
43+
44+
placeholder: Optional[str] = None
45+
46+
required: Optional[bool] = None
47+
"""Whether the field is required."""
48+
49+
50+
class FieldMessageTypeListField(BaseModel):
51+
"""A list field used in a message type."""
52+
53+
key: str
54+
"""The unique key of the field."""
55+
56+
label: Optional[str] = None
57+
"""The label of the field."""
58+
59+
type: Literal["list"]
60+
"""The type of the field."""
61+
62+
settings: Optional[FieldMessageTypeListFieldSettings] = None
63+
"""Settings for the list field."""
64+
65+
66+
class FieldMessageTypeNumberFieldSettings(BaseModel):
67+
"""Settings for the number field."""
68+
69+
default: Optional[float] = None
70+
"""The default numeric value."""
71+
72+
description: Optional[str] = None
73+
74+
max: Optional[float] = None
75+
"""Optional inclusive maximum allowed value."""
76+
77+
min: Optional[float] = None
78+
"""Optional inclusive minimum allowed value."""
79+
80+
placeholder: Optional[str] = None
81+
82+
required: Optional[bool] = None
83+
"""Whether the field is required."""
84+
85+
unit_label: Optional[str] = None
86+
"""Optional short label shown after the input (e.g. px, kg)."""
87+
88+
89+
class FieldMessageTypeNumberField(BaseModel):
90+
"""
91+
A numeric field used in a message type or partial input schema, with optional min/max bounds and a unit label for display.
92+
"""
93+
94+
key: str
95+
"""The unique key of the field."""
96+
97+
label: Optional[str] = None
98+
"""The label of the field."""
99+
100+
type: Literal["number"]
101+
"""The type of the field."""
102+
103+
settings: Optional[FieldMessageTypeNumberFieldSettings] = None
104+
"""Settings for the number field."""
105+
106+
107+
class FieldMessageTypeColorFieldSettings(BaseModel):
108+
"""Settings for the color field."""
109+
110+
default: Optional[str] = None
111+
"""The default hex color value."""
112+
113+
description: Optional[str] = None
114+
115+
placeholder: Optional[str] = None
116+
117+
required: Optional[bool] = None
118+
"""Whether the field is required."""
119+
120+
121+
class FieldMessageTypeColorField(BaseModel):
122+
"""
123+
A hex color field (#RGB or #RRGGBB) used in a message type or partial input schema.
124+
"""
125+
126+
key: str
127+
"""The unique key of the field."""
128+
129+
label: Optional[str] = None
130+
"""The label of the field."""
131+
132+
type: Literal["color"]
133+
"""The type of the field."""
134+
135+
settings: Optional[FieldMessageTypeColorFieldSettings] = None
136+
"""Settings for the color field."""
137+
19138

20139
Field: TypeAlias = Union[
140+
FieldMessageTypeListField,
21141
MessageTypeSelectField,
22142
MessageTypeBooleanField,
23143
MessageTypeJsonField,
144+
FieldMessageTypeNumberField,
24145
MessageTypeTextField,
25146
MessageTypeImageField,
147+
FieldMessageTypeColorField,
26148
MessageTypeURLField,
27149
MessageTypeMarkdownField,
28150
MessageTypeMultiSelectField,

src/knock_mapi/types/message_type_variant_param.py

Lines changed: 125 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from __future__ import annotations
44

5-
from typing import Union, Iterable
6-
from typing_extensions import Required, TypeAlias, TypedDict
5+
from typing import Union, Iterable, Optional
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from .message_type_text_field_param import MessageTypeTextFieldParam
99
from .shared_params.message_type_url_field import MessageTypeURLField
@@ -16,14 +16,136 @@
1616
from .shared_params.message_type_textarea_field import MessageTypeTextareaField
1717
from .shared_params.message_type_multi_select_field import MessageTypeMultiSelectField
1818

19-
__all__ = ["MessageTypeVariantParam", "Field"]
19+
__all__ = [
20+
"MessageTypeVariantParam",
21+
"Field",
22+
"FieldMessageTypeListField",
23+
"FieldMessageTypeListFieldSettings",
24+
"FieldMessageTypeNumberField",
25+
"FieldMessageTypeNumberFieldSettings",
26+
"FieldMessageTypeColorField",
27+
"FieldMessageTypeColorFieldSettings",
28+
]
29+
30+
31+
class FieldMessageTypeListFieldSettings(TypedDict, total=False):
32+
"""Settings for the list field."""
33+
34+
default: Optional[Iterable[object]]
35+
"""The default value of the list field."""
36+
37+
description: Optional[str]
38+
39+
item_schema: Optional[object]
40+
"""A JSON schema used to validate the structure of each item in the list.
41+
42+
Must be a valid JSON schema.
43+
"""
44+
45+
placeholder: Optional[str]
46+
47+
required: bool
48+
"""Whether the field is required."""
49+
50+
51+
class FieldMessageTypeListField(TypedDict, total=False):
52+
"""A list field used in a message type."""
53+
54+
key: Required[str]
55+
"""The unique key of the field."""
56+
57+
label: Required[Optional[str]]
58+
"""The label of the field."""
59+
60+
type: Required[Literal["list"]]
61+
"""The type of the field."""
62+
63+
settings: FieldMessageTypeListFieldSettings
64+
"""Settings for the list field."""
65+
66+
67+
class FieldMessageTypeNumberFieldSettings(TypedDict, total=False):
68+
"""Settings for the number field."""
69+
70+
default: Optional[float]
71+
"""The default numeric value."""
72+
73+
description: Optional[str]
74+
75+
max: Optional[float]
76+
"""Optional inclusive maximum allowed value."""
77+
78+
min: Optional[float]
79+
"""Optional inclusive minimum allowed value."""
80+
81+
placeholder: Optional[str]
82+
83+
required: bool
84+
"""Whether the field is required."""
85+
86+
unit_label: Optional[str]
87+
"""Optional short label shown after the input (e.g. px, kg)."""
88+
89+
90+
class FieldMessageTypeNumberField(TypedDict, total=False):
91+
"""
92+
A numeric field used in a message type or partial input schema, with optional min/max bounds and a unit label for display.
93+
"""
94+
95+
key: Required[str]
96+
"""The unique key of the field."""
97+
98+
label: Required[Optional[str]]
99+
"""The label of the field."""
100+
101+
type: Required[Literal["number"]]
102+
"""The type of the field."""
103+
104+
settings: FieldMessageTypeNumberFieldSettings
105+
"""Settings for the number field."""
106+
107+
108+
class FieldMessageTypeColorFieldSettings(TypedDict, total=False):
109+
"""Settings for the color field."""
110+
111+
default: Optional[str]
112+
"""The default hex color value."""
113+
114+
description: Optional[str]
115+
116+
placeholder: Optional[str]
117+
118+
required: bool
119+
"""Whether the field is required."""
120+
121+
122+
class FieldMessageTypeColorField(TypedDict, total=False):
123+
"""
124+
A hex color field (#RGB or #RRGGBB) used in a message type or partial input schema.
125+
"""
126+
127+
key: Required[str]
128+
"""The unique key of the field."""
129+
130+
label: Required[Optional[str]]
131+
"""The label of the field."""
132+
133+
type: Required[Literal["color"]]
134+
"""The type of the field."""
135+
136+
settings: FieldMessageTypeColorFieldSettings
137+
"""Settings for the color field."""
138+
20139

21140
Field: TypeAlias = Union[
141+
FieldMessageTypeListField,
22142
MessageTypeSelectField,
23143
MessageTypeBooleanField,
24144
MessageTypeJsonField,
145+
FieldMessageTypeNumberField,
25146
MessageTypeTextFieldParam,
26147
MessageTypeImageField,
148+
FieldMessageTypeColorField,
27149
MessageTypeURLField,
28150
MessageTypeMarkdownField,
29151
MessageTypeMultiSelectField,

0 commit comments

Comments
 (0)