{- 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.NotebookDocumentIdentifier 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 notebook document in the client.

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

instance Aeson.ToJSON NotebookDocumentIdentifier where
  toJSON :: NotebookDocumentIdentifier -> Value
toJSON (NotebookDocumentIdentifier 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 NotebookDocumentIdentifier where
  parseJSON :: Value -> Parser NotebookDocumentIdentifier
parseJSON = String
-> (Object -> Parser NotebookDocumentIdentifier)
-> Value
-> Parser NotebookDocumentIdentifier
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"NotebookDocumentIdentifier" ((Object -> Parser NotebookDocumentIdentifier)
 -> Value -> Parser NotebookDocumentIdentifier)
-> (Object -> Parser NotebookDocumentIdentifier)
-> Value
-> Parser NotebookDocumentIdentifier
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Uri -> NotebookDocumentIdentifier
NotebookDocumentIdentifier (Uri -> NotebookDocumentIdentifier)
-> Parser Uri -> Parser NotebookDocumentIdentifier
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"