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

{-|
A previous result id in a workspace pull request.

@since 3.17.0
-}
data PreviousResultId = PreviousResultId 
  { {-|
  The URI for which the client knowns a
  result id.
  -}
  PreviousResultId -> Uri
_uri :: Language.LSP.Protocol.Types.Uri.Uri
  , {-|
  The value of the previous result id.
  -}
  PreviousResultId -> Text
_value :: Data.Text.Text
  }
  deriving stock (Int -> PreviousResultId -> ShowS
[PreviousResultId] -> ShowS
PreviousResultId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PreviousResultId] -> ShowS
$cshowList :: [PreviousResultId] -> ShowS
show :: PreviousResultId -> String
$cshow :: PreviousResultId -> String
showsPrec :: Int -> PreviousResultId -> ShowS
$cshowsPrec :: Int -> PreviousResultId -> ShowS
Show, PreviousResultId -> PreviousResultId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PreviousResultId -> PreviousResultId -> Bool
$c/= :: PreviousResultId -> PreviousResultId -> Bool
== :: PreviousResultId -> PreviousResultId -> Bool
$c== :: PreviousResultId -> PreviousResultId -> Bool
Eq, Eq PreviousResultId
PreviousResultId -> PreviousResultId -> Bool
PreviousResultId -> PreviousResultId -> Ordering
PreviousResultId -> PreviousResultId -> PreviousResultId
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 :: PreviousResultId -> PreviousResultId -> PreviousResultId
$cmin :: PreviousResultId -> PreviousResultId -> PreviousResultId
max :: PreviousResultId -> PreviousResultId -> PreviousResultId
$cmax :: PreviousResultId -> PreviousResultId -> PreviousResultId
>= :: PreviousResultId -> PreviousResultId -> Bool
$c>= :: PreviousResultId -> PreviousResultId -> Bool
> :: PreviousResultId -> PreviousResultId -> Bool
$c> :: PreviousResultId -> PreviousResultId -> Bool
<= :: PreviousResultId -> PreviousResultId -> Bool
$c<= :: PreviousResultId -> PreviousResultId -> Bool
< :: PreviousResultId -> PreviousResultId -> Bool
$c< :: PreviousResultId -> PreviousResultId -> Bool
compare :: PreviousResultId -> PreviousResultId -> Ordering
$ccompare :: PreviousResultId -> PreviousResultId -> Ordering
Ord, forall x. Rep PreviousResultId x -> PreviousResultId
forall x. PreviousResultId -> Rep PreviousResultId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PreviousResultId x -> PreviousResultId
$cfrom :: forall x. PreviousResultId -> Rep PreviousResultId x
Generic)
  deriving anyclass (PreviousResultId -> ()
forall a. (a -> ()) -> NFData a
rnf :: PreviousResultId -> ()
$crnf :: PreviousResultId -> ()
NFData, Eq PreviousResultId
Int -> PreviousResultId -> Int
PreviousResultId -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: PreviousResultId -> Int
$chash :: PreviousResultId -> Int
hashWithSalt :: Int -> PreviousResultId -> Int
$chashWithSalt :: Int -> PreviousResultId -> Int
Hashable)
  deriving forall ann. [PreviousResultId] -> Doc ann
forall ann. PreviousResultId -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [PreviousResultId] -> Doc ann
$cprettyList :: forall ann. [PreviousResultId] -> Doc ann
pretty :: forall ann. PreviousResultId -> Doc ann
$cpretty :: forall ann. PreviousResultId -> Doc ann
Pretty via (ViaJSON PreviousResultId)

instance Aeson.ToJSON PreviousResultId where
  toJSON :: PreviousResultId -> Value
toJSON (PreviousResultId Uri
arg0 Text
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
"value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg1]]

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