{- 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.WorkspaceFolder 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 workspace folder inside a client.
-}
data WorkspaceFolder = WorkspaceFolder 
  { {-|
  The associated URI for this workspace folder.
  -}
  WorkspaceFolder -> Uri
_uri :: Language.LSP.Protocol.Types.Uri.Uri
  , {-|
  The name of the workspace folder. Used to refer to this
  workspace folder in the user interface.
  -}
  WorkspaceFolder -> Text
_name :: Data.Text.Text
  }
  deriving stock (Int -> WorkspaceFolder -> ShowS
[WorkspaceFolder] -> ShowS
WorkspaceFolder -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceFolder] -> ShowS
$cshowList :: [WorkspaceFolder] -> ShowS
show :: WorkspaceFolder -> String
$cshow :: WorkspaceFolder -> String
showsPrec :: Int -> WorkspaceFolder -> ShowS
$cshowsPrec :: Int -> WorkspaceFolder -> ShowS
Show, WorkspaceFolder -> WorkspaceFolder -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceFolder -> WorkspaceFolder -> Bool
$c/= :: WorkspaceFolder -> WorkspaceFolder -> Bool
== :: WorkspaceFolder -> WorkspaceFolder -> Bool
$c== :: WorkspaceFolder -> WorkspaceFolder -> Bool
Eq, Eq WorkspaceFolder
WorkspaceFolder -> WorkspaceFolder -> Bool
WorkspaceFolder -> WorkspaceFolder -> Ordering
WorkspaceFolder -> WorkspaceFolder -> WorkspaceFolder
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 :: WorkspaceFolder -> WorkspaceFolder -> WorkspaceFolder
$cmin :: WorkspaceFolder -> WorkspaceFolder -> WorkspaceFolder
max :: WorkspaceFolder -> WorkspaceFolder -> WorkspaceFolder
$cmax :: WorkspaceFolder -> WorkspaceFolder -> WorkspaceFolder
>= :: WorkspaceFolder -> WorkspaceFolder -> Bool
$c>= :: WorkspaceFolder -> WorkspaceFolder -> Bool
> :: WorkspaceFolder -> WorkspaceFolder -> Bool
$c> :: WorkspaceFolder -> WorkspaceFolder -> Bool
<= :: WorkspaceFolder -> WorkspaceFolder -> Bool
$c<= :: WorkspaceFolder -> WorkspaceFolder -> Bool
< :: WorkspaceFolder -> WorkspaceFolder -> Bool
$c< :: WorkspaceFolder -> WorkspaceFolder -> Bool
compare :: WorkspaceFolder -> WorkspaceFolder -> Ordering
$ccompare :: WorkspaceFolder -> WorkspaceFolder -> Ordering
Ord, forall x. Rep WorkspaceFolder x -> WorkspaceFolder
forall x. WorkspaceFolder -> Rep WorkspaceFolder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkspaceFolder x -> WorkspaceFolder
$cfrom :: forall x. WorkspaceFolder -> Rep WorkspaceFolder x
Generic)
  deriving anyclass (WorkspaceFolder -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceFolder -> ()
$crnf :: WorkspaceFolder -> ()
NFData, Eq WorkspaceFolder
Int -> WorkspaceFolder -> Int
WorkspaceFolder -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceFolder -> Int
$chash :: WorkspaceFolder -> Int
hashWithSalt :: Int -> WorkspaceFolder -> Int
$chashWithSalt :: Int -> WorkspaceFolder -> Int
Hashable)
  deriving forall ann. [WorkspaceFolder] -> Doc ann
forall ann. WorkspaceFolder -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceFolder] -> Doc ann
$cprettyList :: forall ann. [WorkspaceFolder] -> Doc ann
pretty :: forall ann. WorkspaceFolder -> Doc ann
$cpretty :: forall ann. WorkspaceFolder -> Doc ann
Pretty via (ViaJSON WorkspaceFolder)

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

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