{- ORMOLU_DISABLE -}
{- HLINT ignore -}
-- THIS IS A GENERATED FILE, DO NOT EDIT

{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.TextDocumentFilterLanguage where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson as Aeson
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Data.Text
import qualified Language.LSP.Protocol.Types.Common

{-|
A document filter where `language` is required field.

@since 3.18.0
@proposed
-}
data TextDocumentFilterLanguage = TextDocumentFilterLanguage 
  { {-|
  A language id, like `typescript`.
  -}
  TextDocumentFilterLanguage -> Text
_language :: Data.Text.Text
  , {-|
  A Uri `Uri.scheme`, like `file` or `untitled`.
  -}
  TextDocumentFilterLanguage -> Maybe Text
_scheme :: (Maybe Data.Text.Text)
  , {-|
  A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples.
  -}
  TextDocumentFilterLanguage -> Maybe Text
_pattern :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> TextDocumentFilterLanguage -> ShowS
[TextDocumentFilterLanguage] -> ShowS
TextDocumentFilterLanguage -> String
(Int -> TextDocumentFilterLanguage -> ShowS)
-> (TextDocumentFilterLanguage -> String)
-> ([TextDocumentFilterLanguage] -> ShowS)
-> Show TextDocumentFilterLanguage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TextDocumentFilterLanguage -> ShowS
showsPrec :: Int -> TextDocumentFilterLanguage -> ShowS
$cshow :: TextDocumentFilterLanguage -> String
show :: TextDocumentFilterLanguage -> String
$cshowList :: [TextDocumentFilterLanguage] -> ShowS
showList :: [TextDocumentFilterLanguage] -> ShowS
Show, TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
(TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool)
-> (TextDocumentFilterLanguage
    -> TextDocumentFilterLanguage -> Bool)
-> Eq TextDocumentFilterLanguage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
== :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
$c/= :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
/= :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
Eq, Eq TextDocumentFilterLanguage
Eq TextDocumentFilterLanguage =>
(TextDocumentFilterLanguage
 -> TextDocumentFilterLanguage -> Ordering)
-> (TextDocumentFilterLanguage
    -> TextDocumentFilterLanguage -> Bool)
-> (TextDocumentFilterLanguage
    -> TextDocumentFilterLanguage -> Bool)
-> (TextDocumentFilterLanguage
    -> TextDocumentFilterLanguage -> Bool)
-> (TextDocumentFilterLanguage
    -> TextDocumentFilterLanguage -> Bool)
-> (TextDocumentFilterLanguage
    -> TextDocumentFilterLanguage -> TextDocumentFilterLanguage)
-> (TextDocumentFilterLanguage
    -> TextDocumentFilterLanguage -> TextDocumentFilterLanguage)
-> Ord TextDocumentFilterLanguage
TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
TextDocumentFilterLanguage
-> TextDocumentFilterLanguage -> Ordering
TextDocumentFilterLanguage
-> TextDocumentFilterLanguage -> TextDocumentFilterLanguage
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TextDocumentFilterLanguage
-> TextDocumentFilterLanguage -> Ordering
compare :: TextDocumentFilterLanguage
-> TextDocumentFilterLanguage -> Ordering
$c< :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
< :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
$c<= :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
<= :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
$c> :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
> :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
$c>= :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
>= :: TextDocumentFilterLanguage -> TextDocumentFilterLanguage -> Bool
$cmax :: TextDocumentFilterLanguage
-> TextDocumentFilterLanguage -> TextDocumentFilterLanguage
max :: TextDocumentFilterLanguage
-> TextDocumentFilterLanguage -> TextDocumentFilterLanguage
$cmin :: TextDocumentFilterLanguage
-> TextDocumentFilterLanguage -> TextDocumentFilterLanguage
min :: TextDocumentFilterLanguage
-> TextDocumentFilterLanguage -> TextDocumentFilterLanguage
Ord, (forall x.
 TextDocumentFilterLanguage -> Rep TextDocumentFilterLanguage x)
-> (forall x.
    Rep TextDocumentFilterLanguage x -> TextDocumentFilterLanguage)
-> Generic TextDocumentFilterLanguage
forall x.
Rep TextDocumentFilterLanguage x -> TextDocumentFilterLanguage
forall x.
TextDocumentFilterLanguage -> Rep TextDocumentFilterLanguage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
TextDocumentFilterLanguage -> Rep TextDocumentFilterLanguage x
from :: forall x.
TextDocumentFilterLanguage -> Rep TextDocumentFilterLanguage x
$cto :: forall x.
Rep TextDocumentFilterLanguage x -> TextDocumentFilterLanguage
to :: forall x.
Rep TextDocumentFilterLanguage x -> TextDocumentFilterLanguage
Generic)
  deriving anyclass (TextDocumentFilterLanguage -> ()
(TextDocumentFilterLanguage -> ())
-> NFData TextDocumentFilterLanguage
forall a. (a -> ()) -> NFData a
$crnf :: TextDocumentFilterLanguage -> ()
rnf :: TextDocumentFilterLanguage -> ()
NFData, Eq TextDocumentFilterLanguage
Eq TextDocumentFilterLanguage =>
(Int -> TextDocumentFilterLanguage -> Int)
-> (TextDocumentFilterLanguage -> Int)
-> Hashable TextDocumentFilterLanguage
Int -> TextDocumentFilterLanguage -> Int
TextDocumentFilterLanguage -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> TextDocumentFilterLanguage -> Int
hashWithSalt :: Int -> TextDocumentFilterLanguage -> Int
$chash :: TextDocumentFilterLanguage -> Int
hash :: TextDocumentFilterLanguage -> Int
Hashable)
  deriving (forall ann. TextDocumentFilterLanguage -> Doc ann)
-> (forall ann. [TextDocumentFilterLanguage] -> Doc ann)
-> Pretty TextDocumentFilterLanguage
forall ann. [TextDocumentFilterLanguage] -> Doc ann
forall ann. TextDocumentFilterLanguage -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. TextDocumentFilterLanguage -> Doc ann
pretty :: forall ann. TextDocumentFilterLanguage -> Doc ann
$cprettyList :: forall ann. [TextDocumentFilterLanguage] -> Doc ann
prettyList :: forall ann. [TextDocumentFilterLanguage] -> Doc ann
Pretty via (ViaJSON TextDocumentFilterLanguage)

instance Aeson.ToJSON TextDocumentFilterLanguage where
  toJSON :: TextDocumentFilterLanguage -> Value
toJSON (TextDocumentFilterLanguage Text
arg0 Maybe Text
arg1 Maybe Text
arg2) = [Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [[Key
"language" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg0]
    ,String
"scheme" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1
    ,String
"pattern" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg2]

instance Aeson.FromJSON TextDocumentFilterLanguage where
  parseJSON :: Value -> Parser TextDocumentFilterLanguage
parseJSON = String
-> (Object -> Parser TextDocumentFilterLanguage)
-> Value
-> Parser TextDocumentFilterLanguage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TextDocumentFilterLanguage" ((Object -> Parser TextDocumentFilterLanguage)
 -> Value -> Parser TextDocumentFilterLanguage)
-> (Object -> Parser TextDocumentFilterLanguage)
-> Value
-> Parser TextDocumentFilterLanguage
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text -> Maybe Text -> Maybe Text -> TextDocumentFilterLanguage
TextDocumentFilterLanguage (Text -> Maybe Text -> Maybe Text -> TextDocumentFilterLanguage)
-> Parser Text
-> Parser (Maybe Text -> Maybe Text -> TextDocumentFilterLanguage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"language" Parser (Maybe Text -> Maybe Text -> TextDocumentFilterLanguage)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> TextDocumentFilterLanguage)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"scheme" Parser (Maybe Text -> TextDocumentFilterLanguage)
-> Parser (Maybe Text) -> Parser TextDocumentFilterLanguage
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"pattern"