{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE NoFieldSelectors #-}

module WikiMusic.SSR.Model.Api
  ( AuthToken (..),
    SortOrder (..),
    Include (..),
    UiMode (..),
    Language (..),
    Palette (..),
    authCookieName,
    localeCookieName,
    uiModeCookieName,
    ViewVars (..),
    artistSortingCookieName,
    songSortingCookieName,
    genreSortingCookieName,
    songAsciiSizeCookieName,
    paletteCookieName,
    SongAsciiSize (..),
  )
where

import Optics
import Relude

newtype AuthToken = AuthToken {AuthToken -> Text
value :: Text} deriving (AuthToken -> AuthToken -> Bool
(AuthToken -> AuthToken -> Bool)
-> (AuthToken -> AuthToken -> Bool) -> Eq AuthToken
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthToken -> AuthToken -> Bool
== :: AuthToken -> AuthToken -> Bool
$c/= :: AuthToken -> AuthToken -> Bool
/= :: AuthToken -> AuthToken -> Bool
Eq, (forall x. AuthToken -> Rep AuthToken x)
-> (forall x. Rep AuthToken x -> AuthToken) -> Generic AuthToken
forall x. Rep AuthToken x -> AuthToken
forall x. AuthToken -> Rep AuthToken x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AuthToken -> Rep AuthToken x
from :: forall x. AuthToken -> Rep AuthToken x
$cto :: forall x. Rep AuthToken x -> AuthToken
to :: forall x. Rep AuthToken x -> AuthToken
Generic, Int -> AuthToken -> ShowS
[AuthToken] -> ShowS
AuthToken -> String
(Int -> AuthToken -> ShowS)
-> (AuthToken -> String)
-> ([AuthToken] -> ShowS)
-> Show AuthToken
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthToken -> ShowS
showsPrec :: Int -> AuthToken -> ShowS
$cshow :: AuthToken -> String
show :: AuthToken -> String
$cshowList :: [AuthToken] -> ShowS
showList :: [AuthToken] -> ShowS
Show)

newtype SortOrder = SortOrder {SortOrder -> Text
value :: Text} deriving (SortOrder -> SortOrder -> Bool
(SortOrder -> SortOrder -> Bool)
-> (SortOrder -> SortOrder -> Bool) -> Eq SortOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SortOrder -> SortOrder -> Bool
== :: SortOrder -> SortOrder -> Bool
$c/= :: SortOrder -> SortOrder -> Bool
/= :: SortOrder -> SortOrder -> Bool
Eq, (forall x. SortOrder -> Rep SortOrder x)
-> (forall x. Rep SortOrder x -> SortOrder) -> Generic SortOrder
forall x. Rep SortOrder x -> SortOrder
forall x. SortOrder -> Rep SortOrder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SortOrder -> Rep SortOrder x
from :: forall x. SortOrder -> Rep SortOrder x
$cto :: forall x. Rep SortOrder x -> SortOrder
to :: forall x. Rep SortOrder x -> SortOrder
Generic, Int -> SortOrder -> ShowS
[SortOrder] -> ShowS
SortOrder -> String
(Int -> SortOrder -> ShowS)
-> (SortOrder -> String)
-> ([SortOrder] -> ShowS)
-> Show SortOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SortOrder -> ShowS
showsPrec :: Int -> SortOrder -> ShowS
$cshow :: SortOrder -> String
show :: SortOrder -> String
$cshowList :: [SortOrder] -> ShowS
showList :: [SortOrder] -> ShowS
Show)

newtype Include = Include {Include -> Text
value :: Text} deriving (Include -> Include -> Bool
(Include -> Include -> Bool)
-> (Include -> Include -> Bool) -> Eq Include
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Include -> Include -> Bool
== :: Include -> Include -> Bool
$c/= :: Include -> Include -> Bool
/= :: Include -> Include -> Bool
Eq, (forall x. Include -> Rep Include x)
-> (forall x. Rep Include x -> Include) -> Generic Include
forall x. Rep Include x -> Include
forall x. Include -> Rep Include x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Include -> Rep Include x
from :: forall x. Include -> Rep Include x
$cto :: forall x. Rep Include x -> Include
to :: forall x. Rep Include x -> Include
Generic, Int -> Include -> ShowS
[Include] -> ShowS
Include -> String
(Int -> Include -> ShowS)
-> (Include -> String) -> ([Include] -> ShowS) -> Show Include
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Include -> ShowS
showsPrec :: Int -> Include -> ShowS
$cshow :: Include -> String
show :: Include -> String
$cshowList :: [Include] -> ShowS
showList :: [Include] -> ShowS
Show)

makeFieldLabelsNoPrefix ''AuthToken
makeFieldLabelsNoPrefix ''SortOrder
makeFieldLabelsNoPrefix ''Include

newtype Language = Language {Language -> Text
value :: Text} deriving (Language -> Language -> Bool
(Language -> Language -> Bool)
-> (Language -> Language -> Bool) -> Eq Language
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Language -> Language -> Bool
== :: Language -> Language -> Bool
$c/= :: Language -> Language -> Bool
/= :: Language -> Language -> Bool
Eq, (forall x. Language -> Rep Language x)
-> (forall x. Rep Language x -> Language) -> Generic Language
forall x. Rep Language x -> Language
forall x. Language -> Rep Language x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Language -> Rep Language x
from :: forall x. Language -> Rep Language x
$cto :: forall x. Rep Language x -> Language
to :: forall x. Rep Language x -> Language
Generic, Int -> Language -> ShowS
[Language] -> ShowS
Language -> String
(Int -> Language -> ShowS)
-> (Language -> String) -> ([Language] -> ShowS) -> Show Language
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Language -> ShowS
showsPrec :: Int -> Language -> ShowS
$cshow :: Language -> String
show :: Language -> String
$cshowList :: [Language] -> ShowS
showList :: [Language] -> ShowS
Show)

newtype UiMode = UiMode {UiMode -> Text
value :: Text} deriving (UiMode -> UiMode -> Bool
(UiMode -> UiMode -> Bool)
-> (UiMode -> UiMode -> Bool) -> Eq UiMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UiMode -> UiMode -> Bool
== :: UiMode -> UiMode -> Bool
$c/= :: UiMode -> UiMode -> Bool
/= :: UiMode -> UiMode -> Bool
Eq, (forall x. UiMode -> Rep UiMode x)
-> (forall x. Rep UiMode x -> UiMode) -> Generic UiMode
forall x. Rep UiMode x -> UiMode
forall x. UiMode -> Rep UiMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UiMode -> Rep UiMode x
from :: forall x. UiMode -> Rep UiMode x
$cto :: forall x. Rep UiMode x -> UiMode
to :: forall x. Rep UiMode x -> UiMode
Generic, Int -> UiMode -> ShowS
[UiMode] -> ShowS
UiMode -> String
(Int -> UiMode -> ShowS)
-> (UiMode -> String) -> ([UiMode] -> ShowS) -> Show UiMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UiMode -> ShowS
showsPrec :: Int -> UiMode -> ShowS
$cshow :: UiMode -> String
show :: UiMode -> String
$cshowList :: [UiMode] -> ShowS
showList :: [UiMode] -> ShowS
Show)

makeFieldLabelsNoPrefix ''Language
makeFieldLabelsNoPrefix ''UiMode

newtype SongAsciiSize = SongAsciiSize {SongAsciiSize -> Text
value :: Text} deriving (SongAsciiSize -> SongAsciiSize -> Bool
(SongAsciiSize -> SongAsciiSize -> Bool)
-> (SongAsciiSize -> SongAsciiSize -> Bool) -> Eq SongAsciiSize
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SongAsciiSize -> SongAsciiSize -> Bool
== :: SongAsciiSize -> SongAsciiSize -> Bool
$c/= :: SongAsciiSize -> SongAsciiSize -> Bool
/= :: SongAsciiSize -> SongAsciiSize -> Bool
Eq, (forall x. SongAsciiSize -> Rep SongAsciiSize x)
-> (forall x. Rep SongAsciiSize x -> SongAsciiSize)
-> Generic SongAsciiSize
forall x. Rep SongAsciiSize x -> SongAsciiSize
forall x. SongAsciiSize -> Rep SongAsciiSize x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SongAsciiSize -> Rep SongAsciiSize x
from :: forall x. SongAsciiSize -> Rep SongAsciiSize x
$cto :: forall x. Rep SongAsciiSize x -> SongAsciiSize
to :: forall x. Rep SongAsciiSize x -> SongAsciiSize
Generic, Int -> SongAsciiSize -> ShowS
[SongAsciiSize] -> ShowS
SongAsciiSize -> String
(Int -> SongAsciiSize -> ShowS)
-> (SongAsciiSize -> String)
-> ([SongAsciiSize] -> ShowS)
-> Show SongAsciiSize
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SongAsciiSize -> ShowS
showsPrec :: Int -> SongAsciiSize -> ShowS
$cshow :: SongAsciiSize -> String
show :: SongAsciiSize -> String
$cshowList :: [SongAsciiSize] -> ShowS
showList :: [SongAsciiSize] -> ShowS
Show)

makeFieldLabelsNoPrefix ''SongAsciiSize

newtype Palette = Palette {Palette -> Text
value :: Text} deriving (Palette -> Palette -> Bool
(Palette -> Palette -> Bool)
-> (Palette -> Palette -> Bool) -> Eq Palette
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Palette -> Palette -> Bool
== :: Palette -> Palette -> Bool
$c/= :: Palette -> Palette -> Bool
/= :: Palette -> Palette -> Bool
Eq, (forall x. Palette -> Rep Palette x)
-> (forall x. Rep Palette x -> Palette) -> Generic Palette
forall x. Rep Palette x -> Palette
forall x. Palette -> Rep Palette x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Palette -> Rep Palette x
from :: forall x. Palette -> Rep Palette x
$cto :: forall x. Rep Palette x -> Palette
to :: forall x. Rep Palette x -> Palette
Generic, Int -> Palette -> ShowS
[Palette] -> ShowS
Palette -> String
(Int -> Palette -> ShowS)
-> (Palette -> String) -> ([Palette] -> ShowS) -> Show Palette
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Palette -> ShowS
showsPrec :: Int -> Palette -> ShowS
$cshow :: Palette -> String
show :: Palette -> String
$cshowList :: [Palette] -> ShowS
showList :: [Palette] -> ShowS
Show)

makeFieldLabelsNoPrefix ''Palette

localeCookieName :: Text
localeCookieName :: Text
localeCookieName = Text
"wikimusic-locale"

uiModeCookieName :: Text
uiModeCookieName :: Text
uiModeCookieName = Text
"wikimusic-ui-mode"

songAsciiSizeCookieName :: Text
songAsciiSizeCookieName :: Text
songAsciiSizeCookieName = Text
"wikimusic-song-ascii-size"

authCookieName :: Text
authCookieName :: Text
authCookieName = Text
"wikimusic-auth"

artistSortingCookieName :: Text
artistSortingCookieName :: Text
artistSortingCookieName = Text
"wikimusic-artist-sorting"

songSortingCookieName :: Text
songSortingCookieName :: Text
songSortingCookieName = Text
"wikimusic-song-sorting"

genreSortingCookieName :: Text
genreSortingCookieName :: Text
genreSortingCookieName = Text
"wikimusic-genre-sorting"

paletteCookieName :: Text
paletteCookieName :: Text
paletteCookieName = Text
"wikimusic-palette"

data ViewVars = ViewVars
  { ViewVars -> Language
locale :: Language,
    ViewVars -> UiMode
uiMode :: UiMode,
    ViewVars -> AuthToken
authToken :: AuthToken,
    ViewVars -> SortOrder
songSorting :: SortOrder,
    ViewVars -> SortOrder
artistSorting :: SortOrder,
    ViewVars -> SortOrder
genreSorting :: SortOrder,
    ViewVars -> SongAsciiSize
songAsciiSize :: SongAsciiSize,
    ViewVars -> Palette
palette :: Palette
  }
  deriving (ViewVars -> ViewVars -> Bool
(ViewVars -> ViewVars -> Bool)
-> (ViewVars -> ViewVars -> Bool) -> Eq ViewVars
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ViewVars -> ViewVars -> Bool
== :: ViewVars -> ViewVars -> Bool
$c/= :: ViewVars -> ViewVars -> Bool
/= :: ViewVars -> ViewVars -> Bool
Eq, (forall x. ViewVars -> Rep ViewVars x)
-> (forall x. Rep ViewVars x -> ViewVars) -> Generic ViewVars
forall x. Rep ViewVars x -> ViewVars
forall x. ViewVars -> Rep ViewVars x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ViewVars -> Rep ViewVars x
from :: forall x. ViewVars -> Rep ViewVars x
$cto :: forall x. Rep ViewVars x -> ViewVars
to :: forall x. Rep ViewVars x -> ViewVars
Generic, Int -> ViewVars -> ShowS
[ViewVars] -> ShowS
ViewVars -> String
(Int -> ViewVars -> ShowS)
-> (ViewVars -> String) -> ([ViewVars] -> ShowS) -> Show ViewVars
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ViewVars -> ShowS
showsPrec :: Int -> ViewVars -> ShowS
$cshow :: ViewVars -> String
show :: ViewVars -> String
$cshowList :: [ViewVars] -> ShowS
showList :: [ViewVars] -> ShowS
Show)

makeFieldLabelsNoPrefix ''ViewVars