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

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

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