syllable-sdk 0.44.1__py3-none-any.whl → 0.44.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. syllable_sdk/_version.py +4 -4
  2. syllable_sdk/directory.py +100 -39
  3. syllable_sdk/models/__init__.py +62 -19
  4. syllable_sdk/models/agentsttprovider.py +1 -0
  5. syllable_sdk/models/bridgephrasesconfig.py +0 -9
  6. syllable_sdk/models/{schemas_tts_v1_pronunciations_dictionarymetadata.py → dictionarymetadata.py} +2 -2
  7. syllable_sdk/models/directory_member_createop.py +28 -0
  8. syllable_sdk/models/directory_member_downloadop.py +21 -0
  9. syllable_sdk/models/directory_member_get_by_idop.py +12 -2
  10. syllable_sdk/models/directory_member_listop.py +28 -18
  11. syllable_sdk/models/directory_member_test_extensionop.py +4 -5
  12. syllable_sdk/models/directory_member_updateop.py +17 -2
  13. syllable_sdk/models/directorymembertestresponse.py +9 -4
  14. syllable_sdk/models/directoryresponseformat.py +11 -0
  15. syllable_sdk/models/eventtaskevents.py +1 -4
  16. syllable_sdk/models/expressiontask.py +2 -2
  17. syllable_sdk/models/expressiontaskevents.py +4 -6
  18. syllable_sdk/models/getvalueaction.py +151 -0
  19. syllable_sdk/models/pronunciationoverridesdictionary.py +3 -6
  20. syllable_sdk/models/stepeventactions.py +14 -7
  21. syllable_sdk/models/toolparametertransform.py +5 -3
  22. syllable_sdk/pronunciations.py +4 -8
  23. {syllable_sdk-0.44.1.dist-info → syllable_sdk-0.44.12.dist-info}/METADATA +39 -39
  24. {syllable_sdk-0.44.1.dist-info → syllable_sdk-0.44.12.dist-info}/RECORD +25 -22
  25. syllable_sdk/models/schemas_cortex_v1_bridge_phrases_dictionarymetadata.py +0 -67
  26. {syllable_sdk-0.44.1.dist-info → syllable_sdk-0.44.12.dist-info}/WHEEL +0 -0
@@ -1,10 +1,6 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .schemas_cortex_v1_bridge_phrases_dictionarymetadata import (
5
- SchemasCortexV1BridgePhrasesDictionaryMetadata,
6
- SchemasCortexV1BridgePhrasesDictionaryMetadataTypedDict,
7
- )
8
4
  from syllable_sdk.types import BaseModel
9
5
  from typing import List, Optional
10
6
  from typing_extensions import NotRequired, TypedDict
@@ -19,8 +15,6 @@ class BridgePhrasesConfigTypedDict(TypedDict):
19
15
  r"""Messages to say when the agent is significantly delayed."""
20
16
  tool_responses: NotRequired[List[str]]
21
17
  r"""Messages to say when a tool call is in progress."""
22
- metadata: NotRequired[SchemasCortexV1BridgePhrasesDictionaryMetadataTypedDict]
23
- r"""Metadata for the bridge phrases dictionary."""
24
18
 
25
19
 
26
20
  class BridgePhrasesConfig(BaseModel):
@@ -34,6 +28,3 @@ class BridgePhrasesConfig(BaseModel):
34
28
 
35
29
  tool_responses: Optional[List[str]] = None
36
30
  r"""Messages to say when a tool call is in progress."""
37
-
38
- metadata: Optional[SchemasCortexV1BridgePhrasesDictionaryMetadata] = None
39
- r"""Metadata for the bridge phrases dictionary."""
@@ -6,7 +6,7 @@ from typing import Optional
6
6
  from typing_extensions import NotRequired, TypedDict
7
7
 
8
8
 
9
- class SchemasTtsV1PronunciationsDictionaryMetadataTypedDict(TypedDict):
9
+ class DictionaryMetadataTypedDict(TypedDict):
10
10
  r"""Audit metadata associated with a dictionary."""
11
11
 
12
12
  entries: int
@@ -14,7 +14,7 @@ class SchemasTtsV1PronunciationsDictionaryMetadataTypedDict(TypedDict):
14
14
  source: NotRequired[str]
