{- 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.VersionedNotebookDocumentIdentifier 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 versioned notebook document identifier.

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

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

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