{- 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.FileCreate 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

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

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

instance Aeson.ToJSON FileCreate where
  toJSON :: FileCreate -> Value
toJSON (FileCreate Text
arg0) = [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..= Text
arg0]]

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