Skip to content

Commit b1645a0

Browse files
fix(specs): add secrets payload for updates (generated)
algolia/api-clients-automation#4061 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 3af1599 commit b1645a0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

algoliasearch/ingestion/models/auth_input_partial.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from __future__ import annotations
88

9-
from json import dumps
9+
from json import dumps, loads
1010
from sys import version_info
1111
from typing import Any, Dict, Optional, Set, Union
1212

@@ -49,13 +49,16 @@ class AuthInputPartial(BaseModel):
4949

5050
oneof_schema_6_validator: Optional[AuthAlgoliaInsightsPartial] = Field(default=None)
5151

52+
oneof_schema_7_validator: Optional[Dict[str, str]] = Field(default=None)
53+
""" A key:value authentication for your transformations. """
5254
actual_instance: Union[
5355
AuthAPIKeyPartial,
5456
AuthAlgoliaInsightsPartial,
5557
AuthAlgoliaPartial,
5658
AuthBasicPartial,
5759
AuthGoogleServiceAccountPartial,
5860
AuthOAuthPartial,
61+
Dict[str, str],
5962
None,
6063
] = None
6164
one_of_schemas: Set[str] = {
@@ -65,6 +68,7 @@ class AuthInputPartial(BaseModel):
6568
"AuthBasicPartial",
6669
"AuthGoogleServiceAccountPartial",
6770
"AuthOAuthPartial",
71+
"Dict[str, str]",
6872
}
6973

7074
def __init__(self, *args, **kwargs) -> None:
@@ -91,6 +95,7 @@ def unwrap_actual_instance(
9195
AuthBasicPartial,
9296
AuthGoogleServiceAccountPartial,
9397
AuthOAuthPartial,
98+
Dict[str, str],
9499
Self,
95100
None,
96101
]:
@@ -145,12 +150,19 @@ def from_json(cls, json_str: str) -> Self:
145150
try:
146151
instance.actual_instance = AuthAlgoliaInsightsPartial.from_json(json_str)
147152

153+
return instance
154+
except (ValidationError, ValueError) as e:
155+
error_messages.append(str(e))
156+
try:
157+
instance.oneof_schema_7_validator = loads(json_str)
158+
instance.actual_instance = instance.oneof_schema_7_validator
159+
148160
return instance
149161
except (ValidationError, ValueError) as e:
150162
error_messages.append(str(e))
151163

152164
raise ValueError(
153-
"No match found when deserializing the JSON string into AuthInputPartial with oneOf schemas: AuthAPIKeyPartial, AuthAlgoliaInsightsPartial, AuthAlgoliaPartial, AuthBasicPartial, AuthGoogleServiceAccountPartial, AuthOAuthPartial. Details: "
165+
"No match found when deserializing the JSON string into AuthInputPartial with oneOf schemas: AuthAPIKeyPartial, AuthAlgoliaInsightsPartial, AuthAlgoliaPartial, AuthBasicPartial, AuthGoogleServiceAccountPartial, AuthOAuthPartial, Dict[str, str]. Details: "
154166
+ ", ".join(error_messages)
155167
)
156168

@@ -177,6 +189,7 @@ def to_dict(
177189
AuthBasicPartial,
178190
AuthGoogleServiceAccountPartial,
179191
AuthOAuthPartial,
192+
Dict[str, str],
180193
]
181194
]:
182195
"""Returns the dict representation of the actual instance"""

0 commit comments

Comments
 (0)