15
15
 
16
16
 
17
- class SchemasTtsV1PronunciationsDictionaryMetadata(BaseModel):
17
+ class DictionaryMetadata(BaseModel):
18
18
  r"""Audit metadata associated with a dictionary."""
19
19
 
20
20
  entries: int
@@ -0,0 +1,28 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .directorymembercreate import DirectoryMemberCreate, DirectoryMemberCreateTypedDict
5
+ from .directoryresponseformat import DirectoryResponseFormat
6
+ from syllable_sdk.types import BaseModel
7
+ from syllable_sdk.utils import FieldMetadata, QueryParamMetadata, RequestMetadata
8
+ from typing import Optional
9
+ from typing_extensions import Annotated, NotRequired, TypedDict
10
+
11
+
12
+ class DirectoryMemberCreateRequestTypedDict(TypedDict):
13
+ directory_member_create: DirectoryMemberCreateTypedDict
14
+ response_format: NotRequired[DirectoryResponseFormat]
15
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
16
+
17
+
18
+ class DirectoryMemberCreateRequest(BaseModel):
19
+ directory_member_create: Annotated[
20
+ DirectoryMemberCreate,
21
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
22
+ ]
23
+
24
+ response_format: Annotated[
25
+ Optional[DirectoryResponseFormat],
26
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
27
+ ] = None
28
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
@@ -0,0 +1,21 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .directoryresponseformat import DirectoryResponseFormat
5
+ from syllable_sdk.types import BaseModel
6
+ from syllable_sdk.utils import FieldMetadata, QueryParamMetadata
7
+ from typing import Optional
8
+ from typing_extensions import Annotated, NotRequired, TypedDict
9
+
10
+
11
+ class DirectoryMemberDownloadRequestTypedDict(TypedDict):
12
+ response_format: NotRequired[DirectoryResponseFormat]
13
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
14
+
15
+
16
+ class DirectoryMemberDownloadRequest(BaseModel):
17
+ response_format: Annotated[
18
+ Optional[DirectoryResponseFormat],
19
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
20
+ ] = None
21
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
@@ -1,16 +1,26 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .directoryresponseformat import DirectoryResponseFormat
4
5
  from syllable_sdk.types import BaseModel
5
- from syllable_sdk.utils import FieldMetadata, PathParamMetadata
6
- from typing_extensions import Annotated, TypedDict
6
+ from syllable_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
7
+ from typing import Optional
8
+ from typing_extensions import Annotated, NotRequired, TypedDict
7
9
 
8
10
 
9
11
  class DirectoryMemberGetByIDRequestTypedDict(TypedDict):
10
12
  member_id: int
13
+ response_format: NotRequired[DirectoryResponseFormat]
14
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
11
15
 
12
16
 
13
17
  class DirectoryMemberGetByIDRequest(BaseModel):
14
18
  member_id: Annotated[
15
19
  int, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16
20
  ]
21
+
22
+ response_format: Annotated[
23
+ Optional[DirectoryResponseFormat],
24
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
25
+ ] = None
26
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .directorymemberproperties import DirectoryMemberProperties
5
+ from .directoryresponseformat import DirectoryResponseFormat
5
6
  from .orderbydirection import OrderByDirection
6
7
  from pydantic import model_serializer
