{- 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.WorkspaceSymbolParams 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.Internal.Types.ProgressToken
import qualified Language.LSP.Protocol.Types.Common

{-|
The parameters of a `WorkspaceSymbolRequest`.
-}
data WorkspaceSymbolParams = WorkspaceSymbolParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  WorkspaceSymbolParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  An optional token that a server can use to report partial results (e.g. streaming) to
  the client.
  -}
  WorkspaceSymbolParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  A query string to filter symbols by. Clients may send an empty
  string here to request all symbols.
  -}
  WorkspaceSymbolParams -> Text
_query :: Data.Text.Text
  }
  deriving stock (Int -> WorkspaceSymbolParams -> ShowS
[WorkspaceSymbolParams] -> ShowS
WorkspaceSymbolParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceSymbolParams] -> ShowS
$cshowList :: [WorkspaceSymbolParams] -> ShowS
show :: WorkspaceSymbolParams -> String
$cshow :: WorkspaceSymbolParams -> String
showsPrec :: Int -> WorkspaceSymbolParams -> ShowS
$cshowsPrec :: Int -> WorkspaceSymbolParams -> ShowS
Show, WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
$c/= :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
== :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
$c== :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
Eq, Eq WorkspaceSymbolParams
WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
WorkspaceSymbolParams -> WorkspaceSymbolParams -> Ordering
WorkspaceSymbolParams
-> WorkspaceSymbolParams -> WorkspaceSymbolParams
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 :: WorkspaceSymbolParams
-> WorkspaceSymbolParams -> WorkspaceSymbolParams
$cmin :: WorkspaceSymbolParams
-> WorkspaceSymbolParams -> WorkspaceSymbolParams
max :: WorkspaceSymbolParams
-> WorkspaceSymbolParams -> WorkspaceSymbolParams
$cmax :: WorkspaceSymbolParams
-> WorkspaceSymbolParams -> WorkspaceSymbolParams
>= :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
$c>= :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
> :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
$c> :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
<= :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
$c<= :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
< :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
$c< :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Bool
compare :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Ordering
$ccompare :: WorkspaceSymbolParams -> WorkspaceSymbolParams -> Ordering
Ord, forall x. Rep WorkspaceSymbolParams x -> WorkspaceSymbolParams
forall x. WorkspaceSymbolParams -> Rep WorkspaceSymbolParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkspaceSymbolParams x -> WorkspaceSymbolParams
$cfrom :: forall x. WorkspaceSymbolParams -> Rep WorkspaceSymbolParams x
Generic)
  deriving anyclass (WorkspaceSymbolParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceSymbolParams -> ()
$crnf :: WorkspaceSymbolParams -> ()
NFData, Eq WorkspaceSymbolParams
Int -> WorkspaceSymbolParams -> Int
WorkspaceSymbolParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceSymbolParams -> Int
$chash :: WorkspaceSymbolParams -> Int
hashWithSalt :: Int -> WorkspaceSymbolParams -> Int
$chashWithSalt :: Int -> WorkspaceSymbolParams -> Int
Hashable)
  deriving forall ann. [WorkspaceSymbolParams] -> Doc ann
forall ann. WorkspaceSymbolParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceSymbolParams] -> Doc ann
$cprettyList :: forall ann. [WorkspaceSymbolParams] -> Doc ann
pretty :: forall ann. WorkspaceSymbolParams -> Doc ann
$cpretty :: forall ann. WorkspaceSymbolParams -> Doc ann
Pretty via (ViaJSON WorkspaceSymbolParams)

instance Aeson.ToJSON WorkspaceSymbolParams where
  toJSON :: WorkspaceSymbolParams -> Value
toJSON (WorkspaceSymbolParams Maybe ProgressToken
arg0 Maybe ProgressToken
arg1 Text
arg2) = [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
$  [String
"workDoneToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0
    ,String
"partialResultToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg1
    ,[Key
"query" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg2]]

instance Aeson.FromJSON WorkspaceSymbolParams where
  parseJSON :: Value -> Parser WorkspaceSymbolParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceSymbolParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> Maybe ProgressToken -> Text -> WorkspaceSymbolParams
WorkspaceSymbolParams forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"workDoneToken" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"partialResultToken" 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
"query"