{- 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.TextDocumentIdentifier 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 Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.Uri

{-|
A literal to identify a text document in the client.
-}
data TextDocumentIdentifier = TextDocumentIdentifier 
  { {-|
  The text document's uri.
  -}
  TextDocumentIdentifier -> Uri
_uri :: Language.LSP.Protocol.Types.Uri.Uri
  }
  deriving stock (Int -> TextDocumentIdentifier -> ShowS
[TextDocumentIdentifier] -> ShowS
TextDocumentIdentifier -> String
(Int -> TextDocumentIdentifier -> ShowS)
-> (TextDocumentIdentifier -> String)
-> ([TextDocumentIdentifier] -> ShowS)
-> Show TextDocumentIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TextDocumentIdentifier -> ShowS
showsPrec :: Int -> TextDocumentIdentifier -> ShowS
$cshow :: TextDocumentIdentifier -> String
show :: TextDocumentIdentifier -> String
$cshowList :: [TextDocumentIdentifier] -> ShowS
showList :: [TextDocumentIdentifier] -> ShowS
Show, TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
(TextDocumentIdentifier -> TextDocumentIdentifier -> Bool)
-> (TextDocumentIdentifier -> TextDocumentIdentifier -> Bool)
-> Eq TextDocumentIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
== :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
$c/= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
/= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
Eq, Eq TextDocumentIdentifier
Eq TextDocumentIdentifier =>
(TextDocumentIdentifier -> TextDocumentIdentifier -> Ordering)
-> (TextDocumentIdentifier -> TextDocumentIdentifier -> Bool)
-> (TextDocumentIdentifier -> TextDocumentIdentifier -> Bool)
-> (TextDocumentIdentifier -> TextDocumentIdentifier -> Bool)
-> (TextDocumentIdentifier -> TextDocumentIdentifier -> Bool)
-> (TextDocumentIdentifier
    -> TextDocumentIdentifier -> TextDocumentIdentifier)
-> (TextDocumentIdentifier
    -> TextDocumentIdentifier -> TextDocumentIdentifier)
-> Ord TextDocumentIdentifier
TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
TextDocumentIdentifier -> TextDocumentIdentifier -> Ordering
TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
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 :: TextDocumentIdentifier -> TextDocumentIdentifier -> Ordering
compare :: TextDocumentIdentifier -> TextDocumentIdentifier -> Ordering
$c< :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
< :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
$c<= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
<= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
$c> :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
> :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
$c>= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
>= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
$cmax :: TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
max :: TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
$cmin :: TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
min :: TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
Ord, (forall x. TextDocumentIdentifier -> Rep TextDocumentIdentifier x)
-> (forall x.
    Rep TextDocumentIdentifier x -> TextDocumentIdentifier)
-> Generic TextDocumentIdentifier
forall x. Rep TextDocumentIdentifier x -> TextDocumentIdentifier
forall x. TextDocumentIdentifier -> Rep TextDocumentIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TextDocumentIdentifier -> Rep TextDocumentIdentifier x
from :: forall x. TextDocumentIdentifier -> Rep TextDocumentIdentifier x
$cto :: forall x. Rep TextDocumentIdentifier x -> TextDocumentIdentifier
to :: forall x. Rep TextDocumentIdentifier x -> TextDocumentIdentifier
Generic)
  deriving anyclass (TextDocumentIdentifier -> ()
(TextDocumentIdentifier -> ()) -> NFData TextDocumentIdentifier
forall a. (a -> ()) -> NFData a
$crnf :: TextDocumentIdentifier -> ()
rnf :: TextDocumentIdentifier -> ()
NFData, Eq TextDocumentIdentifier
Eq TextDocumentIdentifier =>
(Int -> TextDocumentIdentifier -> Int)
-> (TextDocumentIdentifier -> Int)
-> Hashable TextDocumentIdentifier
Int -> TextDocumentIdentifier -> Int
TextDocumentIdentifier -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> TextDocumentIdentifier -> Int
hashWithSalt :: Int -> TextDocumentIdentifier -> Int
$chash :: TextDocumentIdentifier -> Int
hash :: TextDocumentIdentifier -> Int
Hashable)
  deriving (forall ann. TextDocumentIdentifier -> Doc ann)
-> (forall ann. [TextDocumentIdentifier] -> Doc ann)
-> Pretty TextDocumentIdentifier
forall ann. [TextDocumentIdentifier] -> Doc ann
forall ann. TextDocumentIdentifier -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. TextDocumentIdentifier -> Doc ann
pretty :: forall ann. TextDocumentIdentifier -> Doc ann
$cprettyList :: forall ann. [TextDocumentIdentifier] -> Doc ann
prettyList :: forall ann. [TextDocumentIdentifier] -> Doc ann
Pretty via (ViaJSON TextDocumentIdentifier)

instance Aeson.ToJSON TextDocumentIdentifier where
  toJSON :: TextDocumentIdentifier -> Value
toJSON (TextDocumentIdentifier Uri
arg0) = [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
"uri" Key -> Uri -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg0]]

instance Aeson.FromJSON TextDocumentIdentifier where
  parseJSON :: Value -> Parser TextDocumentIdentifier
parseJSON = String
-> (Object -> Parser TextDocumentIdentifier)
-> Value
-> Parser TextDocumentIdentifier
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TextDocumentIdentifier" ((Object -> Parser TextDocumentIdentifier)
 -> Value -> Parser TextDocumentIdentifier)
-> (Object -> Parser TextDocumentIdentifier)
-> Value
-> Parser TextDocumentIdentifier
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Uri -> TextDocumentIdentifier
TextDocumentIdentifier (Uri -> TextDocumentIdentifier)
-> Parser Uri -> Parser TextDocumentIdentifier
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser Uri
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"uri"