-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(python): add get_flag method (#148)
* feat(python): added get_flag method to flag api * feat(python): removed duplicate logic * feat(python): added ruff rules * feat(python): updated to poetry=1.7.1 and fixed ci python test step * feat(python): fixed ruff warning --------- Co-authored-by: v.kozyar <v.kozyar@tinkoff.ru>
- Loading branch information
1 parent
5a6ebd4
commit f31c6c9
Showing
20 changed files
with
220 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
from datetime import datetime | ||
from enum import Enum | ||
from typing import Any | ||
from enum import StrEnum | ||
|
||
from flipt.models import CamelAliasModel, PaginatedResponse | ||
|
||
|
||
class FlagType(str, Enum): | ||
class FlagType(StrEnum): | ||
variant = "VARIANT_FLAG_TYPE" | ||
boolean = "BOOLEAN_FLAG_TYPE" | ||
|
||
|
||
class Flag(CamelAliasModel): | ||
created_at: datetime | ||
class Variant(CamelAliasModel): | ||
attachment: str | ||
description: str | ||
enabled: bool | ||
flag_key: str | ||
id: str | ||
key: str | ||
name: str | ||
namespace_key: str | ||
created_at: datetime | ||
updated_at: datetime | ||
|
||
|
||
class Flag(CamelAliasModel): | ||
key: str | ||
name: str | ||
namespacekey: str | None = None | ||
description: str | ||
enabled: bool | ||
namespace_key: str | ||
type: FlagType | ||
updatedAt: datetime | ||
variants: list[Any] | ||
created_at: datetime | ||
updated_at: datetime | ||
variants: list[Variant] | ||
|
||
|
||
class ListFlagsResponse(CamelAliasModel, PaginatedResponse): | ||
class ListFlagsResponse(PaginatedResponse): | ||
flags: list[Flag] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.