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

{-|
Represents information on a file/folder rename.

@since 3.16.0
-}
data FileRename = FileRename 
  { {-|
  A file:// URI for the original location of the file/folder being renamed.
  -}
  FileRename -> Text
_oldUri :: Data.Text.Text
  , {-|
  A file:// URI for the new location of the file/folder being renamed.
  -}
  FileRename -> Text
_newUri :: Data.Text.Text
  }
  deriving stock (Int -> FileRename -> ShowS
[FileRename] -> ShowS
FileRename -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileRename] -> ShowS
$cshowList :: [FileRename] -> ShowS
show :: FileRename -> String
$cshow :: FileRename -> String
showsPrec :: Int -> FileRename -> ShowS
$cshowsPrec :: Int -> FileRename -> ShowS
Show, FileRename -> FileRename -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileRename -> FileRename -> Bool
$c/= :: FileRename -> FileRename -> Bool
== :: FileRename -> FileRename -> Bool
$c== :: FileRename -> FileRename -> Bool
Eq, Eq FileRename
FileRename -> FileRename -> Bool
FileRename -> FileRename -> Ordering
FileRename -> FileRename -> FileRename
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 :: FileRename -> FileRename -> FileRename
$cmin :: FileRename -> FileRename -> FileRename
max :: FileRename -> FileRename -> FileRename
$cmax :: FileRename -> FileRename -> FileRename
>= :: FileRename -> FileRename -> Bool
$c>= :: FileRename -> FileRename -> Bool
> :: FileRename -> FileRename -> Bool
$c> :: FileRename -> FileRename -> Bool
<= :: FileRename -> FileRename -> Bool
$c<= :: FileRename -> FileRename -> Bool
< :: FileRename -> FileRename -> Bool
$c< :: FileRename -> FileRename -> Bool
compare :: FileRename -> FileRename -> Ordering
$ccompare :: FileRename -> FileRename -> Ordering
Ord, forall x. Rep FileRename x -> FileRename
forall x. FileRename -> Rep FileRename x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FileRename x -> FileRename
$cfrom :: forall x. FileRename -> Rep FileRename x
Generic)
  deriving anyclass (FileRename -> ()
forall a. (a -> ()) -> NFData a
rnf :: FileRename -> ()
$crnf :: FileRename -> ()
NFData, Eq FileRename
Int -> FileRename -> Int
FileRename -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: FileRename -> Int
$chash :: FileRename -> Int
hashWithSalt :: Int -> FileRename -> Int
$chashWithSalt :: Int -> FileRename -> Int
Hashable)

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

instance Aeson.FromJSON FileRename where
  parseJSON :: Value -> Parser FileRename
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"FileRename" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text -> Text -> FileRename
FileRename forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"oldUri" 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
"newUri"