-- 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 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextDocumentIdentifier] -> ShowS
$cshowList :: [TextDocumentIdentifier] -> ShowS
show :: TextDocumentIdentifier -> String
$cshow :: TextDocumentIdentifier -> String
showsPrec :: Int -> TextDocumentIdentifier -> ShowS
$cshowsPrec :: Int -> TextDocumentIdentifier -> ShowS
Show, TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
$c/= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
== :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
$c== :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
Eq, Eq 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
min :: TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
$cmin :: TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
max :: TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
$cmax :: TextDocumentIdentifier
-> TextDocumentIdentifier -> TextDocumentIdentifier
>= :: TextDocumentIdentifier -> TextDocumentIdentifier -> Bool
$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
compare :: TextDocumentIdentifier -> TextDocumentIdentifier -> Ordering
$ccompare :: TextDocumentIdentifier -> TextDocumentIdentifier -> Ordering
Ord, 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
$cto :: forall x. Rep TextDocumentIdentifier x -> TextDocumentIdentifier
$cfrom :: forall x. TextDocumentIdentifier -> Rep TextDocumentIdentifier x
Generic)
  deriving anyclass (TextDocumentIdentifier -> ()
forall a. (a -> ()) -> NFData a
rnf :: TextDocumentIdentifier -> ()
$crnf :: TextDocumentIdentifier -> ()
NFData, Eq TextDocumentIdentifier
Int -> TextDocumentIdentifier -> Int
TextDocumentIdentifier -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TextDocumentIdentifier -> Int
$chash :: TextDocumentIdentifier -> Int
hashWithSalt :: Int -> TextDocumentIdentifier -> Int
$chashWithSalt :: Int -> TextDocumentIdentifier -> Int
Hashable)

instance Aeson.ToJSON TextDocumentIdentifier where
  toJSON :: TextDocumentIdentifier -> Value
toJSON (TextDocumentIdentifier Uri
arg0) = [Pair] -> Value
Aeson.object forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [[Key
"uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg0]]

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