Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/mobility-core/src/Kernel/External/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ data Language
| ITALIAN
| ASSAMESE
| RUSSIAN
| PUNJABI
| MARATHI
deriving (Eq, Show, Ord, Read, Generic, ToJSON, FromJSON, ToParamSchema, ToSchema, Enum, Bounded)
deriving (PrettyShow) via Showable Language

Expand All @@ -75,6 +77,8 @@ instance FromHttpApiData Language where
parseUrlPiece "it" = pure ITALIAN
parseUrlPiece "as" = pure ASSAMESE
parseUrlPiece "ru" = pure RUSSIAN
parseUrlPiece "pa" = pure PUNJABI
parseUrlPiece "mr" = pure MARATHI
parseUrlPiece _ = Left "Unable to parse Language"

instance ToHttpApiData Language where
Expand All @@ -98,6 +102,8 @@ instance ToHttpApiData Language where
toUrlPiece ITALIAN = "it"
toUrlPiece ASSAMESE = "as"
toUrlPiece RUSSIAN = "ru"
toUrlPiece PUNJABI = "pa"
toUrlPiece MARATHI = "mr"

type ServiceFlow m r = (EncFlow m r, EsqDBFlow m r, CacheFlow m r, HasKafkaProducer r)

Expand Down
Loading