|
6 | 6 |
|
7 | 7 | from enum import Enum |
8 | 8 | from pydantic import BaseModel, ConfigDict, Field |
9 | | -from typing import List, Literal, Optional |
| 9 | +from typing import List, Literal, Optional, Union |
| 10 | + |
| 11 | + |
| 12 | +class GeneratePasswordResponse(BaseModel): |
| 13 | + """ |
| 14 | + For future use, if we want to return more information about the generated password. |
| 15 | + Currently, it only returns the password itself. |
| 16 | + """ |
| 17 | + |
| 18 | + password: str |
| 19 | + """ |
| 20 | + The generated password. |
| 21 | + """ |
10 | 22 |
|
11 | 23 |
|
12 | 24 | class ItemCategory(str, Enum): |
@@ -40,6 +52,7 @@ class ItemFieldType(str, Enum): |
40 | 52 | TEXT = "Text" |
41 | 53 | CONCEALED = "Concealed" |
42 | 54 | CREDITCARDTYPE = "CreditCardType" |
| 55 | + CREDITCARDNUMBER = "CreditCardNumber" |
43 | 56 | PHONE = "Phone" |
44 | 57 | URL = "Url" |
45 | 58 | TOTP = "Totp" |
@@ -273,3 +286,100 @@ class VaultOverview(BaseModel): |
273 | 286 | """ |
274 | 287 | The vault's title |
275 | 288 | """ |
| 289 | + |
| 290 | + |
| 291 | +class PasswordRecipeMemorableInner(BaseModel): |
| 292 | + """ |
| 293 | + Generated type representing the anonymous struct variant `Memorable` of the `PasswordRecipe` Rust enum |
| 294 | + """ |
| 295 | + |
| 296 | + model_config = ConfigDict(populate_by_name=True) |
| 297 | + |
| 298 | + separator_type: SeparatorType = Field(alias="separatorType") |
| 299 | + """ |
| 300 | + The type of separator between chunks. |
| 301 | + """ |
| 302 | + capitalize: bool |
| 303 | + """ |
| 304 | + Uppercase one randomly selected chunk. |
| 305 | + """ |
| 306 | + word_list_type: WordListType = Field(alias="wordListType") |
| 307 | + """ |
| 308 | + The type of word list used. |
| 309 | + """ |
| 310 | + word_count: int = Field(alias="wordCount") |
| 311 | + """ |
| 312 | + The number of "words" (words or syllables). |
| 313 | + """ |
| 314 | + |
| 315 | + |
| 316 | +class PasswordRecipePinInner(BaseModel): |
| 317 | + """ |
| 318 | + Generated type representing the anonymous struct variant `Pin` of the `PasswordRecipe` Rust enum |
| 319 | + """ |
| 320 | + |
| 321 | + length: int |
| 322 | + """ |
| 323 | + Number of digits in the PIN. |
| 324 | + """ |
| 325 | + |
| 326 | + |
| 327 | +class PasswordRecipeRandomInner(BaseModel): |
| 328 | + """ |
| 329 | + Generated type representing the anonymous struct variant `Random` of the `PasswordRecipe` Rust enum |
| 330 | + """ |
| 331 | + |
| 332 | + model_config = ConfigDict(populate_by_name=True) |
| 333 | + |
| 334 | + include_digits: bool = Field(alias="includeDigits") |
| 335 | + """ |
| 336 | + Include at least one digit in the password. |
| 337 | + """ |
| 338 | + include_symbols: bool = Field(alias="includeSymbols") |
| 339 | + """ |
| 340 | + Include at least one symbol in the password. |
| 341 | + """ |
| 342 | + length: int |
| 343 | + """ |
| 344 | + The length of the password. |
| 345 | + """ |
| 346 | + |
| 347 | + |
| 348 | +class PasswordRecipeTypes(str, Enum): |
| 349 | + MEMORABLE = "Memorable" |
| 350 | + PIN = "Pin" |
| 351 | + RANDOM = "Random" |
| 352 | + |
| 353 | + |
| 354 | +class PasswordRecipeMemorable(BaseModel): |
| 355 | + type: Literal[PasswordRecipeTypes.MEMORABLE] = PasswordRecipeTypes.MEMORABLE |
| 356 | + parameters: PasswordRecipeMemorableInner |
| 357 | + |
| 358 | + |
| 359 | +class PasswordRecipePin(BaseModel): |
| 360 | + type: Literal[PasswordRecipeTypes.PIN] = PasswordRecipeTypes.PIN |
| 361 | + parameters: PasswordRecipePinInner |
| 362 | + |
| 363 | + |
| 364 | +class PasswordRecipeRandom(BaseModel): |
| 365 | + type: Literal[PasswordRecipeTypes.RANDOM] = PasswordRecipeTypes.RANDOM |
| 366 | + parameters: PasswordRecipeRandomInner |
| 367 | + |
| 368 | + |
| 369 | +PasswordRecipe = Union[PasswordRecipeMemorable, PasswordRecipePin, PasswordRecipeRandom] |
| 370 | + |
| 371 | + |
| 372 | +class SeparatorType(str, Enum): |
| 373 | + DIGITS = "digits" |
| 374 | + DIGITSANDSYMBOLS = "digitsAndSymbols" |
| 375 | + SPACES = "spaces" |
| 376 | + HYPHENS = "hyphens" |
| 377 | + UNDERSCORES = "underscores" |
| 378 | + PERIODS = "periods" |
| 379 | + COMMAS = "commas" |
| 380 | + |
| 381 | + |
| 382 | +class WordListType(str, Enum): |
| 383 | + FULLWORDS = "fullWords" |
| 384 | + SYLLABLES = "syllables" |
| 385 | + THREELETTERS = "threeLetters" |
0 commit comments