7
8
  from syllable_sdk.types import (
@@ -17,84 +18,93 @@ from typing_extensions import Annotated, NotRequired, TypedDict
17
18
 
18
19
 
19
20
  class DirectoryMemberListRequestTypedDict(TypedDict):
21
+ response_format: NotRequired[DirectoryResponseFormat]
22
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
20
23
  page: NotRequired[Nullable[int]]
21
- r"""The page number from which to start (0-based)"""
24
+ r"""Page number (0-based)"""
22
25
  limit: NotRequired[int]
23
- r"""The maximum number of items to return"""
26
+ r"""Items per page"""
24
27
  search_fields: NotRequired[List[DirectoryMemberProperties]]
25
- r"""String names of fields to search. Correspond by index to search field values"""
28
+ r"""Fields to search; aligns with search_field_values"""
26
29
  search_field_values: NotRequired[List[str]]
27
- r"""Values of fields to search. Correspond by index to search fields. Unless field name contains \"list\", an individual search field value cannot be a list"""
30
+ r"""Values for search_fields in matching order"""
28
31
  order_by: NotRequired[Nullable[DirectoryMemberProperties]]
29
- r"""The field whose value should be used to order the results"""
32
+ r"""Field to order results by"""
30
33
  order_by_direction: NotRequired[Nullable[OrderByDirection]]
31
- r"""The direction in which to order the results"""
34
+ r"""Direction to order results"""
32
35
  fields: NotRequired[Nullable[List[DirectoryMemberProperties]]]
33
- r"""The fields to include in the response"""
36
+ r"""Fields to include in response"""
34
37
  start_datetime: NotRequired[Nullable[str]]
35
- r"""The start datetime for filtering results"""
38
+ r"""Start datetime for filtering results"""
36
39
  end_datetime: NotRequired[Nullable[str]]
37
- r"""The end datetime for filtering results"""
40
+ r"""End datetime for filtering results"""
38
41
 
39
42
 
40
43
  class DirectoryMemberListRequest(BaseModel):
44
+ response_format: Annotated[
45
+ Optional[DirectoryResponseFormat],
46
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
47
+ ] = None
48
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
49
+
41
50
  page: Annotated[
42
51
  OptionalNullable[int],
43
52
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
44
53
  ] = UNSET
45
- r"""The page number from which to start (0-based)"""
54
+ r"""Page number (0-based)"""
46
55
 
47
56
  limit: Annotated[
48
57
  Optional[int],
49
58
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
50
59
  ] = 25
51
- r"""The maximum number of items to return"""
60
+ r"""Items per page"""
52
61
 
53
62
  search_fields: Annotated[
54
63
  Optional[List[DirectoryMemberProperties]],
55
64
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
56
65
  ] = None
57
- r"""String names of fields to search. Correspond by index to search field values"""
66
+ r"""Fields to search; aligns with search_field_values"""
58
67
 
59
68
  search_field_values: Annotated[
60
69
  Optional[List[str]],
61
70
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
62
71
  ] = None
63
- r"""Values of fields to search. Correspond by index to search fields. Unless field name contains \"list\", an individual search field value cannot be a list"""
72
+ r"""Values for search_fields in matching order"""
64
73
 
65
74
  order_by: Annotated[
66
75
  OptionalNullable[DirectoryMemberProperties],
67
76
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
68
77
  ] = UNSET
69
- r"""The field whose value should be used to order the results"""
78
+ r"""Field to order results by"""
70
79
 
71
80
  order_by_direction: Annotated[
72
81
  OptionalNullable[OrderByDirection],
73
82
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
74
83
  ] = UNSET
75
- r"""The direction in which to order the results"""
84
+ r"""Direction to order results"""
76
85
 
77
86
  fields: Annotated[
78
87
  OptionalNullable[List[DirectoryMemberProperties]],
79
88
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
80
89
  ] = UNSET
81
- r"""The fields to include in the response"""
90
+ r"""Fields to include in response"""
82
91
 
83
92
  start_datetime: Annotated[
84
93
  OptionalNullable[str],
85
94
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
86
95
  ] = UNSET
87
- r"""The start datetime for filtering results"""
96
+ r"""Start datetime for filtering results"""
88
97
 
89
98
  end_datetime: Annotated[
90
99
  OptionalNullable[str],
91
100
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
92
101
  ] = UNSET
93
- r"""The end datetime for filtering results"""
102
+ r"""End datetime for filtering results"""
94
103
 
95
104
  @model_serializer(mode="wrap")
96
105
  def serialize_model(self, handler):
97
106
  optional_fields = [
107
+ "response_format",
98
108
  "page",
99
109
  "limit",
100
110
  "search_fields",
@@ -2,7 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .languagecode import LanguageCode
5
- from datetime import datetime
6
5
  from pydantic import model_serializer
7
6
  from syllable_sdk.types import (
8
7
  BaseModel,
@@ -17,8 +16,8 @@ from typing_extensions import Annotated, NotRequired, TypedDict
17
16
 
18
17
  class DirectoryMemberTestExtensionRequestTypedDict(TypedDict):
19
18
  member_id: int
20
- timestamp: datetime
21
- r"""Timestamp for test"""
19
+ timestamp: str
20
+ r"""Timestamp for test in ISO 8601 format (e.g., 2025-12-04T14:29:39)"""
22
21
  language_code: NotRequired[Nullable[LanguageCode]]
23
22
  r"""Optional language code for test"""
24
23
 
@@ -29,9 +28,9 @@ class DirectoryMemberTestExtensionRequest(BaseModel):
29
28
  ]
30
29
 
31
30
  timestamp: Annotated[
32
- datetime, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
31
+ str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
33
32
  ]
34
- r"""Timestamp for test"""
33
+ r"""Timestamp for test in ISO 8601 format (e.g., 2025-12-04T14:29:39)"""
35
34
 
36
35
  language_code: Annotated[
37
36
  OptionalNullable[LanguageCode],
@@ -2,14 +2,23 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .directorymemberupdate import DirectoryMemberUpdate, DirectoryMemberUpdateTypedDict
5
+ from .directoryresponseformat import DirectoryResponseFormat
5
6
  from syllable_sdk.types import BaseModel
6
- from syllable_sdk.utils import FieldMetadata, PathParamMetadata, RequestMetadata
7
- from typing_extensions import Annotated, TypedDict
7
+ from syllable_sdk.utils import (
8
+ FieldMetadata,
9
+ PathParamMetadata,
10
+ QueryParamMetadata,
11
+ RequestMetadata,
12
+ )
13
+ from typing import Optional
14
+ from typing_extensions import Annotated, NotRequired, TypedDict
8
15
 
9
16
 
10
17
  class DirectoryMemberUpdateRequestTypedDict(TypedDict):
11
18
  member_id: int
12
19
  directory_member_update: DirectoryMemberUpdateTypedDict
20
+ response_format: NotRequired[DirectoryResponseFormat]
21
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
13
22
 
14
23
 
15
24
  class DirectoryMemberUpdateRequest(BaseModel):
@@ -21,3 +30,9 @@ class DirectoryMemberUpdateRequest(BaseModel):
21
30
  DirectoryMemberUpdate,
22
31
  FieldMetadata(request=RequestMetadata(media_type="application/json")),
23
32
  ]
33
+
34
+ response_format: Annotated[
35
+ Optional[DirectoryResponseFormat],
36
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
37
+ ] = None
38
+ r"""Directory response format: normalized (default) strips @hours and formats times; raw returns stored @hours values."""
@@ -14,17 +14,22 @@ from typing_extensions import NotRequired, TypedDict
14
14
 
15
15
  class DirectoryMemberTestResponseTypedDict(TypedDict):
16
16
  extension: NotRequired[Nullable[str]]
17
- r"""Extension to which the user will be transferred if they call at the provided timestamp in the given language"""
17
+ r"""Extension to which the user will be transferred if they call at the provided timestamp in the given language, or a status message if no rules match"""
18
+ status: NotRequired[Nullable[str]]
19
+ r"""Status message if no rules match"""
18
20
 
19
21
 
20
22
  class DirectoryMemberTestResponse(BaseModel):
21
23
  extension: OptionalNullable[str] = UNSET
22
- r"""Extension to which the user will be transferred if they call at the provided timestamp in the given language"""
24
+ r"""Extension to which the user will be transferred if they call at the provided timestamp in the given language, or a status message if no rules match"""
25
+
26
+ status: OptionalNullable[str] = UNSET
27
+ r"""Status message if no rules match"""
23
28
 
24
29
  @model_serializer(mode="wrap")
25
30
  def serialize_model(self, handler):
26
- optional_fields = ["extension"]
27
- nullable_fields = ["extension"]
31
+ optional_fields = ["extension", "status"]
32
+ nullable_fields = ["extension", "status"]
28
33
  null_default_fields = []
29
34
 
30
35
  serialized = handler(self)
@@ -0,0 +1,11 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from enum import Enum
5
+
6
+
7
+ class DirectoryResponseFormat(str, Enum):
8
+ r"""Response shape selector for directory member APIs."""
9
+
10
+ NORMALIZED = "normalized"
11
+ RAW = "raw"
@@ -3,7 +3,6 @@
3
3
  from __future__ import annotations
4
4
  from .callaction import CallAction, CallActionTypedDict
5
5
  from .incrementaction import IncrementAction, IncrementActionTypedDict
6
- from .saveaction import SaveAction, SaveActionTypedDict
7
6
  from .sayaction import SayAction, SayActionTypedDict
8
7
  from .setvalueaction import SetValueAction, SetValueActionTypedDict
9
8
  from pydantic import Discriminator, Tag, model_serializer
@@ -22,9 +21,8 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
22
21
  EventTaskEventsStartTypedDict = TypeAliasType(
23
22
  "EventTaskEventsStartTypedDict",
24
23
  Union[
25
- SayActionTypedDict,
26
- SaveActionTypedDict,
27
24
  IncrementActionTypedDict,
25
+ SayActionTypedDict,
28
26
  SetValueActionTypedDict,
29
27
  CallActionTypedDict,
30
28
  ],
@@ -35,7 +33,6 @@ EventTaskEventsStart = Annotated[
35
33
  Union[
36
34
  Annotated[CallAction, Tag("call")],
37
35
  Annotated[IncrementAction, Tag("inc")],
38
- Annotated[SaveAction, Tag("save")],
39
36
  Annotated[SayAction, Tag("say")],
40
37
  Annotated[SetValueAction, Tag("set")],
41
38
  ],
@@ -60,7 +60,7 @@ class ExpressionTaskTypedDict(TypedDict):
60
60
  expression: NotRequired[Nullable[Expression2TypedDict]]
61
61
  output: NotRequired[Nullable[Any]]
62
62
  on: NotRequired[ExpressionTaskEventsTypedDict]
63
- r"""Actions to perform when events occur (enter, submit)."""
63
+ r"""Actions to perform when events occur (start, submit)."""
64
64
 
65
65
 
66
66
  class ExpressionTask(BaseModel):
@@ -97,7 +97,7 @@ class ExpressionTask(BaseModel):
97
97
  output: OptionalNullable[Any] = UNSET
98
98
 
99
99
  on: Optional[ExpressionTaskEvents] = None
100
- r"""Actions to perform when events occur (enter, submit)."""
100
+ r"""Actions to perform when events occur (start, submit)."""
101
101
 
102
102
  @model_serializer(mode="wrap")
103
103
  def serialize_model(self, handler):
@@ -22,9 +22,8 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
22
22
  ExpressionTaskEventsStartTypedDict = TypeAliasType(
23
23
  "ExpressionTaskEventsStartTypedDict",
24
24
  Union[
25
- SayActionTypedDict,
26
- SaveActionTypedDict,
27
25
  IncrementActionTypedDict,
26
+ SayActionTypedDict,
28
27
  SetValueActionTypedDict,
29
28
  CallActionTypedDict,
30
29
  ],
@@ -35,7 +34,6 @@ ExpressionTaskEventsStart = Annotated[
35
34
  Union[
36
35
  Annotated[CallAction, Tag("call")],
37
36
  Annotated[IncrementAction, Tag("inc")],
38
- Annotated[SaveAction, Tag("save")],
39
37
  Annotated[SayAction, Tag("say")],
40
38
  Annotated[SetValueAction, Tag("set")],
41
39
  ],
@@ -47,8 +45,8 @@ ExpressionTaskEventsSubmitTypedDict = TypeAliasType(
47
45
  "ExpressionTaskEventsSubmitTypedDict",
48
46
  Union[
49
47
  IncrementActionTypedDict,
50
- SayActionTypedDict,
51
48
  SaveActionTypedDict,
49
+ SayActionTypedDict,
52
50
  SetValueActionTypedDict,
53
51
  CallActionTypedDict,
54
52
  ],
@@ -68,7 +66,7 @@ ExpressionTaskEventsSubmit = Annotated[
68
66
 
69
67
 
70
68
  class ExpressionTaskEventsTypedDict(TypedDict):
71
- r"""Actions to perform when events occur (enter, submit)."""
69
+ r"""Actions to perform when events occur (start, submit)."""
72
70
 
73
71
  start: NotRequired[Nullable[List[ExpressionTaskEventsStartTypedDict]]]
74
72
  r"""Actions to execute on the first input from the user."""
@@ -77,7 +75,7 @@ class ExpressionTaskEventsTypedDict(TypedDict):
77
75
 
78
76
 
79
77
  class ExpressionTaskEvents(BaseModel):
80
- r"""Actions to perform when events occur (enter, submit)."""
78
+ r"""Actions to perform when events occur (start, submit)."""
81
79
 
82
80
  start: OptionalNullable[List[ExpressionTaskEventsStart]] = UNSET
83
81
  r"""Actions to execute on the first input from the user."""
@@ -0,0 +1,151 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .caseexpression import CaseExpression, CaseExpressionTypedDict
5
+ from .celexpression import CelExpression, CelExpressionTypedDict
6
+ from .jmespathexpression import JMESPathExpression, JMESPathExpressionTypedDict
7
+ from enum import Enum
8
+ import pydantic
9
+ from pydantic import Discriminator, Tag, model_serializer
10
+ from syllable_sdk.types import (
11
+ BaseModel,
12
+ Nullable,
13
+ OptionalNullable,
14
+ UNSET,
15
+ UNSET_SENTINEL,
16
+ )
17
+ from syllable_sdk.utils import get_discriminator
18
+ from typing import Any, List, Optional, Union
19
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
20
+
21
+
22
+ GetValueActionValueFrom1TypedDict = TypeAliasType(
23
+ "GetValueActionValueFrom1TypedDict",
24
+ Union[CelExpressionTypedDict, JMESPathExpressionTypedDict],
25
+ )
26
+
27
+
28
+ GetValueActionValueFrom1 = Annotated[
29
+ Union[
30
+ Annotated[CelExpression, Tag("cel")],
31
+ Annotated[JMESPathExpression, Tag("jmespath")],
32
+ Annotated[JMESPathExpression, Tag("jp")],
33
+ ],
34
+ Discriminator(lambda m: get_discriminator(m, "type", "type")),
35
+ ]
36
+
37
+
38
+ GetValueActionValueFrom2TypedDict = TypeAliasType(
39
+ "GetValueActionValueFrom2TypedDict",
40
+ Union[CaseExpressionTypedDict, GetValueActionValueFrom1TypedDict, str],
41
+ )
42
+ r"""Expression to compute initial value (mutually exclusive with value)."""
43
+
44
+
45
+ GetValueActionValueFrom2 = TypeAliasType(
46
+ "GetValueActionValueFrom2", Union[CaseExpression, GetValueActionValueFrom1, str]
47
+ )
48
+ r"""Expression to compute initial value (mutually exclusive with value)."""
49
+
50
+
51
+ GetValueActionIf1TypedDict = TypeAliasType(
52
+ "GetValueActionIf1TypedDict",
53
+ Union[CelExpressionTypedDict, JMESPathExpressionTypedDict],
54
+ )
55
+
56
+
57
+ GetValueActionIf1 = Annotated[
58
+ Union[
59
+ Annotated[CelExpression, Tag("cel")],
60
+ Annotated[JMESPathExpression, Tag("jmespath")],
61
+ Annotated[JMESPathExpression, Tag("jp")],
62
+ ],
63
+ Discriminator(lambda m: get_discriminator(m, "type", "type")),
64
+ ]
65
+
66
+
67
+ GetValueActionIf2TypedDict = TypeAliasType(
68
+ "GetValueActionIf2TypedDict",
69
+ Union[CaseExpressionTypedDict, GetValueActionIf1TypedDict, str],
70
+ )
71
+ r"""An expression that must evaluate to true for the action to be applied."""
72
+
73
+
74
+ GetValueActionIf2 = TypeAliasType(
75
+ "GetValueActionIf2", Union[CaseExpression, GetValueActionIf1, str]
76
+ )
77
+ r"""An expression that must evaluate to true for the action to be applied."""
78
+
79
+
80
+ class GetValueActionAction(str, Enum):
81
+ r"""Populate default input values."""
82
+
83
+ GET = "get"
84
+ LOAD = "load"
85
+
86
+
87
+ class GetValueActionTypedDict(TypedDict):
88
+ value: NotRequired[Nullable[Any]]
89
+ r"""Initial value of the variable."""
90
+ value_from: NotRequired[Nullable[GetValueActionValueFrom2TypedDict]]
91
+ r"""Expression to compute initial value (mutually exclusive with value)."""
92
+ if_: NotRequired[Nullable[GetValueActionIf2TypedDict]]
93
+ r"""An expression that must evaluate to true for the action to be applied."""
94
+ action: NotRequired[GetValueActionAction]
95
+ r"""Populate default input values."""
96
+ inputs: NotRequired[Nullable[List[str]]]
97
+ r"""Input field names to populate; None populates all step inputs."""
98
+ overwrite: NotRequired[bool]
99
+ r"""If False (default), only populate empty inputs. If True, always overwrite."""
100
+
101
+
102
+ class GetValueAction(BaseModel):
103
+ value: OptionalNullable[Any] = UNSET
104
+ r"""Initial value of the variable."""
105
+
106
+ value_from: OptionalNullable[GetValueActionValueFrom2] = UNSET
107
+ r"""Expression to compute initial value (mutually exclusive with value)."""
108
+
109
+ if_: Annotated[OptionalNullable[GetValueActionIf2], pydantic.Field(alias="if")] = (
110
+ UNSET
111
+ )
112
+ r"""An expression that must evaluate to true for the action to be applied."""
113
+
114
+ action: Optional[GetValueActionAction] = GetValueActionAction.GET
115
+ r"""Populate default input values."""
116
+
117
+ inputs: OptionalNullable[List[str]] = UNSET
118
+ r"""Input field names to populate; None populates all step inputs."""
119
+
120
+ overwrite: Optional[bool] = False
121
+ r"""If False (default), only populate empty inputs. If True, always overwrite."""
122
+
123
+ @model_serializer(mode="wrap")
124
+ def serialize_model(self, handler):
125
+ optional_fields = ["value", "value_from", "if", "action", "inputs", "overwrite"]
126
+ nullable_fields = ["value", "value_from", "if", "inputs"]
127
+ null_default_fields = []
128
+
129
+ serialized = handler(self)
130
+
131
+ m = {}
132
+
133
+ for n, f in type(self).model_fields.items():
134
+ k = f.alias or n
135
+ val = serialized.get(k)
136
+ serialized.pop(k, None)
137
+
138
+ optional_nullable = k in optional_fields and k in nullable_fields
139
+ is_set = (
140
+ self.__pydantic_fields_set__.intersection({n})
141
+ or k in null_default_fields
142
+ ) # pylint: disable=no-member
143
+
144
+ if val is not None and val != UNSET_SENTINEL:
145
+ m[k] = val
146
+ elif val != UNSET_SENTINEL and (
147
+ not k in optional_fields or (optional_nullable and is_set)
148
+ ):
149
+ m[k] = val
150
+
151
+ return m
@@ -1,11 +1,8 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .dictionarymetadata import DictionaryMetadata, DictionaryMetadataTypedDict
4
5
  from .pronunciationoverride import PronunciationOverride, PronunciationOverrideTypedDict
5
- from .schemas_tts_v1_pronunciations_dictionarymetadata import (
6
- SchemasTtsV1PronunciationsDictionaryMetadata,
7
- SchemasTtsV1PronunciationsDictionaryMetadataTypedDict,
8
- )
9
6
  from .voicedisplayinfo import VoiceDisplayInfo, VoiceDisplayInfoTypedDict
10
7
  from syllable_sdk.types import BaseModel
11
8
  from typing import Dict, List, Optional
@@ -35,7 +32,7 @@ class PronunciationOverridesDictionaryTypedDict(TypedDict):
35
32
  """
36
33
 
37
34
  pronunciations: List[PronunciationOverrideTypedDict]
38
- metadata: SchemasTtsV1PronunciationsDictionaryMetadataTypedDict
35
+ metadata: DictionaryMetadataTypedDict
39
36
  r"""Audit metadata associated with a dictionary."""
40
37
  type: NotRequired[str]
41
38
  voices: NotRequired[Dict[str, VoiceDisplayInfoTypedDict]]
@@ -65,7 +62,7 @@ class PronunciationOverridesDictionary(BaseModel):
65
62
 
66
63
  pronunciations: List[PronunciationOverride]
67
64
 
68
- metadata: SchemasTtsV1PronunciationsDictionaryMetadata
65
+ metadata: DictionaryMetadata
69
66
  r"""Audit metadata associated with a dictionary."""
70
67
 
71
68
  type: Optional[str] = "pronunciations_v1"